query_id stringlengths 4 64 | query_authorID stringlengths 6 40 | query_text stringlengths 66 72.1k | candidate_id stringlengths 5 64 | candidate_authorID stringlengths 6 40 | candidate_text stringlengths 9 101k |
|---|---|---|---|---|---|
8d31148383fdc303cfb4ceacf5f09af65db6b0bb9b02431a338b78cefbc3ac7e | ['1f4b7f194194448b8bddbd386d107a10'] | I tried the Gaussian elimination but didn't get the right answer, I was wonder if you could help out, here is what I did: 4t-12s = -4 :
-9t+s = -4 : (r2*12)+r1 -- > -104t = -4 : -9t-s = -4 : r1/-104 --> t = 0.04 : -9t-s = -4 : -9(0.04)-s = -4 : -0.36+4 = s : s = -3.64 which is clearly wrong lol.. Where am I going wrong with this. Thanks in advance. | e3a5d9cfae13b42ec8c57d4248b1c28e9cb66baa4dcd9103b61ab6bc720ea5e0 | ['1f4b7f194194448b8bddbd386d107a10'] | What about rewarding users that flagged a question with some reputation if the flag was accepted?
So, for example, user A sees a question that is spam (an advertisement) and a moderator accepts this flag, wouldn't it be nice to give the user that flagged the question some reputation (maybe +2 or so).
On the other hand, if user B flaggs a question and the flag was not helpful, and this happens some more time, the user could lose some reputation (-1).
|
ae53900baac173d4c336c98ba3b84bafffe81763c8d12f898ee7e51ae1226e84 | ['1f4e110dfab14a9aa8c6405a9cba5eda'] | I'm assuming you're using a segue to switch between the controllers, so first add a text property to AddNew ViewController, then change your prepareForSegue to
if segue.identifier == "yourSegueName" {
let addNewVC = segue.destinationViewController as! AddNew
AddNew?.text = "TEXT"
}
then, when you load your AddNew VC,
change labelTextText to the text variable you defined earlier
| e10cc7960615e2750bcceff9090f8b4cdbe8cb13ed6c3046f571b810403ef789 | ['1f4e110dfab14a9aa8c6405a9cba5eda'] | I just added a ui searchbar to my program, and every time i rerun the program I get the error-
[general] Connection to daemon was invalidated
Despite this, my app is able to run perfectly and I can't seem to tell what is wrong.
Does anyone know what this means and how I could fix this?
If you'd like to to take a look at my code, please let me know and I'll clean it up.
|
b567f8f86ea7eb7b7e552a37802dc1c49effe1bfbc2bb3382ead38da521bd466 | ['1f4ea9bbff7d43be90982707c130bf56'] | i have a dynamic gridview to which i can add a row dynamically....code for that is given below
.aspx page : (without pagination)
<asp:GridView ID="Grid_AccEntry" runat="server" AutoGenerateColumns="False" GridLines="None"
OnRowDeleting="Grid_AccEntry_RowDeleting" CellPadding="4" ForeColor="#333333">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="Amount">
<ItemTemplate>
<asp:TextBox ID="amount" runat="server" Width="100" Text='<%# Bind("amount") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please Enter Amount"
ValidationGroup="Validation" ControlToValidate="amount" Display="None"></asp:RequiredFieldValidator>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DR/CR">
<ItemTemplate>
<asp:DropDownList ID="DrCr" runat="server" AutoPostBack="true">
<asp:ListItem Value="D">Debit</asp:ListItem>
<asp:ListItem Value="C">Credit</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Account">
<ItemTemplate>
<asp:DropDownList ID="account" runat="server" Width="100" OnSelectedIndexChanged="accountChanged"
DataSourceID="SqlDataSource1" DataTextField="account" AutoPostBack="true"
DataValueField="acc" >
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [Account] as [acc],[ADesc] as [account], [OpenItemC] as [opn] FROM [Account_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Opr Unit">
<ItemTemplate>
<asp:DropDownList ID="oprUnit" runat="server" Width="100"
DataSourceID="SqlDataSource2" DataTextField="OUnitName"
DataValueField="OprUnit">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [OprUnit], SUBSTRING([OUnitName],0,50) as [OUnitName] FROM [OprUnit_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dept">
<ItemTemplate>
<asp:DropDownList ID="dept" runat="server" Width="100"
DataSourceID="deptSqlDataSource" DataTextField="DeptName"
DataValueField="DeptCode">
</asp:DropDownList>
<asp:SqlDataSource ID="deptSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [DeptCode], SUBSTRING([DeptName],0,50) as [DeptName] FROM [Department_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Affiliate">
<ItemTemplate>
<asp:DropDownList ID="affiliate" runat="server" Width="100"
DataSourceID="affilSqlDataSource" DataTextField="AfBUName"
DataValueField="AffilateBU">
</asp:DropDownList>
<asp:SqlDataSource ID="affilSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [AffilateBU], SUBSTRING([AfBUName],0,50) as [AfBUName] FROM [Affilate_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Open Item">
<ItemTemplate>
<asp:DropDownList ID="openItem" runat="server" Width="100"
DataSourceID="openitmSqlDataSource" DataTextField="EmpName"
DataValueField="EmpCode">
</asp:DropDownList>
<asp:SqlDataSource ID="openitmSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [EmpCode], SUBSTRING([EmpName],0,50) as [EmpName] FROM [OpenItem_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Line Narration">
<ItemTemplate><asp:TextBox runat="server" ID="lineNar" Width="100"></asp:TextBox></ItemTemplate>
</asp:TemplateField>
<asp:CommandField DeleteText="Remove" ShowDeleteButton="True" />
</Columns>
<HeaderStyle BackColor="#993300" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
.cs page :
private void SetInitialRow()
{
DataTable dt = new DataTable();
DataRow dr = null;
dt.Columns.Add(new DataColumn("amount", typeof(string)));
dt.Columns.Add(new DataColumn("DrCr", typeof(string)));
dt.Columns.Add(new DataColumn("account", typeof(string)));
dt.Columns.Add(new DataColumn("oprUnit", typeof(string)));
dt.Columns.Add(new DataColumn("dept", typeof(string)));
dt.Columns.Add(new DataColumn("affiliate", typeof(string)));
dt.Columns.Add(new DataColumn("openItem", typeof(string)));
dt.Columns.Add(new DataColumn("lineNar", typeof(string)));
dr = dt.NewRow();
dr["amount"] = string.Empty;
dr["DrCr"] = string.Empty;
dr["account"] = string.Empty;
dr["oprUnit"] = string.Empty;
dr["dept"] = string.Empty;
dr["affiliate"] = string.Empty;
dr["openItem"] = string.Empty;
dr["lineNar"] = string.Empty;
dt.Rows.Add(dr);
ViewState["CurrentTable"] = dt;
Grid_AccEntry.DataSource = dt;
Grid_AccEntry.DataBind();
}
protected void addRow(object sender, EventArgs e)
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox amount = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[0].FindControl("amount");
DropDownList DrCr = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[1].FindControl("DrCr");
DropDownList account = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[2].FindControl("account");
DropDownList oprUnit = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[3].FindControl("oprUnit");
DropDownList dept = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[4].FindControl("dept");
DropDownList affiliate = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[5].FindControl("affiliate");
DropDownList openItem = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[6].FindControl("openItem");
TextBox lineNar = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
drCurrentRow = dtCurrentTable.NewRow();
dtCurrentTable.Rows[i - 1]["amount"] = amount.Text.Trim() == "" ? 0 : Convert.ToDecimal(amount.Text);
dtCurrentTable.Rows[i - 1]["DrCr"] = DrCr.Text;
dtCurrentTable.Rows[i - 1]["account"] = account.Text;
dtCurrentTable.Rows[i - 1]["oprUnit"] = oprUnit.Text;
dtCurrentTable.Rows[i - 1]["dept"] = dept.Text;
dtCurrentTable.Rows[i - 1]["affiliate"] = affiliate.Text;
dtCurrentTable.Rows[i - 1]["openItem"] = openItem.Text;
dtCurrentTable.Rows[i - 1]["lineNar"] = lineNar.Text;
rowIndex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrentTable"] = dtCurrentTable;
Grid_AccEntry.DataSource = dtCurrentTable;
Grid_AccEntry.DataBind();
}
}
else
{
Response.Write("ViewState is null");
}
SetPreviousData();
}
private void SetPreviousData()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrentTable"];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
TextBox amount = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[0].FindControl("amount");
DropDownList DrCr = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[1].FindControl("DrCr");
DropDownList account = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[2].FindControl("account");
DropDownList oprUnit = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[3].FindControl("oprUnit");
DropDownList dept = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[4].FindControl("dept");
DropDownList affiliate = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[5].FindControl("affiliate");
DropDownList openItem = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[6].FindControl("openItem");
TextBox lineNar = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
amount.Text = dt.Rows[i]["amount"].ToString();
DrCr.Text = dt.Rows[i]["DrCr"].ToString();
account.Text = dt.Rows[i]["account"].ToString();
oprUnit.Text = <PERSON><PHONE_NUMBER>">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="Amount">
<ItemTemplate>
<asp:TextBox ID="amount" runat="server" Width="100" Text='<%# Bind("amount") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Please Enter Amount"
ValidationGroup="Validation" ControlToValidate="amount" Display="None"></asp:RequiredFieldValidator>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="DR/CR">
<ItemTemplate>
<asp:DropDownList ID="DrCr" runat="server" AutoPostBack="true">
<asp:ListItem Value="D">Debit</asp:ListItem>
<asp:ListItem Value="C">Credit</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Account">
<ItemTemplate>
<asp:DropDownList ID="account" runat="server" Width="100" OnSelectedIndexChanged="accountChanged"
DataSourceID="SqlDataSource1" DataTextField="account" AutoPostBack="true"
DataValueField="acc" >
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [Account] as [acc],[ADesc] as [account], [OpenItemC] as [opn] FROM [Account_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Opr Unit">
<ItemTemplate>
<asp:DropDownList ID="oprUnit" runat="server" Width="100"
DataSourceID="SqlDataSource2" DataTextField="OUnitName"
DataValueField="OprUnit">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [OprUnit], SUBSTRING([OUnitName],0,50) as [OUnitName] FROM [OprUnit_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Dept">
<ItemTemplate>
<asp:DropDownList ID="dept" runat="server" Width="100"
DataSourceID="deptSqlDataSource" DataTextField="DeptName"
DataValueField="DeptCode">
</asp:DropDownList>
<asp:SqlDataSource ID="deptSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [DeptCode], SUBSTRING([DeptName],0,50) as [DeptName] FROM [Department_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Affiliate">
<ItemTemplate>
<asp:DropDownList ID="affiliate" runat="server" Width="100"
DataSourceID="affilSqlDataSource" DataTextField="AfBUName"
DataValueField="AffilateBU">
</asp:DropDownList>
<asp:SqlDataSource ID="affilSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [AffilateBU], SUBSTRING([AfBUName],0,50) as [AfBUName] FROM [Affilate_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Open Item">
<ItemTemplate>
<asp:DropDownList ID="openItem" runat="server" Width="100"
DataSourceID="openitmSqlDataSource" DataTextField="EmpName"
DataValueField="EmpCode">
</asp:DropDownList>
<asp:SqlDataSource ID="openitmSqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConStr %>"
SelectCommand="SELECT [EmpCode], SUBSTRING([EmpName],0,50) as [EmpName] FROM [OpenItem_M]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Line Narration">
<ItemTemplate><asp:TextBox runat="server" ID="lineNar" Width="100"></asp:TextBox></ItemTemplate>
</asp:TemplateField>
<asp:CommandField DeleteText="Remove" ShowDeleteButton="True" />
</Columns>
<HeaderStyle BackColor="#993300" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#<PHONE_NUMBER>" HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#<PHONE_NUMBER>" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
.cs page :
private void SetInitialRow()
{
DataTable dt = new DataTable();
DataRow dr = null;
dt.Columns.Add(new DataColumn("amount", typeof(string)));
dt.Columns.Add(new DataColumn("DrCr", typeof(string)));
dt.Columns.Add(new DataColumn("account", typeof(string)));
dt.Columns.Add(new DataColumn("oprUnit", typeof(string)));
dt.Columns.Add(new DataColumn("dept", typeof(string)));
dt.Columns.Add(new DataColumn("affiliate", typeof(string)));
dt.Columns.Add(new DataColumn("openItem", typeof(string)));
dt.Columns.Add(new DataColumn("lineNar", typeof(string)));
dr = dt.NewRow();
dr["amount"] = string.Empty;
dr["DrCr"] = string.Empty;
dr["account"] = string.Empty;
dr["oprUnit"] = string.Empty;
dr["dept"] = string.Empty;
dr["affiliate"] = string.Empty;
dr["openItem"] = string.Empty;
dr["lineNar"] = string.Empty;
dt.Rows.Add(dr);
ViewState["CurrentTable"] = dt;
Grid_AccEntry.DataSource = dt;
Grid_AccEntry.DataBind();
}
protected void addRow(object sender, EventArgs e)
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox amount = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[0].FindControl("amount");
DropDownList DrCr = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[1].FindControl("DrCr");
DropDownList account = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[2].FindControl("account");
DropDownList oprUnit = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[3].FindControl("oprUnit");
DropDownList dept = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[4].FindControl("dept");
DropDownList affiliate = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[5].FindControl("affiliate");
DropDownList openItem = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[6].FindControl("openItem");
TextBox lineNar = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
drCurrentRow = dtCurrentTable.NewRow();
dtCurrentTable.Rows[i - 1]["amount"] = amount.Text.Trim() == "" ? 0 : Convert.ToDecimal(amount.Text);
dtCurrentTable.Rows[i - 1]["DrCr"] = DrCr.Text;
dtCurrentTable.Rows[i - 1]["account"] = account.Text;
dtCurrentTable.Rows[i - 1]["oprUnit"] = oprUnit.Text;
dtCurrentTable.Rows[i - 1]["dept"] = dept.Text;
dtCurrentTable.Rows[i - 1]["affiliate"] = affiliate.Text;
dtCurrentTable.Rows[i - 1]["openItem"] = openItem.Text;
dtCurrentTable.Rows[i - 1]["lineNar"] = lineNar.Text;
rowIndex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrentTable"] = dtCurrentTable;
Grid_AccEntry.DataSource = dtCurrentTable;
Grid_AccEntry.DataBind();
}
}
else
{
Response.Write("ViewState is null");
}
SetPreviousData();
}
private void SetPreviousData()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrentTable"];
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
TextBox amount = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[0].FindControl("amount");
DropDownList DrCr = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[1].FindControl("DrCr");
DropDownList account = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[2].FindControl("account");
DropDownList oprUnit = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[3].FindControl("oprUnit");
DropDownList dept = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[4].FindControl("dept");
DropDownList affiliate = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[5].FindControl("affiliate");
DropDownList openItem = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[6].FindControl("openItem");
TextBox lineNar = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
amount.Text = dt.Rows[i]["amount"].ToString();
DrCr.Text = dt.Rows[i]["DrCr"].ToString();
account.Text = dt.Rows[i]["account"].ToString();
oprUnit.Text = dt.Rows[i]["oprUnit"].ToString();
dept.Text = dt.Rows[i]["dept"].ToString();
affiliate.Text = dt.Rows[i]["affiliate"].ToString();
openItem.Text = dt.Rows[i]["openItem"].ToString();
lineNar.Text = dt.Rows[i]["lineNar"].ToString();
//to bind long narr text to gridview line narr
TextBox lineNar1 = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
if (lineNar1.Text == "")
lineNar1.Text = lngNar.Text;
rowIndex++;
}
}
}
}
private void SetRowData()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox amount = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[0].FindControl("amount");
DropDownList DrCr = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[1].FindControl("DrCr");
DropDownList account = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[2].FindControl("account");
DropDownList oprUnit = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[3].FindControl("oprUnit");
DropDownList dept = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[4].FindControl("dept");
DropDownList affiliate = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[5].FindControl("affiliate");
DropDownList openItem = (DropDownList)Grid_AccEntry.Rows[rowIndex].Cells[6].FindControl("openItem");
TextBox lineNar = (TextBox)Grid_AccEntry.Rows[rowIndex].Cells[7].FindControl("lineNar");
drCurrentRow = dtCurrentTable.NewRow();
dtCurrentTable.Rows[i - 1]["amount"] = amount.Text.Trim() == "" ? 0 : Convert.ToDecimal(amount.Text);
dtCurrentTable.Rows[i - 1]["DrCr"] = DrCr.Text;
dtCurrentTable.Rows[i - 1]["account"] = account.Text;
dtCurrentTable.Rows[i - 1]["oprUnit"] = oprUnit.Text;
dtCurrentTable.Rows[i - 1]["dept"] = dept.Text;
dtCurrentTable.Rows[i - 1]["affiliate"] = affiliate.Text;
dtCurrentTable.Rows[i - 1]["openItem"] = openItem.Text;
dtCurrentTable.Rows[i - 1]["lineNar"] = lineNar.Text;
rowIndex++;
}
ViewState["CurrentTable"] = dtCurrentTable;
}
}
else
{
Response.Write("ViewState is null");
}
//SetPreviousData();
}
protected void Grid_AccEntry_RowDeleting(Object sender, GridViewDeleteEventArgs e)
{
SetRowData();
if (ViewState["CurrentTable"] != null)
{
DataTable dt = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
int rowIndex = Convert.ToInt32(e.RowIndex);
if (dt.Rows.Count > 1)
{
dt.Rows.Remove(dt.Rows[rowIndex]);
drCurrentRow = dt.NewRow();
ViewState["CurrentTable"] = dt;
Grid_AccEntry.DataSource = dt;
Grid_AccEntry.DataBind();
SetPreviousData();
amountChanged(sender, e);
}
}
}
here everything works fine...now for this gridview i want to add pagination.
i.e if i click on ADD button a new row should be added at the end of last page.
what changes i have to be do now to do tat???
| 5a008cd0520c0015b0db096271fdd8630b17125fdae52c41d5466da085a12eda | ['1f4ea9bbff7d43be90982707c130bf56'] | you need to check the dropdown value before binding gridview.
whenever you change the selected value to --SELECT-- it calls ddlGroup_SelectedIndexChanged function.
try:
protected void ddlGroup_SelectedIndexChanged(object sender, EventArgs e)
{
if(ddlGroup.Text!="--Select--")
{
SqlConnection conn = new SqlConnection(strcon);
conn.Open();
string strQuery = "select distinct(Code) from Application where Date = '" + ddlDate.Text + "' and Group='" + ddlGroup.Text + "'";
SqlCommand cmd = new SqlCommand(strQuery, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
ddlCode.DataSource = dt;
ddlCode.DataTextField = "Code";
ddlCode.DataBind();
ddlCode.Items.Insert(0, new ListItem("--Select--", "0"));
conn.Close();
DataTable dtGroup = DataRepository.GetGroup(ddlDate.Text, ddlGroup.Text);
gvDetails.DataSource = dtGroup;
gvDetails.DataBind();
}
else
{
// call ddlDate_SelectedIndexChanged
}
}
|
4461e05cbdfa2b4173e8b46bac34d8b3ba7f67bdd0c454ce42439056dc4311da | ['1f4f51ae43bd4292bcfa32094761573c'] | The simplest way would be to make your columns unique. On undesired inserts, your MySQL driver should throw an exception then, which you can handle.
From a domain logic point of view, this is a bad practice, since exceptions should never handle expected behaviour. By the way, your DB table could use a primary key.
So, to have a better solution, your approach could be:
- Define a unique field (the SKU seems suitable); think about using this as the primary key as well
- With MySQL, use a REPLACE statement:
REPLACE INTO your_tablename
SET product_name='the name'
-- and so on for other columns
WHERE product_sku = 'whatever_sku';
REPLACE does the Job of trying to INSERT, and doing an UPDATE instead if the PK exists.
| 6f373a038950b55bd04b9edc0a5c1ffd92cf6719d8d3739ada1c052ff797ff3e | ['1f4f51ae43bd4292bcfa32094761573c'] | Throw a glance at the Process component of Symfony 2. You will be able to trigger subprocesses that can do the work, e.g. the API connection. The parent can make sure that only n subprocesses are fired. Pack everything in a loop and query for each job status in there.
|
31ac9c5ac5293a54d259ba6e3a575f8a7ffb08ca4f790ddc569f50bb4fc5882c | ['1f5131328ec94301adffb8514a6fef05'] | I haven't worked with SVN in years. Now I have to. With SVN do you get a 'local' copy that you work against and then when you have things right do you push them out to the rest of the team? Or is commit all you have? Meaning that you work on something and risk losing it until it's correct and ready to be committed?
I hate SVN and I remember always hating SVN.
I have to use SVN is there some way to make it better? Can I use Mercurial or GIT at the same time on the same repo?
| e82ac4d7eff41431f5e65253f57526cb0a189c7b13046f8fa2945536f321eb22 | ['1f5131328ec94301adffb8514a6fef05'] | I'm pretty familiar with web programming in C# but I have a challenge I'm unsure how to address?
I need to monitor two different domains to make sure they are up. I need abc.us/Test.aspx to call abc.uk/Test.aspx and pass in a distinct value (request.querystring?) and I want to inspect that parameter and if it's not null I want to call the US site back with same parameter (an int++;) and just keep doing this.
I really just need to monitor both sites and make sure they are up. Is there a good way to do this? Best practice? Web service?
Thanks!
|
b24eb006c245324f23c4123e089321313041e66c49d9f767d951893d74ab2806 | ['1f52b7c36a7a45e9af6d5ca409e1a28c'] | As for your first question, $S^{-1}$ is a diagonal block of $M^{-1}$. You can only say that its eigenvalues are interlaced with those of $M^{-1}$. Since all the eigenvalues of $M$ and $S$ are negative, it amounts to saying that the eigenvalues of $S$ are interlaced with those of $M$~:
$$\lambda_1\le\mu_1\le\lambda_2\le\cdots\le\mu_{n-1}\le\lambda_n.$$
As for your second question, see my previous answer https://mathoverflow.net/q/52588.
| da420cbbeb1c171de123c5c1cee9d5e1113e2f7dec91a2711894aa3484cea689 | ['1f52b7c36a7a45e9af6d5ca409e1a28c'] | If $uV$ is real valued, then the convex set of complex functions $\psi$ with $\|\psi\|_{L^2}\le A$ ($A$ a given constant) is invariant under the flow.
It is hard to find something else, because the <PERSON> equation tends to transform properties of the initial data into something different. See dispersion estimates of <PERSON> estimates. For instance, if the initial data is compactly supported, then the solution is smooth for $t>0$.
|
a2294108991a98b6ecae8519d9260d0fa25f3f955a23c6669988b18980ec8671 | ['1f56e9c1b5314607ba4ac5e8eb165744'] | I am very grateful, it works correctly but I can not give you a public score for not having 15 points on my profile.
I would like the link to appear in the result so that the customer profile can be edited if ( ! empty( $authors ) ) {
echo '';
// loop through each author
foreach ( $authors as $author ) {
// get all the user's data
$author_info = get_userdata( $author->ID );
echo '' . $author_info->nickname . ' ' . $author_info->last_name . '';
echo '' . $author_info->billing_phone . '';
} | 9e9cf7dcfc3e2e2f62c27e17efba07357f641aabfe153a1d7a27d68c45906c7e | ['1f56e9c1b5314607ba4ac5e8eb165744'] | I had problems with this setup trying to tunnel into iisexpress using hostnames. Finally got things working using the following setup.
Set vmware network to shared with mac (NAT)
set guest (windows) network to dhcp note down ALL the settings dhcp assigns.
change back to static and use those settings
the gotcha for me was that i didn't notice the local domain prefix assigned to DNS under advanced options.
Now your mac (host) may be on dhcp and get a new ip address every time but the guest os will always have the same static ip address. This was essential for me as i work from a macbook pro and connect to different networks with different subnets.
hope this helps.
|
b6198c5da891dca08551c9e8fad356ed616b6130cc3b87e08ed0c1cacf09e7a0 | ['1f581bf5a7f24e8c8375f7d4254ea441'] | .directive('equals', function () {
return {
restrict: 'A', // only activate on element attribute
require: '?ngModel', // get a hold of NgModelController
link: function (scope, elem, attrs, ngModel) {
if (!ngModel) return; // do nothing if no ng-model
// watch own value and re-validate on change
scope.$watch(attrs.ngModel, function () {
validate();
});
// observe the other value and re-validate on change
attrs.$observe('equals', function (val) {
validate();
});
var validate = function () {
// values
var val1 = ngModel.$viewValue;
var val2 = attrs.equals;
// set validity
ngModel.$setValidity('equals', val1 === val2);
};
}
}
})
Try this directive.
| fcd90c8c6b042af9bd2d4e83de3db72ba996365a5759c18295bdac5fb832a1cd | ['1f581bf5a7f24e8c8375f7d4254ea441'] | If you want to show the disabled text field. Try this way
<input type='text' ng-model='SampleDTO'>
<input type='text' ng-disabled='SampleDTO == null' ng-if='SampleDTO == null'>
<input type='text' ng-model='SampleDTO2' ng-if='SampleDTO != null'>
By doing this way UI will a disabled text box with no scope attached to it.
Hope it helps!
|
96bcad69f220ced86e8c8e36636acb0c8946e90f7842202e93366551bbc00f5a | ['1f6742a130f8427cb23c6cbb7962231d'] | <PERSON> is not able to validate a Select/Dropdown element?
HTML
<div :class="{ 'form-group--error': $v.subscription.$error }">
<label for="">Year Subscription</label>
<select name="subscription" @change="subscriptionChange()" v-model="$v.subscription.$model" class="custom-select" id="inputGroupSelect04">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
JS Code
subscription : {required }
| 0a269d8dca4e46dd892e33a36eeaf433f607caa307cf2a2b2818e308d6d11465 | ['1f6742a130f8427cb23c6cbb7962231d'] | I'm new to angular and would like to ask if why I'm encountering Cannot read property 'setLng' of null?
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-map',
templateUrl: './map.component.html',
styleUrls: ['./map.component.css']
})
export class MapComponent implements OnInit {
lat: number = 0;
lng: number = 0;
maptitle : string = '';
constructor() {
}
ngOnInit() {
this.initMap();
}
initMap() {
if (navigator) {
navigator.geolocation.watchPosition(this.showPos);
};
}
showPos(position) {
this.setLng(position.coords.latitude);
this.setLat(position.coords.latitude);
}
setLng(lng){
this.lng = lng;
}
setLat(lat){
this.lat = lat;
}
}
Error
ERROR TypeError: Cannot read property 'setLng' of null
at webpackJsonp.../../../../../src/app/map/map.component.ts.MapComponent.showPos (map.component.ts:26)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4749)
|
0cd38d5451964dd5c3c6ebb703b1055b9f9f6fe2aa83f2785424ea5a00779736 | ['1f6873942f9e4c108367c9a0725253b5'] | I think your confusion stems from the Product table's general lack of utility, since it contains an ID and nothing else.
However it's not a big deal. When defining JPA entities, I would start with the Products table and define each of the child objects as separate classes. Then include those in the Product class:
@Entity
@Table(name = "PRODUCT")
public class Product {
@Id
@Column(name = "id")
private long id;
@OneToMany(mappedBy="product")
List<DataSourceProduct> dataSourceProducts;
@OneToMany(mappedBy="product")
List<MasterProduct> masterProducts;
}
Each of these child products would be define with the reverse @ManyToOne relationship with the Product table.
As you mention in the comments, you might rename these and maybe shift around some of the properties, but I think this structure should be a good starting point.
| 719e123d8ebfcc6f5c4cfbca2cd8fdd433df260eae9d0bf3e62cfda5b5650deb | ['1f6873942f9e4c108367c9a0725253b5'] | @MaxU У меня получается 2 входных нейрона, два скрытых нейрона и один выходной. То есть, если сейчас подать веса [-0.51, 0.8, -0.76, 1.28, -0.71, -2.37] и на вход 1 и 1, то выходной будет 0, как положено. Так же вывел график градиентного спуска, все ровно получается, нет колебаний, сеть работает как положено. Но все равно, что делать с весами, и как ее теперь применить ((( |
5aa2fa803db39c91bf7f4d8019bddcfb2ea3d00f3304aef6c2e268aa9f56acd6 | ['1f6fd0f3efa64699a1e756180c6dcb31'] | I am making an application for my church, and my JLabels have some drop shadows on them, I'm trying to make the background transparent on a windows computer but it's not working. It works perfectly on a Mac, I have tried googling this and using setOpague to false but nothing, suggestions?
Images of the problem:
Mac
Windows
Code:
//Made by <PERSON> | 6.25.18
//Credit to <PERSON> for the original idea
//Credit to <PERSON> for UI work
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
public class choosingScreen {
static String versionNumber = new String("1.0"); //Version Number
static String applicationName = new String("Lower Thirds SDV " + versionNumber); //Application Name
public static void main(String[] args) throws IOException {
createChoosingWindow();
}
static void createChoosingWindow() throws IOException {
JFrame mainFrame = new JFrame(applicationName);
//Images to Buffer
URL icon = loginScreen.class.getResource("/images/SDV-Icon.png");
JLabel backgroundImage = new JLabel(new ImageIcon(loginScreen.class.getResource("/images/Main_BKG.png")));
JLabel logo = new JLabel(new ImageIcon(loginScreen.class.getResource("/images/POK Logo.png")));
JLabel copyrightImage = new JLabel(new ImageIcon(loginScreen.class.getResource("/images/Copyright.png")));
JLabel lowerThirdsLogo = new JLabel(new ImageIcon(loginScreen.class.getResource("/images/LowerThirds_Logo.png")));
JButton lowerThirdsButton = new JButton(new ImageIcon(loginScreen.class.getResource("/images/Lower Thirds.png")));
JButton lyricsButton = new JButton(new ImageIcon(loginScreen.class.getResource("/images/Lyrics.png")));
BufferedImage iconImage = ImageIO.read(icon);
mainFrame.add(backgroundImage);
backgroundImage.add(lowerThirdsLogo);
lowerThirdsLogo.setSize(lowerThirdsLogo.getPreferredSize());
lowerThirdsLogo.setLocation(150, 20);
backgroundImage.add(logo);
logo.setSize(logo.getPreferredSize());
logo.setLocation(270, 525);
backgroundImage.add(copyrightImage);
copyrightImage.setSize(copyrightImage.getPreferredSize());
copyrightImage.setLocation(600, 550);
backgroundImage.add(lowerThirdsButton);
lowerThirdsButton.setSize(lowerThirdsButton.getPreferredSize());
lowerThirdsButton.setLocation(200, 200);
lowerThirdsButton.setText("");
lowerThirdsButton.setBorder(BorderFactory.createEmptyBorder());
backgroundImage.add(lyricsButton);
lyricsButton.setSize(lyricsButton.getPreferredSize());
lyricsButton.setLocation(200, 300);
lyricsButton.setText("");
lyricsButton.setBorder(BorderFactory.createEmptyBorder());
//LYRICS ACTION LISTENER
lyricsButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO add code for making Lyrics work
}
});
//LOWER THIRDS ACTION LISTENER
lowerThirdsButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
//TODO make code for working lower thirds here
}
});
mainFrame.setResizable(false);
mainFrame.setIconImage(iconImage);
mainFrame.pack();
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setLocationRelativeTo(null);
mainFrame.setVisible(true);
}
}
Here are the images
| 2924066e7bca8633135d46763c2da87243bf6183571eb04d0af0f846459e73a7 | ['1f6fd0f3efa64699a1e756180c6dcb31'] | thanks for taking the time to read this. I'm fairly new to JavaFX and have a weird error in my compiler that I would like some insight on.
Here's the error:
2018-09-13 19:09:36.387 java[8040:660455] unrecognized type is 4294967295
2018-09-13 19:09:36.387 java[8040:660455] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1652/AppKit.subproj/NSEvent.m:1969
Here is the code I am working with:
This is in a .java file named applicationSettings
public static double lookupUser(String name, String password) throws IOException {
InputStream inputStream = applicationSettings.class.getResourceAsStream("/files/users.xlsx");
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
XSSFSheet sheet = workbook.getSheetAt(0);
Integer lastRow = sheet.getPhysicalNumberOfRows();
int currentRow = 1;
while(currentRow < lastRow) {
if(sheet.getRow(currentRow).getCell(0).getStringCellValue().toLowerCase().equals(name.toLowerCase())) {
if(sheet.getRow(currentRow).getCell(1).getStringCellValue().toLowerCase().equals(password.toLowerCase())) {
double accessLevel = sheet.getRow(currentRow).getCell(2).getNumericCellValue();
System.out.println(accessLevel);
return accessLevel;
}
}
currentRow++;
}
return 4.0;
}
}
This is in a .java file named loginScreen
EventHandler<ActionEvent> loginClicked = new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
double userFound = 0.0;
try {
userFound = applicationSettings.lookupUser(usernameField.getText(), passwordField.getText());
} catch (IOException e) {
e.printStackTrace();
}//END of Try/Catch
if(userFound == 1.0) { //1 is Admin Access
//TODO: Implement Login
System.out.println("Admin Login");
errorLabel.setVisible(false);
}else if(userFound == 2.0){ //2 is Elevated Access
//TODO: Elevated Access
System.out.println("Elevated Login");
errorLabel.setVisible(false);
}else if(userFound == 3.0){
//TODO: Basic Access
System.out.println("Basic Login");
errorLabel.setVisible(false);
}else{//Show Error
errorLabel.setVisible(true);
//TODO: Show Error
}//End If Statement
}
};
My Excel File is basically structured like this:
NAME PASSWORD ACCESS LEVEL
So for my login it would be like:
Trey Carey March3199; 1
This isn't going anywhere besides by church where it's not really doing anything besides automating some tedious tasks, so security isn't an issue.
Also, if there's anyway I can clean up some of these if statements and my code in general I would appreciate any tips or help!
|
90ddb56da4fb2f667c9498e4b43bebf9d1ad0d07b42232465073c63d41f42522 | ['1f7668757e704bfba435d7b9c0ff428a'] | We use OAuth 2.0 to obtain JWT tokens from an Azure AD. In our application, we have used the value of the 'upn' claim to identify an associated internal username.
The Azure AD Token Reference documents the upn claim as a "User Principal Name", which as far as I understand is a username following the addr-spec format (i.e. user@domain). This works well for users created within the Azure AD Tenant. To my surprise, however, the upn claim seems to be gone if the authenticated user is sync'ed from a different AD. This behavior does not seem to be documented anywhere.
Where can I find documentation on when the upn is guaranteed to be in a token?
What are reliable alternative claims that I can use instead? Preferably claims guaranteed to be of the form "user/domain", as that matches our model best. I have considered the following:
unique_name: I have only observed this to be equal to upn, but I am not sure where it comes from. Confusingly, the token reference says: This value is not guaranteed to be unique within a tenant and is designed to be used only for display purposes. (emphasis mine)
email: This too seems to be equal to upn, but again, where is it sourced from? In the management portal, I have tried putting a different value in every email related field associated with the user, but none of them seem to be propagated to this claim. It therefore appears that this field is not actually an email.
I want to be absolutely sure that our application will be able to handle all tokens issued by Azure AD, so I am hesitant to use any of the above claims unless I have some documentation that explains their actual semantics.
| 667b2ccdfe6b82bcd164d42175f2f991b687f55dcf828d2cdae6ffff2f1aef09 | ['1f7668757e704bfba435d7b9c0ff428a'] | I have both Ubuntu 12.04 and Windows 7 running on the same PC and games installed on both operating systems. The Steam application for either of the operating systems does not recognize whether the same game has been installed on the other OS.
I suspect that even if I pinpointed the directory of the Windows game to the Ubuntu Steam client, it wouldn't work simply because both the versions of the game are not identical. This is not just a DirectX/OpenGL issue, I think, but something quite general which makes porting necessary for games from one OS to another. I am not sure about how many games's codebases are completely platform-agnostic.
I think the simple reason to not implement this feature is simply that it isn't required by a lot of people currently. This is likely to change when SteamOS comes out unless NVIDIA and AMD both start churning out platform-agnostic drivers.
So a simple solution (since I don't think this feature will be implemented and no details have been given on the Steam website) is to maintain a rule of thumb while installing games. For eg., I usually install less time-consuming games on Ubuntu as I stick to small play sessions between coding breaks.
As you said when you have cloud sync, there is no problem. In games which don't have cloud saves, I suggest sticking to one OS.
|
bc179e99a50f941935664c59dff9758a3fc445ebcf6e56856f190cd5c35b400d | ['1fa09e409e1d406c8c600d6367f02351'] | I am trying to code a very basic code where I copy some text from one program and then paste it in a different program. I'm not sure how to do this as Pyperclip only seems to paste the text on the command window where I run the code. I want to be able to click on the text-editing program and then have my code paste the text there. I'm attaching my code
import pyperclip
import time
pyperclip.copy('testing')
time.sleep(5)
pyperclip.paste()
When I run this code nothing actually happens. It doesn't paste anything, not even on the command window. I have the sleep function there because that's when I take the time to click on the text-editing program so that Python pastes the text there but it doesn't work.
| c2b45d7a0e2b1250f3e31cf79a4d0d41f86c6844200655faf2a1a8c894cf2374 | ['1fa09e409e1d406c8c600d6367f02351'] | I've done a fair amount of research on adding a colorbar to a plot but I'm still really confused about how to add one. The examples I've seen use different ways of doing so, which just confuses me because I don't get what the "right" way is.
I've seen there is a colorbar method and a colorbar() function, so what should one use to simply add a colorbar?
Some examples do this:
fig,ax = plt.subplots()
s = ax.scatter(x,y,cmap = coolwarm)
matplotlib.colorbar.ColorbarBase(ax=ax, cmap=coolwarm, values=sorted(v),
orientation="horizontal")
While some others simply call the function:
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
image = np.random.poisson(10., (100, 80))
i = ax.imshow(image, interpolation='nearest')
fig.colorbar(i)
I'm probably missing something here, but I just don't see how these both create a colorbar (I just copied the code for the colorbar and excluded that of the data).
My question is simply: what is the simplest way to add a colorbar to a plot?
Thanks!
|
ecfe8fa244285015362d4b17d3192074f35ac39710debc21c7b412cb5ffc5e02 | ['1fa3fc2b62cb41f3ba8658c3a23435a0'] | I found the root cause. The machine is HP Elite 8200, and it is taking internal harddisk as USB hard disk. We have a GPO to block removable devices in the OU and it is making the drives locked.
I am looking for some solutions to fix this issue, because SATA mode is not suporting in UEFI boot mode. SATA option is only available in Legacy boot, and that one is not supporting by Windows. | d911843bb7fff70a605198830439c9d92d875fd4378000831eeff9d64c6834c7 | ['1fa3fc2b62cb41f3ba8658c3a23435a0'] | I have a domain network, most of the windows 7 systems are taking too much time to startup and settle up. High disk activity and increased memory usage are noticed. I have a locally hosted WSUS server which i doubt causing the issue. The high memory usage issue is fixed after I installed the Microsoft patches KB3050265 and KB3102810. however the machine's are taking too much time to settle up after booting.
I tried clearing the SoftwareDistribution folder and by clearing old updates.
|
93a8bc7ab6070aac258bef171d2dc8f80709b1bd8b3e6cf1feec0313e6c7ee06 | ['1fb9d6dd33dc47478ba800a4b02edeff'] | I am setting up a simple cluster with coreos using vagrant and I have a feeling my cloud-init file is not being read. This because the services i want it to start aren't started when i ssh in the machines.
Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
require 'yaml'
require 'fileutils'
# Look for user-data file to configure/customize CoreOS boxes
# # Be sure to edit user-data file to provide etcd discovery URL
USER_DATA = File.join(File.dirname(__FILE__), "user-data")
servers = YAML.load_file('servers.yml')
Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.ssh.insert_key = false
# config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true
# config.ssh.password = "vagrant"
servers.each do |servers|
config.vm.define servers["name"] do |srv|
srv.vm.box_check_update = false
srv.vm.hostname = servers["name"]
srv.vm.box = servers["box"]
srv.vm.network "private_network", ip: servers["priv_ip"]
srv.vm.network "public_network", bridge: "vlan0", ip: servers["pub_ip"]
if srv.vm.box == "coreos-stable"
srv.vm.provision :file, :source => "#{USER_DATA}", :destination => "/tmp/vagrantfile-user-data"
srv.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true
srv.vm.synced_folder ".", "/vagrant", disabled: true
end
end
end
end
cloud-config.yml
coreos:
etcd:
# iedere unieke cluster heeft een nieuwe token nodig. Makkelijk te verkrijgen via https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/054daef60b25b0384350be326fb40bf1
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
fleet:
public-ip: $public_ipv4
units:
- name: "etcd.service"
command: "start"
- name: "fleet.service"
command: "start"
- name: docker-tcp.socket
command: start
enable: true
content: |
[Unit]
Description=Docker Socket voor de API
[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service
[Install]
WantedBy=sockets.target
servers.yml:
- name: arya
box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: <IP_ADDRESS>
pub_ip: <IP_ADDRESS>
- name: sansa
box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: <IP_ADDRESS>
pub_ip: <IP_ADDRESS>
- name: rickon
box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: <IP_ADDRESS>
pub_ip: <IP_ADDRESS><PERSON>box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: 192.168.254.101
pub_ip: 172.16.5.11
- name: <PERSON>box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: 192.168.254.102
pub_ip: 172.16.5.12
- name: <PERSON>box: yungsang/coreos
ram: 512
vcpu: 1
priv_ip: 192.168.254.103
pub_ip: 172.16.5.13
When I ssh into one of the machines and try systemctl status etcd and/or fleet they are inactive.
I am still a beginner, am I doing something wrong? Thanks in advance
| 920e2fc65e1c5054f3f3c56e5fa0929697ac0e30ce13ecc6c0f47881663375de | ['1fb9d6dd33dc47478ba800a4b02edeff'] | For my Windows 2012 R2 school assignment I need to automatically install IIS 8 on my virtual machine. I guess the best way is with a script. I have found numerous solutions for the UI but non for the cmd.
Is there a) a way to automatically install it on every machine with the ui? Or is there b) a script to install IIS 8 on windows?
Thank you in advance.
|
ed11dc0aea3c2fd584332a24514f78b856bf13d37180d75592c750cb2fa7fa2b | ['1fc12473beb64e21b81da75d533c9461'] | Here is a simple one
# My comment
#. Programmer comment
#: location.c:23
#| msgctxt "Old context"
#| msgid "Won"
#, fuzzy
msgctxt "Disambiguation for context"
msgid "One"
msgstr "Een"
I think that covers everything. There are other things like obsolete units, c-format markers. I think I've placed previous messages #| in the correct place and you might want to check the format.
| 1aea6f2d6b11ec46260f693b88d22bcfd450e1c0dafb2959a1f9f53c2bc5c30f | ['1fc12473beb64e21b81da75d533c9461'] | Pootle makes use of RQ, so that would be a more natural fit for background jobs.
I assume you are using update_stores for uploading the files, rather then the UI. The UI can potentially timeout. While update_stores does not background it is easier to safely execute and build into scripts.
|
ddcd1cec10128506bdb216176843b2f0f5272a905669d834310b626868725fb8 | ['1fdc1b3b65904961b0b92b2bbc4d7878'] | I had the same problem with FileReference class and load() function. The problem can solved in this way:
Open the "Flex Build Path" tab.
Expand "Flex 3", select "playerglobal.swc" and click "Remove".
Note the directory path in "Flex 3 - " (on my system it's /Applications/Adobe Flex Builder 3 Plug-in/sdks/3.2.0).
Click "Add SWC" and navigate to the that path, and then deeper into frameworks/libs/player/10, select playerglobal.swc.
Expand "playerglobal.swc", double-click "Link Type" and change it to "External".
Open the "Flex Compiler" tab
In "HTML wrapper", change the "Require Flash Player version" to 10.0.0.
| c783e34cc384980cff58b3f392a0286767a3e7b5aa017008905057b211706c94 | ['1fdc1b3b65904961b0b92b2bbc4d7878'] | So for nginx to act as a cache server it has to be in front of application servers and not "next to" application servers. Makes sense. I'm not sure about best practices on putting load balancing and caching on the same machine but that's another question. Thanks :) BTW can't upvote you, not enough rep yet! |
e9ee4babccc23023baf02f3cca57f8cec9c1db2d1be39ecadf63cbc236c57497 | ['1ff0c7b4d1424bc5b65c6f52942eff5f'] | I don't think this constitutes an answer, it could be seen as anecdotal, but it's a bit long for a comment.
Everything you do when it comes to the integrity of your coding on this issue has to revolve around needing to verify that the data hasn't changed outside of the logic of your game.
My experience with game development (via flash, primarily...but could be compared to javascript) is that you need to think about everything being a handshake where possible. When you are expecting data to come to the server from the client you want to make sure that you have some form of passage of communication that lessens the chance of someone simply sending false data. Store data on the server side as much as possible and use the client side code to call for it when it's needed, and refresh this data store often.
You'll find that HTML games tend to do a lot of abstraction of the logic to the server side, even for menial tasks. Attacking an enemy, picking up an item, these are calls to functions within server-side code, and is why the game animation could carry on in some of these games while the connection times out in the background, causing error messages to pop up and refresh the interface to the server's last known valid state.
Flash was easier in this regard as you didn't have any access to alter any data or corrupt it unless it left the flash environment
| 97ddc02922cf4cf82319378994f14168306814e3b61225e75726812bba40ae41 | ['1ff0c7b4d1424bc5b65c6f52942eff5f'] | You don't need to use a select statement anywhere...
UPDATE user_values AS values
INNER JOIN decrease_times AS times ON values.property = times.property
SET values.value = values.value-times.decrease_value
WHERE values.property = times.property AND times.decrease_time = 0
You are taking your table you're looking to edit, and joining it for the query with the second table... You set the value field on your user_values table using the simple maths equation you need, and ensure that both the property values are the same, and that you're only updating the rows that are meant to be updated every hour.
Your daily version would be the same, but wouldn't need "AND..." onwards
|
79d031f7869cf2e3af4fea5f4c3b6e99eeacea55de34086abed78a1c1953cd54 | ['2005fc29d1ec4174abad4cdbf25fe83d'] |
The answer to your first question is this link .getting start Cgi programmin
The answer to your second question: You should use multi-threaded programming.
If you have sample function in module test2 ...
#in test1.py
import threading
import test2
T1 = threading.Thread(test2.sample(object))
T1.start()
Answer your third question:
Then you can either make a folder in your site's path where your cgi files will live, or configure certain directories to handle certain file types as cgi scripts.
This is described well in the apache2 doc above, but essentially you to make all files in a cgi folder be executed, you would use this conf:
Options ExecCGI
SetHandler cgi-script
and to allow .py files to be executed as scripts in a particular folder you would use this conf:
<Directory /srv/www/yoursite/public_html>
Options +ExecCGI
AddHandler cgi-script .py
</Directory>
Once you have that, if you're running python 3, you can make a python script like this one, and stick it in whichever folder is configured for cgi:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-# enable debugging
import cgitb
cgitb.enable() print("Content-Type: text/html;charset=utf-8")
print() print("Hello World!")
| 29a55c52b3c12e4c9442d3764a98818561b06652269337ea3e8c6c34fba03dcf | ['2005fc29d1ec4174abad4cdbf25fe83d'] | I want code like this:
process=run('2.PY')
whilt ScriptRunning(process):
txt=input()
output=pass(process,txt)
print(output )
I have two scripts
Script 1.py
Script 2.py
I want to run script 2 with script 1. between them passing parameter.
My second script has the ability to stay in zombie mode and wait for input.
I tried with the subprocess module, but after execution, it does not wait to receive input and completes the process.
out put :
import subprocess
cmd = 'python3 TC-Bot/src/run.py'
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
out, err = p.communicate()
if not err:
result = out.split('\n')
for <PERSON> in result:
if not lin.startswith('#'):
print(lin)
else:
print(err)
|
48d857f8ead9c7b53b93ba05a08f0c143e04f2369cc60a2f0dafcd04659c2810 | ['20124681b1a64e6ca0d29929bdd0e29b'] | I'm struggling trying to connect my TeamCity project to my TFS project. I tried a bunch of stuff, but I always get the same error:
TFS failed. ExitCode: 111, command: C:\TeamCity\webapps\ROOT\WEB-INF\plugins\tfs\bin\tfs-native.exe @@C:\TeamCity\temp\TC-TFS-25-7939_109\command.params, in file: {https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity, /hash:S, /noProxy, C:\TeamCity\temp\TC-TFS-25-7939_108.result, ConnectionTest, $/TesteTeamCity/TesteTeamCity}, completed in: 1 second(s)
stdout: TFS Native Verifier v8.0 Copyright (C) 2006-2013 JetBrains s.r.o.
Running under .NET Framework 4.0.30319.18052
INFO -
INFO - Use Team Explorer 2012
INFO -
TFS Native Accessor v8.0 Copyright (C) 2006-2013 JetBrains s.r.o.
INFO - Connecting to server https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity
INFO - WebProxy is disabled
Connection test:
Server='https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity'
Root='$/TesteTeamCity/TesteTeamCity'
ERROR - TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity.
System.Exception: TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity.
em Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.EnsureTokenProvider(HttpWebResponse webResponse)
em Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
em Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)
em Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
em Microsoft.TeamFoundation.Framework.Client.Registration.GetRegistrationEntries(String toolId)
em Microsoft.TeamFoundation.Framework.Client.RegistrationProxy.GetRegistrationEntries(String toolId)
em Microsoft.TeamFoundation.Framework.Client.RegistrationService.GetInstanceId()
em Microsoft.TeamFoundation.Framework.Client.RegistrationService.get_InstanceClientCacheDirectory()
em Microsoft.TeamFoundation.Framework.Client.RegistrationService..ctor(TfsTeamProjectCollection tfsObject)
em Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.CreateServiceProxy(Type serviceType)
em Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetServiceInstance(Type serviceType, Object serviceInstance)
em Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
em Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.FindServiceLocation(String serviceType, String toolId)
em Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.LocationForCurrentConnection(String serviceType, Guid serviceIdentifier)
em Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()
em JetBrains.TeamCity.Tfs.Command.Do() na c:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Command.cs:linha 28
em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Program.cs:linha 134
--- Fim do rastreamento de pilha de exce‡äes internas ---
em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Program.cs:linha 438
I always get the error:
'You are not authorized to access /DefaultCollection/'
I have admin rights in everything on the TFS and I don't know if I'm missing some authorizantion configuration on the TeamCity.
Does anyone have any idea why this is happening?
| 2d4423e1a5cf4c1ea4f065239d4e3b25e593fa5d3779d6bbc63572b517180ea6 | ['20124681b1a64e6ca0d29929bdd0e29b'] | I don't know if your're wiling to change the library that you're using, but I use library "Newtonsoft.Json" to desserialize JSON objects, it's pretty easy to use
[HttpPost]
public void AddSell(string sellList)
{
var sellList = JsonConvert.DeserializeObject<List<Sell>>(sellListJson);
BD.SaveSellList(sellList);
}
As you can see you can deserialize a whole json object list to a List<> fo the type "Sell", an object that i've created... And, of course, you can do that to an array too. I don't know the correct syntax for this, but you can convert this list to an array afterwards
Hope this helps
|
c558aa65cdbd5374db69918f45100aef27b91471cf2eed1944e4c4a3532ffe11 | ['2012c9267e0d443bab162dbe5574c5ce'] | I have an image captured using a camera attached to a drone. The camera I used does not give me any GPS data, however my drone has an in-built GPS which I can use to get the location at which the image was captured. I save this information in a text file. How do I add this latitude and longitude saved in the text file to the image? I am writing my code in python. So far I have only found information about using csv or gpx files with exiftool but nothing about text files.
| 583411f2d81048a9b857e21a75973c904dd74972835616410a730732e247828d | ['2012c9267e0d443bab162dbe5574c5ce'] | I have a Geo-tagged aerial image, that is it contains the latitude, longitude and altitude at which the image was captured. I am using this image to plan a route for a ground robot to move between two points. I got this route as pixel coordinates, however, now i want to convert these coordinates to real world GPS points. I am writing my code in python. I found out that the GDAL library could be of help.
Sample image showing the path between two points. The axis represents the pixels' coordinates.
|
6e71b1931ffb510c301f2d7120a1cab92dfb4456b5d18e2aa1620d47ef303691 | ['201c8bdde28d4d08b39e591587c8d0b1'] | I have three different services in an App Engine.
I have 3 different routes, each of which should be routed to different services.
api.carspecialsxxx.com
Target => default (Welcome page)
api.carspecialsxxx.com/api/v1/...
Target => apiv1 (API V1)
api.carspecialsxxx.com/api/v2/...
Target => apiv2 (API V2)
How do I realize this in the dispatch.yaml
dispatch:
- url: "api.carspecialsxxx.com/*"
service: default
- url: "api.carspecialsxxx.com/api/v1/*"
service: apiv1
- url: "api.carspecialsxxx.com/api/v2/*"
service: apiv2
| a5071c7aa1ab1f0443ddd04fae085ef11691cb3caa6ebd76f9a5d1ce4976723c | ['201c8bdde28d4d08b39e591587c8d0b1'] | I want to create an api. This api should not give back records from database. I do have an application, which does have some logic in it, which does get datas from other apis, does calculate, and much more.
Is apigility a good start point for it?
Does someone know a tutorial, where I can see more than getting records from database and give it back?
Thanks for help.
|
ffcfa46353ecaafa188d0a327a4a61676b6551a40d323207c552ad9380c4f5c6 | ['203026b15572473ab1f1d7c26bda5de0'] | So after grabbing data from my database,$genrelisty=$row['genre'] One of the variables is "R & B" and when I try and search it in my database the resulting page s blank, when I search other genres like "Rap" or "Hip Hop" the resulting page works just fine and just shows the data related to the search.
in php there's a foreach and it echos all the data from the database that I want it to display like the title with $title=$row['Title'] then in a big echo statement display everything with text that I want it t be with, There's a search featre at the top of my page which you can search spefic things like artist or genre and then type the artist name or genre, but whenever the search value is "R & B" or as the link "?searchLocation=genre&searchValue=R%20&%20B" but then I tried replacing '&' with 'n' on both post and get sites but the search result is noting currently the link is like "?searchLocation=genre&searchValue=RnB"
| fab52f4e24032dde41a1079526263aaccf38968efe5a7338e3d54433d9c01746 | ['203026b15572473ab1f1d7c26bda5de0'] | I am coding on codetasty and wanting to run a nodejs file that works on localhost. I am using the sandbox on codetasty so the link is similar to https://'s.codetasty.com'/My username/mysandbox/project/.
var app = express();
var serv = require('http').Server(app);
app.get('/',function(req, res) {
res.sendFile(__dirname + '/client/index.html');
});
app.use('/client',express.static(__dirname + '/client'));
serv.listen(2000);
console.log("Server started.");
When I direct to my index.html file https://'s.codetasty.com'/My username/mysandbox/project/client/index.html only the hmtl "runs" but none of the nodejs is running (on local host you would just do node 'filename'.js in console)
|
af6f28ba436550f54b20b7f3b25d2e1f734a894c698820a7547a7dd5b7a33246 | ['204e16375ff04dcdb23e81bbafbaba2b'] | I was facing similar problem with focusing with MediaRecorder (particulalry on pre 3.0 versions of android). The following code of setting the parameterers explicitly solved my problem:
Camera.Parameters parameters = mCamera.getParameters();
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
parameters.set("cam_mode", 1 ); //not sure why this arcane setting is required. found this in another post on Stackoverlflow
mCamera.setParameters(parameters);
mCamera.stopPreview(); // call this if you had started preview before or else recording wont work on Android versions <= 2.3
mediarecorder.setCamera(mCamera);
Also you have mentioned that you are seeing problems with HTC device. So it would be wise to try the above code on a non-HTC device too. I have faced some really wierd problems with HTC devices at many other places.
| dc4e6ac76b17a035d52d07c131da7e2cab3e968ba5614f383a973ec766debbe3 | ['204e16375ff04dcdb23e81bbafbaba2b'] | Simplest way to get the library paths paths correct is to use the GUI from Eclipse to add the library as shown in the following screenshot and let Eclipse take care of putting the correct relative paths in project.properties. Its a common setup to have your library projects hosted at directories vastly different than your main projects that uses the library. This method will work if the "libary project" and the project using it are in the same eclipse "workspace" (they "need not" be in same parent folder):
|
3c087bed765bed9bfd81c19b32860e752890df23713e98a79c529ecae8ff00b6 | ['2053c2742f1d4e229c80d89d60f40220'] | I'm attempting to create a login page using Tkinter that connects to a database. The user's details should be stored in the database once registered and then used to verify a user upon logging in. The registration part is working fine, however, there seems to be an error in the login verification process as the program keeps outputting "User Not Found" even when the correct credentials are entered.
Any insight into why this is happening would be much appreciated!
db_cursor = db_connection.cursor()
db_cursor.execute("CREATE DATABASE IF NOT EXISTS userdetails")
db_cursor.execute("SHOW DATABASES")
for db in db_cursor:
print(db)
db_cursor.execute("CREATE TABLE IF NOT EXISTS userdetails.users(userid INT(100)
AUTO_INCREMENT PRIMARY KEY, username VARCHAR(255), password VARCHAR(255))")
db_cursor.execute("SHOW TABLES IN userdetails")
for table in db_cursor:
print(table)
class LoginPage:
def __init__(self):
self.userID = 1
self.mainpage()
def mainpage(self):
global mainpage
mainpage = Tk()
mainpage.geometry("600x600")
mainpage.title("Login Page")
mainpage.configure(background="thistle1")
Label(mainpage, text="Please login or register for a new account", bg="plum2", width="300", height="2", font=("Calibri", 13)).pack()
Button(mainpage, text="Login",bg="SkyBlue1", height="2", width="30", command=self.login).pack()
Button(mainpage, text="Register",bg="SkyBlue1", height="2", width="30", command=self.register).pack()
mainpage.mainloop()
def register(self):
global register
global username
global password
Label(mainpage, text="Fill in the boxes below to register as a new user", bg="plum2").pack()
username = str
username_label = Label(mainpage, text="Username: ", bg="SkyBlue1").pack()
usernameRegister_entry = Entry(mainpage, textvariable=username).pack()
password = str
password_label = Label(mainpage, text="Password: ",bg="SkyBlue1").pack()
passwordRegister_entry = Entry(mainpage, textvariable=password, show='*').pack()
Button(mainpage, text="Register", width=10, height=1, bg="plum2", command = self.new_user).pack()
def new_user(self):
self.userID += 1
userdetails_sql_query = "INSERT INTO userdetails.users VALUES(userID,'username','password')"
db_cursor.execute(userdetails_sql_query)
db_connection.commit()
print(db_cursor.rowcount, "Record Inserted")
Label(mainpage,text="Registration Success", bg="plum2", font=("calibri", 11)).pack()
def login(self):
global usernameCheck
global passwordCheck
global login
Label(mainpage, text="Fill in the boxes below to login", bg="plum2").pack()
usernameCheck = str
Label(mainpage, text="Username: ", bg="SkyBlue1").pack()
usernameLogin_entry = Entry(mainpage, textvariable=usernameCheck).pack()
passwordCheck = str
Label(mainpage, text="Password: ", bg="SkyBlue1").pack()
passwordLogin_entry = Entry(mainpage, textvariable=passwordCheck, show= '*').pack()
Button(mainpage, text="Login", width=10, height=1, bg="plum2", command=self.login_verification).pack()
def login_verification(self):
sql_select_Query = "select * from userdetails.users"
db_cursor.execute(sql_select_Query)
records = db_cursor.fetchall()
if usernameCheck in records:
if passwordCheck in records:
self.login_success()
else:
self.incorrect_password()
else:
self.incorrect_user()
def login_success(self):
global login_success
Label(mainpage, text="You have logged in successfully!", bg="plum2").pack()
return self.login_success
def incorrect_password(self):
Label(mainpage, text="Invalid Password ", bg="plum2").pack()
def incorrect_user(self):
Label(mainpage, text="User Not Found", bg="plum2").pack()
| 2cb06b56342702ca265896b0b1c7971ad6aaa4d1dcd4f93473dbaf4721931123 | ['2053c2742f1d4e229c80d89d60f40220'] | As part of a game, I am attempting to create a login page in pygame. As I require buttons I have been trying to get a button function (that I saw on another tutorial page) to work. However, I seem to run into a problem with getting the program to register when the mouse is clicked. Below I have pasted my function for the button:
def button(self,msg,x,y,w,h,ic,ac,action=None):
mouse = pygame.mouse.get_pos()
click = pygame.mouse.get_pressed()
print(click)
if x+w > mouse[0] > x and y+h > mouse[1] > y:
pygame.draw.rect(screen, ac,(x,y,w,h))
if click[0] == 1 and action != None:
action()
else:
pygame.draw.rect(screen, ic,(x,y,w,h))
smallText = pygame.font.Font("freesansbold.ttf",20)
textSurf, textRect = self.text_objects(msg, smallText)
textRect.center = ( (x+(w/2)), (y+(h/2)) )
screen.blit(textSurf, textRect)
pygame.display.update()
Each time I run my program - no matter what I do, my buttons remain static objects and do not change colour or allow any actions to run. Additionally the line 'print(click)' only ever outputs (0,0,0). I am using a laptop to code this program so maybe my trackpad is what is causing issues? I'm not too sure really but any alternatives on how to get this function to work would be much appreciated!
|
4ff1a3a45901d63693ab099480866aa0cd2f804f0bb0a46776bea3a1ca2297a8 | ['20836388bdfe447692ce3202c7365b23'] | I am training CIFAR10 dataset on LeNet CNN model. I am using PyTorch on Google Colab. The code runs only when I use Adam optimizer with model.parameters() as the only parameter. But when I change my optimizer or use weight_decay parameter then the accuracy remains at 10% through all the epochs. I cannot understand the reason why it is happening.
# CNN Model - LeNet
class LeNet_ReLU(nn.Module):
def __init__(self):
super().__init__()
self.cnn_model = nn.Sequential(nn.Conv2d(3,6,5),
nn.ReLU(),
nn.AvgPool2d(2, stride=2),
nn.Conv2d(6,16,5),
nn.ReLU(),
nn.AvgPool2d(2, stride=2))
self.fc_model = nn.Sequential(nn.Linear(400, 120),
nn.ReLU(),
nn.Linear(120,84),
nn.ReLU(),
nn.Linear(84,10))
def forward(self, x):
x = self.cnn_model(x)
x = x.view(x.size(0), -1)
x = self.fc_model(x)
return x
# Importing dataset and creating dataloader
batch_size = 128
trainset = torchvision.datasets.CIFAR10(root='./data', train=True, download=True,
transform=transforms.ToTensor())
trainloader = utils_data.DataLoader(trainset, batch_size=batch_size, shuffle=True)
testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True,
transform=transforms.ToTensor())
testloader = utils_data.DataLoader(testset, batch_size=batch_size, shuffle=False)
# Creating instance of the model
net = LeNet_ReLU()
# Evaluation function
def evaluation(dataloader):
total, correct = 0, 0
for data in dataloader:
inputs, labels = data
outputs = net(inputs)
_, pred = torch.max(outputs.data, 1)
total += labels.size(0)
correct += (pred==labels).sum().item()
return correct/total * 100
# Loss function and optimizer
loss_fn = nn.CrossEntropyLoss()
opt = optim.Adam(net.parameters(), weight_decay = 0.9)
# Model training
loss_epoch_arr = []
max_epochs = 16
for epoch in range(max_epochs):
for i, data in enumerate(trainloader, 0):
inputs, labels = data
outputs = net(inputs)
loss = loss_fn(outputs, labels)
loss.backward()
opt.step()
opt.zero_grad()
loss_epoch_arr.append(loss.item())
print('Epoch: %d/%d, Test acc: %0.2f, Train acc: %0.2f'
% (epoch,max_epochs, evaluation(testloader), evaluation(trainloader)))
plt.plot(loss_epoch_arr)
| a3475a386c2ef8155ca548751a24ccb3ec2380b11c5c6daeb2e6ffab3fe40bdd | ['20836388bdfe447692ce3202c7365b23'] | (1) I want to plot in a loop while keeping old plots and
(2) I want to pause after each plotting so that I can analyse the plot.
While I can do either (1) or (2) but not both. How can I do both?
import numpy as np
import matplotlib.pyplot as plt
def sigmoid(w,x,b):
return 1/(1+np.exp(-(w*x+b)))
w1 = np.array([0.5,3,5.5])
b1 = np.array([0.5,3,5.5])
X = np.linspace(-20,20,100)
for w in w1:
for b in b1:
Y = sigmoid(X,w,b)
plt.plot(X,Y, label = f'w = {w} \n b = {b}' )
plt.legend(bbox_to_anchor = (1.05,1))
plt.pause(1)
plt.show()
|
17af65b0bfaddb5e50fec2b291941450567398fc5960f67dd32019bd739af138 | ['208960a6f75c43a2a060923ba858a5d5'] | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
System.out.println(a);
}
}
I get the following message and don't know why.
Exception in thread "main" java.util.InputMismatchException: For input string: "999999999999999"
at java.util.Scanner.nextInt(Scanner.java:2123)
at java.util.Scanner.nextInt(Scanner.java:2076)
at codingexercises.Main.main(Main.java:9)
I want to know how to fix the problem.
| 9192cb72a4fd0688848e5c264883f85664c13b7e91d9303c0fc1812fab051dfd | ['208960a6f75c43a2a060923ba858a5d5'] | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String num = sc.next();
String[] partsOfNums = num.split("\\-");
int num1 = Integer.parseInt(partsOfNums[0]);
int num2 = Integer.parseInt(partsOfNums[1]);
int result = num1 - num2;
System.out.println(result);
}
}
I want to input 123 -123 and print out 0 but I'm getting the error.
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at codingexercises.Main.main(Main.java:12)
What's wrong with the code?
|
de3284db9f98dcfb86e03623f8dbe480b66c2b1cbd8bb27d1389ac98b8327a85 | ['209db4c80e2f467fbff7260972b53db4'] | I have setup a Fabric network using the BYFN network .
I have also added an extra Org3 by using the EYFN tutorial using https://hyperledger-fabric.readthedocs.io/en/release-1.1/channel_update_tutorial.html
Now i want to start a CA server individually for Org3 so i define a file docker-compose-cas-org.yaml as
version: '2'
networks:
byfn:
services:
ca4:
image: hyperledger/fabric-ca
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-Org3
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org3.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/d86d58e3f0b24d63a18fc22c93f9cdd109afee8543a12e67b232a2fe3548444a_sk
ports:
- "10054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org3.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/d86d58e3f0b24d63a18fc22c93f9cdd109afee8543a12e67b232a2fe3548444a_sk -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/org3.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca_peerOrg3
networks:
- byfn
I have replaced the FABRIC_CA_SERVER_TLS_KEYFILE with the CA keyfile from crypto-config for Org3
When i start the ca with command - docker-compose -f docker-compose-cas-org.yaml up i get the log saying :
Creating ca_peerOrg3 ... done
Attaching to ca_peerOrg3
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] Created default configuration file at /etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] Starting server in home directory: /etc/hyperledger/fabric-ca-server
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] Server Version: 1.1.0
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] Server Levels: &{Identity:1 Affiliation:1 Certificate:1}
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Making server filenames absolute
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Initializing default CA in directory /etc/hyperledger/fabric-ca-server
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Init CA with home /etc/hyperledger/fabric-ca-server and config {Version:1.1.0 Cfg:{Identities:{AllowRemove:false} Affiliations:{AllowRemove:false}} CA:{Name:ca-Org3 Keyfile:/etc/hyperledger/fabric-ca-server-config/d86d58e3f0b24d63a18fc22c93f9cdd109afee8543a12e67b232a2fe3548444a_sk Certfile:/etc/hyperledger/fabric-ca-server-config/ca.org3.example.com-cert.pem Chainfile:ca-chain.pem} Signing:0xc4202efa40 CSR:{CN:fabric-ca-server Names:[{C:US ST:North Carolina L: O:Hyperledger OU:Fabric SerialNumber:}] Hosts:[f27e76c85edd localhost] KeyRequest:<nil> CA:0xc4202c9e60 SerialNumber:} Registry:{MaxEnrollments:-1 Identities:[{ Name:**** Pass:**** Type:client Affiliation: MaxEnrollments:0 Attrs:map[hf.Registrar.DelegateRoles:peer,orderer,client,user hf.Revoker:1 hf.IntermediateCA:1 hf.GenCRL:1 hf.Registrar.Attributes:* hf.AffiliationMgr:1 hf.Registrar.Roles:peer,orderer,client,user] }]} Affiliations:map[org2:[department1] org1:[department1 department2]] LDAP:{ Enabled:false URL:ldap://****:****@<host>:<port>/<base> UserFilter:(uid=%s) GroupFilter:(memberUid=%s) Attribute:{[uid member] [{ }] map[groups:[{ }]]} TLS:{false [] { }} } DB:{ Type:sqlite3 Datasource:fabric-ca-server.db TLS:{false [] { }} } CSP:0xc4202d5050 Client:<nil> Intermediate:{ParentServer:{ URL: CAName: } TLS:{Enabled:false CertFiles:[] Client:{KeyFile: CertFile:}} Enrollment:{ Name: Secret:**** Profile: Label: CSR:<nil> CAName: AttrReqs:[] }} CRL:{Expiry:24h0m0s}}
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] CA Home Directory: /etc/hyperledger/fabric-ca-server
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Checking configuration file version '1.1.0' against server version: '1.1.0'
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Initializing BCCSP: &{ProviderName:SW SwOpts:0xc4202d50b0 PluginOpts:<nil> Pkcs11Opts:<nil>}
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Initializing BCCSP with software options &{SecLevel:256 HashFamily:SHA2 Ephemeral:false FileKeystore:0xc4202fdcf0 DummyKeystore:<nil>}
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Initialize key material
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Making CA filenames absolute
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] Root CA certificate request: {CN:fabric-ca-server Names:[{C:US ST:North Carolina L: O:Hyperledger OU:Fabric SerialNumber:}] Hosts:[f27e76c85edd localhost] KeyRequest:0xc42030c500 CA:0xc4202c9e60 SerialNumber:}
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] generating key: &{A:ecdsa S:256}
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] generate key from request: algo=ecdsa, size=256
ca_peerOrg3 | 2018/08/01 06:27:51 [INFO] encoded CSR
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] validating configuration
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] validate local profile
ca_peerOrg3 | 2018/08/01 06:27:51 [DEBUG] profile is valid
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] signed certificate with serial number 59275873815985971796998828375691992517475407195
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] The CA key and certificate were generated for CA ca-Org3
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] The key was stored by BCCSP provider 'SW'
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] The certificate is at: /etc/hyperledger/fabric-ca-server-config/ca.org3.example.com-cert.pem
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Initializing DB
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Initializing 'sqlite3' database at '/etc/hyperledger/fabric-ca-server/fabric-ca-server.db'
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Using sqlite database, connect to database in home (/etc/hyperledger/fabric-ca-server/fabric-ca-server.db) directory
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating SQLite database (/etc/hyperledger/fabric-ca-server/fabric-ca-server.db) if it does not exist...
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating users table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating affiliations table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating certificates table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating properties table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Successfully opened sqlite3 DB
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Checking database schema...
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Update SQLite schema, if using outdated schema
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Upgrade identities table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating users table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Upgrade affiliation table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating affiliations table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Upgrade certificates table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Creating certificates table if it does not exist
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Initializing identity registry
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Initialized DB identity registry
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Get properties [identity.level affiliation.level certificate.level]
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Checking database levels 'map[affiliation.level:0 certificate.level:0 identity.level:0]' against server levels '&{Identity:1 Affiliation:1 Certificate:1}'
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Loading identity table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Loading identity 'admin'
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Getting identity admin
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Max enrollment value verification - User specified max enrollment: 0, CA max enrollment: -1
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add identity admin
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Successfully added identity admin to the database
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Registered identity: { Name:**** Pass:**** Type:client Affiliation: MaxEnrollments:-1 Attrs:map[hf.Registrar.Roles:peer,orderer,client,user hf.Registrar.DelegateRoles:peer,orderer,client,user hf.Revoker:1 hf.IntermediateCA:1 hf.GenCRL:1 hf.Registrar.Attributes:* hf.AffiliationMgr:1] }
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Successfully loaded identity table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Loading affiliations table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add affiliation org2
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Affiliation 'org2' added
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add affiliation org2.department1
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Affiliation 'org2.department1' added
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add affiliation org1
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Affiliation 'org1' added
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add affiliation org1.department1
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Affiliation 'org1.department1' added
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] DB: Add affiliation org1.department2
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Affiliation 'org1.department2' added
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Successfully loaded affiliations table
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Checking and performing migration, if needed
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Updating database level to &{Identity:1 Affiliation:1 Certificate:1}
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] Initialized sqlite3 database at /etc/hyperledger/fabric-ca-server/fabric-ca-server.db
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Initializing enrollment signer
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] validating configuration
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] validate local profile
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] profile is valid
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] validate local profile
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] profile is valid
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] validate local profile
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] profile is valid
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] CA initialization successful
ca_peerOrg3 | 2018/08/01 06:27:52 [INFO] Home directory for default CA: /etc/hyperledger/fabric-ca-server
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] 1 CA instance(s) running on server
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] TLS is enabled
ca_peerOrg3 | 2018/08/01 06:27:52 [DEBUG] Closing server DBs
ca_peerOrg3 | Error: File specified by 'tls.keyfile' does not exist: /etc/hyperledger/fabric-ca-server-config/d86d58e3f0b24d63a18fc22c93f9cdd109afee8543a12e67b232a2fe3548444a_sk
ca_peerOrg3 exited with code 1
The error says : Error: File specified by 'tls.keyfile' does not exist: /etc/hyperledger/fabric-ca-server-config/d86d58e3f0b24d63a18fc22c93f9cdd109afee8543a12e67b232a2fe3548444a_sk
ca_peerOrg3 exited with code 1
I am not sure what the error is here , have i missed a step or something .
Help .
Thanks
| 8988430296e2eece8be2091512963666da118d243b44d37a3ac8782d39095dc2 | ['209db4c80e2f467fbff7260972b53db4'] | Your crypto materials are not getting generated properly as required . Check that you have all the Prerequisites installed on the platform(s) I hope you have downloaded all the platform specific binaries https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh
This will make sure you have the correct Cryptogen and Configtxgen tools for creating crypto material,ca clients and channel configurations .
|
3959492c084fa8fd25d21080b89e4ba8a8d81addf105dadd9926215a9176c2ef | ['209e06197c9644209c231ec1aeb0a5ff'] | Ok....I considered the system $45$ in https://www.researchgate.net/publication/226141203_Asymptotic_limits_and_stabilization_for_the_1D_nonlinear_Mindlin-Timoshenko_system
with replacing ${\psi _t}$ by $\int\limits_0^\infty {g(s){\psi _{xxxx}}(x,t - s)ds}$ and I added a delay terms to the second equation...
You can see the memory terms in the paper above in comment.
Thank you.
| 5d5aca168df41167a5d1c49399b8296ef86e0a195bb26f60dce802f7ffd5dd4f | ['209e06197c9644209c231ec1aeb0a5ff'] | Check your apache config to see what modules apache is loading. You should look for a line like this:
LoadModule auth_basic_module modules/libphp7.so
And change it to the php module you want to use. Something more like this:
LoadModule auth_basic_module modules/libphp72.so
Of course this assumes that you have the php module inside apache's modules directory.
You can also specify a certain php.ini for apache to use.
|
741a78996c1a39afe94666d5ff73f9d06ac442ead3ed6c6570b0c87b8ffa773a | ['20b0de685a1d434f8c2150de6e3338fb'] | I'm loading JPEG images, but I set the pointer at the beginning, and configure the image:
stream.Seek(0,soFromBeginning);
image.PixelFormat := jf24Bit;
image.Scale := jsFullSize;
image.GrayScale := False;
image.Performance := jpBestQuality;
image.ProgressiveDisplay := True;
image.ProgressiveEncoding := True;
image.LoadFromStream(stream);
If stream.size > 0 then
// OK
else
// not OK
I'll also try decoding an ANSIString, to check if it is related to the Unicode change.
| 80ccdefc2fcb760bfb74a8b83b73d9c38370ce746e0a6bbb4886947268e406fc | ['20b0de685a1d434f8c2150de6e3338fb'] | I have a client that hired me to implement version control using Mercurial, for his fifteen year old application. But also wants to have the whole history loaded to Mercurial server, but there is no version control software currently, only renamed files with the date they were changed, like program1.c to program1_20060917.c and program1 copy (1).c, and old folders with all the files (another version), like folder_20080419.
I thought of importing file by file as a change, but the count goes over 2K commits, and he doesn't want it like that.
He agrees to reconcile to group the files in changes but I couldn't find something to do it.
Maybe if I could loaded into SVN, Git or CVS, then I could convert it to Mercurial.
Does anyone knows what could be used or done? Thanks in advance.
|
a304a0c5c5e6bf948b4b0b7645ccf3781c7865489db5e6d472b456dd519c656a | ['20b46087dd514be69053f91c8c9bead2'] | I have a problem with spark application on kuberenetes. Spark driver tries to create an executor pod and executor pod fails to start. The problem is that as soon as the pod fails, spark driver removes it and creates a new one. The new one fails dues to the same reason. So, how can i recover logs from already removed pods as it seems like default spark behavior on kubernetes. Also, i am not able to catch the pods since the removal is instantaneous. I have to wonder how i am ever supposed to fix the failing pod issue if i cannot recover the errors.
| d74f2a34c463a26d683b2a9fa2a5ea1316d1bd9c806ec94f9ce33f3d7f81bda2 | ['20b46087dd514be69053f91c8c9bead2'] | I am trying to implement a CardView flip in a RecyclerView. I just cannot figure out a simple solution. I have a working CardView where i can display a list of card using the recycler view. The problem is, how to show the back of the card if user click the card. I want to use animation and change the front of the card to the back of the card. Can someone give a simple animation and example of the card layout.
My current example is pretty much copy of this example where a new activity is being created. Where as i need the card to flip 180 degree and show the description. Is the a way to achieve it?
+------------------+ +------------------+
|+----------------+| |+----------------+|
|| front || || back ||
|+----------------+| |+----------------+|
|+----------------+| |+----------------+|
|| front || || front ||
|+----------------+| |+----------------+|
|
dfcb86c0f6954f3a1cc1b30e1c1cfabe998a91037758ceb1b438b297bf350679 | ['20c16794ad4f41dc8f9ed74df3dd9e0a'] | If I understood you correctly, maybe what you are looking for, is a Topic system with publishers (producers) and subscribers (consumers). If it's what you need, maybe AWS SNS can be a good option for that, it's free for 1M requests, and with it, you can configure your environments as subscribers then make the requests to a SNS topic, which will fanout them to the subscribers.
If you only want to log the requests, you can also use PutsReq as a proxy. Making the requests to PutsReq, and "re-passing" them to the real target.
// sample response builder
// https://github.com/phstc/putsreq#forwardto
request.forwardTo = 'http://production.com/api';
| 1653947dfc19e67d570a30718aca4f84508e0e22d860f3e12520584e1903efdc | ['20c16794ad4f41dc8f9ed74df3dd9e0a'] | Problem solved. The issue was with the redirect_to from Rails, it was returning the Location header with HTTP, not HTTPS causing the URL to be outside of the app scope.
App (within scope) =>
Form submit (within scope) =>
Redirects to HTTP (outside scope) =>
CloudFlare Page Rule rewrite to HTTPS =>
App (within scope)
|
cc65696de125445e0bb3e50929013001e3c12ec02287aafe8bd3b699c3cf969a | ['20e500cddff14ee082ef48707ef4840d'] | May I know what is the command that I should use to get the output of all IP & its frequent while they are accessing my server? I need this command to know the frequency of IP that access my server so that I can block the most frequent IP that access my server. Please help me since I am a newbie to Iptables
| 8c41d38479dd0a76dcad96b7e20768de3224d76ba03831991af07ca7033143ba | ['20e500cddff14ee082ef48707ef4840d'] | You shouldn't see such huge delays. Yes, the styling of Telerik's controls has some impact on the initial form loading, but not as much... Which version of Telerik's tools have you tried?
I did a quick test with their latest version (Q2 2011) and I was not able to see such delays. The test was done on a fairly quick PC (Intel Core2 Quad CPU Q9400 @ 2.66 GHz; RAM: 8.00 GB). See quick video here (the times are in milliseconds): http://screencast.com/t/4I8Q536Np
Have you contacted Telerik Support about this? If not, please do so - they will be happy to check this for you.
Good luck!
|
96f04233faa724afbd4cd7b5599d067f6b33bcfa3b54d452c057398b40a24110 | ['20e69c3b6b624b0aa7bdb127ec03dae6'] | Do you have many repeat customers? Are they ordering the same item(s) with each order?
In my experience, users on mobile will commit to the same tasks as they would on desktop - with a certain level of immediacy. If they're searching your site on mobile, does it stand to reason that they'd want to purchase immediately and having an extra click would be an impediment to that task?
You could always run an AB on having the "add to basket" button on the listing and see which converts more or a smaller cart abandonment rate. | 0099935778e80d3f884cdbc79e0bfe29e2805358d7a5c67e157e00c6737165a2 | ['20e69c3b6b624b0aa7bdb127ec03dae6'] | Many thanks <PERSON> for your excellent and complete response. I think that made me understand the math behind $xcorr$ function. Although I also have a feeling of what is the circular cross correlation, I still fail to grasp the concept/math behind FFT and IFFT. As I saw on you profile that you teach DSP and Python for the Boston Section IEEE, do you have any particular book / ressources to recommend on the matter? |
d3e03967b1714a841f201e9407c921f0cbc40a5012aeb6461c18dc9c33c000de | ['20f41bf017b64df6a83a533308dc5fad'] | I am not sure if I totally understand your question but here is something that may help.
The total internal energy of an isolated system remains constant. Any system tries to achieve an ideal state of minimum energy and maximum entropy to be more stable, as the energy is now more evenly distributed between the system and the surroundings. For example, a heated object tends to cool by losing heat to its surroundings by which the heat is distributed and not concentrated in one part of the environment. In the case of isolated objects since there are no surroundings to lose energy to, the energy, heat as in this example, will tend to redistribute/transfer all over the object in order to achieve an equilibrium. And the entropy will increase since the chaos/ movement of particles has increased. I hope this was helpful. let me know if you need more clarification over something or some part of the question I left unanswered.
| 2307d6423eb6bfb1a036e17ed6ef6f2b56cadcb4561a5a8b81e4dbdefb5f6ea2 | ['20f41bf017b64df6a83a533308dc5fad'] | What I think of what maybe a correct proposition is that when the particle hits the boundary of a box( i am assuming that it is a physical box which is what I interpreted from your question let me know if it is otherwise ) momentarily all its momentum is transferred to the wall and hence the kinetic energy becomes zero for the ball itself (also if the ball is set in a zero potential energy condition the total energy of the ball at this instance becomes zero). Then momentum is transferred back from the wall to the ball which causes the change in direction . Therefore , if the collisions between the ball and the wall are perfectly elastic the ball will keep going back and forth since the energy will keep shifting between the ball and the wall without any loss . Also , a point to be noted is that though the energy of the ball at the instance can be zero the law of conservation of energy is not violated since the energy of the whole system involved is constant . let me know if this makes sense or is helpful .
|
02b24726b3d9c5ed2f75e39ef9477716d80d1cf60612626e7e2e28847fdedd0d | ['2103f96f30da4c6b882147fa9caa02fa'] | I want to read a specific line from a text file without reading the whole file line by line. For Example, if I have 10 lines in a text file and I have to read 6th line, I will not read the first 5 lines but will directly read the 6th one. Can anyone help me??
| f9c4228da07241b5190b42dbee5bd7ad5c9769e5dff65217db3b4135f172ef63 | ['2103f96f30da4c6b882147fa9caa02fa'] | I am working on Laravel. I have a blade view page on which multiple forms (of same model) are created. Now, I want, that when I click submit button, an array of all the forms should be returned to controller. But, it returns data of only one form instead of array. How can I achieve this, Can anyone help me?
|
277d6a17dfc1ae5418daa3993294a6a25b7a1ef423ded2d1b9113cbdca837770 | ['2116d1bdad814c64a7249d459e3f6d7c'] | Thanks <PERSON>, here is my final code that worked:
function GetMETAR() {
var ss=SpreadsheetApp.getActiveSheet();//set active sheet where form answers are stored
var lr = ss.getLastRow();//since form pastes last answer to last row we get its number
var rg = ss.getRange(lr,8,1,5);//here I set range where I will paste info from API CALL
var url = 'https://avwx.rest/api/metar/UUWW?options=&format=json&onfail=cache';//API url
var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});//API call
var json = response.getContentText();//response JSON to text
var data = JSON.parse(json);//JSON text parse
var tempr = data.temperature.value;//parsing values
var wind_spd = data.wind_speed.value;
var baro = data.altimeter.value;
var dew = data.dewpoint.value;
var wind_dir = data.wind_direction.value;
var values = [[tempr,wind_spd,wind_dir,baro,dew]];//cobining values in array to paste
rg.setValues(values);//pasting in range
}
Script is set to be triggered on form submit
| f151aab74cfa8013117e10f5e602ca72c6fb35717ed1f5776f7e369e61a94866 | ['2116d1bdad814c64a7249d459e3f6d7c'] | I'm trying to create a simple app that will do the following in a loop:
0. wait for the start button
1. system call to create a screenshot and save it to disk
2. render the screenshot from disk to shiny output
3. print status "filename - ok"
4. Sys.sleep for e.g. 5sec
5. Check if the stop button is not activated - go to 1.
This idea in code:
ui <- fluidPage(
titlePanel("My App"),
sidebarLayout(
sidebarPanel(
radioButtons("control", h3("Start/Stop switch"),
choices = list("Start" = TRUE,
"Stop" = FALSE
),selected = TRUE),
actionButton("go", label = "Go!")
),
mainPanel(
textOutput("status"),
imageOutput("image")
)
)
)
server <- function(input, output) {
actionflag <- eventReactive(input$go,{input$control})
while (actionflag()==TRUE) {
fname<-gsub("[[:punct:] ]", "", Sys.time())
system(paste0("screencapture -t jpg -x ~/Documents/Screens/", fname,".jpg"))
output$status <- renderText({paste(fname,"screen captured")})
output$image <- renderImage({
list(src = paste0("~/Documents/Screens/",fname,".jpg"),
alt = "Image",
width = 400,
height = 300)
}, deleteFile = FALSE)
Sys.sleep(5)
}
}
But it does not work this way. Formally I get this error:
Error in .getReactiveEnvironment()$currentContext() :
Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Moreover, even without control buttons (while(1==1){execute code}), I was not able to use while loop in shiny server to continuously change the output. I guess this 'while' implementation is totally wrong, so any advice is appreciated
|
d7f33b3a3f0fbb85fc0f39cfd63c72ed1b7b5bdadd9aac68c74ce63dc5abedaf | ['211bf4a46bab483996e38869f8b4383c'] | You can add '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5' as part of before_options.
@bot.command(pass_context=True, brief="This will play a song 'play [url]'", aliases=['pl'])
async def play(ctx, url:str):
server = ctx.message.server
voice_client = bot.voice_client_in(server)
player = await voice_client.create_ytdl_player(url, after=lambda: check_queue(server.id), before_options='-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5')
players[server.id] = player
player.start()
| 7c43a712efab1b881d2a706891252580f7dba6eeb9912e8d4d13e7e64c7f635c | ['211bf4a46bab483996e38869f8b4383c'] | This should be possible using channel.purge(). This will delete every message in the specified channel if the bot account has sufficient permissions.
@self.discord_bot.command()
async def clear(ctx):
try:
if ctx.channel != self.channel_name:
return
# clear history
await ctx.channel.purge(limit=None)
except Exception as e:
await ctx.trigger_typing()
await ctx.send("Oops something happened! %s" % str(e))
return
|
2f760f9d41d85e517823d0b1c97d9e09306edf39914d978f0944e06a5c032d2f | ['213049d0d9ce49afbd70a7a1bf85480b'] | This is an important point: the ability to choose either sharps or flats provides a very useful *notational convenience* for representing certain keys that would be difficult to write if you could only use one or the other, which is entirely distinct from the differences caused by natural pitches, and seems to have been missed in the other answers. It's a shame that this answer is hard to understand (not that my theory is good enough to provide a better way of phrasing it, however), but it is worth taking the time to work out what's being described here. | aa5055b59d9b41b38cc1af03aa72b144e4b5dea0f5e44ec2c6aabe54f6d59451 | ['213049d0d9ce49afbd70a7a1bf85480b'] | There are multiple workarounds you can try:
Use Headless browser or run execution in hidden mode using "phantomjs". It is driver like chrome driver which start your execution in hidden mode.
Phantomjs WebSite
Minimize the browser using set position in selenium. Try below code for the same: driver.manage().window().setPosition(new Point(0, -1000));
I hope it will solve your problem.
|
7d9ca8be60ad112b020aab123ecdb8df35591f3bd71d294a785b21651949d833 | ['21471b956e2f445288a2d6282d8646ec'] | technically, this is already what we have - the first part of the password is public knowledge, and used to make the rest of it unique (.... what, that's the effect of the username). The problem with your system is that users are unlikely to use an 'equivalent length' password including a 'username' (eg if their password is 12345 when login includes a username, it will be 12345 when it doesn't). If their password was equivalently long and 'random', the guessability would be no worse than for the username-password combination - although it would be difficult to throttle per-account. | 41187952f7aaa0155c24d575676ddf7be4b07bc66c7af6f4720801bc40639d05 | ['21471b956e2f445288a2d6282d8646ec'] | Well I've found a solution, not very friendly but works, is based on this article
So basically the article says that you need to identify in the query how to include everything that has any value:
Text values consist of alphabetical characters (a..z) and numerical characters (0..9) and use a NOT at the beginning to exclude all the possible values...
The "good new" is SharePoint isn't case sensitive so you have to do it only once per letter, examples:
If you want to filter, let's say by CheckoutUserOWSUSER as in the original question, by an empty value you have to include this in your querytext:
NOT(CheckoutUserOWSUSER:a* OR CheckoutUserOWSUSER:b* OR CheckoutUserOWSUSER:c* OR CheckoutUserOWSUSER:d* OR CheckoutUserOWSUSER:e* OR CheckoutUserOWSUSER:f* OR CheckoutUserOWSUSER:g* OR CheckoutUserOWSUSER:h* OR CheckoutUserOWSUSER:i* OR CheckoutUserOWSUSER:j* OR CheckoutUserOWSUSER:k* OR CheckoutUserOWSUSER:l* OR CheckoutUserOWSUSER:m* OR CheckoutUserOWSUSER:n* OR CheckoutUserOWSUSER:o* OR CheckoutUserOWSUSER:p* OR CheckoutUserOWSUSER:q* OR CheckoutUserOWSUSER:r* OR CheckoutUserOWSUSER:s* OR CheckoutUserOWSUSER:t* OR CheckoutUserOWSUSER:u* OR CheckoutUserOWSUSER:v* OR CheckoutUserOWSUSER:w* OR CheckoutUserOWSUSER:x* OR CheckoutUserOWSUSER:y* OR CheckoutUserOWSUSER:z* OR CheckoutUserOWSUSER:1* OR CheckoutUserOWSUSER:2* OR CheckoutUserOWSUSER:3* OR CheckoutUserOWSUSER:4* OR CheckoutUserOWSUSER:5* OR CheckoutUserOWSUSER:6* OR CheckoutUserOWSUSER:7* OR CheckoutUserOWSUSER:8* OR CheckoutUserOWSUSER:9* OR CheckoutUserOWSUSER:0*)
So now you are sure that you exclude all the possible values for that field and voilá.
Long and no friendly, so if you have another idea please hit it =)
|
220d6cba9c394da448abea04749cfcb837616bd0e29db5c886f092e60d6274db | ['214a46c7d43a4643a4aee6b9298e215a'] | When you use jenssegers/laravel-mongodb and you insert an object (document), the deteted_at field is not created. This is created and set with the current date-time when you execute a delete() on the object. It is not necessary to assign a null value when the object is saved. The library retrieves by default the documents that do not have the field deleted_at set, or those that have null values, in case the restore() method has been previously executed.
Do not forget to use Jenssegers\Mongodb\Eloquent\SoftDeletes; in the definition of the model, otherwise, the SoftDelete will not work and it will always return all records.
| 721b72d3b26a127576fb5fa0eb77d752885e32c814af6ffe05070c97cb51c645 | ['214a46c7d43a4643a4aee6b9298e215a'] | I add an example that does not shows an error when the value is empty and validates a regular expression (MAC Address).
<TextField id="macAddress" label="MAC Address" name="macAddress"
value={this.state.macAddress}
onChange={this.handleChange}
error={this.state.macAddress !== "" && !this.state.macAddress.match("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$")}
helperText={this.state.macAddress !== "" && !this.state.macAddress.match("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$") ? 'MAC Address must be a 6-bytes string.' : ' '}
/>
|
6345dd8cea2335f217ae0a86b7006ba3c4ef4ba95f39d9ebdb2bcd8cb8fb23ef | ['2150c289c6ac423198687a1fab48c666'] | I have a sphere of radius 5 and a cone (i.e. z=√(x^2+y^2)) inside of it. I can show them separately, but I'd like to show them together. I've tried a few tricks with opacity, implicit specifications, show, and range changes, but nothing is giving me a satisfying result.
Really I'd like to show the "ice cream cone" shape by itself, but I'd settle for a cone under a hemisphere right now. Anyone know how I can get this done?
Thanks in advance
| a56e4fab66ecab5b92562e0c43118e4b2caaa21157e0e29f4a2d002e24199327 | ['2150c289c6ac423198687a1fab48c666'] | We use a DIY motioning system (built with Raspberry Pi) to monitor our 2-year-old child while he plays in his own room, so we can have a dinner in the kitchen, study in the living room, and do other works with peace of mind.
We didn't directly tell him (yet) he is being monitored, but we sometimes make remote conversations (from other rooms) like: "Bravo! You've made a nice rainbow tower, do it again!" and "Don't put this in your mouth", and he responds nearly as if we were in the same room.
I guess he learns something about our ability to see what he is doing without us being physically existing in the same room or even being visible to him (e.g. on a screen). But ideally, in the future, we hope he learns not to do harmful or "bad things" without monitoring.
Questions:
What is the potential negative impact on toddlers/children behaviour and characters in later childhood if they know they are monitored by parents 'all the time' even when alone?
Should children be explicitly told they are monitored by parents ("Look, we watch you through that camera"), or just let them discover that?
At which age it becomes 'more harmful than useful' to monitor a child?
|
22e9f7d5968f13435983654887059adf69abb4ec47727c45be44b48f47fb4d4f | ['2163233ae81b447087dff2ddb774319d'] | i'm not very able to use stata. For my thesis, I have a panel data(1970-2017) for different countries and a lot of variables.
In this dataset, there is a dummy (dhairendH) that is equal to one in the years where a country end a debt restructuration.
i would like to graph 3 different dependent variable (it is better if they are overlapped) depending on the 7 years after the restructuration, like the image attached.
The name of the the dependent variables are gini_disp, gini_cons and ginipretax. Obviously, I have variables years and CountryName. The name of the dummy is dhairendH.
| 4b9cb2f80929826797c0089a4e329ce2d72cb5a1d84b0dd81c9751120d41c180 | ['2163233ae81b447087dff2ddb774319d'] | let defines lexically scoped bindings that are not accessible from the body of the eval function. This is no different than any other function. However, the bindings created with def are accessible because they are namespace global. All functions have access to namespace global variables, as long as they are public.
|
70f029ea0491fcc73fb6c48b113308e6c7c7166c7cc2bbc1ab213ca9e987bc96 | ['2167f3adea734e5bb7b82d6312d432f0'] | The best answer so far. Please feel flattened <PERSON>, for the well-rounded and accurate answer. I think I will end up projecting the pagination filter way down to the SQL queries using SQL Server's `OFFSET` and `FETCH` keywords. The only downside to this, is that the more filtering I end up doing at the query level, the more useless and pointless OData feels. | 07621fa7090905aed75accb0b8f9fce9d1f7255b7d7feea8c0d0710a4ce66655 | ['2167f3adea734e5bb7b82d6312d432f0'] | Under the REST architecture principles, a RESTful application should be stateless, therefore each time I invoke an ASP.NET 4 REST service (with GET verb) that pulls tens of thousands of records, the REST service paginates them with in chunks of 10 (with OData v4), which makes the UI lightweight because it only loads 10 records each time, however each time the user calls for the next chunk of 10 records the ASP.NET controller calls the read method on the data access layer (Dapper micro ORM) which in turns pulls the same thousands of records over and over again, even though the controller only returns 10 records each time thanks to OData pagination engine, the data access layer (Dapper) queries for the same thousands of records each time, which is expensive and slow. I know I could modify the query that Dapper uses so the pagination filter goes down to the query level, but I find that's too much burden to do since the filter OData sends can be quite complex and I don't have the luxury to generate a semantic tree for generating filters on the WHERE clause, and besides, isn't that OData work in the first place? Isn't it possible to simply cache the thousands of records somewhere to avoid calling the database each time if I the same filer is being request over and over again?
Oh yes, and Entity Framework is an absolute no go, Dapper is mandatory instead.
|
68aa6e82b41b44a2bf933a145d09a7783fa65e48f7155d0ae1be9c96dc20584b | ['216808e9dd3e480ebc8449498e828045'] | So Later on when i check my local/temp folder where the .exe file was extracting the whole files, it came to realize that after the extract it do not have any \tessdata folder of which we were giving the path and the e13b.traindata was direclty extracted inside the "Tesseract-OCR" folder.
So in app.py gave the path of
tessdata_dir_config = r'--tessdata-dir "Tesseract-OCR/tessdata/"'
To
tessdata_dir_config = r'--tessdata-dir "Tesseract-OCR"'
and finally this resolved the issue.
But again stuck into another error ...
well that's another story.
| 0ef4b33dd793f54961f1bbdffc84bc984a6a74d97555ad7f1edd69958c119de3 | ['216808e9dd3e480ebc8449498e828045'] | What you can do to get data from ArrayList inside the OnitemClickListener method is,
bookList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String bookName = booksArrayList.get(position);
}
});
With get method you get the value at index position in your array List.
|
97b9174402c7af8319d25eb26b53e770e4919ec9f1988083586f1abd3d55f0c8 | ['2179aef9313f40b196e82ef751a6b155'] | The best and easy way if you are using the text editor for the resx file is by pressing
Shift+Enter
for every new line that you want, as noted in other answers.
If you are using text from other source and you are copying/pasting the text in the resx, then the Visual Studio will paste the text in the same format as it already is, which will include the linebreaks.
| eb070555f863c4cc9e07d1f2e95ff0976373beb5990aaf2bc8cf651e95135f1a | ['2179aef9313f40b196e82ef751a6b155'] | I need to know what is the meaning of part of the Eclipse log. For example:
!ENTRY org.eclipse.ui.navigator 2 0 2017-03-31 13:07:11.248
!MESSAGE Warning: popupMenuId of ".....
After the plugin ID there are 2 and 0, I think the 2 is the severity, which is warning in this case but could you tell me about the second digit?
|
5f24a5c47372584c17bfcc7af8c35f6d8188bb83afccb9122794128003efb023 | ['2181e9d3bce54c1f8af02696a2268958'] | So I have an ESXi server setup with pfSense acting as the DHCP Server for the VM's. I use VNC's to access each VM over the internet (For example with ports :5905,5906,5907 etc.) and I would like to restrict that only certain IP's can access (whitelisted IP's) these VNC Servers and nothing else. In where and how exactly can I do this easily? In pfSense or in the VM's itself, or maybe in ESXi firewall? Would be nice if someone could explain this. Thanks!
| af6b12e0b14be0983f1281601e174e7f37e3067723b1efd09fb7481a14b3bc6c | ['2181e9d3bce54c1f8af02696a2268958'] | As stated before: Using only Google API the only way around the limitation is to pay for it. Or in a more shady way make the requests form more than one IP/API-Key which i would not recommend.
But to stay on the save side i would suggest mixing the services up since there a few more Geocoding APIs out there - for free.
With the right gem mixing them is also not a big issue:
http://www.rubygeocoder.com/
Supports a couple of them with a nice interface. You would pretty much only have to add some rate-limiting counters making sure you stay within the limits of each provider.
Or go the heavy way of implementing your own geocoding. With for example your own running Openstreetmaps database. The Database can be downloaded here: http://wiki.openstreetmap.org/wiki/Planet.osm#Worldwide_data
Which is the best way depends on what your actual requirements are and what ressources you have available.
|
94a5c8eadc4d7d05aa2b01223a8ec9e47ac8c1c8118f78eb90869f3426433137 | ['21907007137e479097741b850a0b9c3d'] | I'm trying to create a SalesOrder via WebServices but it always fails due to missing mandatory fields.
I'm sending the following fields.
The error message does not specify the missing fields
I'm using vTiger 6.0.0
How can I figure it out
salesOrder.subject = fullDescription
salesOrder.sostatus = "delivered"
salesOrder.account_id ='11x28'
salesOrder.bill_street = shipping.address.street
salesOrder.bill_city = shipping.address.city
salesOrder.bill_state = shipping.address.state
salesOrder.bill_code = shipping.address.postalCode
salesOrder.bill_country = shipping.address.postalCode
salesOrder.ship_street = shipping.address.street
salesOrder.ship_city = shipping.address.city
salesOrder.ship_state = shipping.address.state
salesOrder.ship_code = shipping.address.postalCode
salesOrder.ship_country = shipping.address.postalCode
salesOrder.invoicestatus = "Created"
salesOrder.productid = selectedServices[0].id
salesOrder.quantity = 1
salesOrder.listprice = selectedServices[0].unit_price
//
salesOrder.comment= ""
salesOrder.tax1 = ""
salesOrder.tax2 = "10.000"
salesOrder.tax3 = "6.000"
salesOrder.pre_tax_total = "876.00"
salesOrder.currency_id = "21x1"
salesOrder.conversion_rate = "1.000"
salesOrder.tax4 = ""
salesOrder.duedate = "2014-12-12"
salesOrder.carrier = "FedEx"
salesOrder.pending = ""
salesOrder.txtAdjustment = "-21.00000000"
salesOrder.salescommission = "5.000"
salesOrder.exciseduty = "0.000"
salesOrder.hdnGrandTotal = "995.16000000"
salesOrder.hdnSubTotal = "876.00000000"
salesOrder.hdnTaxType = "group"
salesOrder.hdndiscountamount = "0"
salesOrder.hdnS_H_Percent = "21"
salesOrder.discount_percent = "25.000"
salesOrder.discount_amount = ""
salesOrder.terms_conditions = "- Unless "
salesOrder.enable_recurring = "0"
| c699de540bc60577b3d01d91ffa75dd18b8713b6cdf9ac8190f156a1f6fe7456 | ['21907007137e479097741b850a0b9c3d'] | I managed to find a solution
At the domain
static indexList = ['number', 'carrier', 'validThrough', 'inUse', 'dateUsed', 'active']
read it at the index.gsp (scaffolding template)
def listFields = domainClass.getClazz()['indexList']
if(listFields){
allowedNames=listFields
props = []
listFields.each{p ->
props<<domainClass.getPropertyByName(p)
}
}else{
props = domainClass.properties.findAll { ...}
Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
}
|
d75855258ea42fac4a7393e0bb17a592810919d93a0ed7ddac6d4b9d8bc149d4 | ['21a98b67ac09432faa103ef7eb79479a'] | Using eclipse Luna you have to:
clone it from GIT.
cut (copy & delete) the folder COM under the JAVA folder to below the SRC folder like in regular Android project.
change the project.properties target to 15 instead of 8.
build the project.
export the project as jar file including the source - use the export tool.
keep in the exported jar only the COM folder and the META-INF folder, delete all the others folders - use zip tool to delete the content of the jar.
use this jar as your Volley jar project.
put the Volley jar in the lib folder of your destination Android project.
| 599765825624b08642c9ae9e27cbea667aedfc53b5ce1faa1986cadda4073d40 | ['21a98b67ac09432faa103ef7eb79479a'] | You have to use http call to query the factual.com tables.
Here are some http examples you have to call on your code: (after you have your api key)
http://api.v3.factual.com/t/products-cpg?q=shampoo
http://api.v3.factual.com/t/products-cpg?q=shampoo&filters={"brand":"pantene"}
http://api.v3.factual.com/t/products-cpg?filters={"upc":"<PHONE_NUMBER>"}
You can look on this page for more examples:
http://developer.factual.com/working-with-factual-products/
I think you are looking for this table field: upc_e = The UPC-E barcode used for identifying products. 8-digits in length.
The product table schema is here:
http://www.factual.com/data/t/products-cpg/schema
|
e2f1ecdfb8fb74d1e9a01403378e3e94f2290988e1f2c872d73b73884a07f2ec | ['21c941c9ef3c42d8ba62a6b14eab1e3f'] | I'm using Ubuntu 12.10 and as I know there is already a firewall on any ubuntu system. It's ufw and because I like fancy gui stuff I can use gufw, that's very nice.
Now I would like to configure this firewall. I want always a notification if there is some incoming or outgoing traffic. The user should be able to choose allow once, allow always for this or refuse. Can I do this with gufw? Or do I need another firewall? What do I have for options? Thank you
| 0c092396eacbd3fc45dad3e4e1be2e4f4adc3836fa957ba3fe22501f5419a2b7 | ['21c941c9ef3c42d8ba62a6b14eab1e3f'] | This may be related to the operatingsystemconditions configuration in the Installshield pre-requisite file Microsoft Visual C++ 2012 Redistributable Package (x86).prq located in the Installshield SetupPrerequisites directory.
The operatingsystemconditions section specifies which versions of Windows, including service packs, 32/64 bits, the redistributable file should be installed on.
To resolve this I copied the operatingsystemconditions section from the Visual C++ 2010 prq file into the 2012 prq file.
See http://daniellang.net/installshield-and-microsoft-visual-c-2010-redistributables/ for some more details.
|
5b259f5dc746f89560a867c8c3dc99fed9a8f6547457c103d57d6d5660c85971 | ['21d6520e6f1d4ff482aa53c5d62219db'] | It has come to my understanding that the error
[Linker error] undefined reference to `__gxx_personality_v0'
is caused by trying to compile a C++ program with the gcc compiler. This would be solved by compiling the program with a g++ compiler, but how does one get Dev-C++ to use the g++ compiler???
| 5bfa35a9e2e5a4c5967f9126d31dbee53368891382c74b8f37a1bdc63b6ae8f3 | ['21d6520e6f1d4ff482aa53c5d62219db'] | In the code below, a method is used to input a Mat image and output an edited Mat image. The code works okay, although I am unable to have all five images on the screen at once, as when the code is run, only the last output image is displayed. Ideally, the code should display smaller, scaled down versions of each output image in the same window.
void method (Mat input)
{
...
imshow("Output", output);
}
int main()
{
img_1 = imread("img1.jpg");
img_2 = imread("img2.jpg");
img_3 = imread("img3.jpg");
img_4 = imread("img4.jpg");
img_5 = imread("img5.jpg");
method(img_1);
method(img_2);
method(img_3);
method(img_4);
method(img_5);
}
|
25c178b608c73fda00efc0d6ed3df5d527170ee12f8aa8dfe677dbafbad1795e | ['21d80164ea484f9d8033206a2793a9ab'] | Here you go For Google.
Button login, signup, signout;
GoogleSignInClient mGoogleSignInClient;
private static final int RC_SIGN_IN = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
login = findViewById(R.id.login);
signup = findViewById(R.id.signup);
signout = findViewById(R.id.signout);
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
signout.setOnClickListener(v -> mGoogleSignInClient.signOut()
.addOnCompleteListener(this, task -> Log.e("checker", "Sign Out")));
signup.setOnClickListener(v -> {
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, RC_SIGN_IN);
});
login.setOnClickListener(v -> {
GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
if (account != null) {
String personName = account.getDisplayName();
String personEmail = account.getEmail();
String personId = account.getId();
Uri personPhoto = account.getPhotoUrl();
Log.e("checker", personName);
Log.e("checker", personId);
Log.e("checker", String.valueOf(personPhoto));
Log.e("checker", personEmail);
} else
Log.e("checker", "did not login");
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
handleSignInResult(task);
}
}
private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class);
if (account != null) {
String personName = account.getDisplayName();
String personEmail = account.getEmail();
String personId = account.getId();
Uri personPhoto = account.getPhotoUrl();
Log.e("checker", personName);
Log.e("checker", personId);
Log.e("checker", String.valueOf(personPhoto));
Log.e("checker", personEmail);
}
else
Log.e("checker", "Failed!");
} catch (ApiException e) {
Log.e("checker", "signInResult:failed code=" + e.getStatusCode());
}
}
This is for Facebook.
LoginManager.getInstance().logOut();
| d360d1f076d2c5772ecce75ec8367211b3e079dbade3b0ef60d6fafc2e1f1b7b | ['21d80164ea484f9d8033206a2793a9ab'] | There You Go
final String WHATSAPP_STATUSES_LOCATION = "/WhatsApp/Media/.Statuses";
RecyclerView mRecyclerViewMediaList = findViewById(R.id.recyclerViewMedia);
LinearLayoutManager mLinearLayoutManager = new LinearLayoutManager(this);
mRecyclerViewMediaList.setLayoutManager(mLinearLayoutManager);
ListAdapter recyclerViewMediaAdapter = new ListAdapter(MainActivity.this, this.getListFiles(new File(Environment.getExternalStorageDirectory().toString() + WHATSAPP_STATUSES_LOCATION)));
mRecyclerViewMediaList.setAdapter(recyclerViewMediaAdapter);
private ArrayList<File> getListFiles(File parentDir) {
ArrayList<File> inFiles = new ArrayList<>();
File[] files;
files = parentDir.listFiles();
if (files != null) {
for (File file : files) {
Log.e("check", file.getName());
if (file.getName().endsWith(".jpg") ||
file.getName().endsWith(".gif") ||
file.getName().endsWith(".mp4")) {
if (!inFiles.contains(file))
inFiles.add(file);
}
}
}
return inFiles;
}
Adapter
public class ListAdapter extends RecyclerView.Adapter<ListAdapter.MyViewHolder> {
final Context context;
final ArrayList<File> modelFeedArrayList;
private static final String DIRECTORY_TO_SAVE_MEDIA_NOW = "/WhatsappStatus/";
public ListAdapter(Context context, final ArrayList<File> modelFeedArrayList) {
this.context = context;
this.modelFeedArrayList = modelFeedArrayList;
}
@NonNull
@Override
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_media_row_item, parent, false);
return new MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final MyViewHolder holder, int position) {
File currentFile = modelFeedArrayList.get(position);
if (currentFile.getAbsolutePath().endsWith(".mp4")) {
holder.cardViewImageMedia.setVisibility(View.GONE);
holder.cardViewVideoMedia.setVisibility(View.VISIBLE);
Uri video = Uri.parse(currentFile.getAbsolutePath());
holder.videoViewVideoMedia.setVideoURI(video);
holder.videoViewVideoMedia.setOnPreparedListener(mp -> {
mp.setLooping(true);
holder.videoViewVideoMedia.start();
});
} else {
holder.cardViewImageMedia.setVisibility(View.VISIBLE);
holder.cardViewVideoMedia.setVisibility(View.GONE);
Bitmap myBitmap = BitmapFactory.decodeFile(currentFile.getAbsolutePath());
holder.imageViewImageMedia.setImageBitmap(myBitmap);
}
}
@Override
public int getItemCount() {
return modelFeedArrayList.size();
}
public static class MyViewHolder extends RecyclerView.ViewHolder {
ImageView imageViewImageMedia;
VideoView videoViewVideoMedia;
CardView cardViewVideoMedia;
CardView cardViewImageMedia;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
imageViewImageMedia = itemView.findViewById(R.id.imageViewImageMedia);
videoViewVideoMedia = itemView.findViewById(R.id.videoViewVideoMedia);
cardViewVideoMedia = itemView.findViewById(R.id.cardViewVideoMedia);
cardViewImageMedia = itemView.findViewById(R.id.cardViewImageMedia);
}
}
}
Row XML
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_margin="10dp">
<androidx.cardview.widget.CardView
android:id="@+id/cardViewVideoMedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:visibility="gone">
<VideoView
android:id="@+id/videoViewVideoMedia"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardViewImageMedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<ImageView
android:id="@+id/imageViewImageMedia"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_weight="1"
android:scaleType="fitCenter"
android:contentDescription="@string/todo" />
</androidx.cardview.widget.CardView>
</RelativeLayout>
add to your AndroidManifest.xml.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:requestLegacyExternalStorage="true"
Android 10 File.listFiles() may return null, see File exists and IS directory, but listFiles() returns null
|
d9758f44b0a36bfe3b64f7e43f6473216515ab9f22c23be154d2cee5a43bf71f | ['21e01cd69cff4475946f2bada1578ef1'] | <PERSON>, valeu mesmo pela resposta. Muito completa e detalhada! Valeu muito mais, porque você usou parte do que eu escrevi no meu site pra responder a minha própria pergunta e isso me deixa muito feliz, já que eu sei que você achou meu conteúdo interessante!
Fiz esta pergunta em outubro de 2016 e publiquei o artigo sobre interposers em novembro. A pergunta surgiu porque eu sempre usei interposers e nunca usava helpers, aliás, a pergunta surgiu justamente enquanto eu escrevia o artigo! Muito obrigado pela resposta | fc904f600b971518748cd1988866f11902960e7d639d043cadcb827a15dc090a | ['21e01cd69cff4475946f2bada1578ef1'] | Pensando exclusivamente em tags e o que elas representam, penso que list e lista são a mesma coisa. Se levarmos em conta que estamos no SO em português o mais sensato seria manter o tag em português, contudo, como sabemos, o idioma da informática é o inglês, logo, algumas pessoas se sentem mais confortáveis em usar um tag chamado "list" ao invés de "lista", talvez com o intuito de atingir uma maior quantidade de pessoas.
Em suma, são sinônimos, mas se isso implica em escolher uma das duas, eu escolheria "list"
|
d73c515901610dfeb1be4f2fcfed06780624646a008ca165765a2c28bafe5c62 | ['21f00ac75b3c44b2a9f46166f821c460'] | I have configured my CAS 5.1.4 and I also generated my self-signed certificate using keytool, I have LDAP for the repository of my users, to run the CAS project I perform these steps:
./build.sh clean package
./build.sh copy
./build.sh run
Configuration file:
application.yml is https://jpst.it/1YrFH
cas.properties is https://justpaste.it/7k5ah
The certificate (.keystore) will place you in the folder
/etc/cas/
<MyProject>/etc/cas/
<MyProject>/src/main/resources/etc/cas
It is worth mentioning that I have a CAS project without Spring which runs smoothly but in Spring I get these errors, you can guide me to the solution thanks.
| 1c7e02d8188ae8b11b5a94c522bca075ee6b9de7b9b4f01b47cb4b859685628d | ['21f00ac75b3c44b2a9f46166f821c460'] | I need to call in each of the pages, the connection status of the wifi.
Then use a provider, but in the MyApp(app.component.ts) constructor, call the provider(ConectivityServiceProvider) only once.
app.component.ts
import { ConectivityServiceProvider } from '...'
import { Network } from '.....';
export class MyApp {
conectivity:boolean
constructor(private provider: ConectivityServiceProvider,public network: Network){
platform.ready().then(() => {
this.conectivity=provider.isOnline();
// call once in all pages
if(this.conectivity){
//do someting
}else //do something
}
}
}
Provider:
@Injectable()
export class ConectivityServiceProvider {
statusConectivity: boolean =true;
constructor(public network: Network){
this.network.onDisconnect().subscribe(() => {
this.statusConectivity=false;
});
}
isOnline(){
return this.statusConectivity;
}
}
If I put everything inside the provider in the MyApp class, it does call in each of the pages and not just once.
Why using the provider only calls once?
|
c4d676f0744528b49e402dc4e898990ea037a87831b366d5a400372038f87a59 | ['21f36a0a2ae84474a3103489f79e4725'] | I have the following table:
date1 date2 sc cash date
"2010-09-20" "2010-09-21" 202 300 "2010-03-01"
"2010-09-20" "2010-09-21" 202 600 "2010-08-01"
"2010-09-20" "2010-09-21" 202 670 "2010-08-20"
"2010-09-20" "2010-09-21" 202 710 "2010-09-01"
"2010-09-20" "2010-09-21" 202 870 "2010-09-21"
"2010-09-21" "2010-09-22" 199 300 "2010-03-01"
"2010-09-21" "2010-09-22" 199 600 "2010-08-01"
"2010-09-21" "2010-09-22" 199 670 "2010-08-20"
"2010-09-21" "2010-09-22" 199 710 "2010-09-01"
"2010-09-21" "2010-09-22" 199 870 "2010-09-21"
What is to group by (date1,date2) and (cash,date) such that date = max(date <= date1)
date1 date2 sc cash date
"2010-09-20" "2010-09-21" 202 870 "2010-09-21"
"2010-09-21" "2010-09-22" 199 870 "2010-09-21"
| 9a4e20bdb602ccc479b662ca231893d3b4b2c3e8190ae826378cee091e4a6aaa | ['21f36a0a2ae84474a3103489f79e4725'] | I have been asked this question and I think it's doable, However I am having a hard time coming up with an algorithm to do this. The restrictions is that you can not use any other data structure nor create another queue. Also you only can use enqueue, dequeue and peek (NOT a priority queue).
Thanx for contributing :)
|
714c5dae01271a1a7ca593fa5d315d5f8281306ee0702ef728525457fcc3141a | ['220437e7150842a5947b1ec7baf80d16'] | I have a PS4 with 500gb HDD and I've purchased a new 1TB HDD to upgrade the capacity.
According to the official Sony guide, If I want to backup everything (users, saves and installed games) I'd have to find an external storage big enough (~400GB as the disk is almost full) to witch I backup and the restore from when the new HDD is installed.
So the path would be OLD HDD->External Drive->New HDD.
My question - is there a way to skip the external drive and copy the data directly to the new hdd. For example plugging the to HDDs to a PC/MAC and running some sort of copy command.
| b0618a2b3fe88ee5c9c67e042f3a9acb4a327ad829b5f00a9efaaaabee867b74 | ['220437e7150842a5947b1ec7baf80d16'] | As an additional information, I made a new installation of Ubuntu 16.04 and tried to open pdf-documents compiled "at different locations". So I guess that the owncloud-client is not messing things up here. Maybe it has to do with encryption of my homefolder or it is some texlive issue. |
8a5b14d6f40bbd922d6fe59a50f354f880875996281e4fab388bb0eefffbae5d | ['220ce08e8b5d45459fbc822d97ec79a4'] | I have to create a hashmap with the key to store in the format 'firstname lastname' or 'firstname' and the value is an integer. Then I have to perform search operations after receiving the input till the end of file. Please suggest edits in my program to handle space separated strings and point out any other errors if you see.
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int main() {
long n;
map<string,int> m;
cin>>n;
for(long i=0;i<n;i++){
string name;
int phone;
cin>>name;
cin>>phone;
m.insert(pair<string,int>(name,phone));
}
string query;
while(cin>>query){
map<string,int><IP_ADDRESS>iterator p;
p=m.find(query);
if(p!=m.end())
cout<<p->first<<"="<<p->second<<"\n";
else
cout<<"Not found\n";
}
return 0;
}
| 5ab4ce316593fc18be17bc8784c7fb35e9a89f45c6004c875625e386931ff1b7 | ['220ce08e8b5d45459fbc822d97ec79a4'] | I want to create an if/else in template matching method, so that I can print if there was a match or not. But whenever the function cv2.matchTemplate does not get a match it simply throws an error instead of returning some value. So how do I get it to return me an integer value so that I can use it for comparison? Basically, how do I stop it from throwing an error and instead return some value in case of no match?
The error is: cv2.error: /tmp/opencv20160107-54198-1duzac3/opencv-2.4.12/modules/imgproc/src/templmatch.cpp:251: error: (-215) img.rows >= templ.rows && img.cols >= templ.cols in function matchTemplate
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('image.jpg',0)
template = cv2.imread('template.jpg',0)
w, h = template.shape[<IP_ADDRESS>-1]
methods = ['cv2.TM_CCOEFF_NORMED','cv2.TM_SQDIFF']
res=cv2.matchTemplate(img,template,cv2.TM_CCOEFF_NORMED)
if res.any():
print "match"
else:
print "no match"
|
ee74c6813ff3d3177557f1bfd618f4cf40aba877f0d111996b678387595c1330 | ['22415b49bd714b7ea1382578e47e4cc4'] | The Sidekiq documentation recommends against having more than a few queues. I'm considering attempting to migrate a Resque setup that currently uses 107 queues.
Can anyone provide a more detailed explanation of why I shouldn't use Sidekiq with 107 queues? The above linked documentation just says that Sidekiq is "is not designed to work well with dozens of queues."
Rearchitecting the existing application isn't out of the question, but it makes Sidekiq a harder sell for us.
| e3555ad69474541c8a48e7425a30998d4142892515d957555f0f1386963460ca | ['22415b49bd714b7ea1382578e47e4cc4'] | It seems like what you're actually trying to test is that /products/foo/bar is routed to the show action of the ProductsController with "foo/bar" as the id parameter.
Under the covers, rspec-rails controller tests use ActionController<IP_ADDRESS>TestCase, which provides an assert_routing assertion. In rspec-rails you can use this assertion with the #route_to expectation, like so:
expect(get: "/products/foo/bar").to route_to(controller: "products", action: "show", id: "foo/bar")
|
e5a563b7af6903f55b5ca0c4940bef17974b4e0fae02e3b1aa4c6904580ec4f9 | ['2244c86414ce40469f5676bfabaab8e6'] | It's best to always consider SOLID principles. Because it makes your code simpler and easier to maintain.
As I understand, the Person and FavoriteThing classes are both your domain and data entities and are also exposed to the Presentation. I think that's the first design smell here. We need different objects to represent the same concept in different layers. Those classes are designed with tables and data structure in mind. So there may be some problems between your data and domain layers already. I mean maybe those 15 (more or less) fields are enough for the domain, but other fields live there because of table structures or data concerns!
So the first issue we have here is the SOC. These classes are domain classes and handle domain logic but ViewModels are presentation classes and handle presentation logic. So there are different concerns here. Separate them!
And also it happens many times that ViewModels need more or less data that exists in multiple domain objects. It's really hard to fill ViewModels with different kinds of domain objects. You can use ServiceLayer and DTOs for this problem. One more thing, do not change your domain entities because of ViewModels or any other presentation object. Domain objects change only because of business needs.
It kind of violate the OCP too I think. Because when your classes have more and more clients they will have more and more reasons for change. And that makes it hard to consider OCP.
So first of all respect the principles and separate codes that have different concerns. Then start refactoring wherever you think that needs it! That makes you consider domain concerns when you're refactoring domain objects, and presentation concerns when you're refactoring ViewModels or other presentation objects.
| 838247ac2e28dcb90e6be75bf6e76f837412e7c4db316effa4ff1d2505e99dd7 | ['2244c86414ce40469f5676bfabaab8e6'] | <PERSON> thanks for the elaborate response! It worked for me and this is what I did in detail: 1. Disabled all TM destinations (`sudo tmutil removedestination UNIQUE_ID`) 2. Defragment all the APFS-related partitions/volumes (as mentioned above) 3. [Decrypted my drive](https://www.youtube.com/watch?v=Evp13JAqdi4) 4. optional: removed tons of old files to save space using (over 100GB through [Disk Inventory X](http://www.derlien.com/) 5. Restart. |
cd14eafcb19a17a8da2a74e17c039a13911b22b8823439fb930d5b4aef31971b | ['224a9c877c124bb5a221185faa54771c'] | Hello again =) <PERSON> just look at http://ignn.ru/map, <PERSON> at http://ignn.ru/map/hs.js. <PERSON> example - name = г. Волгоград п. 19 Партсъезда пер. Банный д. 6. By first word "г.Волгоград" i get result. But.for example by next someone word like "Партсъезда" search <PERSON> don't found result =( | 0bf42159bd025edd44d3c49095c39d8dc4babb71b76f0d540962f1a9a79cd809 | ['224a9c877c124bb5a221185faa54771c'] | One note @whuber - it may be useful to express chemical concentrations as logarithms at times, but in this specific case the molar ratio is the focus. A log transform of the provided subset might get the data to look 'neater', but I see that as an unnecessary step. It is beneficial to look at large data sets spanning orders of magnitude on a log scale, however, which is what I think you were hinting at. As an added bonus - these data are not technically in concentration units (I've left the units off so we wouldn't talk about it!). |
9e453b9e1020437e9430bc7eac4fff575a6719fb8cb500c132b69b44f0fd2654 | ['224fed153579400386a960421229febb'] | As you can see YansWifiPhy is a child class of WifiPhy. The typeId of WifiPhy has Frequency as an attribute. You can set this attribute using any to of the following way:
You can change the default value of ns3<IP_ADDRESS>WifiPhy<IP_ADDRESS>Frequency using the Config<IP_ADDRESS>SetDefault function. The documentation for the same can be found here.
Secondly you can use the Set function of YansWifiPhyHelper to set any attribute of YansWifiPhy (WifiPhy). You can find an example of this here. The only difference from the link will be that you need to change the attribute name to Frequency and change the value accordingly.
Please, let me know in case of any doubts or any of these don't work for you.
| 0618fb832ef1920bcf7820226fff19bccd5d300432c2ed34d1b9ba0a6d406efc | ['224fed153579400386a960421229febb'] | There are different ways to do it based on the network topology you want to work on. If you want to have four nodes sharing the same shared medium, you can simply do a node.Create (4) and install a CsmaHelper on your NodeContainer, you can checkout /examples/tutorial/second.cc for a simple implementation of this.
But if you want a dumbbell like topology with one leaf node on each side and one central channel, you will have to create three NodeContainer with PointToPointHelper installed on each of them.
NodeContainer leftLeaf, rightLeaf, central;
leftLeaf.Create(2); //creates two left side node
rightLeaf.Create(2); //creates two right side node
central.Add(leftLeaf.Get(1)); //add one node from left in central link
central.Add(rightLeaf.Get(1)); //add one node from right in central link
You will also have to set forwarding on for the central link nodes.
This is done because a point to point link must have exactly two end points. For such topology you can even use PointToPointDumbbellHelper, an implementation for which can be found in src/traffic-control/examples/red-vs-ared.cc
|
2e04c871baef6385417d7525ca55106dceeeec41902503f9012433a013a292d1 | ['2251c4eb357a4cc9bdcde34e4fa1af95'] | To be honest, I'm not even sure this is an issue, but I'm curious about sharing my observables when using ngrx.
Let's say you have these three variables in your store that control whether something is open or expanded:
export interface State {
isSidebarActive: boolean;
isPlaylistExpanded: boolean;
isFolderListExpanded: boolean;
}
If you return all three variables with a single selector, you might end up with the same variable being used multiple times in your template. This isn't actual code, so bear with me:
<div [hidden]="!(uiState$ | async)?.isSidebarActive">
<ul [@expand]="(uiState$ | async)?.isPlaylistExpanded">
<li></li>
</ul>
<ul [@expand]="(uiState$ | async)?.isFolderListExpanded">
<li></li>
</ul>
</div>
From what I understand, this will create three unique subscriptions to uiState$, and you can use the .share() operator to share one subscription to all three items. If this is necessary, where would you share your Observable? Here?
constructor(private store: Store<fromRoot.State>) {
this.uiState$ = this.store.select(fromRoot.getUiState).share();
}
Looking at this answer, I'm not even sure it is necessary.
TIA.
| 5b954558514848bf4564a7d9ce3d011c34552cc66decfe375fe252c01098b325 | ['2251c4eb357a4cc9bdcde34e4fa1af95'] | I've seen a dozen ways to implement retry strategies, and I feel like I'm really close. What I have here doesn't throw an error after takeWhile() completes.
getItems(): Observable<ListItem[]> {
return this.authHttp.get(URL + '/items')
.retryWhen(e =>
e.scan((errorCount, err) => errorCount + 1, 0)
.takeWhile(errorCount => errorCount < 4)
.delay(3000))
.map(this.dataService.extractData)
.catch(err => this.dataService.handleError(err, 'The items could not be retrieved.'))
}
I've seen some jagged looking code snippets that might get it done. I experimented with inserting a .finally() before the .delay().
Once I get this one solved, I'll want to pass the errorCount back up to my subscription so that I can display something useful. "Retry 1 of 4." Something to let the user know what is going on.
|
6e62c9de666b94b30056d7d9ec448898c94573739aa93af4fe7380df08b53b85 | ['2255fb8344bf47e481ae471edfab731c'] | I hope this answer is not too late!
For your first model the version in nlme would be:
model1 <- lme(y ~ A ,
random = list(A = pdDiag(~time)),
data=data)
Your seccond and third models are equivalent. Model 3 in lme4 package can be also written as:
model3 <- lmer(y~A + (1|site/A), data, method=FALSE)
I foud this link that might help you a lot to compare nlme and lme4 packages
https://rpsychologist.com/r-guide-longitudinal-lme-lmer#conditional-growth-model-dropping-intercept-slope-covariance
| d070f07d4c97835a871bb46552fb86f8775956f87c7b618fd050ec25732ce1ea | ['2255fb8344bf47e481ae471edfab731c'] | That error usually arises when the funtion does not accept one argument that you are including in the function call.
It seems that the function plotTangentSpace does not use the argument groups.
The function is from the package geomorph. I found two versions of the package, one accepts the argumentgroups and the other does not.
V3.2.1, with groups parameter :[https://www.rdocumentation.org/packages/geomorph/versions/3.2.1/topics/plotTangentSpace]
V1.0 does not include groups: [https://www.rdocumentation.org/packages/geomorph/versions/1.0/topics/plotTangentSpace]
Check what version of the package you have installed.
The other functions you mention gm.prcompalso does not accept groups as an argument and therefore the same error arises.
Suggestion: Try to have your R in English, it will be easier to share your problems.
|
f3a480b3bccd1c35e901ac2467a3dbf6725eb1ece16cf42a990c28517ec76535 | ['226a42b5dc6a4af1aa8c0d358c38d435'] | First problem:
If your for loop is written such that it does not go over the length of the linked list:
for (int i = 0; i < length(); i++) {
Then why do you need this?
if (node.getNext().getNext() != null) {
node= node.getNext();
}
In particular, this code might mean that a node just before the end is evaluated twice, because the node beyond it is null. It is not necessarily making your algorithm wrong, but it smells bad and I don't like it.
Second problem:
for (int j = 0; j < i; j++) {
if (node.getInfo().equals(node.getNext().getInfo())) {
isDistinct = false;
}
}
This is a faulty way to calculate duplicates because you do not store and advance the position of the second node you are comparing against. Try something like
Node node2 = firstNode(); //idk what method gets the first node :)
for (int j = 0; j < i; j++) {
if (node.getInfo().equals(node2.getInfo())) {
isDistinct = false;
break; //optimization, stop as soon as we find a duplicate
}
node2 = node2.GetNext();
}
Finally, whenever faced with code that does not work, attach a debugger, step through it and notice when the code does not do what you expect it to. This will solve all logic errors quickly with just a small amount of observation. Even if you don't have access to the debugger, you can use print statements to print the value of various variables and when certain code branches execute and compare to what you expected would happen.
| 3528f247af88f841ef41eb42e33e9cf5485d6d6ca577a47e09aec17ea3c0776d | ['226a42b5dc6a4af1aa8c0d358c38d435'] | In an aggregate function using queries, all selected values must either be
1) in the group by
2) an aggregate function.
This is because max is not the only aggregate function - imagine if you used AVG instead of MAX. What values would SQL have to give for the other rows, that apply only to one row? There's no way to pick, which is why you cannot express such a query.
But what you want is not to aggregate but to FIND the row with the highest RequestedAmount. So let's do:
Select ProposalID, Title, RequestedAmount AS Budget, ResearcherID
From
Proposal
Where Budget >= ALL (select RequestedAmount from Proposal)
|
5aaa9efec32a35e55b0eabedb54a4605f9e21b85d71615064d9e71603759063b | ['228305e41c5a4540a662c27c20c92451'] | I am preparing a ps1 file. It will install some programmes silently. But my programmes' setup files were saved in my USB flash drive. In my ps1 file,
cd E:\User\User_Setups
This path is my USB flash drive's path. But it will change on the other machine. Maybe G:\, F:\ etc.
Naturally, I don't want to change this path for every different machines. How PowerShell find my USB flash drive's path by a command-line?
| dad2091c16539ef5241509ed95ac2d6ef633c5e3774c42667c3536040cd28f90 | ['228305e41c5a4540a662c27c20c92451'] | This question had asked for PowerShell before. I want to do this in C#.
I have a directory on my desktop. The directories name is "rename".
C:\Users\dell\Desktop\rename
And "rename" folder contains "a_b", "b_c", "c_d", "d_e" folders.
I want to replace "_" with "-" characters.
In other words, folders' new names will be "a-b", "b-c", "c-d", "d-e"
Thank you for your help!
|
02bff479a4552ec4b21b70796bb46f36c0d38023eeb57714d3f85ebc1a0da306 | ['228bc600b00d4d1fb676d9b624c7dd7c'] | I would focus on the training data. To me, it looks like the model is over-trained. The second possible option is a problem with train-, cross-validation- and test-set.
Please check:
Are they really independent? Especially train and cross-validation set.
How large your sets are? If you have enough variance in cross-validation.
| a85fc25242856da1c800cedf84ff7320949fff314bde9fe295cda83a1b94ba7a | ['228bc600b00d4d1fb676d9b624c7dd7c'] | At the beginning, I will describe formula, what I am trying to compute:
Math formula on google chat api (I can't post image directly.)
where I is identity matrix with shape (M,M), N_i is the vector (C) and T is the matrix (C*F,M), T_c are submatrices with shape (F,M).
My code for tensorflow to enumerate this look like that:
N_p = tf.placeholder(floatX, shape=[C], name='N_p')
I = tf.Variable(np.eye(M),dtype=tf.float32, name="I")
T = tf.Variable(np.random.rand(C*F,M),dtype=tf.float32, name="T")
L = I
for i,T_c in enumerate([T[i:i+F,:] for i in xrange(0,F*C,F)]):
L=tf.add(L,tf.scalar_mul(N_p[i],tf.matmul(tf.transpose(T_c),T_c)))
This works fine, unfortunately, I need expand this into batch processing, here N_p will be:
N_p = tf.placeholder(floatX, shape=[None,C], name='N_p')
Unfortunately, I don't know hor change my tensorflow formula.
Problem is in scalar_mul.
L=tf.add(L,tf.scalar_mul(N_p[:,i],tf.matmul(tf.transpose(T_c),T_c)))
what is obvious why, but how to rewrite it?
Thanks a lot for any advice.
|
9d220de2fd7262c255770b3168197fc559dc4d185e17ee23f6ac878adb423aba | ['22b52200fde84902837da086cfdc7da2'] | in general if you just print as in example below (which works for me) it will go to the log of the task which will perform the UDF. the complicated part here is to find the the relevant map/reduce task which produced it through the job tracker (in pig 11 it is more simple as pig write each phase to stdout)
@outputSchema("schema:chararray")
def convertBagToStr(acctBag):
#print len(acctBag)
#print acctBag
return "_".join([str(i[0]) for i in sorted(acctBag)])
| 028053ced021e864f8fbfb84145f8fa307109c4ef0bf1f5efadd174996271ac1 | ['22b52200fde84902837da086cfdc7da2'] | this is an example for a UDF concatenating strings which are tuples in a bag assuming there is 1 item in each tuple (string delimiter in the output will be an '_'):
#!/usr/bin/python
@outputSchema("schema:chararray")
def convertBagToStr(acctBag):
return "_".join([str(i[0]) for i in sorted(acctBag)])
in the Pig script :
register '$udf_dir/myUDF.py' using jython as funcs;
a = foreach mygroup generate funcs.convertBagToStr(mybag) as bag_str;
|
7bd27297f0c6d433607bafd22c4346d99fbff860490d0fc8b33f8ebb6e850b27 | ['22bfed71ac2a42aaa8c3ef27f83eafe9'] | I am setting up Squid proxy with mac address acl. I have recompiled squid 3.5 rpm with --enable-arp, acl. But after configuring Squid.conf with mac address acl its unable to block access for unwanted mac address.
Is it possible to create iptable rule and allow some mac addresses to permit web access? if yes how to do that?
Edit: Added as follows:
acl mac arp 00:E1:34:CD:C0:22
http_access allow mac
http_access deny all
| d121a7d8db21baee8e987d6d8ff093636de7c393b3d05fa67622b25533700b29 | ['22bfed71ac2a42aaa8c3ef27f83eafe9'] | thanks for the reply <PERSON>, but I still have the bleed on the inner side !? My document is a booklet two page, with facing pages. Now when I put crop marks it takes the belled from the inner side of the page too. Also, the info for the linked images says ICC Profile: Document RGB . Any ideas of hoe two make this ready for print. ? Thanks |
1a6b75b38be0ec8a11bc4c52808e6e0276e7a3415d4e1f1154a471c4f55181d2 | ['22d9ff2807c241ac9f84650fe7c4a76b'] | My quess..You are using a ListFragment derived class with an xml file that has a view in it with the id android.R.id.list. That view is not a ListView.
When you use a listfragment derived fragment you do not need an xml layout file, but if you create one the listview in it has to have the id android.R.id.list
| 1c34187211a5d47726bbddb73f53d7d96ff5fdffb30ec8643f766b13ef4394ab | ['22d9ff2807c241ac9f84650fe7c4a76b'] | You have two controls with the same Id. One is a menu item the other a Switch. If you change the Id of the menu item it should work. On a side note, I would put the code:
bluetoothSwitch = (Switch) findViewById(R.id.bluetooth_switch);
if(bluetoothSwitch == null) {
Log.d("NXTController", "Switch = null");
}
checkForBluetoothAdapter();
in onCreate(). This makes it clear you are not trying to get an item from the menu.
|
1083ba6fed539130debb60be4faae9e446b36211c75b283fa276bfc9af886a76 | ['22e4bf1fa31a4da3acf4332b3bb357ae'] | aapt appears to have a --custom-package flag. Is it possible to configure the Android facet of IntelliJ such that it is possible to make use of this flag? Looking at the Project Structure GUI, I get the impression that it is not.
Though I do see that CUSTOM_COMPILER_MANIFEST is listed in the .iml file, but I do not see how that bubbles up into the UI.
| 4051ca025b9c45a8fe186ca887ef9fc33095619a2849b96112798a02dc917bba | ['22e4bf1fa31a4da3acf4332b3bb357ae'] | If your animations are tied to a goog.ui.Component (or any other object that extends goog.Disposable), then after creating each animation, you could register the animation with the component via the component/disposable's registerDisposable() method.
That way, you could dispose the component (by invoking its dispose() method), which would invoke dispose() on all Disposables registered with it. Looking at goog.fx.Animation, when dispose() is invoked, its stop() method is invoked, so I believe this should work.
You could also just create a goog.Disposable for the purpose of registering animations on it and disposing all of them from one place. That said, if you register a lot of animations and don't call dispose until long after they are needed, you will have a memory leak because this will prevent the Animations from being garbage collected.
|
5033050df76e3a45d4e0af3a5a6d27149fd77a7a0e850017198a8965fd494e75 | ['22ebdb9846854a7ca827b3fbcc3187fa'] | This is very helpful, and all sounds perfectly reasonable. My concern has to do exactly with @gung's answer to the question you link to: if the plot.lm plots, being intended for linear models, can be misleading, it seems there should be GLM-specific functions like glm.diag.plots. | f84d09894b7c315bb2c707c247f5428c811534c932c1c01dc3ea7417267a8c39 | ['22ebdb9846854a7ca827b3fbcc3187fa'] | select t.user_id, count(t.user_id)+1 as cnt_session, (SELECT count(DISTINCT t2.user_id) FROM time_user t2) as cnt_users
from time_user t
WHERE ROUND(((SELECT t1.`time` FROM time_user t1 WHERE t1.user_id = t.user_id AND t1.`time` > t.`time` ORDER BY t1.time ASC LIMIT 1) - t.`time`) / 60) > 5
GROUP BY t.user_id
ORDER BY t.`time` ASC
Осталось только как-то посчитать суммарное время сессии.. и поделить его на cnt_session и cnt_users
|
106fef2c825849f8bdf5da454f725e52744bd1c610eda6befcd83e62ae5b2acf | ['2303308c4d4a4d35be40fe8518ad81ca'] | I am trying to create a day-view with times on the left side, and a top header of people. Currently I can get the left OR the top header to stick, but not both.
How do you get 2 sticky headers?
My render looks like this:
<ScrollView style={{height: 600}}>
<ScrollView horizontal={true}>
<View style={styles.column}>
<View style={{ flex: 1, flexDirection: 'row', width}}>
{header}
</View>
<View style={styles.row}>
<View style={[styles.container, { width, marginLeft: 40 }]}>
{this.generateRows()}
</View>
</View>
</View>
</ScrollView>
<View style={{backgroundColor: 'white', position: 'absolute', top: 0, bottom: 0, left: 0, }}>
<View style={{ flex: 1, flexDirection: 'row'}}>
<View style={styles.row}>
<Text></Text>
</View>
</View>
<View style={{height: 1000, width: 40 }}>
{this.generateRowLabels()}
</View>
</View>
</ScrollView>
| cb92d92e9c5aea6f810f36ba05e571de08a71e72124088a31635fbcc87a3a90a | ['2303308c4d4a4d35be40fe8518ad81ca'] | Here is a better way to do this. This really cleans up the asynchronous nature of javascript. Checkout the async library that I am using here.
var collection = db.get('nomi');
var async = require('async');
app.post('/genderize', function(req, res){
let countingObject = {
females: 0,
males: 0,
unknown: 0
};
async.each(req.body.data, function(name, callback) {
collection.findOne({ nome : name.split(" ")[0].toUpperCase() }, { fields: {_id:0, nome:0}}, function (err, nameObject) {
//instead, maybe check if it is male, female, or otherwise mark as unknown?
if (!isEmptyObject(nameObject)) {
//this object probably has getters that you could use instead
nameObject = JSON.parse(JSON.stringify(nameObject));
if(nameObject.sesso == "M"){
countingObject.males++;
} else {
countingObject.females++;
}
} else {
countingObject.unknown++;
}
callback();
});
}, function() {
res.setHeader('Content-Header', 'application/json');
res.send(JSON.stringify(countingCallback));
});
});
|
fcecefa2088a0477b1efb02e126a1cc8687dd90eaf43fa8cbc2d90b233df523c | ['2304fb4e7ff84c47958d8d1b489925ac'] | I needed to do this today.
Here's my code, mind i decided to make this a HOC that you can choose to wrap or not wrap.
For use cases that have multiple redirect cases you'll definitely want to use this inline instead of as a wrapper.
import React from 'react';
import {Redirect} from 'react-router';
interface IConditionalRedirectProps {
shouldRedirect: boolean,
to: string
}
export const ConditionalRedirect: React.FC<IConditionalRedirectProps> = (props) => {
const {shouldRedirect, to, children} = props;
if (shouldRedirect) {
console.log('redirecting');
return <Redirect to={to}/>
} else {
return (
<>
{children}
</>
)
}
};
Usage:
<ConditionalRedirect shouldRedirect={someFunctionThatReturnsBool()}
to={'some url'}>
<Normal Elements here>
</ConditionalRedirect>
| 34b719ff53a62727533541782e1b0f994b669d9a4487f0d6818e64c8613e85f5 | ['2304fb4e7ff84c47958d8d1b489925ac'] | Found the permanent solution in the mongodb documentation
In /etc/mongod.conf write:
cloud:
monitoring:
free:
state: "off"
Then run either
sudo systemctl restart mongod
sudo service mongod restart
Honestly mongo, you should never be this persistent when pushing unwanted monetization features. It's bad enough it's enabled by default. You are after all, only a lovely opensource db service, just like mysql. - Sincerely Redis
|
7a619502cd2f4bf43074f036d01d72266ed984b839a450545e3cbc67f7f46573 | ['231efe6576cf4fd5b1124eb8c7f35825'] | I don't know what the problem was, but it's gone now: I removed vim (pacman -R vim), manually deleted the directories /usr/share/vim/ and ~/.vim/ and reinstalled vim and vim-runtime. I then placed my colour scheme in ~/.vim/colors and my syntax files in ~/.vim/after/syntax - and it's working.
| c46b20cd75d2f32a9c9cf30f525220aa57b3aec8f169ce20fca38c9b0db114da | ['231efe6576cf4fd5b1124eb8c7f35825'] | I have a fresh installation of Manjaro linux 0.8.10 with vim 7.4 installed, and I'm unsuccessfully trying to enable syntax highlighting for c++11/14 using the script by <PERSON> (which I've been working with until recently), or vim-cpp-enhanced-highlight which I've never tried before.
I've googled around, and followed any clue I could found. The best I got, is making highlighting work for some small subset of the keywords (e.g: "return", "using", "size_t" and "std", but not "static", "class", "public" or "const"), and it doesn't seem to recognize any of my own types, function calls and so on.
I've tried the following things:
Using the original cpp.vim from /usr/share/vim/vim74/syntax, and placing cpp.vim from vim-cpp-enhanced-highlight in ~/.vim/after/syntax
Placing cpp.vim from vim-cpp-enhanced-highlight in ~/.vim/syntax
Override cpp.vim in /usr/share/vim/vim74/syntax with the file from vim-cpp-enhanced-highlight.
and pretty much the same variations with the .vim files taken form <PERSON> (and I'm reasonably sure I didn't make any mess, and I restored the original configuration before each trial).
I'm using the same .vimrc file that I've used before (and which worked with <PERSON> files). It has in it "filetype plugin on" and "syntax enable". I've also tried placing there "au BufNewFile,BufRead *.cpp set syntax=cpp11" (which had no measurable impact), and I've tried setting the syntax configuration manually from inside vim (e.g. "set syntax=cpp" or "set syntax=cpp11") which had rather strange effect (toggling the highlighting for only the "std" keyword).
I guess it's obvious that I don't know what I'm doing. Could it be that I should be using a different build for vim, compiled with some support for c++? If so - is there such a package for manjaro?
I'd appreciate any help.
Thanks!
|
1c52520ee2342be40527b6a25c99a6d6136521cdf3a86bf9b22ce203fe8a35a0 | ['2320de822d894152bcec8ff8fde2c9ae'] | quiero hacer la actualización de un campo en una tabla.
Actualmente luce así:
El último número del campo "referencia" corresponde al "idtitular".
Necesito actualizar el campo "referencia" a que diga "T202100-idtitular".
Por ejemplo en el primer registro, que quede "T202100-1".
Es una cantidad grande de registros, por lo que intenté hacer una consulta anidada:
UPDATE "TORRDBV1".tb_toroparking set referencia = (select concat('T202100-', idtitular) from "TORRDBV1".tb_toroparking);
Si lo uso con un where para que sea un sólo registro, funciona bien, pero al quitar la condición me devuelve este error:
Agradecería que alguien me pudiera ayudar.
| 81bdb972f62092e055b2daa541522af00bb38d323393754deaa440204f4f16d4 | ['2320de822d894152bcec8ff8fde2c9ae'] | quisiera saber si hay alguna forma de hacer algo como lo siguiente:
Por ejemplo, tengo esta línea:
m_gridEmployee = new ASPNexusGrid(__gridEmployee.XMLDocument);
Esta línea es de un sistema que se hizo específicamente para Internet Explorer, entonces tengo entendido que la propiedad .XMLDocument, sólo funciona en IE, o al menos en este caso lo está haciendo.
Quisiera saber si es posible que al tratar de acceder a la propiedad XMLDocument, me regrese simplemente el valor de lo que hay en "__gridEmployee".
Algo como esto: Element.prototype.XMLDocument = "Valor del grid"
Al hacer esto, sí toma el valor que le estoy asignando directamente, pero no entiendo como hacer se pueda asignar lo de "__gridEmployee" o el valor del objeto que trata de acceder a esa propiedad.
Espero haberlo explicado bien.
Lo quiero hacer de esta forma ya que este caso se repite infinidad de veces y sería más sencillo así.
Agradecería la ayuda
|
fae30c4f108eda9d6309c431906293b54384a4d3bd268106136ea14241a004e6 | ['2325ef12455d47f2a1c9d72b45c66526'] | I want to fetch images from Mobile External Storage,
I added permissions in my manifest.xml
error I getting in myconsole
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.learning.essentials, PID: 10988
java.lang.NullPointerException: Attempt to get length of null array
at com.learning.essentials.ui.main.Fragment_page.imageReader(Fragment_page.java:132)
Here is my fragment.java code
public class Fragment_page extends Fragment {
View status_permission;
View status_granted;
GridView gridView;
ArrayList<File> list;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_wa__status, container, false);
}
@Override
public void onViewCreated(@NotNull View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Find Ids
status_permission = view.findViewById(R.id.status_permission);
status_granted = view.findViewById(R.id.status_granted);
Button allow_btn = view.findViewById(R.id.status_allow_btn);
gridView = view.findViewById(R.id.imagegrideView);
list = imageReader(Environment.getExternalStorageDirectory());
gridView.setAdapter(new gridAdapter());
gridView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("clicked!");
}
});
//Visibility Gone
status_granted.setVisibility(View.GONE);
allow_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(),
Manifest.permission.READ_EXTERNAL_STORAGE)) {
requestPermissions(
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1
);
} else {
requestPermissions(
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1
);
}
}
});
//Main Permission and Visibility goes here
if (ActivityCompat.checkSelfPermission(Objects.requireNonNull(getContext()), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(Objects.requireNonNull(getContext()), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1
);
} else {
status_permission.setVisibility(View.GONE);
status_granted.setVisibility(View.VISIBLE);
}
}
public class gridAdapter extends BaseAdapter{
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View convtView = null;
if (convtView == null){
convtView = getLayoutInflater().inflate(R.layout.image_row_layout, parent, false);
ImageView imgview = convtView.findViewById(R.id.imagegrideView);
imgview.setImageURI(Uri.parse(list.get(position).toString()));
}
return convtView;
}
}
private ArrayList<File> imageReader(File externalStorageDirectory) {
ArrayList<File> b = new ArrayList<>();
File[] files = externalStorageDirectory.listFiles();
for (int i = 0; i < files.length; i++){
if (files[i].isDirectory()){
b.addAll(imageReader(files[i]));
} else {
if (files[i].getName().endsWith(".jpg")){
b.add(files[i]);
}
}
}
return b;
}
@Override
public void onResume() {
super.onResume();
if (ActivityCompat.checkSelfPermission(Objects.requireNonNull(getContext()), Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(Objects.requireNonNull(getContext()), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
status_permission.setVisibility(View.GONE);
status_granted.setVisibility(View.VISIBLE);
}
}
}
I facing the error in this line.
list = imageReader(Environment.getExternalStorageDirectory());
In my AndroidStudio Editor I getting this in Underline
getExternalStorageDirectory()
please help me I am Beginner in Android and I Learning,
Thanks in advance =)
| 0c04e11abba6cca6a880f6c2cf347ddb35d521b350b1ff6f5f32f7de888737f2 | ['2325ef12455d47f2a1c9d72b45c66526'] | I want to Read files from External Storage,
I developing Android App for Android 10+
I use this code to targetpath in android lower 9 version, but while using this code in Android 10 it's not working
String targetPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera";
System.out.println("FilePath1" + targetPath);
//---->Output Filepath1
I/System.out: FilePath1/storage/emulated/0/DCIM/Camera
I tried this code for Android 10 but I getting Output something different:
File fileff = new File(getContext().getExternalFilesDir(null).getAbsolutePath() + "/DCIM/Camera");
System.out.println("FilePath2" + fileff);
//---->Output Filepath2
I/System.out: FilePath2/storage/emulated/0/Android/data/com.learning.mylearning/files/DCIM/Camera
please help me, how should I get Filepath1 in Android 10?
Thanks in Advance =)
|
854e598f490dfc1025131e4b26aa47ecc6b0b249c13e06e5a05bd4d924a17204 | ['23270956ce884c53b7a19b869b192559'] | I am trying to write an ejs file with a for-each loop that displays, as text, names of javascript variables line by line. I want each name to be hyperlinked to a route, such as /getinfo, that renders a page that displays more information about the variable that was clicked on.
I tried to use an "a href" tag as follows:
<a href="/getinfo?name=" <%= variable.name>> <%= variable.name %></a>
I expected variable.name to be included in the URL's query parameters, but it won't be appended properly. Considering how HTML does not support string concatenation, I am not sure how to properly include this data in an HTTP GET request.
What would be a correct way to achieve this? Thank you!
| 3b24b2b3ec24cf0a221e5be10f90f97bb93da15c823ec33cd52880b7842c7fd4 | ['23270956ce884c53b7a19b869b192559'] | I am having trouble understanding why the solution of Leetcode's Repeated String match only goes up to q + 1 repeats of A (if A.length() < B.length()) for B to be a possible substring of A repeated.
I read other StackOverflow solutions as well as Leetcode discussion pages but I am still unable to fully understand the solution.
The algorithm is explained as:
Imagine we wrote S = A+A+A+.... If B is to be a substring of S, we
only need to check whether some S[0:], S[1:], ..., S[len(A) - 1:]
starts with B, as S is long enough to contain B, and S has period
at most len(A).
Now, suppose q is the least number for which len(B) <= len(A * q).
We only need to check whether B is a substring of A * q or A *
(q+1). If we try k < q, then B has larger length than A * q and
therefore can't be a substring. When k = q+1, A * k is already big
enough to try all positions for B; namely, A[i:i+len(B)] == B for i
= 0, 1, ..., len(A) - 1.
The implementation is as follows:
class Solution {
public int repeatedStringMatch(String A, String B) {
int q = 1;
StringBuilder S = new StringBuilder(A);
for (; S.length() < B.length(); q++) S.append(A);
if (S.indexOf(B) >= 0) return q;
if (S.append(A).indexOf(B) >= 0) return q+1;
return -1;
}
}
I understand that when A.length() < B.length(), B cannot be a substring, so we would need to keep appending A until A.length() is at least equal to B.length(). But once this is the case, why is it that we would only need to add one more copy of A to get the minimum number of repeats?
My intuition is that after A is repeated some number of times there is a pattern that is established and if B does not fall into that pattern/sequence of characters then no matter how many times you repeat A, B will not be a substring of the repeated A.
However, I just don't know why it has to be specifically the number of copies to match B's length or 1 more copy added after A.length() = B.length().
If someone could clear up this confusion for me, it would be much appreciated. Thank you.
|
b1a17d310d8fe9af30d79187ccbf1d3558fb096e957bd0aea47032d539f11e8f | ['233413482ced44a89cc7873a4d764ed5'] | I'm trying to get fontawesome pro to work with rails 6.
I was successfully able to get fontawesome-free working with rails 6 and webpacker, but I can't get webpacker to successfully compile with fa-pro. I've tried tweaking to get webpack to compile using something like the code below, but was unsuccessful.
I've installed the following node_modules via Yarn
fortawesome
fontawesome-commont-types
free-brands-svg-icons
pro-light-svg-icons
pro-regular-svg-icons
pro-solid-svg-icons
app/javascript/stylesheets/application.scss
@import "~bootstrap/scss/bootstrap";
$fa-font-path: '~@fortawesome/<NOT SURE>';
@import '~@fortawesome/fontawesome-common-types';
@import '~@fortawesome/free-brands-svg-icons';
@import '~@fortawesome/pro-light-svg-icons';
@import '~@fortawesome/pro-regular-svg-icons';
@import '~@fortawesome/pro-solid-svg-icons';
I've also added the following to the projects .npmrc
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken= TOKEN HIDDEN
Not sure what I'm missing. Any thoughts or direction would be greatly appreciated.
| 9637edc38caff4f4a800ded722606dd9229c2161661289407883c4452ddde0a3 | ['233413482ced44a89cc7873a4d764ed5'] | Quick question, I’m building a rails app that has the ability to contain multiple “features” one of those being rsyslog, other features could be any other software. Below is the current construct:
Controllers:
features/
features/rsyslog/
features/rsyslog/rsyslog_inputs_controller.rb
features/rsyslog/rsyslog_outputs_controller.rb
features/rsyslog/rsyslog_rules_controller.rb
Routes:
resources :features do
scope module: "features/rsyslog” do
resources :rsyslog_inputs
resources :rsyslog_outputs
resources :rsyslog_rules
end
end
(controller code does not work here)
Controller code:
class Features<IP_ADDRESS>RsyslogInputsController < ApplicationController;end
class Features<IP_ADDRESS>RsyslogOutputsController < ApplicationController;end
class Features<IP_ADDRESS>RsyslogRulesController < ApplicationController;end
I’m curious, given that there are multiple features and I’d like to keep each features controllers nested in a directory specific to that feature.. i.e. (rsyslog containing all of the rsyslog controllers) as opposed to building the structure like so:
features/
features/rsyslog_inputs_controller.rb
features/rsyslog_outputs_controller.rb
features/rsyslog_rules_controller.rb
How does that translate to the controller code class definition? doing this:
Class Features<IP_ADDRESS>Rsyslog<IP_ADDRESS>RsyslogInputsController < ApplicationController; end
(note the addition of Rsyslog above)
RubyMine it’s getting pissy with a “expected end of line” on the second set of “<IP_ADDRESS>” in the class definition... However, the routes work.. Am I missing something here? is this just my IDE being weird?
|
1f2d875458da5266f3f2d1dc7d6577fdc7ac88fc55624bc116623fe4c40cf067 | ['233a294b3c484db883f858045b920b9f'] | On one (of many) of the planets that I am planning out, there are no seas. The planet is mainly composed of enormous mountains, with some deserts in between.
There are no seas or large bodies of water anywhere on the planet. Not many people like to live on this desolate planet, but those that brave its harsh condition face a boring and necessary consideration.
They need a method to determine the elevation of certain mountains, but without oceans, it is difficult to determine a standard sea-level.
In a planet without seas or any large bodies of water, how do the habitants determine a standard sea-level?
These people have the technology level of the 1700's of Earth, so no futuristic tech.
| cac4e907c0d9204314f5bd685616fa25bb4bd739d8ddd6c26c2eee0631dae68f | ['233a294b3c484db883f858045b920b9f'] | Okay, the solution is that I did not disable Time Machine and remove all backup drives first. Doing that solved the issue. So the full solution is:
Disable "Backup Up Automatically" in Time Machine System Preferences, and remove all backup drives, such that it looks like this:
Then run sudo tmutil thinlocalsnapshots / 999999999999
And try again. Optionally restart the computer and try again.
|
259093933b020cad2065ae44c612e97873903a14b534172d3e470bec80e110c0 | ['233d44383a084313ba7d8022c374a6cb'] | You can add the item using PnPjs like this:
private PnPAddItem():void
{
sp.web.lists.getByTitle("Jerry").items.add({
Title: "NewItemAddedTitle"
}).then((iar: ItemAddResult) => {
console.log(iar);
});
}
You can console.log(iar) response in the console to see which field failed validation and you could also check the Network tab to see reponse status and request details:
| a3aa76eb77facd1fba5cf702ae401c94b2ac601afbafe1727cab86f2a1bafb1e | ['233d44383a084313ba7d8022c374a6cb'] | In SharePoint 2010 CSOM, try to get file stream using Microsoft.SharePoint.Client.File.OpenBinaryDirect, here is the modified code:
private static byte[] GetFileData(ClientContext clientContext, string SiteUrl, string path)
{
try
{
var web = clientContext.Web;
clientContext.Load(web, website => website.ServerRelativeUrl);
clientContext.ExecuteQuery();
var regex = new Regex(SiteUrl, RegexOptions.IgnoreCase);
var siteRelavtiveURL = regex.Replace(path, string.Empty);
var serverRelativeURL = web.ServerRelativeUrl + siteRelavtiveURL;
var file = web.GetFileByServerRelativeUrl(serverRelativeURL);
clientContext.Load(file);
clientContext.ExecuteQuery();
FileInformation fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(clientContext, serverRelativeURL);
//var stream = file.OpenBinaryStream();
//clientContext.ExecuteQuery();
using (var memoryStream = new MemoryStream())
{
fileInfo.Stream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
catch (Exception ex)
{
return new byte[0];
}
}
Reference:
Method “OpenBinaryStream” does not exist reading a file from SharePoint 2010
|
27182818435c1a8fff64faf6a10bc3a53c86d5082f5f9b48cecd6ef31168e645 | ['23425c5e83ec4dc090d05a57901cfb93'] | Perl 6, 72 bytes
There is surely a better way, but this is what I have...
->$a {grep {$a==[+] @^a.reverse Z+< ^∞},[X] (1,-1)xx $a.base(2).chars}
Try it online!
Explanation: It's a function that takes one argument (->$a). We first get the number of coefficients needed ($a.base(2).chars = number of characters in base 2 representation), then make a Cartesian product (X) of that many pairs (1,-1). (The [X] means: reduce the following list with X.) So we get a list of all possible combinations of 1s and -1s. Then we filter (grep) only the lists which encode the given number $a. There is only one, so we get a list of one list with the coefficients.
The grep block does this: takes its argument as a list (@^a), reverses it and zips it with an infinite list 0,1,2,... using the "left bit shift" operator +<. Zipping stops as soon as the shorter list is depleted (good for us!) We then sum all the results and compare it with the given number. We had to use .reverse because the OP demands that the coefficients be in the order from most significant to least significant.
| 5fbf438c2064fc80133528de5563475036678e7d43768e65c6aea8ae22877293 | ['23425c5e83ec4dc090d05a57901cfb93'] | re: config scripts, all other physical servers in our datacenter running SLES 11 are similar: we only have config scripts for the NICs being used, and the others are non-existent. Its never posed an issue. I put in a minimal config with all of the suggestions here, but won't be able to test a reboot for a while (maybe not until the weekend). Thanks for the info. |
8c79a8432ca237628bc92061b28d13c1bb7ec3c71970e560333508a2d6ce7c6c | ['23476d3e1bf2410fad0134f0d76d5f3d'] | that is the intent of the failover: transport. It will hide transport failures and automatically try and reconnect, replaying any jms state when a new connection is established.
There is a transportListener that you can use to get transport suspended and resumed events.
If you remove the failover: component from the broker url, you will get all exceptions propagated up to your client.
| dd5ca642b8029acee92863e33a9c231bc38250b5665e75db64b860a388db5954 | ['23476d3e1bf2410fad0134f0d76d5f3d'] | You need to update to the latest Better Store Search release which features a fix to deal with the search related changes in Magento <IP_ADDRESS> and <IP_ADDRESS>.
I did this yesterday and it worked. At the time of writing the latest BSS release is v1.2.1.0.
|
a76167743b8f13bf4f2105fa0f41c88227c77d33ec53097661cdfec18e11ba4d | ['234880e2165a4cd8acc7403670e0138f'] | I'm not able to correctly draw a colour aesthetic line in plotly, using a ggplot object. What am I missing?
library(ggplot2)
library(plotly)
df <- data.frame(val = as.numeric(LakeHuron), idx = 1:length(LakeHuron))
p <- ggplot(df, aes(x = idx, y = val, colour = val)) + geom_line()
p <- p + scale_color_gradient2(low="red", mid = "gold", high="green", midpoint = mean(df$val))
p
p2 <- ggplotly(p)
p2
p prints the correct expected output.
When I print the plotly object p2, I dont get the line points joining correctly?
The problem is when i add the colour aesthetic I think.
Versions:
plotly 4.9, ggplot2 3.1.1
| a16a01111b9ac9f9afba937936f6ab9bcf24dfe6078e102e9cbe5c3c4c18e149 | ['234880e2165a4cd8acc7403670e0138f'] | Change the order of loading the packages. Load dplyr first, then xts. This will mask lag from dplyr by default
library(dplyr)
library(xts)
if you still are getting the wrong function call look up, as mentioned you can use xts<IP_ADDRESS>lag, where you want to apply the xts operator.
|
fd241deac235580b8424abf15f5ce7272b15a59aeb9b91ab1179824f485989c2 | ['2349103c75dd440994f112fa61fd771d'] | In laravel 5.1 check the bellow mail setting
.env file
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=<your email>
MAIL_PASSWORD=<password>
MAIL_ENCRYPTION=tls
mail.php file
return [
'driver' => env('MAIL_DRIVER', 'mail'),
'host' => env('MAIL_HOST', 'localhost'),
'port' => env('MAIL_PORT', ""),
'from' => ['address' => "<from email>", 'name' => "<name>"],
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME',""),
'password' => env('MAIL_PASSWORD',""),
];
| 0dd21777a4ebd5cb6ce011af2758ac467c59af4e01e5ee41a2216cc59b193221 | ['2349103c75dd440994f112fa61fd771d'] | I use Stripe payment gateway in codeigniter using stripe.js. In stripe payment process first do client side validation and then after server side validation by stripe php 2.1.1 library. Client side validation working ready but server side validation gives error. I put stripe php 2.1.1 folder in codeigniter library folder.
I refer this link http://code.tutsplus.com/tutorials/how-to-accept-payments-with-stripe--pre-80957
code:
<?php
$success = "";
$error = "";
require_once(APPPATH.'libraries/stripe/lib/Stripe.php');
if ($_POST) {
Stripe<IP_ADDRESS>setApiKey("dm_wsdst_yJQB5mrfjpfQX2uMQHf3CbD");
$error = '';
$success = '';
try {
if (!isset($_POST['stripeToken']))
throw new Exception("The Stripe Token was not generated correctly");
Stripe_Charge<IP_ADDRESS>create(array("amount" => 11,
"currency" => "usd",
"card" => $_POST['stripeToken']));
$success = 'Your payment was successful.';
}
catch (Exception $e) {
$error = $e->getMessage();
}
}
echo "sucess". isset($success) ? $success : "";
echo "error".isset($error) && $success ? $error : "";
?>
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script>
Stripe.setPublishableKey('es_iksl_l5li2xygPS9cJE5MMWE8GSr');
</script>
<div class="content_white register_wrapper">
<div class="content_40" style="margin-left:350px;">
<div class="content_gray" style="margin-top: 50px;">
<form method="post" name="payment_form" id="payment_form">
<div class="error" id="payment_error"></div>
<div class="box" style="padding: 15px 0;">
<label>Card Number</label>
<input type="text" class="text_box" placeholder="Card Number" data-stripe="number" id="card_number" name="card_number" style="height: 40px;" />
<div class="error" id="form_fname_error"></div>
</div>
<div class="box" style="padding: 15px 0;">
<label>Card CVC No</label>
<input type="text" class="text_box" placeholder="CVC Number" data-stripe="cvc" id="cvc_number" name="cvc_number" style="height: 40px;" />
<div class="error" id="form_lname_error"></div>
</div>
<br>
<div class="box" style="padding: 0px">
<label>Card Expiration Month/Year (MM/YYYY)</label>
</div>
<div class="box" style="padding: 15px 0; width: 30%;float: left;">
<input type="text" class="text_box" placeholder="Month-(MM)" data-stripe="exp-month" id="exp_month" name="exp_month" style="height: 40px;" />
<div class="error" id="email_error1"></div>
</div>
<div class="box" style="padding: 15px 0; width: 50%;float: left;" >
<input type="text" class="text_box" placeholder="Year-(YYYY)" data-stripe="exp-year" id="exp_year" name="exp_year" style="height: 40px;" />
<div class="error" id="form_password_error"></div>
</div>
<div class="clear"></div>
<div class="box" style="text-align:center;">
<div class="submit_btn">
<input type="submit" class="btn_blue" id="submit_btn" value="Pay $20"/>
</div>
</div>
<div class="clear"></div>
</form>
</div>
</div>
<div class="clear"></div>
</div>
<script>
$(document).ready(function(){
$('#payment_form').submit(function(event) {
console.log("start");
var $form = $(this);
// Disable the submit button to prevent repeated clicks
$form.find('#submit_btn').prop('disabled', true);
Stripe.createToken({
number: $('#card_number').val(),
cvc: $('#cvc_number').val(),
exp_month: $('#exp_month').val(),
exp_year: $('#exp_year').val()
}, stripeResponseHandler);
// Prevent the form from submitting with the default action
return false;
});
});
// Call back function for stripe response.
function stripeResponseHandler(status, response) {
console.log("ststus"+status);
if (response.error) {
// Re-enable the submit button
$('#submit_btn').removeAttr("disabled");
// Show the errors on the form
// stripeErrorDisplayHandler(response);
$('#payment_error').text(response.error.message);
// $('.subscribe_process').hide();
} else {
var form = $("#payment_form");
// Getting token from the response json.
$('<input>', {
'type': 'hidden',
'name': 'stripeToken',
'value': response.id
}).appendTo(form);
// Doing AJAX form submit to your server.
form.get(0).submit();
return false;
}
}
</script>
When i run this file then run ready, and when i click on pay button then check card data and expiration month and year if it is ok then return stripeToken then resubmit form again then it will return error that is
Fatal error: Class 'Stripe' not found in
D:\xampp\htdocs\moviesaints\application\views\user\payment_precess.php
on line 12
Any idea give me solution.
|
8e6f3da9517382c8a7cfe79c0103d1e8b3bc5d3649cf84027c0731dffa1688c1 | ['23750893c03947a08868d70b6f9be365'] | You need to start MongoDB daemon first. To do that, go the directory where your MongoDB files reside and run mongod.exe under the bin folder.
In other words run:
<MONGO_HOME>\bin\mongod.exe
To make sure that the main MongoDB database process is running, run mongo.exe (Mongo Shell) which also resides under the same folder. If it connects successfully and greets you with the shell awaiting your commands, then your database is up and running. Go back and restart compound server to see if it helped. If it did not, check your database connection settings.
| bd07490e9143a0936adde7551f6132516a53e571b0ffe82bd9aea737e818127a | ['23750893c03947a08868d70b6f9be365'] | Before answering your question, I would like to note that it's considered a bad practice to add a cache-buster parameter to your service worker URL, since the browser will already enqueue the new service worker for installation if it's byte-different to the existing service worker. You may read more about this on: The Service Worker Lifecycle
Now, to answer your actual question:
You can manually trigger the update by calling the update() method of your service worker registration, when a push message is received:
self.addEventListener('push', function (event) {
...
event.waitUntil(
Promise.all([
self.registration.showNotification(title, options);
self.registration.update()
])
);
});
You may also want to trigger self.registration.update() only if there actually is a newer version of the service worker available. To do that:
Store the version identifier of your SW in a variable.
Always send the latest SW version identifier within your push message payload.
Compare the two and trigger self.registration.update() if they don't match.
Hope this helps!
|
714a886c6139869b7aeaabf5dc5d36019305dd76fb57da85284910c62f8fde5b | ['2381fdd6a16a495eb04ea248d23fcb31'] | I managed to figure it out
//@version=4
study("5min MAs", overlay=true)
plot(timeframe.isseconds or (timeframe.isintraday and (timeframe.multiplier <= 2)) ? security(syminfo.tickerid, '5', ema(close[1],9), lookahead=barmerge.lookahead_on) : ema(close,9) , title="9EMA", color=#ff6d00, linewidth=1)
plot(timeframe.isseconds or (timeframe.isintraday and (timeframe.multiplier <= 2)) ? security(syminfo.tickerid, '5', ema(close[1],20), lookahead=barmerge.lookahead_on) : ema(close,20) , title="20EMA", color=#ffeb3b, linewidth=1)
plot(timeframe.isseconds or (timeframe.isintraday and (timeframe.multiplier <= 2)) ? security(syminfo.tickerid, '5', sma(close[1],200), lookahead=barmerge.lookahead_on) : sma(close,200) , title="200SMA", color=#ff2fbb, linewidth=1)
| cd89e282aac1bd5b9b00d7a3edbfa76d1b7ed773486d1094116736881dc03faf | ['2381fdd6a16a495eb04ea248d23fcb31'] | I made a simple pine script to draw lines for yesterday high/low and 2 days ago high/low.
study("YY H/L", overlay=true)
plot(security(tickerid, 'D', high[1]), title="Yhigh", trackprice=true, offset=-99999, color=#4caf50, linewidth=2)
plot(security(tickerid, 'D', low[1]), title="Ylow", trackprice=true, offset=-99999, color=#4caf50, linewidth=2)
plot(security(tickerid, 'D', high[2]), title="YYhigh", trackprice=true, offset=-99999, color=#ff9800, linewidth=2)
plot(security(tickerid, 'D', low[2]), title="YYlow", trackprice=true, offset=-99999, color=#ff9800, linewidth=2)
I'd like to hide this indicator when I switch to the Daily time frame, is that possible?
|
570d05dcdf2e344ae17b3cab433a15a69a56f93a76280961cca8a4a089a2d94e | ['238d6db08fbe40bdbfefe4b43c0098dd'] | Thank you very much! That's comprehensible. I have a problem with matching this to my of definition of a polynomial proof system. $w$ would be a representation of $\mathcal{A_1}$ an $\mathcal{A_2}$ and $b$ the described word of length at most $n-1$, right? $R \in P$ because the word problem for NEAs is in P. | 3ca5f04360cc2ca920c0994215b5b661de89ebc425478cc3531d38756ffb999f | ['238d6db08fbe40bdbfefe4b43c0098dd'] | а есть ли в этом фреймворке то что я очень ценю в CI:
1) Form Validation
2) File Upload
3) XSS & CRSF
4) Template Parser
5) MVC
6) Active Record
7) Session
8) Image Manipulation
и т.д.?
Конечно может быть ему это всё не надо, если его попросят расширить функционал сайта, то придётся писать на чистом php все эти библиотеки?
Может сразу взять отличный фреймворк, который весит меньше 1 мб?! |
e71fcb729b0049da8d80e90ef9771889caf11deae0288e9d39d59cae5bd6868e | ['238ea0e5be6b402bbd4d02bba217f0d4'] | I'm trying to install the drivers for a wifi dongle but so far have failed.
Could somone please tell me how to do this?
The manufacture supplied a CD with the following driver
RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
with instructions to compile the drivers, but when I tried to do this I got errors.
lsusb gives
Bus 002 Device 005: ID 148f:7601 Ralink Technology, Corp.
I've tried
sudo apt-get install firmware-realtek
giving
E: Unable to locate package firmware-realtek
Compiling the code gave the following output:
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.13.0-71-generic/build M=/home/terry/rtl8188C modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-71-generic'
CC [M] /home/terry/rtl8188C/core/rtw_cmd.o
CC [M] /home/terry/rtl8188C/core/rtw_security.o
CC [M] /home/terry/rtl8188C/core/rtw_debug.o
CC [M] /home/terry/rtl8188C/core/rtw_io.o
CC [M] /home/terry/rtl8188C/core/rtw_ioctl_query.o
CC [M] /home/terry/rtl8188C/core/rtw_ioctl_set.o
CC [M] /home/terry/rtl8188C/core/rtw_ieee80211.o
CC [M] /home/terry/rtl8188C/core/rtw_mlme.o
CC [M] /home/terry/rtl8188C/core/rtw_mlme_ext.o
CC [M] /home/terry/rtl8188C/core/rtw_wlan_util.o
CC [M] /home/terry/rtl8188C/core/rtw_pwrctrl.o
CC [M] /home/terry/rtl8188C/core/rtw_rf.o
CC [M] /home/terry/rtl8188C/core/rtw_recv.o
CC [M] /home/terry/rtl8188C/core/rtw_sta_mgt.o
CC [M] /home/terry/rtl8188C/core/rtw_ap.o
CC [M] /home/terry/rtl8188C/core/rtw_xmit.o
CC [M] /home/terry/rtl8188C/core/rtw_p2p.o
CC [M] /home/terry/rtl8188C/core/rtw_tdls.o
CC [M] /home/terry/rtl8188C/core/rtw_br_ext.o
CC [M] /home/terry/rtl8188C/core/rtw_iol.o
CC [M] /home/terry/rtl8188C/core/rtw_sreset.o
CC [M] /home/terry/rtl8188C/core/efuse/rtw_efuse.o
CC [M] /home/terry/rtl8188C/hal/hal_intf.o
CC [M] /home/terry/rtl8188C/hal/hal_com.o
CC [M] /home/terry/rtl8188C/hal/dm.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_hal_init.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_phycfg.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_rf6052.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_dm.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_rxdesc.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_cmd.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/usb_halinit.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/rtl8192cu_led.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/rtl8192cu_xmit.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/rtl8192cu_recv.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/usb_ops_linux.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_sreset.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/rtl8192c_xmit.o
CC [M] /home/terry/rtl8188C/hal/rtl8192c/usb/Hal8192CUHWImg.o
CC [M] /home/terry/rtl8188C/os_dep/osdep_service.o
CC [M] /home/terry/rtl8188C/os_dep/linux/os_intfs.o
/home/terry/rtl8188C/os_dep/linux/os_intfs.c: In function ‘rtw_proc_init_one’:
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:313:3: error: implicit declaration of function ‘create_proc_entry’ [-Werror=implicit-function-declaration]
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:313:11: warning: assignment makes pointer from integer without a cast [enabled by default]
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:320:3: error: implicit declaration of function ‘create_proc_read_entry’ [-Werror=implicit-function-declaration]
entry = create_proc_read_entry("ver_info", S_IFREG | S_IRUGO, rtw_proc, proc_get_drv_version, dev);
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:320:9: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("ver_info", S_IFREG | S_IRUGO, rtw_proc, proc_get_drv_version, dev);
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:326:9: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("log_level", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:332:8: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_log_level;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:348:21: warning: assignment makes pointer from integer without a cast [enabled by default]
padapter->dir_dev = create_proc_entry(dev->name,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:379:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("write_reg", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:385:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_write_reg;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:387:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("read_reg", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:393:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_read_reg;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:396:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("fwstate", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:404:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("sec_info", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:412:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("mlmext_state", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:420:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("qos_option", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:427:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("ht_option", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:434:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rf_info", S_IFREG | <PERSON>,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:441:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("ap_info", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:448:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("adapter_state", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:455:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("trx_info", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:462:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("mac_reg_dump1", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:469:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("mac_reg_dump2", S_IFREG | <PERSON>,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:476:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("mac_reg_dump3", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:483:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("bb_reg_dump1", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:490:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("bb_reg_dump2", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:497:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("bb_reg_dump3", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:504:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rf_reg_dump1", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:511:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rf_reg_dump2", S_IFREG | <PERSON>,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:520:9: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rf_reg_dump3", S_IFREG | <PERSON>,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:527:9: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rf_reg_dump4", S_IFREG | <PERSON>,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:537:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("all_sta_info", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:555:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("best_channel", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:561:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_best_channel;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:564:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rx_signal", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:570:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_rx_signal;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:572:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("ht_enable", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:578:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_ht_enable;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:580:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("cbw40_enable", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:586:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_cbw40_enable;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:588:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("ampdu_enable", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:594:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_ampdu_enable;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:596:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rx_stbc", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:602:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_rx_stbc;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:605:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("path_rssi", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:608:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("vid", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:615:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("pid", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:622:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("rssi_disp", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:628:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_rssi_disp;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:631:8: warning: assignment makes pointer from integer without a cast [enabled by default]
entry = create_proc_read_entry("sreset", S_IFREG | S_IRUGO,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:637:7: error: dereferencing pointer to incomplete type
entry->write_proc = proc_set_sreset;
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c: At top level:
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:999:2: warning: initialization from incompatible pointer type [enabled by default]
.ndo_select_queue = rtw_select_queue,
^
/home/terry/rtl8188C/os_dep/linux/os_intfs.c:999:2: warning: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’) [enabled by default]
cc1: some warnings being treated as errors
make[2]: *** [/home/terry/rtl8188C/os_dep/linux/os_intfs.o] Error 1
make[1]: *** [_module_/home/terry/rtl8188C] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-71-generic'
make: *** [modules] Error 2
| bf3139d819334670885e340bd2cfcdf9c1143adc3d7fa99cbe455aebdb484405 | ['238ea0e5be6b402bbd4d02bba217f0d4'] | Ok found answer to 2, just recreate a new user as the problem seemed to be corrupted user settings.
Not sure on 1 but I think it might have been because bleachbit was set to delete user settings. Don't want to check this by experimenting on a working system right now.
|
a37445e01defbd92f3e56201d948840bdc454e80e7504b2a183c97ecd4890485 | ['239e58cd8f4145eaa70d8b71740f1b18'] | When trying to install line_profiler via pip install line_profiler, I keep getting the same error :
Installing collected packages: line-profiler
Running setup.py install for line-profiler ... error
Exception:
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 107: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "c:\program files\python36\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "c:\program files\python36\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 107: invalid start byte
Note : I manually added cl.exe to the PATH variables, because I couldn't get vcvarsall.bat x64 to work.
Any idea on how to fix this? I'm using python 3.6: is line_profiler only for python 2.X?
| 73b1c7fa00ad243b499ff0170cfd81041db8266f852d12956778e3b3bebd0ac7 | ['239e58cd8f4145eaa70d8b71740f1b18'] | The solution
To avoid the problem, the best solution is the following:
a[X] -> b[$X] {% id %}
b[X] -> c[$X] {% id %}
c[X] -> $X {% data => data[0].join('') %}
main -> a["test"] {% id %}
Parse results:
[ 'test' ]
Explanation
The problem was that, when the last sub-macro gets the result, since nearley considers everything as an array by default, the result is nested into an array Then each layer do the same. Using the join method on the array makes it a string - and each macro will stop putting it into an array.
|
fb4179af8c8880b00e46a38cde70286aa97c56aefb83348d4e278a67912dfb18 | ['23b4c6f1027a42b98f2bb862aba31230'] | Ok, after trying a few javascript options I remembered the good old suckerfish menu which had you move the dropdown menu up a few pixels so the hover state would not break as you hovered over the gap between the anchor trigger and the menu itself.
So I kept my script the same but fired it only on desktop widths and then adjusted my CSS to remove the hover gap.
Final Solution: https://codepen.io/JacobLett/pen/jaaQYG
HTML
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Mega Dropdown</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Category</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Category 1
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<div class="container">
<div class="row">
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<a href="">
<img src="https://dummyimage.com/200x100/ccc/000&text=image+link" alt="" class="img-fluid">
</a>
<p class="text-white">Short image call to action</p>
</div>
<!-- /.col-md-4 -->
</div>
</div>
<!-- /.container -->
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Category 2
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<div class="container">
<div class="row">
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<a href="">
<img src="https://dummyimage.com/200x100/ccc/000&text=image+link" alt="" class="img-fluid">
</a>
<p class="text-white">Short image call to action</p>
</div>
<!-- /.col-md-4 -->
</div>
</div>
<!-- /.container -->
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Category 3
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<div class="container">
<div class="row">
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link item</a>
</li>
</ul>
</div>
<!-- /.col-md-4 -->
<div class="col-md-4">
<a href="">
<img src="https://dummyimage.com/200x100/ccc/000&text=image+link" alt="" class="img-fluid">
</a>
<p class="text-white">Short image call to action</p>
</div>
<!-- /.col-md-4 -->
</div>
</div>
<!-- /.container -->
</div>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-light my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav>
CSS
/* adds some margin below the link sets */
.navbar .dropdown-menu div[class*="col"] {
margin-bottom:1rem;
}
.navbar .dropdown-menu {
border:none;
background-color:#0060c8!important;
}
/* breakpoint and up - mega dropdown styles */
@media screen and (min-width: 992px) {
/* remove the padding from the navbar so the dropdown hover state is not broken */
.navbar {
padding-top:0px;
padding-bottom:0px;
}
/* remove the padding from the nav-item and add some margin to give some breathing room on hovers */
.navbar .nav-item {
padding:.5rem .5rem;
margin:0 .25rem;
}
/* makes the dropdown full width */
.navbar .dropdown {position:static;}
.navbar .dropdown-menu {
width:100%;
left:0;
right:0;
/* height of nav-item */
top:45px;
}
/* shows the dropdown menu on hover */
.navbar .dropdown:hover .dropdown-menu, .navbar .dropdown .dropdown-menu:hover {
display:block!important;
}
.navbar .dropdown-menu {
border: 1px solid rgba(0,0,0,.15);
background-color: #fff;
}
}
JS
$(document).ready(function() {
// executes when HTML-Document is loaded and DOM is ready
// breakpoint and up
$(window).resize(function(){
if ($(window).width() >= 980){
// when you hover a toggle show its dropdown menu
$(".navbar .dropdown-toggle").hover(function () {
$(this).parent().toggleClass("show");
$(this).parent().find(".dropdown-menu").toggleClass("show");
});
// hide the menu when the mouse leaves the dropdown
$( ".navbar .dropdown-menu" ).mouseleave(function() {
$(this).removeClass("show");
});
// do something here
}
});
// document ready
});
| a934f7650c91388f390b8fe0390d92c787fa2ed1922b0a0abfa020ffe37fc94b | ['23b4c6f1027a42b98f2bb862aba31230'] | Would like to duplicate a header navigation menu on a sister site but the css applied to the header is comprised of specific and non-specific styles. Is there an easy way to select just the styles needed to duplicate a chunk of html on a page or is the only way to select each child element at a time and copy and paste the CSS?
<header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Clients</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</header>
|
9962eece99781412cf7f6bb19ea5e9ba8da79739fad0cbf2f59a8e8ea5aae3da | ['23b86a15f52948a4badefb8e4c95b2f3'] | I'm writing an RPC middleware in C++. I have a class named RPCClientProxy that contains a socket client inside:
class RPCClientProxy {
...
private:
Socket* pSocket;
...
}
The constructor:
RPCClientProxy<IP_ADDRESS>RPCClientProxy(host, port) {
pSocket = new Socket(host, port);
}
As you can see, I don't need to tell the user that I have a socket inside.
Although, to make unit tests for my proxies it would be necessary to create mocks for sockets and pass them to the proxies, and to do so I must use a setter or pass a factory to the sockets in the proxies's constructors.
My question: According to TDD, is it acceptable to do it ONLY because the tests? As you can see, these changes would change the way the library is used by a programmer.
| 0563076aa14f2fd26b7964b775ea44e8b9858bd337aa272ae5fba20d627bfe4a | ['23b86a15f52948a4badefb8e4c95b2f3'] | What if I'd like to use a select menu, but with filtered options in a second page?
Is it a good idea?
In the following example I created a select menu and a filtered listview in separated pages:
...
<select id="myselect" name="myselect" data-native-menu="false" multiple="multiple">
...
<ul id="dataPointList" data-role="listview" data-filter="true">
...
I update the select menu every time the checkboxes are changed.
Coming back to the first page we can see the select menu with the right options selected.
Here is the code: http://jsfiddle.net/leandrocosta/NwbZu/108/
|
dbd83b3e1ec142d2f7ae07993c4fd014c5b3ba67a695b70e60e85f5241539189 | ['23c172fedf85471b9cda8e67b03268ec'] | I think it would be worth looking at the possible values for side BC. We know that 2 < BC < 8 so from there you can look at what happens in a few cases using AB^2 + AC^2 = 2(AD^2 + BD^2), and from this you should be able to determine the answer. | dd0ef3ee18940ba158b092fc3e35e036691563a49e9758877c934bd5ba3535fe | ['23c172fedf85471b9cda8e67b03268ec'] | I recently read this article http://blog.mathfights.com/once-upon-a-time-on-imo/ where the author discusses an IMO problem from 2006 that only about 20 participants out of 600 were able to solve. So this got me wondering, have there ever been any IMO problems where no contestant was able to solve it.If not does any one know of any other problems with only a few number of correct solutions?
|
8f8dbbbca1b86f1c8ffe8037b5dfde336abc28e3bda8d72553b3c4b3470189a1 | ['23c2430a79c94356a0f8d34cb2a48eca'] | Try wrapping your elements with Div container to control the position.
This is a hacky way of doing it. But you can adjust the .center class to get it where you want on the page, i.e. adjust the right: and/or left properties.
.container {
position: center;
width: 100%;
}
.center {
position: absolute;
right: 30%;
width: 300px;
background-color: #b0e0e6;
}
figure{
display: inline-block;
margin: 0 auto;
}
figure img{
vertical-align: top;
}
figure figcaption{
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="center">
<figure>
<img src="apple.jpg" alt='apple/>
<figcaption>Apple</figcaption>
</figure>
<figure>
<img src="apple.jpg" alt='apple'/>
<figcaption>Apple</figcaption>
</figure>
<figure>
<img src="apple.jpg" alt='apple'/>
<figcaption>Apple</figcaption>
</figure>
</div>
</div>
| c952abeaa3069c2ebcd1e4639ce826ba4029cb1e2dd827575861c55093de7cc5 | ['23c2430a79c94356a0f8d34cb2a48eca'] | Yes there is a difference. Most regex engines have flags you can specify to search for whitespace or newlines. for example in python to match whitespace you would do re.match(r'\s', yourVar) the '\s' matches whitespace. the two slashes you are referring to '//' that is used in many languages to represent the regular expression. e.g. /\s/ your expression would go between the two.
Hope this helps
|
d15a949d738afc81486fa4557bb234416fc1a5ea403610ff2b9f27291b937450 | ['23cb13bf8965438ea15e72ba6257b2ad'] | I already know how to change the text in label box by with a text field:
self.titleLabel.text = self.textField.text
How do I add static text to text that is being entered?
If in the textField a name is entered, how do get the label box to display a "Hi," then whatever text that was entered?
What do I have to put in front of self.textField.text after the "=" sign?
| 4a65c918c8600680e8fdf6c7d2261045b6e1a76875153ab86a23ab8583553b7c | ['23cb13bf8965438ea15e72ba6257b2ad'] | I am a Xcode newbie, please help.
So I know how to change the text in Label box by with a text field:
self.textLabel.text = self.textField.text
The question is: how do I add static text to text that is being entered?
Like if in the textField a name is entered, how do get the label box to display a "Hi," then whatever text that was entered?
What do I have to put in front of "self.textField.text" after the "=" sign ?
Thanks
|
e6735c1e91d8bc7c5bce85298cc21919ef361f80bb5f54836de0ce88cd4dfaf6 | ['23d5c1e0014240c7b6850dcb9c736052'] | good evening,
im trying to write a programme that extracts the sell price of certain stocks and shares on a website called hl.co.uk
As you can imagine you have to search for the stock you want to see the sale price of.
my code so far is as follows:
import requests
from bs4 import BeautifulSoup as soup
url = "https://www.hl.co.uk/shares"
page = requests.get(url)
parsed_html = soup(page.content, 'html.parser')
form = parsed_html.find('form', id="stock_search")
input_tag = form.find('input').get('name')
submit = form.find('input', id="stock_search_submit").get('alt')
post_data = {input_tag: "fgt", "alt": submit}
i have been able to extract the correct form tag and the input names i require. but the website has multiple forms on this page.
how can i submit a post request to this website using the data i have in "post_data" to that specfic form in order for it to search the stockk/share that i desire and then give me the next page?
thanks in advance
| 96ff19c417037815792db4724c0da77c020b1d0e138c2394690f1bf68367217e | ['23d5c1e0014240c7b6850dcb9c736052'] | As part of an online course I've wrote a programme that can guess passwords for an online login page. However im trying to write is so it also guesses the username. I'm very happy with what I've done so far but it can be better. I don't expect anybody to re-write it for me, but if you could have a look over it and point me in the right direction. essentially what i would like is for it to continue using a words list and to check 1 user name to all passwords. for example;
WORDLIST
abc
abb
acc
first use abc and check abc, abb, acc
secondly use abb and check abc, abb, acc
lastly use acc and check abc, abb, acc
Any help would be greatly appreciated. I am very new to programming. here is my code;
#!/usr/bin/env python
import requests
target_url = "http://<IP_ADDRESS>/dvwa/login.php"
data_dict = {"username": "admin", "password": "", "Login": "submit"}
with open("/root/Documents/hotmail.txt", "r") as wordlist:
count = 0
for line in wordlist:
word = line.strip()
data_dict["password"] = word
response = requests.post(target_url, data=data_dict)
count +=1
print("\r[+] ATTEMPTS MADE = " + str(count), end="")
if b"Login failed" not in response.content:
print("\n[+] PASSWORD FOUND ---- >>>> " + word)
exit()
print("[-] PASSWORD NOT FOUND")
|
7744c23eb3f376fc873a45fc7cd644fad8251e7866ca3dd9a7fa962f919093a7 | ['23d94e932a4949a6aaed102529fc52c9'] | CREATE PROCEDURE sp_product_listing
(
@product varchar(30),
@month datetime,
@year datetime
)
AS
SELECT
'product_name' = products.name,
products.unit_price,
products.quantity_in_stock,
'supplier_name' = suppliers.name
FROM
suppliers
INNER JOIN
products ON suppliers.supplier_id = products.supplier_id
INNER JOIN
order_details ON products.product_id = order_details.product_id
INNER JOIN
orders ON order_details.order_id = orders.order_id
WHERE
products.name = @product
AND MONTH ('orders.order_date') = @month
AND YEAR ('orders.order_date') = @year;
GO
When some try to execute the procedure with wrong input, instead of getting this error message catch in exception block
Msg 8114, Level 16, State 5, Procedure sp_product_listing, Line 0
Error converting data type varchar to datetime.
| 677c86305f52440242a8becf4a0a226514ee64f42ef5b45906365749fedcca02 | ['23d94e932a4949a6aaed102529fc52c9'] | USE DYNAMIC QUERY
Test code is below
-- DDL for Table TMP_TEST
--------------------------------------------------------
CREATE TABLE "TMP_TEST"
( "NAME" VARCHAR2(20),
"APP" VARCHAR2(20)
);
/
SET DEFINE OFF;
Insert into TMP_TEST (NAME,APP) values ('suhaib','2');
Insert into TMP_TEST (NAME,APP) values ('suhaib','1');
Insert into TMP_TEST (NAME,APP) values ('shahzad','3');
Insert into TMP_TEST (NAME,APP) values ('shahzad','2');
Insert into TMP_TEST (NAME,APP) values ('shahzad','5');
Insert into TMP_TEST (NAME,APP) values ('tariq','1');
Insert into TMP_TEST (NAME,APP) values ('tariq','2');
Insert into TMP_TEST (NAME,APP) values ('tariq','6');
Insert into TMP_TEST (NAME,APP) values ('tariq','4');
/
CREATE TABLE "TMP_TESTAPP"
( "APP" VARCHAR2(20)
);
SET DEFINE OFF;
Insert into TMP_TESTAPP (APP) values ('1');
Insert into TMP_TESTAPP (APP) values ('2');
Insert into TMP_TESTAPP (APP) values ('3');
Insert into TMP_TESTAPP (APP) values ('4');
Insert into TMP_TESTAPP (APP) values ('5');
Insert into TMP_TESTAPP (APP) values ('6');
/
create or replace PROCEDURE temp_test(
pcursor out sys_refcursor,
PRESULT OUT VARCHAR2
)
AS
V_VALUES VARCHAR2(4000);
V_QUERY VARCHAR2(4000);
BEGIN
PRESULT := 'Nothing';
-- concating activities name using comma, replace "'" with "''" because we will use it in dynamic query so "'" can effect query.
SELECT DISTINCT
LISTAGG('''' || REPLACE(APP,'''','''''') || '''',',')
WITHIN GROUP (ORDER BY APP) AS temp_in_statement
INTO V_VALUES
FROM (SELECT DISTINCT APP
FROM TMP_TESTAPP);
-- designing dynamic query
V_QUERY := 'select *
from ( select NAME,APP
from TMP_TEST )
pivot (count(*) for APP in
(' ||V_VALUES|| '))
order by NAME' ;
OPEN PCURSOR
FOR V_QUERY;
PRESULT := 'Success';
Exception
WHEN OTHERS THEN
PRESULT := SQLcode || ' - ' || SQLERRM;
END temp_test;
|
bcc8c158d587a86bc1b598047000a6d7cb97438efd00a32520a6226192579879 | ['23eeb7e5daa94e9c8bdcb1f487630b75'] | I create a simple question->answer command.
Code write in Ruby
I send message to user like this:
HTTP.post(bot_send_message_uri, :json => {
'chat_id'=> message['chat']['id'],
'text'=> "You sure?",
'reply_markup'=> {
'force_reply' => true,
'keyboard'=> [['Yes!'],['No!']],
'one_time_keyboard'=> true,
'selective'=> true
}
})
How can I find out how the user responded to the message?
| e9c0dcea10413d17d307e47bb9d400a7fda1d4cea191e4c806ca6d558c7db066 | ['23eeb7e5daa94e9c8bdcb1f487630b75'] | I have some trouble. I am using this plugin "angular-masonry" (it's on Github) to dynamically build the grid on the page. When the page loads I get this:
http://joxi.ru/YBQPVP3JTJCwfIgLgbc
Here is my code:
<div class="container" style="width:80%">
<h1 style="text-align: center; margin-bottom: 40px">
Category: {{category.text}}
</h1>
<div>(masonry='' load-images="false")
<div class="masonry-brick" ng-repeat="portal in category.claim_portals" style='width:50%;float:left'>
<div>
<h3>(style='margin-left:30px')
Portal: {{portal.text}}
</h3>
<div class="category-list" ng-repeat="claim in portal.portal_claim" style="margin-bottom:2px">
<div class="claim_sections">
<claimforlist claim="claim"></claimforlist>
</div>
</div>
</div>
</div>
</div>
</div>
But after resizing browser window, everything becomes normal and looks like this:
http://joxi.ru/iBQPVP3JTJCUfLnoqQQ
I think that view loads earlier than JSON data arrives.
Can anyone help and tell me how can I load view after the data has arrived? Or if you know another reason of such an issue, please reply.
Thanks in advance.
|
0b91f6d81813d554b0371be0259975d8dadea97ceb82ae00cec2b786a558b5c6 | ['23f4576708324598baf810c2d76db9cc'] | I need to create a layout that has a toolbar, a (variable height) tab line, a content view and an info view. The entire content must always fill the entire browser window, without causing a scrollbar to appear. Only the content and info panels can have scrollbars, and only when they overflow. My layout so far seems to be working in Chrome, but not in Firefox or Internet Explorer. I can't use absolute positions, because the tab line can vary in height, and I would really like to avoid using JavaScript for layout.
Right now I have this markup:
<body>
<table>
<tr>
<td colspan="2" class="toolbar">toolbar</td>
</tr>
<tr class="tabs">
<td colspan="2" class="tabs">tabs</td>
</tr>
<tr>
<td class="content">
<div>content content content content</div>
</td>
<td class="info">info</td>
</tr>
</table>
</body>
And this css:
html, body, body > table {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
box-sizing: border-box;
}
body > table {
border-collapse: collapse;
border-spacing: 0;
}
body > table > tbody > tr > td {
padding: 0;
vertical-align: top;
}
.toolbar { background-color: red; }
.tabs { background-color: green; }
.content {
background-color: blue;
height: 100%;
}
.content > div {
height: 100%;
overflow: auto;
}
.info {
background-color: yellow;
width: 300px;
}
It must look like this:
| 30438a278b987e8d06cf7d780424a180e285d9f9f45d216df98679be6abc2da4 | ['23f4576708324598baf810c2d76db9cc'] | I'm making a roulette widget using jQuery widget factory (see it at http://stuff.manisto.dk/roulette/). To make it easier for people to use, I specify some default options, such as the elements.
The problem is, when I specify an element array that is smaller than the default options (see http://stuff.manisto.dk/roulette/?elements=stack;overflow), the remaining elements are still displayed.
How to fix this? And why does jQuery copy all of the array values instead of supplying the new array, if one is specified?
By the way, you can view the code at http://bitbucket.org/manisto/jroulette/src.
|
143e62c8fbf131609aa74c3377d1c4b2e54a615b68f1c6079ba7b3d6fed09df6 | ['240bba248111434cb9f055aa35172de6'] | I just got myself a new screen (Lenovo P27H). It comes with USB-C, so I planned to use my laptop (Tuxedo InfinityBook from 2015 running elementaryOS - so basically Ubuntu 18 LTS) with this screen by its USB-C port, so I could charge it, use the second screen as video output, and connecting peripheries to the screen's USB hub, all at once. This works perfectly with my Lenovo Thinkpad running Windows 10, but not with this laptop.
The laptop doesn't show any reaction whatsoever when I plug in the USB-C wire. I'm watching dmesg -w and nothing shows up.
I tried to connect another device to the laptop by USB-C (an Ethernet adapter), which works nicely, so the port is probably not broken or anything.
On some websites, I have read that there is currently no support in the Linux kernel for video over USB-C. Could this be the simple reason and I cannot do much about it besides waiting?
Can somebody please give me a hint on how I can further debug this?
| 337cd2b2474a6a16ec6cd3e6aba0a2c7f0ebafb7babcbfa6ff45c704619fd1dc | ['240bba248111434cb9f055aa35172de6'] | I finally figured out what the problem was. Just add ProxyPreserveHost on in the Apache config and everything works nicely. I cannot provide any details about why this did the trick, maybe somebody more experienced with Apache can give some insights.
The full vHost configuration looks like this:
<VirtualHost *:80>
ServerAlias *.customdomain.com
<Location />
ProxyPreserveHost on
ProxyPass http://localhost:9081/
ProxyPassReverse http://localhost:9081/
</Location>
</VirtualHost>
|
6abc15a4a70bf18af66943986a6540b7d92eb877ef1c24321ca6179cd457b6c5 | ['242695fcced44030b4a640e395efce6b'] | Интересует такой вопрос, как можно упростить данный скрипт?
Учитывая то, что он будет еще больше так как хешей еще 3 штуки, каким образом можно сократить его, сделать более мобильным? Заранее благодарен.
$(window).bind('hashchange', function () {
if (window.location.hash == '#home') {
$('.topnav').css('background-color', '#341f76').css('color', '#000');
$('.bottomnav').css('background-color', '#341f76').css('color', '#000');
$('section.nav div.topnav ul.right a.cta').css('background-color', '#522bcb').css('color', '#fff');
$('section.nav div.bottomnav ul li a').css('color', '#fff');
$('section.nav div.topnav h1').css('color', '#fff');
$('section.nav div.topnav ul li i').css('color', '#fff');
$('section.nav div.topnav ul.right a.phone').css('color', '#fff');
$("section.nav div.bottomnav ul li a").removeClass("active");
$('.menu1').addClass('active');
}
if (window.location.hash == '#about') {
$('.topnav').css('background-color', '#ffa201').css('color', '#000');
$('.bottomnav').css('background-color', '#ffa201').css('color', '#000');
$('section.nav div.topnav ul.right a.cta').css('background-color', '#ffcc01').css('color', '#151515');
$("section.nav div.bottomnav ul li a").removeClass("active");
$('.menu2').addClass('active');
}
if (window.location.hash == '#services') {
$('.topnav').css('background-color', '#<PHONE_NUMBER>').css('color', '#fff');
$('.bottomnav').css('background-color', '#<PHONE_NUMBER>').css('color', '#fff');
$('section.nav div.topnav ul.right a.cta').css('background-color', '#4d6680').css('color', '#fff');
$('section.nav div.bottomnav ul li a').css('color', '#fff');
$('section.nav div.topnav h1').css('color', '#eee');
$('section.nav div.topnav ul li i').css('color', '#eee');
$('section.nav div.topnav ul.right a.phone').css('color', '#eee');
$("section.nav div.bottomnav ul li a").removeClass("active");
$('.menu3').addClass('active');
}
});
| 62724706de25f44b5b9e4481d092171ea02c2fba21ac6227f218a7c37024bcac | ['242695fcced44030b4a640e395efce6b'] | Хочу сделать возможным редактирование конкретной статьи, а не всех имеющихся, не могу построить правильный запрос:
В этом случае возникает ошибка:
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<?php
include 'bd.php';
$zagolovok = $_POST['zagolovok'];
$smallopisanie = $_POST['smallopisanie'];
$opisanie = $_POST['opisanie'];
$editid = $_GET[edit];
$result = mysql_query("UPDATE news WHERE id = '$editid' SET zagolovok = replace('$zagolovok','zagolovok','$zagolovok')");
if (!$result) {
die('Неверный запрос: ' . mysql_error());
}
if ($result) {
echo "<center><p style='color: #404040; font-size: 24px; text-decoration: none; font-family: 'Gerbera''>Статья отредактирована</p><br><a style='color: #1d97e1; font-size: 24px; text-decoration: none; font-family: 'Gerbera'' href='adminpanel'>Назад в админ-панель</div></a></center>";
}
?>
В этом случае редактируются все статьи:
<?php
include 'bd.php';
$zagolovok = $_POST['zagolovok'];
$smallopisanie = $_POST['smallopisanie'];
$opisanie = $_POST['opisanie'];
$result = mysql_query("UPDATE news SET zagolovok = replace('$zagolovok','zagolovok','$zagolovok' WHERE id = '$editid')");
if (!$result) {
die('Неверный запрос: ' . mysql_error());
}
if ($result) {
echo "<center><p style='color: #404040; font-size: 24px; text-decoration: none; font-family: 'Gerbera''>Статья отредактирована</p><br><a style='color: #1d97e1; font-size: 24px; text-decoration: none; font-family: 'Gerbera'' href='adminpanel'>Назад в админ-панель</div></a></center>";
}
?>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.