PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
2,335,555
02/25/2010 16:16:30
83,639
03/27/2009 14:05:32
28
0
How to remove a reference in mongodb?
I have the following object { "_id" : ObjectId("4b8699aa3b97dc29dd000000"), "name" : "test", "email" : "test", "url" : "test", "items" : [ { "$ref" : "item", "$id" : ObjectId("4b866a043b97dc22a9000001") } ]} How can I remove the reference from items? I have the objectid for the reference?
mongodb
null
null
null
null
null
open
How to remove a reference in mongodb? === I have the following object { "_id" : ObjectId("4b8699aa3b97dc29dd000000"), "name" : "test", "email" : "test", "url" : "test", "items" : [ { "$ref" : "item", "$id" : ObjectId("4b866a043b97dc22a9000001") } ]} How can I remove the reference from items? I have the objectid for the reference?
0
5,154,530
03/01/2011 12:29:53
277,826
02/20/2010 21:01:00
412
19
wxpython: nested sizers, and little square in top left corner?
I'm trying to look into wxPython and sizers, and I put together the following example: import wx class MyTestFrame(wx.Frame): def __init__(self, parent, title): super(MyTestFrame, self).__init__(parent, title=title, size=(250, 150)) # the master panel of the frame - "Add a panel so it looks correct on all platforms" self.panel = wx.Panel(self, wx.ID_ANY) # want these buttons absolutely positioned btn_A = wx.Button(self, id=1, label='A', pos=(10, 10), size=(30, 30)) btn_A.SetBackgroundColour(wx.Colour(224, 124, 124)) btn_B = wx.Button(self, id=2, label='B', pos=(45, 10), size=(30, 30)) btn_C = wx.Button(self, id=3, label='C', pos=(80, 10), size=(30, 30)) # additional object mastersizer = wx.BoxSizer(wx.VERTICAL) btnsizer = wx.BoxSizer(wx.HORIZONTAL) btnsizer.Add(btn_A, 0) btnsizer.Add(btn_B, 0) btnsizer.Add(btn_C, 0) mastersizer.Add(btnsizer, 1, wx.EXPAND) self.panel.SetSizer(mastersizer) #~ mastersizer.Fit(self) # makes the window as large as the buttons self.Centre() self.Show() if __name__ == '__main__': app = wx.App() MyTestFrame(None, 'Test') app.MainLoop() When I run this, I get a window like on the image: ![wxPython window][1] Can someone explain, why do I get that gray little square in the upper left corner - and what would be the correct way to implement the code? (The button is deliberately colored, so it can be obvious.. ) I'm on Ubuntu Lucid, in case this is platform specific. Thanks in advance for any answers, Cheers! [1]: http://i.stack.imgur.com/XgEtd.png
wxpython
sizer
null
null
null
null
open
wxpython: nested sizers, and little square in top left corner? === I'm trying to look into wxPython and sizers, and I put together the following example: import wx class MyTestFrame(wx.Frame): def __init__(self, parent, title): super(MyTestFrame, self).__init__(parent, title=title, size=(250, 150)) # the master panel of the frame - "Add a panel so it looks correct on all platforms" self.panel = wx.Panel(self, wx.ID_ANY) # want these buttons absolutely positioned btn_A = wx.Button(self, id=1, label='A', pos=(10, 10), size=(30, 30)) btn_A.SetBackgroundColour(wx.Colour(224, 124, 124)) btn_B = wx.Button(self, id=2, label='B', pos=(45, 10), size=(30, 30)) btn_C = wx.Button(self, id=3, label='C', pos=(80, 10), size=(30, 30)) # additional object mastersizer = wx.BoxSizer(wx.VERTICAL) btnsizer = wx.BoxSizer(wx.HORIZONTAL) btnsizer.Add(btn_A, 0) btnsizer.Add(btn_B, 0) btnsizer.Add(btn_C, 0) mastersizer.Add(btnsizer, 1, wx.EXPAND) self.panel.SetSizer(mastersizer) #~ mastersizer.Fit(self) # makes the window as large as the buttons self.Centre() self.Show() if __name__ == '__main__': app = wx.App() MyTestFrame(None, 'Test') app.MainLoop() When I run this, I get a window like on the image: ![wxPython window][1] Can someone explain, why do I get that gray little square in the upper left corner - and what would be the correct way to implement the code? (The button is deliberately colored, so it can be obvious.. ) I'm on Ubuntu Lucid, in case this is platform specific. Thanks in advance for any answers, Cheers! [1]: http://i.stack.imgur.com/XgEtd.png
0
7,552,550
09/26/2011 08:35:06
840,145
07/12/2011 06:16:10
79
0
renaming a temporary table into a physical one
Can I do something like this? create table #tbl_tmp (col1 int) insert into #tbl_tmp select 3 exec sp_rename '#tbl_tmp','tbl_new'
sql
sql-server
sql-server-2008
null
null
null
open
renaming a temporary table into a physical one === Can I do something like this? create table #tbl_tmp (col1 int) insert into #tbl_tmp select 3 exec sp_rename '#tbl_tmp','tbl_new'
0
11,507,719
07/16/2012 15:41:50
1,419,400
05/26/2012 19:15:54
12
0
C# Saving GIF or JPG.... how to improve the quality?
I screen captured the desktop and saved in jpg and gif the quality of png file is perfect. However, the quality of jpg and gif seems little bit low... Is there way to improve this?
c#
gif
jpg
null
null
07/16/2012 16:49:42
not a real question
C# Saving GIF or JPG.... how to improve the quality? === I screen captured the desktop and saved in jpg and gif the quality of png file is perfect. However, the quality of jpg and gif seems little bit low... Is there way to improve this?
1
9,917,601
03/29/2012 00:29:55
1,299,522
03/29/2012 00:14:24
1
0
Preventing SQL injection asp.net in C#
I have been trying to cure this site of SQL injection and a page I have been working on has had me stopped for 2 days. So far I am validating user input from the client site using. RegularExpressionValidator. On this page this is the only typed input from the user. There is also a dynamic drop down that is being verified using server-side verification. Data from the username textbox is also being validated on the client side using Regex. Initially I converted all of the queries to be parameterized queries. Since I have converted all of the parameterized queries to stored procedures. Now I am at a loss on where to go next. From searching forumns the mix of client-side validation and parameterized queries will generally secure against injection. I feel like I am missing something here. Attached is the code for the page as well as the usercontroll in c#. Any direction would be greatly appreciated! ####################################################################################### <%@ Control Language="C#" AutoEventWireup="true" Inherits="EPayment.AdminSite.AssignUsersUC" %> <script runat="server" type="text/javascript" > </script> <div style="float:left;width:120px"><asp:Label ID="UserNameLbl" runat="server" Text="User Logon:" CssClass="label"></asp:Label></div> <div style="float:left; height: 22px;"><asp:TextBox ID="UserNameTxt" runat="server" OnTextChanged="UserNameTxt_TextChanged"></asp:TextBox> <asp:RegularExpressionValidator id="RegularExpressionValidator1" ControlToValidate="userNameTxt" ValidationExpression="[a-zA-Zs0-9]{1,40}$" AutoPostBack="true" Display="Static" ErrorMessage="Username must contain only Alpha-Numeric Characters" EnableClientScript="False" runat="server"/> <div style="float:left"> <asp:DropDownList ID="ddlcompany" runat="server" AutoPostBack="true" DataTextField="CompanyName" DataValueField="CompanyId" OnSelectedIndexChanged="ddlcompany_SelectedIndexChanged" > </asp:DropDownList></div> </div> <br /> <div style="clear:both"><asp:Label ID="companyLbl" runat="server" Text="Company:" CssClass="label"></asp:Label> </div> <br /> <div> <asp:Button ID="btngetroles" Text="GetRoles" runat="server" Visible="false" OnClick="btngetroles_Click" /><asp:Button ID="btngetuserobject" Text="GetUserId" runat="server" Visible="false" OnClick="btngetuserobject_Click" /></div> <div class="sectionRow" style="width:100%;">Roles: </div> <br /> <div style="width:600px"> <asp:GridView ID="GV" runat="server" DataKeyNames="RoleId" AutoGenerateColumns="false" Width="100%" ShowHeader="true" ShowFooter="false" PageSize="100" CellPadding="7"> <HeaderStyle CssClass="gridHdr" /> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox id="CheckBox2" runat="server" AutoPostBack="True" ></asp:CheckBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Role Description" > <ItemTemplate > <%# DataBinder.Eval(Container.DataItem, "RoleDesc").ToString().Trim() %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> <br /> <div style="float:left;width:120px"><asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /> <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" /> </div> <div> <asp:Label ID="Result" runat="server" ForeColor="red"></asp:Label></div> #################################################################################### using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using EPayment.DatabaseConnectors; using EPayment.DataObjects; using EPayment.Common; using ESource.Security; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text.RegularExpressions; using ESource.Installation; namespace EPayment.AdminSite { public partial class AssignUsersUC : System.Web.UI.UserControl { private string ConnectionString; protected SYUserConnector syuserconnector; protected SYTaskConnector sytaskconnector; protected SYRoleConnector syroleconnector; protected SYTask sytask; protected SYUser syuser; protected SYRole syrole; protected SYUtility syutility; private DBConnString dbconn; private string dbFilePath; private string logFilePath; protected TextBox UserNameTxt; protected DropDownList ddlcompany; protected GridView GV; //protected TextBox UserIdtxt; protected Label Result; private MerchantDBConnector mConnector; private InstallationManager dbReg; protected void Page_Load(object sender, EventArgs e) { UserNameTxt.AutoPostBack = true; syuserconnector = new SYUserConnector(); syuserconnector.SetConnection(ConnectionString); syroleconnector = new SYRoleConnector(); syroleconnector.SetConnection(ConnectionString); sytaskconnector = new SYTaskConnector(); sytaskconnector.SetConnection(ConnectionString); syutility = new SYUtility(); syutility.SetConnection(ConnectionString); syuser = new SYUser(); if (!IsPostBack) { DataTable dt = new DataTable(); dt = syutility.GetSYCompanies(); ddlcompany.DataSource = dt; ddlcompany.DataBind(); ArrayList companies = mConnector.GetGPCompanyIds(); foreach (string[] company in companies) { ddlcompany.SelectedIndex = -1; ddlcompany.Items.FindByText(company[1]); //Context.Response.Write(ddlcompany.SelectedItem.Text + "<br>"); //Context.Response.Write("Before:" + company[1] + "<br>"); //Context.Response.Write("Before Company ID:" + company[0] + "<br>"); if (ddlcompany.SelectedItem.Text.Trim() == company[1].Trim()) { //Context.Response.Write("if:" + ddlcompany.SelectedItem.Text.Trim() + "<br>"); //Context.Response.Write("Company Name:" + company[1] + "<br>"); //Context.Response.Write("Company ID:" + company[0] + "<br>"); } else { //Context.Response.Write("else:" + ddlcompany.SelectedItem.Text.Trim() + "<br>"); //Context.Response.Write("Company ID:" + company[0] + "<br>"); DBConnString epConn = new DBConnString(logFilePath, dbFilePath); dbReg.InsertGPCompanyIntoSYCompany(epConn.StrGPServer, epConn.StrGPUser, epConn.StrGPPass, ConfigurationManager.AppSettings["EPaymentDBName"], company[0], company[1]); //ddlcompany.Items.Add(new ListItem(company[1], company[0])); dt = syutility.GetSYCompanies(); ddlcompany.Items.Clear(); ddlcompany.DataSource = dt; ddlcompany.DataBind(); } } //ddlcompany.Items.Insert(0, new ListItem("ViewAll", "ViewAll")); string companyname = ConfigurationManager.AppSettings["EPaymentCompanyERPId"]; string companyID = syutility.GetCompanyId(companyname); DataView dv = new DataView(); dv = syroleconnector.GetAllRoles(companyID, 0); GV.DataSource = dv; GV.DataBind(); } } protected void btngetroles_Click(object sender, EventArgs e) { } protected void ddlcompany_SelectedIndexChanged(object sender, EventArgs e) { Getroles(); } protected void Page_UnLoad(object sender, EventArgs e) { syuserconnector.CloseConnection(); syroleconnector.CloseConnection(); sytaskconnector.CloseConnection(); syutility.CloseConnection(); syuserconnector = null; syroleconnector = null; sytaskconnector = null; syutility = null; syuser = null; } private void Page_Init(System.Object sender, System.EventArgs e) //Handles page_init event { string serverPath = Request.PhysicalApplicationPath; dbFilePath = serverPath + "include\\dbconn.txt"; logFilePath = serverPath + "logs\\azoxlog.txt"; dbconn = new DBConnString(logFilePath, dbFilePath); ConnectionString = dbconn.StrEPConnString; MerchantAccount m = new MerchantAccount(); mConnector = new MerchantDBConnector(dbFilePath, logFilePath, m); dbReg = new InstallationManager(); dbReg.UseLogFile = true; dbReg.LogFilePath = logFilePath; } protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { syuser = new SYUser(); //Regex r = new Regex("^[a-zA-Z0-9]*$"); //if (r.IsMatch(UserNameTxt.Text.Trim())) //{ string username = UserNameTxt.Text; string companyID = ddlcompany.SelectedItem.Value; ArrayList companies = mConnector.GetGPCompanyIds(); //bool found = companies.Contains(companyID); //if (found == true) //{ string userid = syuserconnector.GetUserId(username, companyID); if (userid != null && userid != "") { Result.Text = ""; //string userId = UserIdtxt.Text; Collection<string> idsList = new Collection<string>(); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (chk != null && chk.Checked) { string secId = GV.DataKeys[row.RowIndex].Value.ToString(); idsList.Add(secId); //Response.Write("TaskId: " +secId + "<br/>"); //Response.End(); } } syuserconnector.UpdateUserRoles(userid, idsList); //Start Check if user is given access to BatchProcess and add user to ep database so that sql user has access to EP_BatchReport table which is public UserDBConnector userConn = new UserDBConnector(dbFilePath, logFilePath, new EPayment.DataObjects.User()); userConn.CreateUserLogOnForBatchReportAccess(UserNameTxt.Text); //End Result.Text = "Roles are Assigned to the User"; } else { Result.Text = ""; syuser = new SYUser(); syuser.UserName = UserNameTxt.Text; string companyname = ddlcompany.SelectedItem.Text; companyID = ddlcompany.SelectedItem.Value; syuser.CompanyId = companyID; syuser.StoreId = 0; syuser.CreatedBy = Session["userLogon"].ToString(); syuser.ExpireDate = DateTime.Now; userid = syuserconnector.SaveUser(syuser); //UserIdtxt.Text = userid; if (userid != null && userid != "") { //string userId = UserIdtxt.Text; Collection<string> idsList = new Collection<string>(); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (chk != null && chk.Checked) { string secId = GV.DataKeys[row.RowIndex].Value.ToString(); idsList.Add(secId); //Response.Write("TaskId: " +secId + "<br/>"); //Response.End(); } } syuserconnector.UpdateUserRoles(userid, idsList); Result.Text = "User is Added and Roles are assigned to the User"; } //} //} } } //else //{ // Result.Text = "Username can only contain alpha-numeric characters. "; //} } protected void btnReset_Click(object sender, EventArgs e) { resetAllFields(); } private void resetAllFields() { //UserIdtxt.Text = ""; UserNameTxt.Text = ""; Result.Text = ""; ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue("E-Payment")); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } } protected void btngetuserobject_Click(object sender, EventArgs e) { } public void Getroles() { if (ValidatePage() == true) { Page.Validate(); if (Page.IsValid) { string companyID = ddlcompany.SelectedItem.Value; //ArrayList companies = mConnector.GetGPCompanyIds(); //bool found = companies.Contains(companyID); //if (found == true) //{ Result.Text = ""; syuserconnector.UseLogFile = true; syuserconnector.LogFilePath = Request.PhysicalApplicationPath + "logs\\azoxlog.txt"; Collection<string> idsList = new Collection<string>(); string companyname = ddlcompany.SelectedItem.Text; companyID = ddlcompany.SelectedItem.Value; // string ERPcompanyId; //string companyID = ""; //if (companyname == "Fabrikam Inc") //{ // ERPcompanyId = "-1"; // companyID = syutility.GetCompanyId(ERPcompanyId); //} //else //{ // string companyID = syutility.GetCompanyId(companyname); //} //Response.Write(companyID); Regex r = new Regex("[a-zA-Z]{1,40}"); string userid; string username = UserNameTxt.Text; if (username != null && r.IsMatch(UserNameTxt.Text.Trim())) { foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } userid = syuserconnector.GetUserId(username, companyID); //UserIdtxt.Text = userid; // Response.Write("Test:" + userid); if (userid != null && userid != "") { syuser = new SYUser(); syuser = syuserconnector.GetUserObject(userid); idsList = syuser.RoleIds; foreach (GridViewRow row in GV.Rows) { string rolegv = GV.DataKeys[row.RowIndex].Value.ToString(); // Response.Write(securitygv + "<br>"); CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (syuser.RoleIds.Contains(rolegv)) { chk.Checked = true; } } } else { foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } Result.Text = "User not in any roles for " + companyname; } } //else // { // Result.Text = "Enter Username"; // } //} } } } protected void UserNameTxt_TextChanged(object sender, EventArgs e) { //string Username = UserNameTxt.Text; //resetAllFields(); //UserNameTxt.Text = Username; //Page.Validate(); //if (Page.IsValid) //{ if (ValidatePage() == true) { //Regex r = new Regex("[a-zA-Z0-9]*$"); //if (r.IsMatch(UserNameTxt.Text.Trim())) //{ Getroles(); //} } } protected bool ValidatePage() { Page.Validate(); if (Page.IsValid) { Regex r = new Regex("[a-zA-Z0-9]"); if (r.IsMatch(UserNameTxt.Text.Trim())) { return true; } return false; } return false; } } }
c#
asp.net
sql
sql-injection
null
03/29/2012 05:11:17
not a real question
Preventing SQL injection asp.net in C# === I have been trying to cure this site of SQL injection and a page I have been working on has had me stopped for 2 days. So far I am validating user input from the client site using. RegularExpressionValidator. On this page this is the only typed input from the user. There is also a dynamic drop down that is being verified using server-side verification. Data from the username textbox is also being validated on the client side using Regex. Initially I converted all of the queries to be parameterized queries. Since I have converted all of the parameterized queries to stored procedures. Now I am at a loss on where to go next. From searching forumns the mix of client-side validation and parameterized queries will generally secure against injection. I feel like I am missing something here. Attached is the code for the page as well as the usercontroll in c#. Any direction would be greatly appreciated! ####################################################################################### <%@ Control Language="C#" AutoEventWireup="true" Inherits="EPayment.AdminSite.AssignUsersUC" %> <script runat="server" type="text/javascript" > </script> <div style="float:left;width:120px"><asp:Label ID="UserNameLbl" runat="server" Text="User Logon:" CssClass="label"></asp:Label></div> <div style="float:left; height: 22px;"><asp:TextBox ID="UserNameTxt" runat="server" OnTextChanged="UserNameTxt_TextChanged"></asp:TextBox> <asp:RegularExpressionValidator id="RegularExpressionValidator1" ControlToValidate="userNameTxt" ValidationExpression="[a-zA-Zs0-9]{1,40}$" AutoPostBack="true" Display="Static" ErrorMessage="Username must contain only Alpha-Numeric Characters" EnableClientScript="False" runat="server"/> <div style="float:left"> <asp:DropDownList ID="ddlcompany" runat="server" AutoPostBack="true" DataTextField="CompanyName" DataValueField="CompanyId" OnSelectedIndexChanged="ddlcompany_SelectedIndexChanged" > </asp:DropDownList></div> </div> <br /> <div style="clear:both"><asp:Label ID="companyLbl" runat="server" Text="Company:" CssClass="label"></asp:Label> </div> <br /> <div> <asp:Button ID="btngetroles" Text="GetRoles" runat="server" Visible="false" OnClick="btngetroles_Click" /><asp:Button ID="btngetuserobject" Text="GetUserId" runat="server" Visible="false" OnClick="btngetuserobject_Click" /></div> <div class="sectionRow" style="width:100%;">Roles: </div> <br /> <div style="width:600px"> <asp:GridView ID="GV" runat="server" DataKeyNames="RoleId" AutoGenerateColumns="false" Width="100%" ShowHeader="true" ShowFooter="false" PageSize="100" CellPadding="7"> <HeaderStyle CssClass="gridHdr" /> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox id="CheckBox2" runat="server" AutoPostBack="True" ></asp:CheckBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Role Description" > <ItemTemplate > <%# DataBinder.Eval(Container.DataItem, "RoleDesc").ToString().Trim() %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> <br /> <div style="float:left;width:120px"><asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /> <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" /> </div> <div> <asp:Label ID="Result" runat="server" ForeColor="red"></asp:Label></div> #################################################################################### using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using EPayment.DatabaseConnectors; using EPayment.DataObjects; using EPayment.Common; using ESource.Security; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text.RegularExpressions; using ESource.Installation; namespace EPayment.AdminSite { public partial class AssignUsersUC : System.Web.UI.UserControl { private string ConnectionString; protected SYUserConnector syuserconnector; protected SYTaskConnector sytaskconnector; protected SYRoleConnector syroleconnector; protected SYTask sytask; protected SYUser syuser; protected SYRole syrole; protected SYUtility syutility; private DBConnString dbconn; private string dbFilePath; private string logFilePath; protected TextBox UserNameTxt; protected DropDownList ddlcompany; protected GridView GV; //protected TextBox UserIdtxt; protected Label Result; private MerchantDBConnector mConnector; private InstallationManager dbReg; protected void Page_Load(object sender, EventArgs e) { UserNameTxt.AutoPostBack = true; syuserconnector = new SYUserConnector(); syuserconnector.SetConnection(ConnectionString); syroleconnector = new SYRoleConnector(); syroleconnector.SetConnection(ConnectionString); sytaskconnector = new SYTaskConnector(); sytaskconnector.SetConnection(ConnectionString); syutility = new SYUtility(); syutility.SetConnection(ConnectionString); syuser = new SYUser(); if (!IsPostBack) { DataTable dt = new DataTable(); dt = syutility.GetSYCompanies(); ddlcompany.DataSource = dt; ddlcompany.DataBind(); ArrayList companies = mConnector.GetGPCompanyIds(); foreach (string[] company in companies) { ddlcompany.SelectedIndex = -1; ddlcompany.Items.FindByText(company[1]); //Context.Response.Write(ddlcompany.SelectedItem.Text + "<br>"); //Context.Response.Write("Before:" + company[1] + "<br>"); //Context.Response.Write("Before Company ID:" + company[0] + "<br>"); if (ddlcompany.SelectedItem.Text.Trim() == company[1].Trim()) { //Context.Response.Write("if:" + ddlcompany.SelectedItem.Text.Trim() + "<br>"); //Context.Response.Write("Company Name:" + company[1] + "<br>"); //Context.Response.Write("Company ID:" + company[0] + "<br>"); } else { //Context.Response.Write("else:" + ddlcompany.SelectedItem.Text.Trim() + "<br>"); //Context.Response.Write("Company ID:" + company[0] + "<br>"); DBConnString epConn = new DBConnString(logFilePath, dbFilePath); dbReg.InsertGPCompanyIntoSYCompany(epConn.StrGPServer, epConn.StrGPUser, epConn.StrGPPass, ConfigurationManager.AppSettings["EPaymentDBName"], company[0], company[1]); //ddlcompany.Items.Add(new ListItem(company[1], company[0])); dt = syutility.GetSYCompanies(); ddlcompany.Items.Clear(); ddlcompany.DataSource = dt; ddlcompany.DataBind(); } } //ddlcompany.Items.Insert(0, new ListItem("ViewAll", "ViewAll")); string companyname = ConfigurationManager.AppSettings["EPaymentCompanyERPId"]; string companyID = syutility.GetCompanyId(companyname); DataView dv = new DataView(); dv = syroleconnector.GetAllRoles(companyID, 0); GV.DataSource = dv; GV.DataBind(); } } protected void btngetroles_Click(object sender, EventArgs e) { } protected void ddlcompany_SelectedIndexChanged(object sender, EventArgs e) { Getroles(); } protected void Page_UnLoad(object sender, EventArgs e) { syuserconnector.CloseConnection(); syroleconnector.CloseConnection(); sytaskconnector.CloseConnection(); syutility.CloseConnection(); syuserconnector = null; syroleconnector = null; sytaskconnector = null; syutility = null; syuser = null; } private void Page_Init(System.Object sender, System.EventArgs e) //Handles page_init event { string serverPath = Request.PhysicalApplicationPath; dbFilePath = serverPath + "include\\dbconn.txt"; logFilePath = serverPath + "logs\\azoxlog.txt"; dbconn = new DBConnString(logFilePath, dbFilePath); ConnectionString = dbconn.StrEPConnString; MerchantAccount m = new MerchantAccount(); mConnector = new MerchantDBConnector(dbFilePath, logFilePath, m); dbReg = new InstallationManager(); dbReg.UseLogFile = true; dbReg.LogFilePath = logFilePath; } protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { syuser = new SYUser(); //Regex r = new Regex("^[a-zA-Z0-9]*$"); //if (r.IsMatch(UserNameTxt.Text.Trim())) //{ string username = UserNameTxt.Text; string companyID = ddlcompany.SelectedItem.Value; ArrayList companies = mConnector.GetGPCompanyIds(); //bool found = companies.Contains(companyID); //if (found == true) //{ string userid = syuserconnector.GetUserId(username, companyID); if (userid != null && userid != "") { Result.Text = ""; //string userId = UserIdtxt.Text; Collection<string> idsList = new Collection<string>(); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (chk != null && chk.Checked) { string secId = GV.DataKeys[row.RowIndex].Value.ToString(); idsList.Add(secId); //Response.Write("TaskId: " +secId + "<br/>"); //Response.End(); } } syuserconnector.UpdateUserRoles(userid, idsList); //Start Check if user is given access to BatchProcess and add user to ep database so that sql user has access to EP_BatchReport table which is public UserDBConnector userConn = new UserDBConnector(dbFilePath, logFilePath, new EPayment.DataObjects.User()); userConn.CreateUserLogOnForBatchReportAccess(UserNameTxt.Text); //End Result.Text = "Roles are Assigned to the User"; } else { Result.Text = ""; syuser = new SYUser(); syuser.UserName = UserNameTxt.Text; string companyname = ddlcompany.SelectedItem.Text; companyID = ddlcompany.SelectedItem.Value; syuser.CompanyId = companyID; syuser.StoreId = 0; syuser.CreatedBy = Session["userLogon"].ToString(); syuser.ExpireDate = DateTime.Now; userid = syuserconnector.SaveUser(syuser); //UserIdtxt.Text = userid; if (userid != null && userid != "") { //string userId = UserIdtxt.Text; Collection<string> idsList = new Collection<string>(); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (chk != null && chk.Checked) { string secId = GV.DataKeys[row.RowIndex].Value.ToString(); idsList.Add(secId); //Response.Write("TaskId: " +secId + "<br/>"); //Response.End(); } } syuserconnector.UpdateUserRoles(userid, idsList); Result.Text = "User is Added and Roles are assigned to the User"; } //} //} } } //else //{ // Result.Text = "Username can only contain alpha-numeric characters. "; //} } protected void btnReset_Click(object sender, EventArgs e) { resetAllFields(); } private void resetAllFields() { //UserIdtxt.Text = ""; UserNameTxt.Text = ""; Result.Text = ""; ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue("E-Payment")); foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } } protected void btngetuserobject_Click(object sender, EventArgs e) { } public void Getroles() { if (ValidatePage() == true) { Page.Validate(); if (Page.IsValid) { string companyID = ddlcompany.SelectedItem.Value; //ArrayList companies = mConnector.GetGPCompanyIds(); //bool found = companies.Contains(companyID); //if (found == true) //{ Result.Text = ""; syuserconnector.UseLogFile = true; syuserconnector.LogFilePath = Request.PhysicalApplicationPath + "logs\\azoxlog.txt"; Collection<string> idsList = new Collection<string>(); string companyname = ddlcompany.SelectedItem.Text; companyID = ddlcompany.SelectedItem.Value; // string ERPcompanyId; //string companyID = ""; //if (companyname == "Fabrikam Inc") //{ // ERPcompanyId = "-1"; // companyID = syutility.GetCompanyId(ERPcompanyId); //} //else //{ // string companyID = syutility.GetCompanyId(companyname); //} //Response.Write(companyID); Regex r = new Regex("[a-zA-Z]{1,40}"); string userid; string username = UserNameTxt.Text; if (username != null && r.IsMatch(UserNameTxt.Text.Trim())) { foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } userid = syuserconnector.GetUserId(username, companyID); //UserIdtxt.Text = userid; // Response.Write("Test:" + userid); if (userid != null && userid != "") { syuser = new SYUser(); syuser = syuserconnector.GetUserObject(userid); idsList = syuser.RoleIds; foreach (GridViewRow row in GV.Rows) { string rolegv = GV.DataKeys[row.RowIndex].Value.ToString(); // Response.Write(securitygv + "<br>"); CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); if (syuser.RoleIds.Contains(rolegv)) { chk.Checked = true; } } } else { foreach (GridViewRow row in GV.Rows) { CheckBox chk = (CheckBox)row.FindControl("CheckBox2"); chk.Checked = false; } Result.Text = "User not in any roles for " + companyname; } } //else // { // Result.Text = "Enter Username"; // } //} } } } protected void UserNameTxt_TextChanged(object sender, EventArgs e) { //string Username = UserNameTxt.Text; //resetAllFields(); //UserNameTxt.Text = Username; //Page.Validate(); //if (Page.IsValid) //{ if (ValidatePage() == true) { //Regex r = new Regex("[a-zA-Z0-9]*$"); //if (r.IsMatch(UserNameTxt.Text.Trim())) //{ Getroles(); //} } } protected bool ValidatePage() { Page.Validate(); if (Page.IsValid) { Regex r = new Regex("[a-zA-Z0-9]"); if (r.IsMatch(UserNameTxt.Text.Trim())) { return true; } return false; } return false; } } }
1
6,956,690
08/05/2011 13:01:00
862,862
07/26/2011 06:16:58
18
1
Best practice for reusing python code
I have write a python library app(which contains several *.py files). And several of my python projects need to reuse the code in the library app. What's the recommended best practice for reusing python code? Currently I have thought out three options: 1. Copy and paste. This is far away from best practice. It violates the DRY principle.(Don't repeat yourself.) 1. Add the folder of the library app to the environment variable PYTHONPATH: `export PYTHONPATH=/path/to/library/app`. Then every projects on the same computer can reference the code int the library app. 1. And the folder of the library app to sys.path in python code: `sys.path.append('/path/to/library/app')` Among the three options above which one do you prefer? What advantage does it have compared to the other two options? Do you have any other better options? It is much appreciated that if some one with years of python development experiences could answer this question.
python
dry
pythonpath
null
null
06/01/2012 11:02:08
not constructive
Best practice for reusing python code === I have write a python library app(which contains several *.py files). And several of my python projects need to reuse the code in the library app. What's the recommended best practice for reusing python code? Currently I have thought out three options: 1. Copy and paste. This is far away from best practice. It violates the DRY principle.(Don't repeat yourself.) 1. Add the folder of the library app to the environment variable PYTHONPATH: `export PYTHONPATH=/path/to/library/app`. Then every projects on the same computer can reference the code int the library app. 1. And the folder of the library app to sys.path in python code: `sys.path.append('/path/to/library/app')` Among the three options above which one do you prefer? What advantage does it have compared to the other two options? Do you have any other better options? It is much appreciated that if some one with years of python development experiences could answer this question.
4
11,257,393
06/29/2012 06:57:50
290,150
03/10/2010 02:21:20
463
22
Suggestions on python tools or approaches for archaeology on django web service?
We are trying to understand the code base of a django REST webservice, which was developed over about 5 years by 2 generations of developer teams, none of whom are currently around. Do you have any suggestions on python tools or approaches for archaeology on this django web service? It appears these 3 modules can be useful tools: [cProfile][1] [trace][2] [pdb][3] [1]: http://docs.python.org/library/profile.html#instant-user-s-manual [2]: http://docs.python.org/library/trace.html [3]: http://docs.python.org/library/pdb.html
python
django
null
null
null
06/30/2012 05:54:40
not a real question
Suggestions on python tools or approaches for archaeology on django web service? === We are trying to understand the code base of a django REST webservice, which was developed over about 5 years by 2 generations of developer teams, none of whom are currently around. Do you have any suggestions on python tools or approaches for archaeology on this django web service? It appears these 3 modules can be useful tools: [cProfile][1] [trace][2] [pdb][3] [1]: http://docs.python.org/library/profile.html#instant-user-s-manual [2]: http://docs.python.org/library/trace.html [3]: http://docs.python.org/library/pdb.html
1
5,704,993
04/18/2011 15:11:43
281,779
02/26/2010 04:14:41
79
6
Storing result from a callback to a variable
How can I save the result of result.getDistance().inMeters() to distance? public class Route { private double distance; public Route() { distance = 0; run(); } public void run() { Directions.load(query, opts, new DirectionsCallback() { public void onFailure(int statusCode) { Window.alert("Failed to route locations: " + StatusCodes.getName(statusCode) + " " + statusCode); } public void onSuccess(DirectionResults result) { distance = result.getDistance().inMeters(); } ); } public double getDistance() { return distance; } } On my main java file, whenever I do Route route = new Route(); double distance = route.getDistance(); distance will always be 0.
java
gwt
programming-languages
null
null
null
open
Storing result from a callback to a variable === How can I save the result of result.getDistance().inMeters() to distance? public class Route { private double distance; public Route() { distance = 0; run(); } public void run() { Directions.load(query, opts, new DirectionsCallback() { public void onFailure(int statusCode) { Window.alert("Failed to route locations: " + StatusCodes.getName(statusCode) + " " + statusCode); } public void onSuccess(DirectionResults result) { distance = result.getDistance().inMeters(); } ); } public double getDistance() { return distance; } } On my main java file, whenever I do Route route = new Route(); double distance = route.getDistance(); distance will always be 0.
0
6,704,224
07/15/2011 08:11:14
522,728
11/28/2010 04:31:07
58
0
passing two dimensional C style array in Objective C method
**.h file** @interface GameState :NSObject{ int SymbolsPositions[3][5]; } -(void)SaveCurrentGameState:(int **)Array; @end @interface GameViewController : UIViewController { ... int sequence_after_spin[3][5]; ... } -(Void)AMethod; @end **.m file** @implementation GameState -(void)SaveCurrentGameState:(int **)Array { for(int i;i<5;i++) for(int j;j<3;j++) NSLog(@" %d",Array[j][i]); } @end @implimentation GameViewController -(void)AMethod { [instanceOfGameState SaveCurrentGameState:sequence_after_spin]; } @end the application crashes when ever AMethod is called iget following warning warning: incompatible pointer types sending 'int [10][5]' to parameter of type 'int **' [-pedantic]
objective-c
pass-by-reference
null
null
null
null
open
passing two dimensional C style array in Objective C method === **.h file** @interface GameState :NSObject{ int SymbolsPositions[3][5]; } -(void)SaveCurrentGameState:(int **)Array; @end @interface GameViewController : UIViewController { ... int sequence_after_spin[3][5]; ... } -(Void)AMethod; @end **.m file** @implementation GameState -(void)SaveCurrentGameState:(int **)Array { for(int i;i<5;i++) for(int j;j<3;j++) NSLog(@" %d",Array[j][i]); } @end @implimentation GameViewController -(void)AMethod { [instanceOfGameState SaveCurrentGameState:sequence_after_spin]; } @end the application crashes when ever AMethod is called iget following warning warning: incompatible pointer types sending 'int [10][5]' to parameter of type 'int **' [-pedantic]
0
7,292,447
09/03/2011 10:02:42
926,490
09/03/2011 10:02:42
1
0
Need help with soundwidget
I have an rimshot app, that i want to make a widget fore, but can not find af guide on the net to make a widget that play a sound when pressed, can someone help me with that plz. sorry, my english fail :P
android
widget
soundpool
null
null
null
open
Need help with soundwidget === I have an rimshot app, that i want to make a widget fore, but can not find af guide on the net to make a widget that play a sound when pressed, can someone help me with that plz. sorry, my english fail :P
0
11,486,918
07/14/2012 19:49:48
1,526,040
07/14/2012 19:31:17
1
0
accessing webserver on desktop PC through wifi dongle from a tablet
I am running windows 7 on my desktop PC and have installed tomcat webserver. I'm able to bring up the default homepage using http://<localhost>:8080 (or, http://<hostname>:8080) on the desktop browser. I have a D-Link USB wifi dongle and the drivers are installed successfully. I'd want to access the default homepage on my tablet's browser (through wifi) by accessing http://<hostname>:8080). Is this possible? If yes, i'd need pointers on this front. Thanks a lot in advance, Ravi.
usb
webserver
wifi
localhost
dongle
07/14/2012 22:16:33
off topic
accessing webserver on desktop PC through wifi dongle from a tablet === I am running windows 7 on my desktop PC and have installed tomcat webserver. I'm able to bring up the default homepage using http://<localhost>:8080 (or, http://<hostname>:8080) on the desktop browser. I have a D-Link USB wifi dongle and the drivers are installed successfully. I'd want to access the default homepage on my tablet's browser (through wifi) by accessing http://<hostname>:8080). Is this possible? If yes, i'd need pointers on this front. Thanks a lot in advance, Ravi.
2
9,430,432
02/24/2012 12:03:09
425,226
08/19/2010 12:42:18
627
36
jQuery and jsTree - select child nodes by class
Having difficulty checking (checkbox) all nodes by a specific class here is what i have so far, i'm trying to check all the nodes that have the class checkMe $('.MyTree').jstree('check_node', 'li.checkMe'); Unfortunately it doesnt work :) I can only seem to check or unchecl all the nodes by doing $('.MyTree').jstree('check_all'); //or uncheck_all Any ideas? Thanks in advance
jquery
tree
jstree
nodes
null
null
open
jQuery and jsTree - select child nodes by class === Having difficulty checking (checkbox) all nodes by a specific class here is what i have so far, i'm trying to check all the nodes that have the class checkMe $('.MyTree').jstree('check_node', 'li.checkMe'); Unfortunately it doesnt work :) I can only seem to check or unchecl all the nodes by doing $('.MyTree').jstree('check_all'); //or uncheck_all Any ideas? Thanks in advance
0
9,600,096
03/07/2012 10:53:27
1,187,594
02/03/2012 13:30:45
135
10
Details to setup Merchant account
I need to open an account in android market and also need to setup merchant account so can any one please tell me the details need to setup Merchant account. As i know the procedure to setup account for free applications.
android
android-market
merchant-account
null
null
03/08/2012 02:36:51
off topic
Details to setup Merchant account === I need to open an account in android market and also need to setup merchant account so can any one please tell me the details need to setup Merchant account. As i know the procedure to setup account for free applications.
2
8,388,190
12/05/2011 16:07:45
558,386
12/30/2010 14:47:55
76
2
Embed works in Firefox and Safari, but not in Internet Explorer 8
I have a flash-based ad that displays/hides based on some javascript. It works in Firefox, Safari, Chrome ... but not in Internet Explorer 8. This is for donations to a non-profit during the holiday season, so any help would be wonderful. See the [test site](http://demo-studio360.wnyc.net/). Thank you! Peter > <div class="grid_12 alpha omega"> > <script type="text/javascript"> > GA_googleFillSlot("360_dropdown"); > </script><script src="http://pubads.g.doubleclick.net/gampad/ads?correlator=1323096793738&amp;output=json_html&amp;callback=GA_googleSetAdContentsBySlotForSync&amp;impl=s&amp;client=ca-pub-1030295571732009&amp;slotname=360_dropdown&amp;page_slots=360_dropdown&amp;cookie_enabled=1&amp;url=http%3A%2F%2Fdemo-studio360.wnyc.net%2F&amp;lmt=1323096764&amp;dt=1323096793743&amp;biw=1201&amp;bih=961&amp;adk=203353989&amp;ifi=1&amp;u_tz=-360&amp;u_his=2&amp;u_java=true&amp;u_h=1200&amp;u_w=1920&amp;u_ah=1174&amp;u_aw=1920&amp;u_cd=24&amp;u_nplug=10&amp;u_nmime=85&amp;flash=11.0.1&amp;gads=v2&amp;ga_vid=901695308.1323096794&amp;ga_sid=1323096794&amp;ga_hid=1643565815"></script><div id="google_ads_div_360_dropdown_ad_container"><script language="javascript" type="text/javascript" src="http://www.pri.org/developer/js/flash_v3005.js"></script> > > <!-- WDIG_CS_HEADER_END --> > > <!--PIXEL TRACKER--> > > <script src="DWConfiguration/ActiveContent/IncludeFiles/AC_ActiveX.js" type="text/javascript"></script> > > <script src="DWConfiguration/ActiveContent/IncludeFiles/AC_RunActiveContent.js" type="text/javascript"></script> > > > > > > <div id="expand_tracker" style="visibility:hidden;position:absolute;top:0px;left:0px;">&nbsp;</div> > > <!--SHOW AND HIDE FUNCTIONALITY--> > > <script type="text/javascript"> > > var pop_suppress = "true"; > > function show_div(div_id) { > > // hide all the divs > > document.getElementById('pencil').style.display = 'none'; > > document.getElementById('expand').style.display = 'none'; > > document.getElementById('intro583325').style.display = 'none'; > > // show the requested div > > document.getElementById(div_id).style.display = 'block'; > > } > > </script> > > <script type="text/javascript"> > > function auto_show_div(div_id) { > > // hide all the divs > > document.getElementById('pencil').style.display = 'none'; > > document.getElementById('expand').style.display = 'none'; > > document.getElementById('intro583325').style.display = 'none'; > > // show the requested div > > document.getElementById(div_id).style.display = 'block'; > > } > > </script> > > <!--PENCIL AD--> > > <div id="pencil" style="display: none; position: relative; width: 960px; height: 50px; text-align: left; background: none repeat scroll 0% 0% rgb(212, 71, 15);"> > > <img src="http://carboncreative.com/PRI/360banner2Iconic.jpg" height="50" width="960"> > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('expand'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_expand.png" alt="Expand Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--RE-EXPAND AD--> > > <div id="expand" style="display: block; position: relative; width: 960px; height: 230px; background: none repeat scroll 0% 0% rgb(212, 71, 15);"> > > <script language="javascript" type="text/javascript"> > > //<! [CDATA[ > > var SOB=new flashObj(); > > var enc_goto = escape("http://secure.publicbroadcasting.net/pri/banner/pledge.pledgemain"); > > var enc_goto2 = escape(""); > > SOB.ID = "reexpand_ad"; > > SOB.flashFile = "http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf"; > > SOB.DenyIEdl = "TRUE"; > > SOB.wmode = "opaque"; > > SOB.width = "960"; > > SOB.height = "230"; > > SOB.FlashVer = 9; > > SOB.cabVersion = "9,0,0,0"; > > SOB.altTxt = '<a href="http://www.pri.org/give-pri.html" target="_new">Give to PRI</a>'; > > SOB.render(true); > > //]]> > > </script><embed src="http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf" swliveconnect="FALSE" quality="best" scale="exactfit" flashvars="null" wmode="opaque" id="reexpand_ad" name="flash1" menu="false" devicefont="false" salign="lt" allowscriptaccess="Always" allownetworking="All" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="230" width="960"> > > > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('pencil'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_collapse.png" alt="Contract Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--INTRO AD--> > > <div id="intro583325" style="position: relative; width: 960px; height: 230px; text-align: right; display: none;"> > > <script language="javascript" type="text/javascript"> > > //<! [CDATA[ > > var SOB=new flashObj(); > > var enc_goto = escape("http://secure.publicbroadcasting.net/pri/banner/pledge.pledgemain"); > > var enc_goto2 = escape(""); > > > > SOB.ID = "intro_ad"; > > SOB.flashFile = "http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf"; > > SOB.DenyIEdl = "TRUE"; > > SOB.wmode = "opaque"; > > SOB.width = "960"; > > SOB.height = "230"; > > SOB.FlashVer = 9; > > SOB.cabVersion = "9,0,0,0"; > > //SOB.altTxt = '<a href="http://www.pri.org/give-pri.html" target="_new">Give to PRI</a>'; > > SOB.render(true); > > //]]> > > </script><embed src="http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf" swliveconnect="FALSE" quality="best" scale="exactfit" flashvars="null" wmode="opaque" id="intro_ad" name="flash2" menu="false" devicefont="false" salign="lt" allowscriptaccess="Always" allownetworking="All" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="230" width="960"> > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('pencil'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_collapse.png" alt="Contract Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--FREQUENCY CAPPING--> > > <script type="text/javascript"> > > //["ID of content to frequency cap", "Display frequency interval (full hours only)"] > > var capcontent=new Array() > > capcontent[0]=["intro583325", "24 hr"] > > > > function get_cookie(Name) { > > var search = Name + "=" > > var returnvalue = ""; > > if (document.cookie.length > 0) { > > offset = document.cookie.indexOf(search) > > if (offset != -1) { // if cookie exists > > offset += search.length > > end = document.cookie.indexOf(";", offset); > > if (end == -1) > > end = document.cookie.length; > > returnvalue=unescape(document.cookie.substring(offset, end)) > > } > > } > > return returnvalue; > > } > > > > function resetcookie(id){ > > var expireDate = new Date() > > expireDate.setHours(expireDate.getHours()-10) > > document.cookie = id+"=;path=/;expires=" + expireDate.toGMTString() > > } > > > > function showorhide(caparray){ > > if (get_cookie(caparray[0])!=''){ > > document.write("#"+caparray[0]+"{display: none;}\n")//CSS TO HIDE CONTENT BTW FREQUENCY > > document.getElementById('pencil').style.display = 'block'; > > }else{ > > var t=setTimeout("auto_show_div('pencil')",14000); > > var expireDate = new Date() > > expireDate.setHours(expireDate.getHours()+parseInt(caparray[1])) > > document.cookie = caparray[0]+"="+parseInt(caparray[1])+";path=/;expires=" + expireDate.toGMTString() > > } > > } > > > > document.write('<style type="text/css">\n') > > > > for (i=0; i<capcontent.length; i++){ > > if (get_cookie(capcontent[i][0])!=parseInt(capcontent[i][1])) > > resetcookie(capcontent[i][0]) > > showorhide(capcontent[i]) > > } > > > > document.write('</style>') > > > > </script><style type="text/css"> > </style> > > </div> > > </div> >
javascript
flash
internet-explorer-8
null
null
null
open
Embed works in Firefox and Safari, but not in Internet Explorer 8 === I have a flash-based ad that displays/hides based on some javascript. It works in Firefox, Safari, Chrome ... but not in Internet Explorer 8. This is for donations to a non-profit during the holiday season, so any help would be wonderful. See the [test site](http://demo-studio360.wnyc.net/). Thank you! Peter > <div class="grid_12 alpha omega"> > <script type="text/javascript"> > GA_googleFillSlot("360_dropdown"); > </script><script src="http://pubads.g.doubleclick.net/gampad/ads?correlator=1323096793738&amp;output=json_html&amp;callback=GA_googleSetAdContentsBySlotForSync&amp;impl=s&amp;client=ca-pub-1030295571732009&amp;slotname=360_dropdown&amp;page_slots=360_dropdown&amp;cookie_enabled=1&amp;url=http%3A%2F%2Fdemo-studio360.wnyc.net%2F&amp;lmt=1323096764&amp;dt=1323096793743&amp;biw=1201&amp;bih=961&amp;adk=203353989&amp;ifi=1&amp;u_tz=-360&amp;u_his=2&amp;u_java=true&amp;u_h=1200&amp;u_w=1920&amp;u_ah=1174&amp;u_aw=1920&amp;u_cd=24&amp;u_nplug=10&amp;u_nmime=85&amp;flash=11.0.1&amp;gads=v2&amp;ga_vid=901695308.1323096794&amp;ga_sid=1323096794&amp;ga_hid=1643565815"></script><div id="google_ads_div_360_dropdown_ad_container"><script language="javascript" type="text/javascript" src="http://www.pri.org/developer/js/flash_v3005.js"></script> > > <!-- WDIG_CS_HEADER_END --> > > <!--PIXEL TRACKER--> > > <script src="DWConfiguration/ActiveContent/IncludeFiles/AC_ActiveX.js" type="text/javascript"></script> > > <script src="DWConfiguration/ActiveContent/IncludeFiles/AC_RunActiveContent.js" type="text/javascript"></script> > > > > > > <div id="expand_tracker" style="visibility:hidden;position:absolute;top:0px;left:0px;">&nbsp;</div> > > <!--SHOW AND HIDE FUNCTIONALITY--> > > <script type="text/javascript"> > > var pop_suppress = "true"; > > function show_div(div_id) { > > // hide all the divs > > document.getElementById('pencil').style.display = 'none'; > > document.getElementById('expand').style.display = 'none'; > > document.getElementById('intro583325').style.display = 'none'; > > // show the requested div > > document.getElementById(div_id).style.display = 'block'; > > } > > </script> > > <script type="text/javascript"> > > function auto_show_div(div_id) { > > // hide all the divs > > document.getElementById('pencil').style.display = 'none'; > > document.getElementById('expand').style.display = 'none'; > > document.getElementById('intro583325').style.display = 'none'; > > // show the requested div > > document.getElementById(div_id).style.display = 'block'; > > } > > </script> > > <!--PENCIL AD--> > > <div id="pencil" style="display: none; position: relative; width: 960px; height: 50px; text-align: left; background: none repeat scroll 0% 0% rgb(212, 71, 15);"> > > <img src="http://carboncreative.com/PRI/360banner2Iconic.jpg" height="50" width="960"> > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('expand'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_expand.png" alt="Expand Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--RE-EXPAND AD--> > > <div id="expand" style="display: block; position: relative; width: 960px; height: 230px; background: none repeat scroll 0% 0% rgb(212, 71, 15);"> > > <script language="javascript" type="text/javascript"> > > //<! [CDATA[ > > var SOB=new flashObj(); > > var enc_goto = escape("http://secure.publicbroadcasting.net/pri/banner/pledge.pledgemain"); > > var enc_goto2 = escape(""); > > SOB.ID = "reexpand_ad"; > > SOB.flashFile = "http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf"; > > SOB.DenyIEdl = "TRUE"; > > SOB.wmode = "opaque"; > > SOB.width = "960"; > > SOB.height = "230"; > > SOB.FlashVer = 9; > > SOB.cabVersion = "9,0,0,0"; > > SOB.altTxt = '<a href="http://www.pri.org/give-pri.html" target="_new">Give to PRI</a>'; > > SOB.render(true); > > //]]> > > </script><embed src="http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf" swliveconnect="FALSE" quality="best" scale="exactfit" flashvars="null" wmode="opaque" id="reexpand_ad" name="flash1" menu="false" devicefont="false" salign="lt" allowscriptaccess="Always" allownetworking="All" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="230" width="960"> > > > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('pencil'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_collapse.png" alt="Contract Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--INTRO AD--> > > <div id="intro583325" style="position: relative; width: 960px; height: 230px; text-align: right; display: none;"> > > <script language="javascript" type="text/javascript"> > > //<! [CDATA[ > > var SOB=new flashObj(); > > var enc_goto = escape("http://secure.publicbroadcasting.net/pri/banner/pledge.pledgemain"); > > var enc_goto2 = escape(""); > > > > SOB.ID = "intro_ad"; > > SOB.flashFile = "http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf"; > > SOB.DenyIEdl = "TRUE"; > > SOB.wmode = "opaque"; > > SOB.width = "960"; > > SOB.height = "230"; > > SOB.FlashVer = 9; > > SOB.cabVersion = "9,0,0,0"; > > //SOB.altTxt = '<a href="http://www.pri.org/give-pri.html" target="_new">Give to PRI</a>'; > > SOB.render(true); > > //]]> > > </script><embed src="http://media.wnyc.org/media/resources/2011/Nov/30/360pushdown.swf" swliveconnect="FALSE" quality="best" scale="exactfit" flashvars="null" wmode="opaque" id="intro_ad" name="flash2" menu="false" devicefont="false" salign="lt" allowscriptaccess="Always" allownetworking="All" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="230" width="960"> > > <div style="position: absolute; top: 1px; right: 1px;"> > > <a href="" onclick="show_div('pencil'); return false;" style="outline: none;"><img src="http://www.pri.org/developer/images/adtop_collapse.png" alt="Contract Ad" border="0" height="23" width="23"></a> > > </div> > > </div> > > <!--FREQUENCY CAPPING--> > > <script type="text/javascript"> > > //["ID of content to frequency cap", "Display frequency interval (full hours only)"] > > var capcontent=new Array() > > capcontent[0]=["intro583325", "24 hr"] > > > > function get_cookie(Name) { > > var search = Name + "=" > > var returnvalue = ""; > > if (document.cookie.length > 0) { > > offset = document.cookie.indexOf(search) > > if (offset != -1) { // if cookie exists > > offset += search.length > > end = document.cookie.indexOf(";", offset); > > if (end == -1) > > end = document.cookie.length; > > returnvalue=unescape(document.cookie.substring(offset, end)) > > } > > } > > return returnvalue; > > } > > > > function resetcookie(id){ > > var expireDate = new Date() > > expireDate.setHours(expireDate.getHours()-10) > > document.cookie = id+"=;path=/;expires=" + expireDate.toGMTString() > > } > > > > function showorhide(caparray){ > > if (get_cookie(caparray[0])!=''){ > > document.write("#"+caparray[0]+"{display: none;}\n")//CSS TO HIDE CONTENT BTW FREQUENCY > > document.getElementById('pencil').style.display = 'block'; > > }else{ > > var t=setTimeout("auto_show_div('pencil')",14000); > > var expireDate = new Date() > > expireDate.setHours(expireDate.getHours()+parseInt(caparray[1])) > > document.cookie = caparray[0]+"="+parseInt(caparray[1])+";path=/;expires=" + expireDate.toGMTString() > > } > > } > > > > document.write('<style type="text/css">\n') > > > > for (i=0; i<capcontent.length; i++){ > > if (get_cookie(capcontent[i][0])!=parseInt(capcontent[i][1])) > > resetcookie(capcontent[i][0]) > > showorhide(capcontent[i]) > > } > > > > document.write('</style>') > > > > </script><style type="text/css"> > </style> > > </div> > > </div> >
0
5,368,047
03/20/2011 11:03:23
230,632
12/13/2009 10:43:08
333
2
twitter for max/sparrow like tooltips
I am trying to create custom tooltips like the one we can found in Twitter for Mac or even Sparrow. Do you have any direction for achieving this? Thanks in advance for your help, Regards,
objective-c
cocoa
tooltip
null
null
null
open
twitter for max/sparrow like tooltips === I am trying to create custom tooltips like the one we can found in Twitter for Mac or even Sparrow. Do you have any direction for achieving this? Thanks in advance for your help, Regards,
0
8,220,232
11/21/2011 23:56:48
259,881
01/27/2010 08:40:55
984
48
How to add hidden bcc for outlook with c#
I'm using POP for mails and I want to inform one of my company mails when a message is sent by one of the users. And I want it hidden so they cannot delete it. I see there is solutions bun not free and not suitable for every version of Outlook. Is there a short way to code it in c#, like an office add-in or else?
c#
outlook
outlook-addin
office
null
null
open
How to add hidden bcc for outlook with c# === I'm using POP for mails and I want to inform one of my company mails when a message is sent by one of the users. And I want it hidden so they cannot delete it. I see there is solutions bun not free and not suitable for every version of Outlook. Is there a short way to code it in c#, like an office add-in or else?
0
7,233,897
08/29/2011 18:00:16
918,307
08/29/2011 18:00:16
1
0
anyone can help me about wordpress?
It's so foolish for me, Im so sad!! all right, It's not complex, you can do it like this, just a few step: $mysql -u root -p $ENTER UR MYSQL PASS \>use your_wordpress_databse_name; \>select option_value from wp_options where option_id = 36; then, you can tell me the query result. And I'm sure the result is not leak ur info. please, I need ur help!
wordpress
blogs
null
null
null
08/29/2011 18:17:49
not a real question
anyone can help me about wordpress? === It's so foolish for me, Im so sad!! all right, It's not complex, you can do it like this, just a few step: $mysql -u root -p $ENTER UR MYSQL PASS \>use your_wordpress_databse_name; \>select option_value from wp_options where option_id = 36; then, you can tell me the query result. And I'm sure the result is not leak ur info. please, I need ur help!
1
7,754,762
10/13/2011 13:21:52
993,522
10/13/2011 13:10:12
1
0
Minimum required version of iOS
a few days ago a new iOS 5 was released so my question is, will Apple increase or increased already the minimum required version of iOS for apps in App Store? I can't find such information anywhere.
ios
version
minimum
required
null
11/27/2011 22:18:10
off topic
Minimum required version of iOS === a few days ago a new iOS 5 was released so my question is, will Apple increase or increased already the minimum required version of iOS for apps in App Store? I can't find such information anywhere.
2
8,441,810
12/09/2011 06:20:55
1,089,139
12/09/2011 05:53:56
16
1
Android Starting Guide
What do I need to start Android Development? What languages do you need to know? What book should I use? Any YouTube Channels? Best way of learning Android?
android
development
guide
null
null
05/04/2012 13:26:57
not constructive
Android Starting Guide === What do I need to start Android Development? What languages do you need to know? What book should I use? Any YouTube Channels? Best way of learning Android?
4
8,935,177
01/20/2012 00:05:51
1,053,377
11/18/2011 08:18:29
1
0
PHP prepends backtick to all print and echo output
This is a server-wide issue, not confined to this particular script, but I'll give code regardless. include_once('LIB/LIB_data.php'); $id = $_GET['id']; $columns = Data::getTableColumns('table'); if(!in_array($id, $columns)) { exit("Illegal value"); } else { $dbh = new PDO('/* connects successfully */'); $sth = $dbh->prepare("SELECT DISTINCT $id FROM table"); $sth->execute(); $result = $sth->fetchAll(PDO::FETCH_ASSOC); $fields = array(); foreach($result as $set) { $val = $set[$id]; array_push($fields, "{\"optionValue\": \"$val\", \"optionDisplay\": \"$val\"}"); } $return_val = '[' . implode(",", $fields) . ']'; print($return_val); } Should return something like this: [{"optionValue": "f", "optionDisplay": "f"},{"optionValue": "m", "optionDisplay": "m"}] Instead, it's this: `[{"optionValue": "f", "optionDisplay": "f"},{"optionValue": "m", "optionDisplay": "m"}] It works the same with echo. There's a backtick before absolutely everything that I output with either one. I don't use backticks anywhere. I'm on PHP 5.2.10, if that helps. This is a weird error I haven't been able to find mention of anywhere else, so any help would be greatly appreciated.
php
null
null
null
null
01/20/2012 08:49:58
too localized
PHP prepends backtick to all print and echo output === This is a server-wide issue, not confined to this particular script, but I'll give code regardless. include_once('LIB/LIB_data.php'); $id = $_GET['id']; $columns = Data::getTableColumns('table'); if(!in_array($id, $columns)) { exit("Illegal value"); } else { $dbh = new PDO('/* connects successfully */'); $sth = $dbh->prepare("SELECT DISTINCT $id FROM table"); $sth->execute(); $result = $sth->fetchAll(PDO::FETCH_ASSOC); $fields = array(); foreach($result as $set) { $val = $set[$id]; array_push($fields, "{\"optionValue\": \"$val\", \"optionDisplay\": \"$val\"}"); } $return_val = '[' . implode(",", $fields) . ']'; print($return_val); } Should return something like this: [{"optionValue": "f", "optionDisplay": "f"},{"optionValue": "m", "optionDisplay": "m"}] Instead, it's this: `[{"optionValue": "f", "optionDisplay": "f"},{"optionValue": "m", "optionDisplay": "m"}] It works the same with echo. There's a backtick before absolutely everything that I output with either one. I don't use backticks anywhere. I'm on PHP 5.2.10, if that helps. This is a weird error I haven't been able to find mention of anywhere else, so any help would be greatly appreciated.
3
6,296,543
06/09/2011 17:01:04
791,397
06/09/2011 17:01:04
1
0
System.load() method not loading shared libraries whithout setting LD_LIBRARY_PATH environment variable
I'm facing a strange issue while loading shared libraries in Linux. There are two Shared libraries (suppose abc.so and xyz.so) in my application. abc.so is dependent on xyz.so i.e. whenever you will try to load abc.so jvm will first load xyz.so. Now, when I'm loading these libraries by setting LD_LIBRARY_PATH to the folder containing these two libraries, its working without any problem. However, When I'm trying to load abc.so with System.load("<FULL_PATH>/abc.so") its not getting loaded. Following line is displayed as the error: undefined symbol: __cxa_pure_virtual. Can any one help me in understanding this error? Thanks in advance! Note: Due to some project requirement I can not change LD_LIBRARY_PATH and therefore I need to load abc.so by using System.load() method.
linux
shared-libraries
environment-variables
null
null
null
open
System.load() method not loading shared libraries whithout setting LD_LIBRARY_PATH environment variable === I'm facing a strange issue while loading shared libraries in Linux. There are two Shared libraries (suppose abc.so and xyz.so) in my application. abc.so is dependent on xyz.so i.e. whenever you will try to load abc.so jvm will first load xyz.so. Now, when I'm loading these libraries by setting LD_LIBRARY_PATH to the folder containing these two libraries, its working without any problem. However, When I'm trying to load abc.so with System.load("<FULL_PATH>/abc.so") its not getting loaded. Following line is displayed as the error: undefined symbol: __cxa_pure_virtual. Can any one help me in understanding this error? Thanks in advance! Note: Due to some project requirement I can not change LD_LIBRARY_PATH and therefore I need to load abc.so by using System.load() method.
0
11,365,863
07/06/2012 16:07:46
639,713
03/01/2011 16:33:22
173
5
mvc .net mobile: how to go about arranging the controllers (very beginner)
So I want to start working on specific pages on my website to have a mobile version. I was wondering how I should go about it? Do I create a new controller for each controller so that if it detects mobile then it redirects to that controller? or do i just use css to change how the page gets viewed? If I need to create a new controlelr do I host it on a subdomain? Comments are greatly appreciated. Thanks!!
asp.net-mvc
asp.net-mvc-3
null
null
null
07/10/2012 11:45:15
not constructive
mvc .net mobile: how to go about arranging the controllers (very beginner) === So I want to start working on specific pages on my website to have a mobile version. I was wondering how I should go about it? Do I create a new controller for each controller so that if it detects mobile then it redirects to that controller? or do i just use css to change how the page gets viewed? If I need to create a new controlelr do I host it on a subdomain? Comments are greatly appreciated. Thanks!!
4
7,633,044
10/03/2011 09:11:36
864,027
07/26/2011 18:04:17
851
59
Compiler error message with cout
I'm currently getting the following compiler error message error: no match for 'operator<<' in std::Collection::operator[](int)(j)' The code that the compiler is complaining about is cout << testingSet[j]; Where `testingSet` is an object of type `Collection` that has `operator[]` overloaded to return an object of type `Example`. `Example` has a friend function that overloads `operator<<` for ostream and Example. note: this actually compiles just fine within Visual Studio; however does not compile using g++.
c++
compilation
compiler-errors
stdio
null
null
open
Compiler error message with cout === I'm currently getting the following compiler error message error: no match for 'operator<<' in std::Collection::operator[](int)(j)' The code that the compiler is complaining about is cout << testingSet[j]; Where `testingSet` is an object of type `Collection` that has `operator[]` overloaded to return an object of type `Example`. `Example` has a friend function that overloads `operator<<` for ostream and Example. note: this actually compiles just fine within Visual Studio; however does not compile using g++.
0
6,918,506
08/02/2011 20:56:10
769,841
05/25/2011 15:14:53
23
0
PHP Gallery Problem
Ok, I have a gallery that's being populated by a database but for some reason it's not pulling entries from beyond May 31st 2011. I've scoured the code and can't find any date limitations so I'm at a loss as to why it's not pulling in any recent entries. I've also looked through the database table and don't see any irregularities between pre May31st and more current entries. <?php //GALLERY PAGE $user="USER"; $password = "PASSWORD"; $database = "GALLERY"; $hostname_portfolio ="localhost:3306"; //gets the page number from the URL if($_GET["pageNum"]==''){ $listedNum=0; //gets the page limit from the URL $limit=5; } else{ $listedNum=$_GET["pageNum"]; //gets the page limit from the URL $limit=$_GET["limit"]; } //creates the list of projects and puts them into an array $project= array(); $con = mysql_connect($hostname_portfolio,$user,$password); if (!$con) { die('Could not connect: ' . mysql_error()); } $dbcon = mysql_select_db("GALLERY", $con); if (!$dbcon) { die('Could not connect: ' . mysql_error()); } if ($dbcon) { } mysql_select_db($database, $con); $result = mysql_query("SELECT * FROM Persons ORDER BY date_uploaded DESC"); echo"<div class='clear' style='clear:both;'></div>"; $j=0; do{ if($row['approved']=="true"){ $project[$j] = "<div class='project-list'> <div class='user-project'> <div class='container'> <div class='before-box' > <p class='picture_state'>Before</p> <a href='http://THEURL.com/". $row['image_path']."'> <img src= '". $row['image_path']. "' width='400px' height='300px'/></a> <br /> </div> <div class='after-box'> <p class='picture_state'>After</p> <a href='". $row['picture_state']."'> <img src= '". $row['picture_state']. "' width='400px' height='300px' /></a> <br /> </div> <div class='sidebox'> <div class='inner-sidebox'> <p class='date-project'> Submitted by " . $row['FirstName'] . " " . $row['LastName']. " on " .$row['date_uploaded']. "</p> <p> " .$row['decription']. "</p>"; if($row['countertop'] || $row['cabinet']){ $project[$j] .= "<p>Used "; if ($row['countertop']){ $project[$j] .= "PRODUCT2&trade;"; if ($row['color1']){ $project[$j] .= " in " . $row['color1']; } if ($row['cabinet']){ $project[$j] .= " and "; } } if($row['cabinet']){ $project[$j] .= "PRODUCT<sup>&reg;</sup>"; if ($row['color2']){ $project[$j] .= " in " . $row['color2']; } } $project[$j] .= "</p>"; } $project[$j] .= " </div> </div> </div>".$facebook." <div class='clear' style='clear:both;'> </div> </div> <div class='clear' style='clear:both;'> </div> </div> <div class='clear' style='clear:both;'> </div>"; $j++; } } while($row = mysql_fetch_array($result)); $max=sizeof($project); for($i=$listedNum;$i<$limit;$i++){ echo $project[$i]; } $max=sizeof($project) - 1; echo "<div class='bottom' style='width:170px;margin:0px auto;'>"; if($listedNum > 0){ $prevPageNum=$listedNum - 5; $lastPage= $limit - 5; echo "<a href='http://THEURL.com/gallery.php? pageNum=".$prevPageNum."&limit=".$lastPage."'>< Last Page </a>"; } else{ $prevPageNum=$listedNum; $lastPage= $limit; } echo"&nbsp;&nbsp;"; if($limit <= $max){ $newPageNum=$listedNum + 5; $nextPage= $limit + 5; echo "<a href='http://THEURL.com/gallery.php?pageNum=".$newPageNum."&limit=".$nextPage."'> Next Page ></a>"; } else{ $newPageNum=$listedNum; $nextPage= $limit; } echo "</div>"; mysql_close($con); ?>
php
mysql
null
null
null
null
open
PHP Gallery Problem === Ok, I have a gallery that's being populated by a database but for some reason it's not pulling entries from beyond May 31st 2011. I've scoured the code and can't find any date limitations so I'm at a loss as to why it's not pulling in any recent entries. I've also looked through the database table and don't see any irregularities between pre May31st and more current entries. <?php //GALLERY PAGE $user="USER"; $password = "PASSWORD"; $database = "GALLERY"; $hostname_portfolio ="localhost:3306"; //gets the page number from the URL if($_GET["pageNum"]==''){ $listedNum=0; //gets the page limit from the URL $limit=5; } else{ $listedNum=$_GET["pageNum"]; //gets the page limit from the URL $limit=$_GET["limit"]; } //creates the list of projects and puts them into an array $project= array(); $con = mysql_connect($hostname_portfolio,$user,$password); if (!$con) { die('Could not connect: ' . mysql_error()); } $dbcon = mysql_select_db("GALLERY", $con); if (!$dbcon) { die('Could not connect: ' . mysql_error()); } if ($dbcon) { } mysql_select_db($database, $con); $result = mysql_query("SELECT * FROM Persons ORDER BY date_uploaded DESC"); echo"<div class='clear' style='clear:both;'></div>"; $j=0; do{ if($row['approved']=="true"){ $project[$j] = "<div class='project-list'> <div class='user-project'> <div class='container'> <div class='before-box' > <p class='picture_state'>Before</p> <a href='http://THEURL.com/". $row['image_path']."'> <img src= '". $row['image_path']. "' width='400px' height='300px'/></a> <br /> </div> <div class='after-box'> <p class='picture_state'>After</p> <a href='". $row['picture_state']."'> <img src= '". $row['picture_state']. "' width='400px' height='300px' /></a> <br /> </div> <div class='sidebox'> <div class='inner-sidebox'> <p class='date-project'> Submitted by " . $row['FirstName'] . " " . $row['LastName']. " on " .$row['date_uploaded']. "</p> <p> " .$row['decription']. "</p>"; if($row['countertop'] || $row['cabinet']){ $project[$j] .= "<p>Used "; if ($row['countertop']){ $project[$j] .= "PRODUCT2&trade;"; if ($row['color1']){ $project[$j] .= " in " . $row['color1']; } if ($row['cabinet']){ $project[$j] .= " and "; } } if($row['cabinet']){ $project[$j] .= "PRODUCT<sup>&reg;</sup>"; if ($row['color2']){ $project[$j] .= " in " . $row['color2']; } } $project[$j] .= "</p>"; } $project[$j] .= " </div> </div> </div>".$facebook." <div class='clear' style='clear:both;'> </div> </div> <div class='clear' style='clear:both;'> </div> </div> <div class='clear' style='clear:both;'> </div>"; $j++; } } while($row = mysql_fetch_array($result)); $max=sizeof($project); for($i=$listedNum;$i<$limit;$i++){ echo $project[$i]; } $max=sizeof($project) - 1; echo "<div class='bottom' style='width:170px;margin:0px auto;'>"; if($listedNum > 0){ $prevPageNum=$listedNum - 5; $lastPage= $limit - 5; echo "<a href='http://THEURL.com/gallery.php? pageNum=".$prevPageNum."&limit=".$lastPage."'>< Last Page </a>"; } else{ $prevPageNum=$listedNum; $lastPage= $limit; } echo"&nbsp;&nbsp;"; if($limit <= $max){ $newPageNum=$listedNum + 5; $nextPage= $limit + 5; echo "<a href='http://THEURL.com/gallery.php?pageNum=".$newPageNum."&limit=".$nextPage."'> Next Page ></a>"; } else{ $newPageNum=$listedNum; $nextPage= $limit; } echo "</div>"; mysql_close($con); ?>
0
10,880,031
06/04/2012 10:47:37
1,434,895
06/04/2012 10:16:26
1
0
Partial page curl by pan gesture like in UIPageViewController
I would like to **partly** display a view controller exactly like > UIModalTransitionStylePartialCurl , but instead of the curling animation i want to curl the view by a pan gesture My goal is to get the same affect like when using UIPageViewController to switch between ViewControllers by dragging\curling the page according to the user touches (not a swipe gesture). Any help will be appreciated.
ios
ios5
presentmodalviewcontrolle
uipageviewcontroller
null
null
open
Partial page curl by pan gesture like in UIPageViewController === I would like to **partly** display a view controller exactly like > UIModalTransitionStylePartialCurl , but instead of the curling animation i want to curl the view by a pan gesture My goal is to get the same affect like when using UIPageViewController to switch between ViewControllers by dragging\curling the page according to the user touches (not a swipe gesture). Any help will be appreciated.
0
10,624,066
05/16/2012 18:00:12
1,308,380
04/02/2012 15:17:21
3
3
What type of Android apps are the hardest to support (fragmentation worry)
Saw an interesting and kinda scary blog post the other day. It was a mobile developer's collection of Android devices they test on. It was around 400. --> http://feedproxy.google.com/~r/Techcrunch/~3/0LybOzd0l0U/ I'm a solo guy, there is NO way I could support an app if it took even a fraction of that kind of testing and support. I know you can emulate many devices, but there would still be considerable time in testing on more than a handful of AVDs. It sounds like it could be a nightmare. For those who've been chewing on Android for awhile, any data or advice on what apps handle the various devices the easiest? The developer in the blog did a lot of games, are those the trickiest? I'm sure Hello World works very well on all Android devices, but there won't be many takers, you know? It would be great to know before starting on an ambitious app that for example, GPS is easy, consistent, but native code could be a nightmare, or still pictures are OK, video is nasty to support. SMS, database, sdcard access? OpenGL, gestures, etc. that sort of thing... If anyone has some general tips or especially an easiest-to-hardest list that could be VERY helpful for us newbies. Thanks P.S. and please don't say "develop on iOS...", it's not the question, and worse it's too predictable. ;-)
android
testing
avd
fragmentation
null
05/17/2012 18:33:47
not constructive
What type of Android apps are the hardest to support (fragmentation worry) === Saw an interesting and kinda scary blog post the other day. It was a mobile developer's collection of Android devices they test on. It was around 400. --> http://feedproxy.google.com/~r/Techcrunch/~3/0LybOzd0l0U/ I'm a solo guy, there is NO way I could support an app if it took even a fraction of that kind of testing and support. I know you can emulate many devices, but there would still be considerable time in testing on more than a handful of AVDs. It sounds like it could be a nightmare. For those who've been chewing on Android for awhile, any data or advice on what apps handle the various devices the easiest? The developer in the blog did a lot of games, are those the trickiest? I'm sure Hello World works very well on all Android devices, but there won't be many takers, you know? It would be great to know before starting on an ambitious app that for example, GPS is easy, consistent, but native code could be a nightmare, or still pictures are OK, video is nasty to support. SMS, database, sdcard access? OpenGL, gestures, etc. that sort of thing... If anyone has some general tips or especially an easiest-to-hardest list that could be VERY helpful for us newbies. Thanks P.S. and please don't say "develop on iOS...", it's not the question, and worse it's too predictable. ;-)
4
9,632,016
03/09/2012 09:53:23
1,249,715
03/05/2012 11:39:09
1
0
.Net Framework Compatible Unexpected Error?
I am constanly receiving this error on my VAIO Laptop every time I start it. I am looking for solution to this since long. Model No: VPCEB46FG (Windows 7 Premium 64 bit) .Net Framework Compatible Error: Unhandled exception has occurred in your application Exception Text ` System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.Convert.ToDateTime(String value) at VCsystray.AccFunctions.nextSilentRun() at VCsystray.Form1.CheckOneClickLastRun() at VCsystray.Form1.tmrOneclick_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ` I already have the updated .net framework and other updates of Windows 7 and VAIO softwares still I am facing the same plroblem. Any of your suggestions are welcome. Please do assist the best.
.net
frameworks
null
null
null
03/09/2012 10:04:50
off topic
.Net Framework Compatible Unexpected Error? === I am constanly receiving this error on my VAIO Laptop every time I start it. I am looking for solution to this since long. Model No: VPCEB46FG (Windows 7 Premium 64 bit) .Net Framework Compatible Error: Unhandled exception has occurred in your application Exception Text ` System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at System.Convert.ToDateTime(String value) at VCsystray.AccFunctions.nextSilentRun() at VCsystray.Form1.CheckOneClickLastRun() at VCsystray.Form1.tmrOneclick_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ` I already have the updated .net framework and other updates of Windows 7 and VAIO softwares still I am facing the same plroblem. Any of your suggestions are welcome. Please do assist the best.
2
11,114,635
06/20/2012 07:18:30
1,468,286
06/20/2012 06:22:08
1
0
facebook send button is not working with localhost
I have included the following code in my jsp page, <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-send" data-href="http://www.172.28.188.com" data-font="tahoma"></div> But it is not working,I think it is not accepting the data-href as "http://www.172.28.188.com",Please help me to find a solution.
javascript
facebook
jsp
null
null
null
open
facebook send button is not working with localhost === I have included the following code in my jsp page, <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-send" data-href="http://www.172.28.188.com" data-font="tahoma"></div> But it is not working,I think it is not accepting the data-href as "http://www.172.28.188.com",Please help me to find a solution.
0
8,561,917
12/19/2011 13:18:18
912,319
08/25/2011 14:26:52
36
3
What is the Best Way to Store fixed no of data in Java? (Array vs ArrayList)
I believe Array and ArrayList both are non-Synchronised;behave same in multiThreaded env. And both are Index based. However ArrayList has utility methods and flexible. So to store fixed no of Objects which is best in java? Is there any overhead in using Arraylist than Array? Pls explain.
java
null
null
null
null
12/19/2011 15:05:44
not a real question
What is the Best Way to Store fixed no of data in Java? (Array vs ArrayList) === I believe Array and ArrayList both are non-Synchronised;behave same in multiThreaded env. And both are Index based. However ArrayList has utility methods and flexible. So to store fixed no of Objects which is best in java? Is there any overhead in using Arraylist than Array? Pls explain.
1
9,840,663
03/23/2012 14:10:58
923,794
09/01/2011 15:55:59
473
15
Why did Python introduce a new syntax for format specifiers instead of using the sprintf C standards?
[Pep 3101](http://www.python.org/dev/peps/pep-3101/) provides a rationale for ultimately replacing the `%` operator with the `format` method. I can follow that. [This question](http://stackoverflow.com/q/7202709/923794) and the accepted answer dwell on the same points. I could not find, however, a rationale for the new syntax. The pep 3101 lists various alternate syntaxes which also included the famous `printf` style of format specifiers as noted in the C99 standard and it's variants. (For a documentation example go [here](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf) to section 7.19.6.1 "The fprintf function" on pages 274ff). Other than the fact that for historic reasons many people are familiar with the `printf` like formatting syntax, I don't favor one over the other. It is odd that such an extensive PEP, and the good documentation done in its [sandbox](http://svn.python.org/view/sandbox/trunk/pep3101/pep_differences.txt?revision=54966&view=markup) should cover so many aspects, but ignore one of the most important ones. Imho, the decision to change the operator to a method is quite decoupled from the decision to change the format spec. On of the arguments which can be found is that numeric indexing is possible with the Python's format spec. But my sprintf man page knows how to do that as well: `printf("%*d", width, num);` and `printf("%2$*1$d", width, num);` Does anybody know the official - maybe Guido's - reasoning? Or can possibly summarize the discussions on development lists or during the implementation phase?
python
string
formatting
format-specifiers
null
03/23/2012 15:27:53
not constructive
Why did Python introduce a new syntax for format specifiers instead of using the sprintf C standards? === [Pep 3101](http://www.python.org/dev/peps/pep-3101/) provides a rationale for ultimately replacing the `%` operator with the `format` method. I can follow that. [This question](http://stackoverflow.com/q/7202709/923794) and the accepted answer dwell on the same points. I could not find, however, a rationale for the new syntax. The pep 3101 lists various alternate syntaxes which also included the famous `printf` style of format specifiers as noted in the C99 standard and it's variants. (For a documentation example go [here](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf) to section 7.19.6.1 "The fprintf function" on pages 274ff). Other than the fact that for historic reasons many people are familiar with the `printf` like formatting syntax, I don't favor one over the other. It is odd that such an extensive PEP, and the good documentation done in its [sandbox](http://svn.python.org/view/sandbox/trunk/pep3101/pep_differences.txt?revision=54966&view=markup) should cover so many aspects, but ignore one of the most important ones. Imho, the decision to change the operator to a method is quite decoupled from the decision to change the format spec. On of the arguments which can be found is that numeric indexing is possible with the Python's format spec. But my sprintf man page knows how to do that as well: `printf("%*d", width, num);` and `printf("%2$*1$d", width, num);` Does anybody know the official - maybe Guido's - reasoning? Or can possibly summarize the discussions on development lists or during the implementation phase?
4
9,905,334
03/28/2012 10:10:19
1,180,092
01/31/2012 10:39:16
48
0
Using rails3-jquery-autocomplete to avoid duplicate entries?
I'm using the rails3-jquery-autocomplete gem my artist field on a releases form and want to make sure any new releases use the id of an existing artist if found via autocomplete or create a new artist if not found. At the moment the autocomplete gem returns artists as expected but created a new entry even if that artist exists. My models are as follows: class Artist < ActiveRecord::Base has_and_belongs_to_many :releases end class Release < ActiveRecord::Base has_and_belongs_to_many :artists accepts_nested_attributes_for :artists, :reject_if => lambda { |a| a[:name].blank? } end And controllers: class ArtistsController < ApplicationController def index @artists = Artist.find(:all, :order => :name, :group => :name) end def create @release = Release.find(params[:release_id]) @artist = @release.artists.create(params[:artist]) redirect_to release_path(@release) end def destroy @release = Release.find(params[:release_id]) @artist = @release.artists.find(params[:id]) @artist.destroy redirect_to release_path(@release) end end class ReleasesController < ApplicationController autocomplete :artist, :name def new @release = Release.new @release.artists.build end def create @release = Release.new(params[:release]) @release.user_id = current_user.id end end My routes contains: resources :releases do get :autocomplete_artist_name, :on => :collection end And finally the artist fields: <%= f.fields_for :artists do |builder| %> <%= render 'artist_fields', :f => builder %> <% end %> (The rendered fields) <%= f.label :name, "Artist" %><br /> <%= f.autocomplete_field :name, autocomplete_artist_name_releases_path, :class => "text" %>
ruby-on-rails
ruby-on-rails-3
null
null
null
null
open
Using rails3-jquery-autocomplete to avoid duplicate entries? === I'm using the rails3-jquery-autocomplete gem my artist field on a releases form and want to make sure any new releases use the id of an existing artist if found via autocomplete or create a new artist if not found. At the moment the autocomplete gem returns artists as expected but created a new entry even if that artist exists. My models are as follows: class Artist < ActiveRecord::Base has_and_belongs_to_many :releases end class Release < ActiveRecord::Base has_and_belongs_to_many :artists accepts_nested_attributes_for :artists, :reject_if => lambda { |a| a[:name].blank? } end And controllers: class ArtistsController < ApplicationController def index @artists = Artist.find(:all, :order => :name, :group => :name) end def create @release = Release.find(params[:release_id]) @artist = @release.artists.create(params[:artist]) redirect_to release_path(@release) end def destroy @release = Release.find(params[:release_id]) @artist = @release.artists.find(params[:id]) @artist.destroy redirect_to release_path(@release) end end class ReleasesController < ApplicationController autocomplete :artist, :name def new @release = Release.new @release.artists.build end def create @release = Release.new(params[:release]) @release.user_id = current_user.id end end My routes contains: resources :releases do get :autocomplete_artist_name, :on => :collection end And finally the artist fields: <%= f.fields_for :artists do |builder| %> <%= render 'artist_fields', :f => builder %> <% end %> (The rendered fields) <%= f.label :name, "Artist" %><br /> <%= f.autocomplete_field :name, autocomplete_artist_name_releases_path, :class => "text" %>
0
6,816,758
07/25/2011 13:20:42
309,145
04/05/2010 10:25:17
380
7
Why can't Reflector show byte arrays?
I want to see the contents of a byte array, but Reflector don't show them. Why? Is there any other tool which I can use? ![Screenshot][1] [1]: http://i.stack.imgur.com/erf3d.png
c#
.net
reflection
reflector
null
07/25/2011 13:57:08
off topic
Why can't Reflector show byte arrays? === I want to see the contents of a byte array, but Reflector don't show them. Why? Is there any other tool which I can use? ![Screenshot][1] [1]: http://i.stack.imgur.com/erf3d.png
2
1,554,874
10/12/2009 14:19:54
167,739
09/03/2009 08:50:16
36
0
Why it is allowed to point to constructors parameters?
This code class Foo(str: String) { val len = str.length def getLen = len def getStr = str} will be compiled to public class Foo implements ScalaObject { private final int len; private final String str; public Foo(String str) { this.str = str; super(); len = str.length(); } public String getStr() { return str; } public int getLen() { return len(); } public int len() { return len; } public int $tag() throws RemoteException { return scala.ScalaObject.class.$tag(this); } } But this code class Foo(str: String) { val len = str.length def getLen = len } will be compiled to public class Foo implements ScalaObject { private final int len; public Foo(String str) { len = str.length(); } public int getLen() { return len(); } public int len() { return len; } public int $tag() throws RemoteException { return scala.ScalaObject.class.$tag(this); } } Why there is no private member in class Foo? private final String str; Is it some sort of optimization? Why it is allowed to point to constructor's parameters. Why there is no compile-time error for line "def getStr = str"?
scala
null
null
null
null
null
open
Why it is allowed to point to constructors parameters? === This code class Foo(str: String) { val len = str.length def getLen = len def getStr = str} will be compiled to public class Foo implements ScalaObject { private final int len; private final String str; public Foo(String str) { this.str = str; super(); len = str.length(); } public String getStr() { return str; } public int getLen() { return len(); } public int len() { return len; } public int $tag() throws RemoteException { return scala.ScalaObject.class.$tag(this); } } But this code class Foo(str: String) { val len = str.length def getLen = len } will be compiled to public class Foo implements ScalaObject { private final int len; public Foo(String str) { len = str.length(); } public int getLen() { return len(); } public int len() { return len; } public int $tag() throws RemoteException { return scala.ScalaObject.class.$tag(this); } } Why there is no private member in class Foo? private final String str; Is it some sort of optimization? Why it is allowed to point to constructor's parameters. Why there is no compile-time error for line "def getStr = str"?
0
8,403,401
12/06/2011 16:33:14
291,915
03/11/2010 21:27:49
410
16
Choosing cloud storage service with web API can FTP third party server
I need to find a storage service that can programatically (REST API) send (FTP) a file to a third party service. I was thinking of using Amazon S3, but I found a previous similar question here: http://stackoverflow.com/q/4859509/291915 and apparently it cant be done. If I can't find a storage service that delivers this functionality, pricing is my second priority. Right now I'm thinking either sugarsync or dropbox, as well as amazon S3 since all of these provide a REST API I can use.
amazon-s3
cloud
dropbox
dropbox-api
cloud-storage
12/07/2011 17:26:27
off topic
Choosing cloud storage service with web API can FTP third party server === I need to find a storage service that can programatically (REST API) send (FTP) a file to a third party service. I was thinking of using Amazon S3, but I found a previous similar question here: http://stackoverflow.com/q/4859509/291915 and apparently it cant be done. If I can't find a storage service that delivers this functionality, pricing is my second priority. Right now I'm thinking either sugarsync or dropbox, as well as amazon S3 since all of these provide a REST API I can use.
2
2,666,371
04/19/2010 09:18:41
104,295
05/10/2009 08:53:05
13
0
ASP.NET MVC ViewModel Auto Generation
I have a load of ADO.NET Entities in my MVC project. I was going to use these entities directly from my views/controllers... however, I think it's probably best to use ViewModels which more accurately reflect what the View requires. I'm looking for a way that I can auto-generate a ViewModel from an existing Entity, i.e., auto-generate the wrapper or adapter pattern from an existing member... Or a T4 template that would loop through the public properties of an Entity, and output properties for the ViewModel... then I can delete the properties I don't need or create aggregate view models etc. I cannot seem to find anywhere a way to auto-gen a wrapper or adapter pattern class from an existing type? The idea is then at runtime, use AutoMapper to map between the ViewModel and the Entity. thanks
asp.net-mvc
mvvm
viewmodel
null
null
null
open
ASP.NET MVC ViewModel Auto Generation === I have a load of ADO.NET Entities in my MVC project. I was going to use these entities directly from my views/controllers... however, I think it's probably best to use ViewModels which more accurately reflect what the View requires. I'm looking for a way that I can auto-generate a ViewModel from an existing Entity, i.e., auto-generate the wrapper or adapter pattern from an existing member... Or a T4 template that would loop through the public properties of an Entity, and output properties for the ViewModel... then I can delete the properties I don't need or create aggregate view models etc. I cannot seem to find anywhere a way to auto-gen a wrapper or adapter pattern class from an existing type? The idea is then at runtime, use AutoMapper to map between the ViewModel and the Entity. thanks
0
8,392,579
12/05/2011 22:08:36
908,148
08/23/2011 16:47:18
269
0
How do you find the Big-O of the Rabin-Karp, Knuth-Morris-Pratt, and the Boyer-Moore string matching algorithms?
I still find the Big-O concept kind of abstract and hard to grasp. We've been going over it in class this past week, but unfortunately my professor isn't in town this week to help me understand the three string matching algorithms... any help is appreciated
string-matching
null
null
null
null
12/06/2011 05:53:52
off topic
How do you find the Big-O of the Rabin-Karp, Knuth-Morris-Pratt, and the Boyer-Moore string matching algorithms? === I still find the Big-O concept kind of abstract and hard to grasp. We've been going over it in class this past week, but unfortunately my professor isn't in town this week to help me understand the three string matching algorithms... any help is appreciated
2
6,949,255
08/04/2011 22:15:34
507,629
11/14/2010 21:52:12
313
14
Why is this Upload File with Random Name PHP script not working?
I have an upload PHP script and before it uploads the file, it renames it to to a random name, so no files that are already there will be overrided. The problem is that it is not working properly. It is putting in a bunch of weird symbols in the file name, and when I try viewing the file, it has a 404 error. It was working before I added this random name part in. Here's the PHP script that I have right now: <?php // Where the file is going to be placed $target_path = "files/"; /* Rename file with random name and keep extension */ $length = 10; $characters = ’123456789’; $string=""; for($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } $pos = strrpos(basename( $_FILES['uploadedfile']['name']), "."); $ext = str_split(basename( $_FILES['uploadedfile']['name']), $pos); $target_path = $target_path.$string.$ext[1]; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "<h2>Your file has been uploaded!</h2><br /><p>Your file has been uploaded successfully. <a href='".$target_path."'>Click here</a> to see the file you uploaded. <br /><br /><br /> <h2>A link to your file</h2><br />The full link to your file is: <br /><br /> <code>http://www.example.com/upload/".$target_path."</code></p>"; } else{ echo "<span class='error'>There was an error uploading the file, please try again.</span>"; } ?> For some reason, it is really acting weird. Then, when I view the folder /files/ in my hosting file manager and I try deleting a file with the weird symbols in it, and I refresh and they are all back. Take a look at this screenshot: ![enter image description here][1] Weird, huh? I will probably need a new random naming PHP script, but this is annoying because I delete all of those files, and, what do you know, they come right back when I reload! It's like the PHP is forcing them to not delete or something. Thanks for any help in advance, Nathan [1]: http://i.stack.imgur.com/V890r.png
php
file-upload
null
null
null
null
open
Why is this Upload File with Random Name PHP script not working? === I have an upload PHP script and before it uploads the file, it renames it to to a random name, so no files that are already there will be overrided. The problem is that it is not working properly. It is putting in a bunch of weird symbols in the file name, and when I try viewing the file, it has a 404 error. It was working before I added this random name part in. Here's the PHP script that I have right now: <?php // Where the file is going to be placed $target_path = "files/"; /* Rename file with random name and keep extension */ $length = 10; $characters = ’123456789’; $string=""; for($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } $pos = strrpos(basename( $_FILES['uploadedfile']['name']), "."); $ext = str_split(basename( $_FILES['uploadedfile']['name']), $pos); $target_path = $target_path.$string.$ext[1]; if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "<h2>Your file has been uploaded!</h2><br /><p>Your file has been uploaded successfully. <a href='".$target_path."'>Click here</a> to see the file you uploaded. <br /><br /><br /> <h2>A link to your file</h2><br />The full link to your file is: <br /><br /> <code>http://www.example.com/upload/".$target_path."</code></p>"; } else{ echo "<span class='error'>There was an error uploading the file, please try again.</span>"; } ?> For some reason, it is really acting weird. Then, when I view the folder /files/ in my hosting file manager and I try deleting a file with the weird symbols in it, and I refresh and they are all back. Take a look at this screenshot: ![enter image description here][1] Weird, huh? I will probably need a new random naming PHP script, but this is annoying because I delete all of those files, and, what do you know, they come right back when I reload! It's like the PHP is forcing them to not delete or something. Thanks for any help in advance, Nathan [1]: http://i.stack.imgur.com/V890r.png
0
6,914,069
08/02/2011 14:54:56
286,260
03/04/2010 13:02:36
1,472
78
google app engine chunkSize & prefetchSize - where can I read details on it?
All the info regarding these two sums up to: chunkSize - Sets the chunk size. Please read the class javadoc for an explanation of how chunk size is used. prefetchSize - Sets the number of entities to prefetch. Tried looking at the java docs, and at the source code in the SVN. No info at all! I mean, info regarding the actual implication of these two. Well, prefetchSize is more or less clear - how many entities are fetched when running th query.<br> If my understanding is right, for example if I set the query's limit to 1000 and prefetchSize to 1000, it will read them all at once to the memory. What about chunkSize? Is this in bytes size? Entities amount? What are the effects of low/high number, set to these two?
java
google-app-engine
null
null
null
null
open
google app engine chunkSize & prefetchSize - where can I read details on it? === All the info regarding these two sums up to: chunkSize - Sets the chunk size. Please read the class javadoc for an explanation of how chunk size is used. prefetchSize - Sets the number of entities to prefetch. Tried looking at the java docs, and at the source code in the SVN. No info at all! I mean, info regarding the actual implication of these two. Well, prefetchSize is more or less clear - how many entities are fetched when running th query.<br> If my understanding is right, for example if I set the query's limit to 1000 and prefetchSize to 1000, it will read them all at once to the memory. What about chunkSize? Is this in bytes size? Entities amount? What are the effects of low/high number, set to these two?
0
7,619,254
10/01/2011 09:00:23
927,002
09/03/2011 20:44:50
149
12
most useful Asp.net MVC 3 Library every programmer shoud have?
i was was wondering that which are the most useful, easy to integrate, easy to code and powerful libraries available in the market (Free, Paid) that every MVC programmer should use to achieve the ultimate goal "Write Less, DO More" .. i am currently using Auto-Mapper, Structure-Map.. please list yours so that every beginner like me can benefits from your answer. every piece of your answers would be appreciated and it deserve the vote up. Thanks in advance...
asp.net
asp.net-mvc
asp.net-mvc-3
null
null
11/12/2011 17:35:42
not constructive
most useful Asp.net MVC 3 Library every programmer shoud have? === i was was wondering that which are the most useful, easy to integrate, easy to code and powerful libraries available in the market (Free, Paid) that every MVC programmer should use to achieve the ultimate goal "Write Less, DO More" .. i am currently using Auto-Mapper, Structure-Map.. please list yours so that every beginner like me can benefits from your answer. every piece of your answers would be appreciated and it deserve the vote up. Thanks in advance...
4
3,663,613
09/08/2010 00:03:24
33,225
10/31/2008 21:47:27
7,633
296
Why is there no SortedList<T> in .NET?
Why is there only a `SortedList<TKey, TValue>` which looks more like a dictionary, but no `SortedList<T>` that is actually just a list that is always sorted? According to [the MSDN documentation on SortedList](http://msdn.microsoft.com/en-us/library/ms132319.aspx), it is actually internally implemented as a dynamically-sized array of `KeyValuePair<TKey, TValue>` that is always sorted by the key. Wouldn’t the same class be more useful as a list of any type `T`? Wouldn’t that fit the name better, too?
.net
sortedlist
base-class-library
null
null
null
open
Why is there no SortedList<T> in .NET? === Why is there only a `SortedList<TKey, TValue>` which looks more like a dictionary, but no `SortedList<T>` that is actually just a list that is always sorted? According to [the MSDN documentation on SortedList](http://msdn.microsoft.com/en-us/library/ms132319.aspx), it is actually internally implemented as a dynamically-sized array of `KeyValuePair<TKey, TValue>` that is always sorted by the key. Wouldn’t the same class be more useful as a list of any type `T`? Wouldn’t that fit the name better, too?
0
8,855,512
01/13/2012 18:40:51
1,148,297
01/13/2012 18:31:59
1
0
Attach two different arrays which can have same ID's but different values?
**Array-1** **Array-2** ID Names ID Names 1 ABC 1 abc 2 DEF 3 ghi 3 GHI 5 xyz 4 PQR 5 XYZ **RESULT** ID NAMES names 1 ABC abc 2 DEF -- 3 GHI ghi 4 PQR -- 5 XYZ xyz
php
php5
null
null
null
01/14/2012 19:50:01
not a real question
Attach two different arrays which can have same ID's but different values? === **Array-1** **Array-2** ID Names ID Names 1 ABC 1 abc 2 DEF 3 ghi 3 GHI 5 xyz 4 PQR 5 XYZ **RESULT** ID NAMES names 1 ABC abc 2 DEF -- 3 GHI ghi 4 PQR -- 5 XYZ xyz
1
8,292,578
11/28/2011 07:19:20
267,695
02/06/2010 11:09:43
1
0
Mercurial failed to load in IIS 7 on windows 2008
Trying to setup Mercurial on windows 2008 using IIS 7. Followed the instruction from the following links, http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2 http://www.jeremyskinner.co.uk/mercurial-on-iis7/ After the setup, when I try to load the hgweb.cgi page, I keep having the error "DLL failed loading". Bellow shows the full error message. From the error, it quite hard to know which DLL is missing. I have tried to find the missing DLL, but do not succeed. Has anyone having the same problem before? What's the missing DLL? I'm using Murcurial 2.0 and python 2.6 with the precompiled installer. Tried both x86 and x64 installer, still has the same problem. HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Traceback (most recent call last): File "C:\inetpub\wwwroot\hg\hgweb.cgi", line 24, in <module> application = hgweb(config) File "mercurial\hgweb\__init__.pyc", line 26, in hgweb File "mercurial\hgweb\hgwebdir_mod.pyc", line 89, in __init__ File "mercurial\hgweb\hgwebdir_mod.pyc", line 98, in refresh File "mercurial\ui.pyc", line 43, in __init__ File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\scmutil.pyc", line 164, in <module> File "mercurial\scmutil.pyc", line 180, in opener File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\util.pyc", line 27, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\windows.pyc", line 13, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\win32.pyc", line 11, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "ctypes\__init__.pyc", line 10, in <module> File "mercurial\demandimport.pyc", line 114, in _demandimport File "_ctypes.pyc", line 12, in <module> File "_ctypes.pyc", line 10, in __load ImportError: DLL load failed: The specified module could not be found. ".
iis
mercurial
windows-server-2008
null
null
null
open
Mercurial failed to load in IIS 7 on windows 2008 === Trying to setup Mercurial on windows 2008 using IIS 7. Followed the instruction from the following links, http://stackingcode.com/blog/2011/02/24/running-a-mercurial-server-on-iis-7-5-windows-server-2008-r2 http://www.jeremyskinner.co.uk/mercurial-on-iis7/ After the setup, when I try to load the hgweb.cgi page, I keep having the error "DLL failed loading". Bellow shows the full error message. From the error, it quite hard to know which DLL is missing. I have tried to find the missing DLL, but do not succeed. Has anyone having the same problem before? What's the missing DLL? I'm using Murcurial 2.0 and python 2.6 with the precompiled installer. Tried both x86 and x64 installer, still has the same problem. HTTP Error 502.2 - Bad Gateway The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Traceback (most recent call last): File "C:\inetpub\wwwroot\hg\hgweb.cgi", line 24, in <module> application = hgweb(config) File "mercurial\hgweb\__init__.pyc", line 26, in hgweb File "mercurial\hgweb\hgwebdir_mod.pyc", line 89, in __init__ File "mercurial\hgweb\hgwebdir_mod.pyc", line 98, in refresh File "mercurial\ui.pyc", line 43, in __init__ File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\scmutil.pyc", line 164, in <module> File "mercurial\scmutil.pyc", line 180, in opener File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\util.pyc", line 27, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\windows.pyc", line 13, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "mercurial\win32.pyc", line 11, in <module> File "mercurial\demandimport.pyc", line 86, in __getattribute__ File "mercurial\demandimport.pyc", line 58, in _load File "ctypes\__init__.pyc", line 10, in <module> File "mercurial\demandimport.pyc", line 114, in _demandimport File "_ctypes.pyc", line 12, in <module> File "_ctypes.pyc", line 10, in __load ImportError: DLL load failed: The specified module could not be found. ".
0
5,976,197
05/12/2011 09:49:24
750,083
05/12/2011 07:12:35
1
0
Hi i have a problem in DateTime API.
I was not able to get Proper Local time from UTC time.due to daylight time savings.This issue i have seen only in onle laptop. i have added the code. DateTime convertedDate = DateTime.SpecifyKind(startTime, DateTimeKind.Utc); DateTime dt = convertedDate.ToLocalTime(); Please let me know.
datetime
null
null
null
null
03/11/2012 14:46:05
not a real question
Hi i have a problem in DateTime API. === I was not able to get Proper Local time from UTC time.due to daylight time savings.This issue i have seen only in onle laptop. i have added the code. DateTime convertedDate = DateTime.SpecifyKind(startTime, DateTimeKind.Utc); DateTime dt = convertedDate.ToLocalTime(); Please let me know.
1
10,325,668
04/26/2012 00:24:13
912,403
08/25/2011 15:02:45
28
0
Access violation in list when deleting element of unorderd_map
I got a wierd access violation error.. When I put a break point at the exit of the function below It sometimes go to the end of the function and sometimes not.. the call stack is the same.. The access violation is inside the list header on line 1533.. s_subscriptions is a static member of type SubscriptionsMap.. typedef std::vector<HandlerSubscriptionBasePtr> Subscriptions; typedef std::unordered_map<const std::type_info*, Subscriptions> SubscriptionsMap; void TE::Events::Event::UnRegisterSubscription(const std::type_info* eventTypeInfoPtr, const EventHandler* eventHandler) { SubscriptionsMap::iterator mapItr = s_subscriptions.find(eventTypeInfoPtr); if (mapItr != s_subscriptions.end()) { s_subscriptions.erase(mapItr); } } I've tried writing a test case for this, but havent been able to reproduce it. What could this be? How do I debug it?
c++
std
null
null
null
null
open
Access violation in list when deleting element of unorderd_map === I got a wierd access violation error.. When I put a break point at the exit of the function below It sometimes go to the end of the function and sometimes not.. the call stack is the same.. The access violation is inside the list header on line 1533.. s_subscriptions is a static member of type SubscriptionsMap.. typedef std::vector<HandlerSubscriptionBasePtr> Subscriptions; typedef std::unordered_map<const std::type_info*, Subscriptions> SubscriptionsMap; void TE::Events::Event::UnRegisterSubscription(const std::type_info* eventTypeInfoPtr, const EventHandler* eventHandler) { SubscriptionsMap::iterator mapItr = s_subscriptions.find(eventTypeInfoPtr); if (mapItr != s_subscriptions.end()) { s_subscriptions.erase(mapItr); } } I've tried writing a test case for this, but havent been able to reproduce it. What could this be? How do I debug it?
0
11,261,353
06/29/2012 11:57:34
867,439
07/28/2011 12:20:44
16
2
has_many :through causes error: HasManyThroughSourceAssociationMacroError
I need to assign students (users) to classes (studentclasses) I have a simple many-to-many relationship using 3 tables: **studentclasses** (lesson details) **users** (user... student info) **studentclass_users** (Join table containing **user_id** and **studentclass_id**) I'm using has_many :through and my models look like the following: **studentclass.rb** class Studentclass < ActiveRecord::Base has_many :studentclass_users has_many :users, :through => :studentclass_users end **user.rb** class User < ActiveRecord::Base ...more here... has_many :studentclass_users has_many :studentclasses, :through => :studentclass_users end **studentclass_users.rb** class StudentclassUsers < ActiveRecord::Base belongs_to :studentclass belongs_to :user end For testing purposes, I'm just using a hidden field in my studentclass new view partial to tack on a user id when creating the class and it is as follows: **_new.html.erb** <%= hidden_field_tag "studentclass[user_ids][]", 29%> And in my studentclass controller: **studentclasses_controller.rb** def new @studentclass = Studentclass.new end def create @studentclass = Studentclass.new(params[:studentclass]) @studentclass.save! end My params comes back: > Parameters: {"utf8"=>"✓", "authenticity_token"=>"MjBTf4rtcyo8inADrSxPZB3vLOKtlZRVFlQJJzfCqWs=", "studentclass"=>{"class_title"=>"hjhkj", "user_ids"=>["29"]}, "commit"=>"Save"} which seems fine but I get the following error: > NameError (uninitialized constant ActiveRecord::HasManyThroughSourceAssociationMacroError): I think this is something simple with naming maybe? Any help would be appreciated
ruby-on-rails-3
associations
null
null
null
null
open
has_many :through causes error: HasManyThroughSourceAssociationMacroError === I need to assign students (users) to classes (studentclasses) I have a simple many-to-many relationship using 3 tables: **studentclasses** (lesson details) **users** (user... student info) **studentclass_users** (Join table containing **user_id** and **studentclass_id**) I'm using has_many :through and my models look like the following: **studentclass.rb** class Studentclass < ActiveRecord::Base has_many :studentclass_users has_many :users, :through => :studentclass_users end **user.rb** class User < ActiveRecord::Base ...more here... has_many :studentclass_users has_many :studentclasses, :through => :studentclass_users end **studentclass_users.rb** class StudentclassUsers < ActiveRecord::Base belongs_to :studentclass belongs_to :user end For testing purposes, I'm just using a hidden field in my studentclass new view partial to tack on a user id when creating the class and it is as follows: **_new.html.erb** <%= hidden_field_tag "studentclass[user_ids][]", 29%> And in my studentclass controller: **studentclasses_controller.rb** def new @studentclass = Studentclass.new end def create @studentclass = Studentclass.new(params[:studentclass]) @studentclass.save! end My params comes back: > Parameters: {"utf8"=>"✓", "authenticity_token"=>"MjBTf4rtcyo8inADrSxPZB3vLOKtlZRVFlQJJzfCqWs=", "studentclass"=>{"class_title"=>"hjhkj", "user_ids"=>["29"]}, "commit"=>"Save"} which seems fine but I get the following error: > NameError (uninitialized constant ActiveRecord::HasManyThroughSourceAssociationMacroError): I think this is something simple with naming maybe? Any help would be appreciated
0
8,130,781
11/15/2011 02:25:17
472,034
01/17/2010 07:35:04
422
0
How to disable displaying of errors in php and log them in a file
I'm trying to disable displaying of errors in a file and just log them into a log file <?php error_reporting('E_ALL'); echo $x; ?> The log file works when I remove the error_reporting('E_ALL') but then the errors are also displayed. Is there another way to do this, but disabling error reporting on specific pages only.
php
error-reporting
null
null
null
null
open
How to disable displaying of errors in php and log them in a file === I'm trying to disable displaying of errors in a file and just log them into a log file <?php error_reporting('E_ALL'); echo $x; ?> The log file works when I remove the error_reporting('E_ALL') but then the errors are also displayed. Is there another way to do this, but disabling error reporting on specific pages only.
0
463,197
01/20/2009 21:28:38
46,866
12/16/2008 23:40:27
17
12
How do I "refresh" element in DOM?
I've got an empty DIV element in which I append images by using function createElement("img") and append them with appendChild. So now I've got DIV element full of images. I would like to use one button to clean this DIV and add new images in it simultaneously. Thanks for your help
javascript
dom
null
null
null
null
open
How do I "refresh" element in DOM? === I've got an empty DIV element in which I append images by using function createElement("img") and append them with appendChild. So now I've got DIV element full of images. I would like to use one button to clean this DIV and add new images in it simultaneously. Thanks for your help
0
11,471,096
07/13/2012 13:04:10
1,523,603
07/13/2012 12:57:06
1
0
IOS Development: Game application creating user accounts
I am looking to create a game application and have done a lot of video tutorials and read a lot of books on IOS. I would like to know more information on techniques and common practices for game applications. I do not want to setup a game using GK/Game Center. Ideally I would like the user to have the option to enter some basic fields like Username/Password or to login with Facebook to create a user account. The game will be peer-to-peer and played by one user completing a move that sending to the other and vice versa. I have had a look at the Facebook SDK and the Hackbook sample application and that part is all fine. I would like to know if someone can provide more information, video tutorial, eBooks and/or sample code for applications that create user accounts. What methods do they use to create these for multi player games, how these are then managed in terms of multiple users being created and playing the game, how these are scalable etc. Thanks
mysql
ios
sqlite
facebook-ios-sdk
ios-sdk
07/15/2012 06:14:02
not constructive
IOS Development: Game application creating user accounts === I am looking to create a game application and have done a lot of video tutorials and read a lot of books on IOS. I would like to know more information on techniques and common practices for game applications. I do not want to setup a game using GK/Game Center. Ideally I would like the user to have the option to enter some basic fields like Username/Password or to login with Facebook to create a user account. The game will be peer-to-peer and played by one user completing a move that sending to the other and vice versa. I have had a look at the Facebook SDK and the Hackbook sample application and that part is all fine. I would like to know if someone can provide more information, video tutorial, eBooks and/or sample code for applications that create user accounts. What methods do they use to create these for multi player games, how these are then managed in terms of multiple users being created and playing the game, how these are scalable etc. Thanks
4
5,433,038
03/25/2011 13:24:00
909,457
08/11/2010 18:18:14
40
5
MapView annotation view
i need to change the view of annotation after each 20 second how can i do it for (int i = 0; i < [_shadowArray count]; i++) { Shadows* shadowObj1; shadowObj1 = [_shadowArray objectAtIndex:i]; CLLocationCoordinate2D location1; location1.latitude = [shadowObj1.position_x floatValue]; location1.longitude = [shadowObj1.position_y floatValue]; annotaionObj = [[AnnotationDelegate alloc] initWithCoordinate:location1 name:@"" sub:@"Catch me! "]; [_annotationArray addObject:annotaionObj]; [_mapView addAnnotation:annotaionObj]; }
iphone
null
null
null
null
null
open
MapView annotation view === i need to change the view of annotation after each 20 second how can i do it for (int i = 0; i < [_shadowArray count]; i++) { Shadows* shadowObj1; shadowObj1 = [_shadowArray objectAtIndex:i]; CLLocationCoordinate2D location1; location1.latitude = [shadowObj1.position_x floatValue]; location1.longitude = [shadowObj1.position_y floatValue]; annotaionObj = [[AnnotationDelegate alloc] initWithCoordinate:location1 name:@"" sub:@"Catch me! "]; [_annotationArray addObject:annotaionObj]; [_mapView addAnnotation:annotaionObj]; }
0
3,504,273
08/17/2010 15:42:39
39,677
11/03/2008 21:48:03
5,890
4
when people say they run 'scala in the backend', in what context could they be talking about?
Say the use scala to process incoming email etc. In what context is (or could) they be running scala? Can it run inside its own daemon? Can it run inside of tomcat? Or would you use it in a cron job? or is it all of the above? :) Sorry this is an open question, and I don't know much about scala, but I just want an idea of how one could utilize scala and under what context it can run in.
scala
null
null
null
null
null
open
when people say they run 'scala in the backend', in what context could they be talking about? === Say the use scala to process incoming email etc. In what context is (or could) they be running scala? Can it run inside its own daemon? Can it run inside of tomcat? Or would you use it in a cron job? or is it all of the above? :) Sorry this is an open question, and I don't know much about scala, but I just want an idea of how one could utilize scala and under what context it can run in.
0
9,438,077
02/24/2012 21:08:51
1,058,876
11/22/2011 01:13:54
6
0
Disable URL creation for node in Drupal
In Drupal, I need to create a node that doesn't have a URL. I have a node called "Collection". It is made up of Collection Pieces (also nodes). It's a list that's presented in a slider. I use nodereference inside the collection, referencing the pieces. I want the collection to have a URL, but not the pieces. Anyone know how to disable the url creation for a node?
drupal
drupal-6
null
null
null
null
open
Disable URL creation for node in Drupal === In Drupal, I need to create a node that doesn't have a URL. I have a node called "Collection". It is made up of Collection Pieces (also nodes). It's a list that's presented in a slider. I use nodereference inside the collection, referencing the pieces. I want the collection to have a URL, but not the pieces. Anyone know how to disable the url creation for a node?
0
7,327,931
09/07/2011 01:23:40
899,231
08/17/2011 18:19:48
6
0
Sharepoint 2010 Dashboard showing error when we try to connect DataSource
SharePoint 2010 Dashboard showing error when we try to connect Data Source.the Error is "An Excepted Error Occurred Contact to Administrator". Kindly help me out. I have goggled a lot but i am unable to find the answer. Thanks In advance Kishan Srivastava SharePoint Consultant
sharepoint
sharepoint2010
sharepoint2007
sharepoint-designer
null
03/28/2012 18:07:07
off topic
Sharepoint 2010 Dashboard showing error when we try to connect DataSource === SharePoint 2010 Dashboard showing error when we try to connect Data Source.the Error is "An Excepted Error Occurred Contact to Administrator". Kindly help me out. I have goggled a lot but i am unable to find the answer. Thanks In advance Kishan Srivastava SharePoint Consultant
2
11,591,703
07/21/2012 11:19:23
1,504,222
07/05/2012 13:57:07
1
0
Value of dropdown
I have 2 tables: CITY 1 New York 2 Melbourne 3 Rome USER 1 John 2 2 Marco 3 3th column of user is a city ID How to proceed to retrieve a Marco's user page and get in dropdown selected value ROME? Thanks.
php
null
null
null
null
07/21/2012 23:58:39
not a real question
Value of dropdown === I have 2 tables: CITY 1 New York 2 Melbourne 3 Rome USER 1 John 2 2 Marco 3 3th column of user is a city ID How to proceed to retrieve a Marco's user page and get in dropdown selected value ROME? Thanks.
1
11,227,953
06/27/2012 13:59:26
1,478,325
06/24/2012 16:08:34
14
0
Event Model in Obj C // IOS
I just created a customViewController with some user actions like touch. I would like to handle the user interaction in the parentObject. In other words the one that created the viewController. From other languages I am used to use Events that are pushed up. So my parent object would have some kind of listener on the reference of the viewController object it can react to. How would that type of interaction handled by Objective C? Thanks Again
objective-c
events
null
null
null
null
open
Event Model in Obj C // IOS === I just created a customViewController with some user actions like touch. I would like to handle the user interaction in the parentObject. In other words the one that created the viewController. From other languages I am used to use Events that are pushed up. So my parent object would have some kind of listener on the reference of the viewController object it can react to. How would that type of interaction handled by Objective C? Thanks Again
0
3,699,468
09/13/2010 10:15:21
446,177
09/13/2010 10:13:42
1
0
iphone application
how to display output of html file in iphone
iphone
null
null
null
null
09/14/2010 09:41:00
not a real question
iphone application === how to display output of html file in iphone
1
8,711,047
01/03/2012 10:45:09
246,776
01/08/2010 22:16:08
6,259
108
Reliable XMPP server recommendation which support file transfer proxy?
I'm using iChat with iCloud/Google accounts. My friends are using iChat/Google Talk (on Windows). We exchanges files very frequently, but sometimes, no very usually, file transfer is impossible because the port is closed or one is behind the firewall. So I decided to install a XMPP server on my AWS instance. The important point is file transferring thought server must be supported. Can I have some list of recommended server software? PS. I'm not sure about this question is appropriate here. If it's not, please promote this to the place :)
xmpp
file-transfer
null
null
null
01/04/2012 13:53:43
off topic
Reliable XMPP server recommendation which support file transfer proxy? === I'm using iChat with iCloud/Google accounts. My friends are using iChat/Google Talk (on Windows). We exchanges files very frequently, but sometimes, no very usually, file transfer is impossible because the port is closed or one is behind the firewall. So I decided to install a XMPP server on my AWS instance. The important point is file transferring thought server must be supported. Can I have some list of recommended server software? PS. I'm not sure about this question is appropriate here. If it's not, please promote this to the place :)
2
7,882,101
10/24/2011 21:17:29
2,173
08/20/2008 18:06:11
2,266
82
Will partitioning fix my deadlock issues
I have an application that updates a table in my SQL Server 2005 database. The app has one thread for each of my regions and these threads run concurrently. On rare occasions, I run into a SQL Server deadlock error when updating the table. It has recently occurred to me that I should partition my table by region. It seems to me that the problem should go away but I can't replicate this error in my test environment so I can't prove it. Does anyone have any thoughts on this?
sql-server-2005
database-partitioning
null
null
null
null
open
Will partitioning fix my deadlock issues === I have an application that updates a table in my SQL Server 2005 database. The app has one thread for each of my regions and these threads run concurrently. On rare occasions, I run into a SQL Server deadlock error when updating the table. It has recently occurred to me that I should partition my table by region. It seems to me that the problem should go away but I can't replicate this error in my test environment so I can't prove it. Does anyone have any thoughts on this?
0
8,358,943
12/02/2011 15:53:22
375,374
06/24/2010 14:36:41
73
1
Weird unidentified connection beside regular wireless connection in windows 7
Every time I connect to a wireless network, the `Network and Sharing Center` shows that there is actually 2 connections that windows is connected to. Name of one of them is the name of the wireless network that is broadcasting by the router but the other one is named `Unidentified Network` which I don't know where it's coming from. ![two connections][1] In the network map also there is an Unknown item that is so weird. ![The Unknown item][2] My computer is Kamran-Think and teytey is name of the WiFi. Eco-Teh-Laptop is another computer that is not related to this issue. What is this redundant network? And how it came to my connections? Can it be a sniffer connection? [1]: http://i.stack.imgur.com/r6Lmx.png [2]: http://i.stack.imgur.com/8KbIx.png
windows-7
wireless
sniffing
network-connection
null
12/02/2011 18:32:16
off topic
Weird unidentified connection beside regular wireless connection in windows 7 === Every time I connect to a wireless network, the `Network and Sharing Center` shows that there is actually 2 connections that windows is connected to. Name of one of them is the name of the wireless network that is broadcasting by the router but the other one is named `Unidentified Network` which I don't know where it's coming from. ![two connections][1] In the network map also there is an Unknown item that is so weird. ![The Unknown item][2] My computer is Kamran-Think and teytey is name of the WiFi. Eco-Teh-Laptop is another computer that is not related to this issue. What is this redundant network? And how it came to my connections? Can it be a sniffer connection? [1]: http://i.stack.imgur.com/r6Lmx.png [2]: http://i.stack.imgur.com/8KbIx.png
2
6,903,523
08/01/2011 19:42:09
693,670
04/05/2011 19:54:39
66
1
Syntax Error: expecting rightparen before
I wrote a singleton class to keep track of some variables across my application. I am getting a syntax error that I can't figure out, I am sure that I am missing something simple but it's been one of those days. Anyone see something wrong with my code? The error is 1084: Syntax error: expecting rightparen before resultNumber. public static function setResult(int resultNumber, int value): void { switch(resultNumber) { case 2: { this.result2 = value; break; } case 3: { this.result3 = value; break; } case 4: { this.result4 = value; break; } case 5: { this.result5 = value; break; } case 6: { this.result6 = value; break; } case 7: { this.result7 = value; break; } case 8: { this.result8 = value; break; } case 9: { this.result9 = value; break; } case 10: { this.result10 = value; break; } case 11: { this.result11 = value; break; } case 12: { this.result12 = value; break; } case 13: { this.result13 = value; break; } case 14: { this.result14 = value; break; } } }
flex
actionscript-3
null
null
null
null
open
Syntax Error: expecting rightparen before === I wrote a singleton class to keep track of some variables across my application. I am getting a syntax error that I can't figure out, I am sure that I am missing something simple but it's been one of those days. Anyone see something wrong with my code? The error is 1084: Syntax error: expecting rightparen before resultNumber. public static function setResult(int resultNumber, int value): void { switch(resultNumber) { case 2: { this.result2 = value; break; } case 3: { this.result3 = value; break; } case 4: { this.result4 = value; break; } case 5: { this.result5 = value; break; } case 6: { this.result6 = value; break; } case 7: { this.result7 = value; break; } case 8: { this.result8 = value; break; } case 9: { this.result9 = value; break; } case 10: { this.result10 = value; break; } case 11: { this.result11 = value; break; } case 12: { this.result12 = value; break; } case 13: { this.result13 = value; break; } case 14: { this.result14 = value; break; } } }
0
11,402,621
07/09/2012 20:28:58
981,205
10/05/2011 20:59:00
58
1
Fluent nHibernate, Hi-Lo table with entity-per-row using a convention
Is there a way to specify a table to use for Hi-Lo values, with each entity having a per-row entry, via a convention (while still having nHibernate create the table structure for you)? I would like to replicate what Phil Haydon blogged about [here][1], but without having to manually manage the table. As it stands, migrating his row-per-table code to its own convention will work only if you've already created the appropriate entries for 'TableKey' in the table already. Alternatively, is this possible via the XML mappings? And if all else fails, is the only other appropriate option to use a custom generator, a la [this post][2]? [1]: http://www.philliphaydon.com/2010/10/using-hilo-with-fluentnhibernate/ [2]: http://daniel.wertheim.se/2011/03/08/nhibernate-custom-id-generator/
nhibernate
fluent-nhibernate
null
null
null
null
open
Fluent nHibernate, Hi-Lo table with entity-per-row using a convention === Is there a way to specify a table to use for Hi-Lo values, with each entity having a per-row entry, via a convention (while still having nHibernate create the table structure for you)? I would like to replicate what Phil Haydon blogged about [here][1], but without having to manually manage the table. As it stands, migrating his row-per-table code to its own convention will work only if you've already created the appropriate entries for 'TableKey' in the table already. Alternatively, is this possible via the XML mappings? And if all else fails, is the only other appropriate option to use a custom generator, a la [this post][2]? [1]: http://www.philliphaydon.com/2010/10/using-hilo-with-fluentnhibernate/ [2]: http://daniel.wertheim.se/2011/03/08/nhibernate-custom-id-generator/
0
6,115,154
05/24/2011 18:34:33
462,883
09/30/2010 13:51:32
21
1
Strange PHP behavior - code mis-counts cumulative data entry in table
I'm trying to have a running total of the number of views an image gets. My test file works perfectly. The actual file, image_win.php, does not and after much testing can't see what's wrong. thanks for taking a look <? //////TEST IMAGE_WIN ////////// include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $art_id = 372; $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = image_visit +1 WHERE user_id = '$owner_id'"); ?> <?php //////// image_win.php //////////////////////////////////// $user_id=$_SESSION['user_id']; include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $image_link = $_GET['image_link']; $art_id = $_GET['art_id']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, height=device-height, target-densityDpi=device-dpi"> <title>Image Window</title> </head> <body bgcolor="#000000" leftmargin="0"> <div align="center" > <img src="slir/w640-h535/<?php echo $path.$image_link.$postCat; ?>" /> <?php $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = (image_visit +1) WHERE user_id = '$owner_id' "); ?>
php
mysql
null
null
null
05/27/2011 03:01:16
not a real question
Strange PHP behavior - code mis-counts cumulative data entry in table === I'm trying to have a running total of the number of views an image gets. My test file works perfectly. The actual file, image_win.php, does not and after much testing can't see what's wrong. thanks for taking a look <? //////TEST IMAGE_WIN ////////// include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $art_id = 372; $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = image_visit +1 WHERE user_id = '$owner_id'"); ?> <?php //////// image_win.php //////////////////////////////////// $user_id=$_SESSION['user_id']; include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $image_link = $_GET['image_link']; $art_id = $_GET['art_id']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, height=device-height, target-densityDpi=device-dpi"> <title>Image Window</title> </head> <body bgcolor="#000000" leftmargin="0"> <div align="center" > <img src="slir/w640-h535/<?php echo $path.$image_link.$postCat; ?>" /> <?php $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = (image_visit +1) WHERE user_id = '$owner_id' "); ?>
1
9,125,841
02/03/2012 08:42:09
533,178
12/07/2010 04:29:12
15
1
rewrite domain to url
I have main domain for example domain.com and i need rewrite another to url for example if domain not domain.com and domain is http://www.yyaa.com/say rewrite it to http://domain.com/index.php?p=say RewriteEngine on RewriteBase / RewriteRule (.*) http://domain.tld/dashboard/$1 [P,QSA,L]
php
.htaccess
mod-rewrite
null
null
02/05/2012 07:35:11
off topic
rewrite domain to url === I have main domain for example domain.com and i need rewrite another to url for example if domain not domain.com and domain is http://www.yyaa.com/say rewrite it to http://domain.com/index.php?p=say RewriteEngine on RewriteBase / RewriteRule (.*) http://domain.tld/dashboard/$1 [P,QSA,L]
2
4,920,674
02/07/2011 11:21:01
415,973
08/10/2010 09:22:16
210
3
Intellij instead of Blackberry JDE
I'm trying to develop a few apps for blackberry and the [IDE they have][1] I'm really not interested in that. I used to use eclipse but after I used IntelliJ IDEA I really don't want to downgrade just for a BlackBerry Java Plug-in for Eclipse. Does anyone know how I can successfully develop in IntelliJ w/o debugging issues? [1]: http://na.blackberry.com/eng/developers/downloads/jde.jsp
blackberry
intellij-idea
blackberry-jde
null
null
null
open
Intellij instead of Blackberry JDE === I'm trying to develop a few apps for blackberry and the [IDE they have][1] I'm really not interested in that. I used to use eclipse but after I used IntelliJ IDEA I really don't want to downgrade just for a BlackBerry Java Plug-in for Eclipse. Does anyone know how I can successfully develop in IntelliJ w/o debugging issues? [1]: http://na.blackberry.com/eng/developers/downloads/jde.jsp
0
8,643,986
12/27/2011 11:10:22
712,779
04/18/2011 04:27:49
18
2
How does corona SDK build for Android
I recently read about Corona SDK and thought I willl give it a try, the concept is really cool since they use Lua as the scripting environment and it is good for cross platform development, Lua script written can be directly run on the Corona Simulator since it is a Lua Interpreter My question is How does it build for Android, does the Lua script get converted to Java code? Does this happen using the local android SDK or do I need to upload the code to Corona servers? It will be really nice if someone who has used it give more details. Thanks in advance.
android
corona
null
null
null
null
open
How does corona SDK build for Android === I recently read about Corona SDK and thought I willl give it a try, the concept is really cool since they use Lua as the scripting environment and it is good for cross platform development, Lua script written can be directly run on the Corona Simulator since it is a Lua Interpreter My question is How does it build for Android, does the Lua script get converted to Java code? Does this happen using the local android SDK or do I need to upload the code to Corona servers? It will be really nice if someone who has used it give more details. Thanks in advance.
0
11,616,937
07/23/2012 16:52:48
427,784
08/22/2010 18:23:20
254
2
Why strange declaration of CCLayer in cocos2d?
I have a class GameScene, during init of which I make a scene and attach a child to it - a layer. I noticed strange code for it: CCScene *scene = [CCScene node]; CCLayer *layer = [GameScene node]; [scene addChild:layer]; Why not do this instead? CCLayer *layer = [CCLayer node]; This doesn't add to readability or am I missing something fundamental here? Also, why not use alloc init at all?
objective-c
ios
cocos2d-iphone
null
null
null
open
Why strange declaration of CCLayer in cocos2d? === I have a class GameScene, during init of which I make a scene and attach a child to it - a layer. I noticed strange code for it: CCScene *scene = [CCScene node]; CCLayer *layer = [GameScene node]; [scene addChild:layer]; Why not do this instead? CCLayer *layer = [CCLayer node]; This doesn't add to readability or am I missing something fundamental here? Also, why not use alloc init at all?
0
4,507,764
12/22/2010 09:27:00
550,087
12/21/2010 15:05:06
1
1
Career in Mainframe field
0 down vote Hi, I am a B.Tech final year Information Technology Student. I am very much interested in pursuing my career in the Mainframe field. I have basic knowledge about the AIX OS and i have done a IBM certification on "IBM ZOS System Programmer Entry level" and scored 90%. But when i surf the Internet for Mainframe related Jobs everywhere i see only the term "EXPERIENCE". I would be really grateful if you guide me how to start my career in Mainframe. I have a offer letter form "TCS" right now and also got an opportunity to study my last semester in University of Wisconsion-Milwaukee for which i am leaving to US dis January. Is there any chance that i will get a mainframe related job there in US or in INDIA after i finish my Undergraduation? Please do answer me in e-mail personally. All suggestions are greatly invited.
mainframe
null
null
null
null
12/23/2010 03:54:10
off topic
Career in Mainframe field === 0 down vote Hi, I am a B.Tech final year Information Technology Student. I am very much interested in pursuing my career in the Mainframe field. I have basic knowledge about the AIX OS and i have done a IBM certification on "IBM ZOS System Programmer Entry level" and scored 90%. But when i surf the Internet for Mainframe related Jobs everywhere i see only the term "EXPERIENCE". I would be really grateful if you guide me how to start my career in Mainframe. I have a offer letter form "TCS" right now and also got an opportunity to study my last semester in University of Wisconsion-Milwaukee for which i am leaving to US dis January. Is there any chance that i will get a mainframe related job there in US or in INDIA after i finish my Undergraduation? Please do answer me in e-mail personally. All suggestions are greatly invited.
2
4,551,854
12/29/2010 06:06:48
515,034
11/21/2010 11:06:45
56
13
Best book to practice HTML?
Which is the best book to practice HTML and memorizing those tags with that practice? What is best choice?
html
css
books
web-application-design
null
12/25/2011 01:30:17
not constructive
Best book to practice HTML? === Which is the best book to practice HTML and memorizing those tags with that practice? What is best choice?
4
9,878,563
03/26/2012 19:39:04
1,103,702
12/17/2011 17:03:19
892
117
A==B vs B==A, What are the differences
So to make a long story short. A professor asked this question in class as a discussion starter. Besides the obvious A = 'C' A==B will guarantee no NPE when comparing, what are the reason to use B==A instead of A==B? Where A and B are of same type, and this is language independent. So you can assume A.equals(B) for JAVA, or equivalent syntax in C or C++ etc.... And no, this is not homework.
c#
java
programming-languages
null
null
03/26/2012 19:49:29
not a real question
A==B vs B==A, What are the differences === So to make a long story short. A professor asked this question in class as a discussion starter. Besides the obvious A = 'C' A==B will guarantee no NPE when comparing, what are the reason to use B==A instead of A==B? Where A and B are of same type, and this is language independent. So you can assume A.equals(B) for JAVA, or equivalent syntax in C or C++ etc.... And no, this is not homework.
1
9,568,496
03/05/2012 14:41:11
924,923
09/02/2011 08:49:29
3
0
How to eliminate the unreadable character from the string with javascript?
I am working on my own search engine,i have some unreadable result like this : Tile : Ù�ارسیÙ�Ø§Ø±Ø so i want to eliminate them with javascript, How can i detect such these character?
javascript
null
null
null
null
03/05/2012 14:44:18
not a real question
How to eliminate the unreadable character from the string with javascript? === I am working on my own search engine,i have some unreadable result like this : Tile : Ù�ارسیÙ�Ø§Ø±Ø so i want to eliminate them with javascript, How can i detect such these character?
1
11,328,844
07/04/2012 12:10:37
473,040
10/12/2010 07:34:59
323
13
how to tell ransack gem to recognize datepicker US format
How to tell [ransack gem][1] to translate US format *mm/dd/yyyy* (deffault from [bootstrap datepicker][2]) ? project I'm working on will have several lacales files (UK, US), so UK is simple (just change the datepicker format option) but US format is problem **Example:** = search_form_for @post do |f| f.input :created_at_gt,7 ![enter image description here][3] params: {"utf8"=>"✓", "q"=>{"created_at_gt"=>"07/04/2012",....} sql: ... `posts`.`created_at` > '2012-04-07 00:00:00') LIMIT 25 OFFSET 0 (should be created_at > '2012-07-04 00:00:00' ) **Note:** I know I could handle that on controller level, but I'm looking for solution where Ransack will automatically pick up locales configuration and parse that way [1]: https://github.com/ernie/ransack/ [2]: http://www.eyecon.ro/bootstrap-datepicker/ [3]: http://i.stack.imgur.com/lxwfl.png
ruby-on-rails
ruby-on-rails-3
meta-search
ransack
null
null
open
how to tell ransack gem to recognize datepicker US format === How to tell [ransack gem][1] to translate US format *mm/dd/yyyy* (deffault from [bootstrap datepicker][2]) ? project I'm working on will have several lacales files (UK, US), so UK is simple (just change the datepicker format option) but US format is problem **Example:** = search_form_for @post do |f| f.input :created_at_gt,7 ![enter image description here][3] params: {"utf8"=>"✓", "q"=>{"created_at_gt"=>"07/04/2012",....} sql: ... `posts`.`created_at` > '2012-04-07 00:00:00') LIMIT 25 OFFSET 0 (should be created_at > '2012-07-04 00:00:00' ) **Note:** I know I could handle that on controller level, but I'm looking for solution where Ransack will automatically pick up locales configuration and parse that way [1]: https://github.com/ernie/ransack/ [2]: http://www.eyecon.ro/bootstrap-datepicker/ [3]: http://i.stack.imgur.com/lxwfl.png
0
10,498,284
05/08/2012 12:07:38
41,654
11/28/2008 18:03:04
339
9
Calling function by name (as a string) within an object literal in Javascript
I am currently building something in JS and have run into the following scenario: // these are set programmatically, not like this, just using as an example var data = {'someData':'blah'}; var widget = 'NameOfWidget'; var command = 'someFunctionName'; // there is a base object that has all widgets and their commands as child objects // format would be like: UBER.WidgetName.command(data); // here is how I have tried to call it thus far UBER[widget][command](data); window['UBER'][widget][command](data); I feel like I am close to figuring it out, just need a little help in figuring out exact syntax! Thanks!
javascript
oop
null
null
null
05/09/2012 13:46:42
not a real question
Calling function by name (as a string) within an object literal in Javascript === I am currently building something in JS and have run into the following scenario: // these are set programmatically, not like this, just using as an example var data = {'someData':'blah'}; var widget = 'NameOfWidget'; var command = 'someFunctionName'; // there is a base object that has all widgets and their commands as child objects // format would be like: UBER.WidgetName.command(data); // here is how I have tried to call it thus far UBER[widget][command](data); window['UBER'][widget][command](data); I feel like I am close to figuring it out, just need a little help in figuring out exact syntax! Thanks!
1
9,184,284
02/07/2012 21:32:18
929,770
09/06/2011 01:23:01
1
0
Where can I find a very simple jQuery/AJAX Coldfusion tutorial?
I am new to jquery but have some experience with Coldfusion. I have been desperate for an easy tutorial that shows how jQuery/AJAX pulls a query from a ColdFusion9 CFC and displays it on the HTML calling page. I tried following this [ben_tutorial][1] but it is too complex for me. There is also a another [tutorial][2], but I do not want to install a plugin. Where should I be looking? I am googling "jquery ajax coldfusion" [1]: http://www.bennadel.com/blog/1515-Ask-Ben-Building-An-AJAX-jQuery-And-ColdFusion-Powered-Application.htm?&_=0.7565910615958273#comments_38884 [2]: http://blog.pengoworks.com/index.cfm/2011/3/3/Easy-AJAX-using-ColdFusion-jQuery-and-CFCs
jquery
coldfusion
null
null
null
02/09/2012 14:41:17
not constructive
Where can I find a very simple jQuery/AJAX Coldfusion tutorial? === I am new to jquery but have some experience with Coldfusion. I have been desperate for an easy tutorial that shows how jQuery/AJAX pulls a query from a ColdFusion9 CFC and displays it on the HTML calling page. I tried following this [ben_tutorial][1] but it is too complex for me. There is also a another [tutorial][2], but I do not want to install a plugin. Where should I be looking? I am googling "jquery ajax coldfusion" [1]: http://www.bennadel.com/blog/1515-Ask-Ben-Building-An-AJAX-jQuery-And-ColdFusion-Powered-Application.htm?&_=0.7565910615958273#comments_38884 [2]: http://blog.pengoworks.com/index.cfm/2011/3/3/Easy-AJAX-using-ColdFusion-jQuery-and-CFCs
4
4,098,081
11/04/2010 15:10:41
497,295
11/04/2010 15:10:41
1
0
Different querystring urlencoding based on codepage. ASP classic
We are currently converting our webapp to UTF-8 from ISO-8859-1. And everything works great but requesting get/post variables from other sites (Signup forms). Some of this sites that post to our site have ISO-8859-1 encoding and som have UTF-8. The problem is that special characters gets URLencoded differently depending on the site charset. For example: ø = %F8 in ISO-8859-1 ø = %C3%B8 in UTF-8 I cant get %F8 right when i have UTF-8 charset. I only get a Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD). Any tips on how to fix this would be much appreciated:) Torbjørn
url
encoding
utf-8
asp
character-encoding
null
open
Different querystring urlencoding based on codepage. ASP classic === We are currently converting our webapp to UTF-8 from ISO-8859-1. And everything works great but requesting get/post variables from other sites (Signup forms). Some of this sites that post to our site have ISO-8859-1 encoding and som have UTF-8. The problem is that special characters gets URLencoded differently depending on the site charset. For example: ø = %F8 in ISO-8859-1 ø = %C3%B8 in UTF-8 I cant get %F8 right when i have UTF-8 charset. I only get a Unicode Character 'REPLACEMENT CHARACTER' (U+FFFD). Any tips on how to fix this would be much appreciated:) Torbjørn
0
84,766
09/17/2008 15:54:07
10,703
09/16/2008 01:08:24
265
15
What operating systems available for an 8-bit microprocessor?
It does not need to be a full fledged OS, but at least have multitasking capabilities (i.e. a scheduler). Please mention what processor architecture it works on. This is a **survey**, so exact capabilities are not really important. Think of this as being a place to look at for possibilities when your next 8-bit embedded project comes up...
embedded
rtos
operating-system
polls
null
05/05/2012 13:43:50
not constructive
What operating systems available for an 8-bit microprocessor? === It does not need to be a full fledged OS, but at least have multitasking capabilities (i.e. a scheduler). Please mention what processor architecture it works on. This is a **survey**, so exact capabilities are not really important. Think of this as being a place to look at for possibilities when your next 8-bit embedded project comes up...
4
5,137,605
02/28/2011 02:13:11
480,807
10/19/2010 17:38:13
103
3
What is the best programming language for a basic web service?
I want to develop an iPhone application that exchanges data with a server running a MySQL database. Is it a good idea to have the iPhone application interact with the server via a PHP script and transfer XML over HTTP? Or would it be better to create some sort of listening web-service using java or C/C++? I'm leaning towards leasing a linux-based VPS for the purpose of building this application. I have a good deal of experience building iPhone applications but I've never built an app that has exchanged data back and forth with a web server, and that's why I'm asking. Thanks! Also, I have a good working knowledge of: PHP JAVA C/C++ SQL and other stuff probably not relevant.
iphone
web-services
null
null
null
02/28/2011 02:27:59
not constructive
What is the best programming language for a basic web service? === I want to develop an iPhone application that exchanges data with a server running a MySQL database. Is it a good idea to have the iPhone application interact with the server via a PHP script and transfer XML over HTTP? Or would it be better to create some sort of listening web-service using java or C/C++? I'm leaning towards leasing a linux-based VPS for the purpose of building this application. I have a good deal of experience building iPhone applications but I've never built an app that has exchanged data back and forth with a web server, and that's why I'm asking. Thanks! Also, I have a good working knowledge of: PHP JAVA C/C++ SQL and other stuff probably not relevant.
4
3,404,028
08/04/2010 09:01:38
351,489
05/26/2010 23:55:50
80
4
ASPX / c# vs J2EE
I am supposed to create a intranet web application and the question is what technology I will use? is that the ASPX with C # or the Java EE. in any case I want to know the great advantages that I will receive. Thanks
c#
asp.net
asp.net-mvc
java-ee
null
08/04/2010 13:29:08
not constructive
ASPX / c# vs J2EE === I am supposed to create a intranet web application and the question is what technology I will use? is that the ASPX with C # or the Java EE. in any case I want to know the great advantages that I will receive. Thanks
4
11,142,922
06/21/2012 16:48:21
1,229,204
02/23/2012 19:32:03
78
0
how to combine 2 or more strings in text file
I've been trying to find a way to combine 2 strings from a single text file. The text file that I am reading has the following format: `String 1 String 2 String 3` ...etc. I would want to append string 2 to string 1 to have: "String1 String2". I tried using the split method and appended them using a string builder. However, this does not work because its doing the splitting and appending per line. I also cant use "." to combine them because they are not stored in variables. Does anyone know how to achieve this or an example? Thank you.
c#
null
null
null
null
06/22/2012 17:05:37
not a real question
how to combine 2 or more strings in text file === I've been trying to find a way to combine 2 strings from a single text file. The text file that I am reading has the following format: `String 1 String 2 String 3` ...etc. I would want to append string 2 to string 1 to have: "String1 String2". I tried using the split method and appended them using a string builder. However, this does not work because its doing the splitting and appending per line. I also cant use "." to combine them because they are not stored in variables. Does anyone know how to achieve this or an example? Thank you.
1
10,216,800
04/18/2012 19:43:57
265,767
02/03/2010 23:23:45
105
0
Sudoku algorithm, brute force
Iam trying to solve a sudoku board with a brute force algorithm, I cant really get this algorithm work correctly. There is created a object for each row, column and box that contains all squares(cells) that belongs to the actually column, square and row, this is used in legalValue() to check if value can be placed in the cell. I cant find the structure that make the algorithm to work. boolean setNumberMeAndTheRest(Board board) { if(getNext() == null) { for(int i = 1; i <= board.getDimension(); i++) { if(legalValue(i)) { setValue(i); } } board.saveSolution(); } else { if(this instanceof DefinedSquare) { getNext().setNumberMeAndTheRest(board); } else { for(int i = 1; i <= board.getDimension(); i++) { if(legalValue(i)) { setValue(i); if(getNext().setNumberMeAndTheRest(board)) { return true; } else { setValue(i+1); } } } return false; } } return false; } Here is legalValue(int i); boolean legalValue(int value) { if(row.legalValue(value) && columne.legalValue(value)) { return true; } return false; }
algorithm
sudoku
brute-force
null
null
04/19/2012 02:39:43
too localized
Sudoku algorithm, brute force === Iam trying to solve a sudoku board with a brute force algorithm, I cant really get this algorithm work correctly. There is created a object for each row, column and box that contains all squares(cells) that belongs to the actually column, square and row, this is used in legalValue() to check if value can be placed in the cell. I cant find the structure that make the algorithm to work. boolean setNumberMeAndTheRest(Board board) { if(getNext() == null) { for(int i = 1; i <= board.getDimension(); i++) { if(legalValue(i)) { setValue(i); } } board.saveSolution(); } else { if(this instanceof DefinedSquare) { getNext().setNumberMeAndTheRest(board); } else { for(int i = 1; i <= board.getDimension(); i++) { if(legalValue(i)) { setValue(i); if(getNext().setNumberMeAndTheRest(board)) { return true; } else { setValue(i+1); } } } return false; } } return false; } Here is legalValue(int i); boolean legalValue(int value) { if(row.legalValue(value) && columne.legalValue(value)) { return true; } return false; }
3
6,623,664
07/08/2011 11:18:05
777,225
05/31/2011 07:10:30
10
0
C - Weird behavior for addLast function of a linked list.
I'm creating a linked list data structure in C. However, I'm receiving some weird behavior in my implementation of an addLast function. It seems that the added element doesn't appear until my next call to addLast. My code (I'll explain through inline comments how I think my code is working): Helper code: typedef struct LinkedList linkedlist; typedef int ListElement; struct LinkedList{ ListElement data; linkedlist *next; }; //Initializes a list; void CreateList(linkedlist *list, ListElement contents){ list->data = contents; list->next = NULL; } //Prints the items of the list, head first. void displayList(linkedlist *list){ printf("(%d", list->data); linkedlist *node = list->next; if(node == NULL){ } else{ while(node->next != NULL){ printf(" %d", node->data); node = node->next; } } printf(")"); } Problematic code: //Adds an element at the tail of the list void addLast(linkedlist *list, ListElement forAdding){ linkedlist *node = list; linkedlist *NewNode = (linkedlist *) malloc(sizeof(linkedlist)); //Go to the last element in the list while(node->next != NULL){ node = node->next; } //Prepare the node we will add NewNode->data = forAdding; NewNode->next = NULL; //Since node is pointing to the tail element, set its //next to the NewNode---the new tail node->next = NewNode; } //Special attention to this function! void List(ListElement items[], linkedlist *list, int numItems){ int i = 0; while(i < numItems){ addLast(list, items[i]); printf("Before "); displayList(list); printf("\n"); printf("Added %d", items[i]); displayList(list); printf("\n"); i++; } } Main function: int main(){ linkedlist *l= (linkedlist *) malloc(sizeof(linkedlist)); CreateList(l, 0); int a_list[5] = {1, 2, 3, 5, 6}; List(a_list, l, sizeof(a_list)/sizeof(a_list[0])); printf("A list of five elements: %d", sizeof(a_list)/sizeof(a_list[0])); displayList(l); removeLast(l); addLast(l, 7); printf("\nAdded something at last position: "); displayList(l); printf("\n"); } For which I get the output: Before (0) Added 1(0) Before (0) Added 2(0 1) Before (0 1) Added 3(0 1 2) Before (0 1 2) Added 5(0 1 2 3) Before (0 1 2 3) Added 6(0 1 2 3 5) A list of five elements: 5(0 1 2 3 5) Added something at last position: (0 1 2 3 5 6) As you see, it seems that the item added will only appear on my next call to addLast. I've so far figured out that it is _actually_ there though for some reason it won't get printed. If, for instance, I do another `addLast(list, 6);` call just before I close function List (but outside the loop, of course!), the output line `Added something at last position...` (which happens after a call to `addLast(l, 7);` will actually display `Added something at last position: (0 1 2 3 5 6 6)`. So, what am I doing wrong? Thanks!
c
pointers
linked-list
null
null
null
open
C - Weird behavior for addLast function of a linked list. === I'm creating a linked list data structure in C. However, I'm receiving some weird behavior in my implementation of an addLast function. It seems that the added element doesn't appear until my next call to addLast. My code (I'll explain through inline comments how I think my code is working): Helper code: typedef struct LinkedList linkedlist; typedef int ListElement; struct LinkedList{ ListElement data; linkedlist *next; }; //Initializes a list; void CreateList(linkedlist *list, ListElement contents){ list->data = contents; list->next = NULL; } //Prints the items of the list, head first. void displayList(linkedlist *list){ printf("(%d", list->data); linkedlist *node = list->next; if(node == NULL){ } else{ while(node->next != NULL){ printf(" %d", node->data); node = node->next; } } printf(")"); } Problematic code: //Adds an element at the tail of the list void addLast(linkedlist *list, ListElement forAdding){ linkedlist *node = list; linkedlist *NewNode = (linkedlist *) malloc(sizeof(linkedlist)); //Go to the last element in the list while(node->next != NULL){ node = node->next; } //Prepare the node we will add NewNode->data = forAdding; NewNode->next = NULL; //Since node is pointing to the tail element, set its //next to the NewNode---the new tail node->next = NewNode; } //Special attention to this function! void List(ListElement items[], linkedlist *list, int numItems){ int i = 0; while(i < numItems){ addLast(list, items[i]); printf("Before "); displayList(list); printf("\n"); printf("Added %d", items[i]); displayList(list); printf("\n"); i++; } } Main function: int main(){ linkedlist *l= (linkedlist *) malloc(sizeof(linkedlist)); CreateList(l, 0); int a_list[5] = {1, 2, 3, 5, 6}; List(a_list, l, sizeof(a_list)/sizeof(a_list[0])); printf("A list of five elements: %d", sizeof(a_list)/sizeof(a_list[0])); displayList(l); removeLast(l); addLast(l, 7); printf("\nAdded something at last position: "); displayList(l); printf("\n"); } For which I get the output: Before (0) Added 1(0) Before (0) Added 2(0 1) Before (0 1) Added 3(0 1 2) Before (0 1 2) Added 5(0 1 2 3) Before (0 1 2 3) Added 6(0 1 2 3 5) A list of five elements: 5(0 1 2 3 5) Added something at last position: (0 1 2 3 5 6) As you see, it seems that the item added will only appear on my next call to addLast. I've so far figured out that it is _actually_ there though for some reason it won't get printed. If, for instance, I do another `addLast(list, 6);` call just before I close function List (but outside the loop, of course!), the output line `Added something at last position...` (which happens after a call to `addLast(l, 7);` will actually display `Added something at last position: (0 1 2 3 5 6 6)`. So, what am I doing wrong? Thanks!
0
10,718,344
05/23/2012 10:43:14
220,005
11/27/2009 11:57:06
2,695
157
Weird character (�) in SQL Server View def
I have generated the Create statement for a SQL Server view. Pretty standard, although there is a some replacing happening on a varchar column, such as: select Replace(txt, '�', '-') What the heck is '`�`'? When I run that against a row that contains that character, I am seeing the literal '`?`' being replaced. Any ideas? Do I need some special encoding in my editor?
tsql
sql-ser
null
null
null
null
open
Weird character (�) in SQL Server View def === I have generated the Create statement for a SQL Server view. Pretty standard, although there is a some replacing happening on a varchar column, such as: select Replace(txt, '�', '-') What the heck is '`�`'? When I run that against a row that contains that character, I am seeing the literal '`?`' being replaced. Any ideas? Do I need some special encoding in my editor?
0
8,561,399
12/19/2011 12:30:30
1,105,883
12/19/2011 12:27:42
1
0
Recording video using webcam in as3
i am new to as3, i know how to use a webcam in as3,i want to record webcam video and save to my Local disk Help me Thanks in advance
flash
actionscript-3
null
null
null
12/19/2011 18:47:39
not a real question
Recording video using webcam in as3 === i am new to as3, i know how to use a webcam in as3,i want to record webcam video and save to my Local disk Help me Thanks in advance
1
6,472,626
06/24/2011 19:10:10
800,447
06/15/2011 21:30:42
1
1
Submitting to App Store, App downloads >500Byte file for the first few times.
I have a little question, I have just started my way developing, newly to this, have already submitted some little with Nokia but am very excited about apple app store, I'm cocos2d to help me with it, to the point, My app downloads a text file that is under 500Bytes in size around 3 times in it's life, in It's life I mean that's it, even if you close your app, it's done with it. The second thing is when you click a special faceboo, twitter button, it downloads a text that is also very small in size, and use it as an input text to share it on facebook or twitter, That's all without the knowledge of the user, but if it's not connected to the internet, it will not interpret the user and will take the last version it have. Although in some places of my app, I warn my user if there's no internet, but not in the facebook button. Hope I delivered my question clear enough, thank you !
iphone
ios
ipad
apple
app-store
06/25/2011 10:28:13
not a real question
Submitting to App Store, App downloads >500Byte file for the first few times. === I have a little question, I have just started my way developing, newly to this, have already submitted some little with Nokia but am very excited about apple app store, I'm cocos2d to help me with it, to the point, My app downloads a text file that is under 500Bytes in size around 3 times in it's life, in It's life I mean that's it, even if you close your app, it's done with it. The second thing is when you click a special faceboo, twitter button, it downloads a text that is also very small in size, and use it as an input text to share it on facebook or twitter, That's all without the knowledge of the user, but if it's not connected to the internet, it will not interpret the user and will take the last version it have. Although in some places of my app, I warn my user if there's no internet, but not in the facebook button. Hope I delivered my question clear enough, thank you !
1
9,041,353
01/27/2012 23:16:54
973,931
09/30/2011 22:21:27
167
3
Design an algorithm to check whether k integers add up to x in the given set
Given an set of n integers and an integer x. Design an algorithm to check whether k integers add up to x in the given set. The complexity should be O(n^(k-1) * logn)
algorithm
interview-questions
null
null
null
01/28/2012 03:06:25
not a real question
Design an algorithm to check whether k integers add up to x in the given set === Given an set of n integers and an integer x. Design an algorithm to check whether k integers add up to x in the given set. The complexity should be O(n^(k-1) * logn)
1
5,591,609
04/08/2011 07:02:33
644,194
02/03/2011 18:00:19
-1
0
fix System.NullReferenceException in C#
i m developing a website and stuck with System.NullReferenceException . on the master page I m using this code ` if (Request.Url.ToString().ToLower().Contains("content.aspx")) { if (Request.Params["ModuleID"].ToString() == null) { Response.Redirect("Content.aspx?ModuleID=1"); } } ` when Module Id is blank then it creates null reference exception.
c#
asp.net
null
null
null
null
open
fix System.NullReferenceException in C# === i m developing a website and stuck with System.NullReferenceException . on the master page I m using this code ` if (Request.Url.ToString().ToLower().Contains("content.aspx")) { if (Request.Params["ModuleID"].ToString() == null) { Response.Redirect("Content.aspx?ModuleID=1"); } } ` when Module Id is blank then it creates null reference exception.
0
8,016,756
11/04/2011 23:09:02
656,925
08/12/2010 02:22:36
1,345
33
Unexplainable call to class constructor generates matching function error
When I call merge_sort I get a string of errors as such the most readable is: no matching function call to dynamic_array<int>::dynamic_array() Does having a base class instantiate a sub class cause that sub-class to re-instantiate it the calling base class? This was my first guess. // Calling main function #include "c_dynamic_array.cpp" int main() { dynamic_array<int> d1(20); d1.order();cout << d1 << endl; d1.rorder();cout << d1 << endl; d1.randorder();cout << d1 << endl; d1.merge_sort();cout << d1 << endl; // This line starts a string of errors } // Dynamic Array Class #include "c_include.cpp" /* Dynamic Array */ using namespace std; template <typename> class merge_inner; template <class T> class dynamic_array { protected: T* array; public: int size; void rorder(); void order(); void randorder(); void print_operator(ostream&)const; dynamic_array(int sizein) { size=sizein; array=new T[size](); } void merge_sort() { merge_inner<T> M1; } }; template <class T> void dynamic_array<T>::print_operator(ostream &os=cout)const { for (int i = 0; i < size; i++) os << array[i] << endl; } template <class T> void dynamic_array<T>::randorder() { srand(time(NULL)); int *ap; for(ap=array;ap!=array+size;++ap){*ap=rand()%size;} } template <class T> void dynamic_array<T>::order() { int *ap,i=0; for(ap=array;ap!=array+size;++ap) { *ap=i; ++i; } } template <class T> void dynamic_array<T>::rorder() { int *ap,i=size-1; for(ap=array;ap!=array+size;++ap) { *ap=i; --i; } } template<class T> ostream& operator<<(ostream& stream, dynamic_array<T> const& data) { data.print_operator(stream); return stream; } /* Merge Sort */ template <class T> class merge_inner : public dynamic_array <T> { using dynamic_array<T>::array; private: const static int size; T *scratch; void flip_if_unordered(int &x, int &y) { if(array[x]>array[y]) { int tmp=array[x]; array[x]=array[y]; array[y]=tmp; } } void merge_algo(int &left, int &right_begin, int &right) { int iter,iter_left=left,iter_right=right_begin; for(iter=left;iter<=right;++iter) { if( (iter_right>right) || ((iter_left < right_begin) && (array[iter_left]<=array[iter_right]))) { scratch[iter]=array[iter_left]; ++iter_left; } else { scratch[iter]=array[iter_right]; ++iter_right; } } for(iter=left;iter<=right;++iter){array[iter]=scratch[iter];} } void merge_recurse(int left,int right) { int left_end=(left+((right-left)/2)); int right_begin=left_end+1; if(((left+1)==right)){flip_if_unordered(left,right);return;} else if ((left==right)){return;} else { merge_recurse(left,left_end); merge_recurse(right_begin,right); merge_algo(left,right_begin,right); } } public: merge_inner() { scratch = new T[size](); if(scratch != NULL){merge_recurse(0, size);} } }; /*Quick Sort void quick_sort() { quick_recurse(0,size); } void quick_recurse(int left, int right) { int l = left, r = right, tmp; int pivot = array[(left + right) / 2]; while (l <= r) { while (array[l] < pivot)l++; while (array[r] > pivot)r--; if (l <= r) { tmp = array[l]; array[l] = array[r]; array[r] = tmp; l++; r--; } } if (left < r)quick_recurse(left, r); if (l < right)quick_recurse(l, right); } */
c++
null
null
null
null
null
open
Unexplainable call to class constructor generates matching function error === When I call merge_sort I get a string of errors as such the most readable is: no matching function call to dynamic_array<int>::dynamic_array() Does having a base class instantiate a sub class cause that sub-class to re-instantiate it the calling base class? This was my first guess. // Calling main function #include "c_dynamic_array.cpp" int main() { dynamic_array<int> d1(20); d1.order();cout << d1 << endl; d1.rorder();cout << d1 << endl; d1.randorder();cout << d1 << endl; d1.merge_sort();cout << d1 << endl; // This line starts a string of errors } // Dynamic Array Class #include "c_include.cpp" /* Dynamic Array */ using namespace std; template <typename> class merge_inner; template <class T> class dynamic_array { protected: T* array; public: int size; void rorder(); void order(); void randorder(); void print_operator(ostream&)const; dynamic_array(int sizein) { size=sizein; array=new T[size](); } void merge_sort() { merge_inner<T> M1; } }; template <class T> void dynamic_array<T>::print_operator(ostream &os=cout)const { for (int i = 0; i < size; i++) os << array[i] << endl; } template <class T> void dynamic_array<T>::randorder() { srand(time(NULL)); int *ap; for(ap=array;ap!=array+size;++ap){*ap=rand()%size;} } template <class T> void dynamic_array<T>::order() { int *ap,i=0; for(ap=array;ap!=array+size;++ap) { *ap=i; ++i; } } template <class T> void dynamic_array<T>::rorder() { int *ap,i=size-1; for(ap=array;ap!=array+size;++ap) { *ap=i; --i; } } template<class T> ostream& operator<<(ostream& stream, dynamic_array<T> const& data) { data.print_operator(stream); return stream; } /* Merge Sort */ template <class T> class merge_inner : public dynamic_array <T> { using dynamic_array<T>::array; private: const static int size; T *scratch; void flip_if_unordered(int &x, int &y) { if(array[x]>array[y]) { int tmp=array[x]; array[x]=array[y]; array[y]=tmp; } } void merge_algo(int &left, int &right_begin, int &right) { int iter,iter_left=left,iter_right=right_begin; for(iter=left;iter<=right;++iter) { if( (iter_right>right) || ((iter_left < right_begin) && (array[iter_left]<=array[iter_right]))) { scratch[iter]=array[iter_left]; ++iter_left; } else { scratch[iter]=array[iter_right]; ++iter_right; } } for(iter=left;iter<=right;++iter){array[iter]=scratch[iter];} } void merge_recurse(int left,int right) { int left_end=(left+((right-left)/2)); int right_begin=left_end+1; if(((left+1)==right)){flip_if_unordered(left,right);return;} else if ((left==right)){return;} else { merge_recurse(left,left_end); merge_recurse(right_begin,right); merge_algo(left,right_begin,right); } } public: merge_inner() { scratch = new T[size](); if(scratch != NULL){merge_recurse(0, size);} } }; /*Quick Sort void quick_sort() { quick_recurse(0,size); } void quick_recurse(int left, int right) { int l = left, r = right, tmp; int pivot = array[(left + right) / 2]; while (l <= r) { while (array[l] < pivot)l++; while (array[r] > pivot)r--; if (l <= r) { tmp = array[l]; array[l] = array[r]; array[r] = tmp; l++; r--; } } if (left < r)quick_recurse(left, r); if (l < right)quick_recurse(l, right); } */
0
11,252,550
06/28/2012 20:40:21
9,950
09/15/2008 20:33:58
612
28
Eclipse book recommendation for release engineers? (run configuration wizardy, workspace generation)
Please recommend a book or a web site where I can find out more about automating eclipse. I'm a release engineer supporting eclipse users and I'm trying to get more information about run-configuration modification, workspace setup automation and other eclipse tasks. Our eclipse workspace generation process is lengthy and I'd like to make it one step process from an archetype. I'd also like to get more information on the internals of run-configuration so I can better customize them to make developer's lives easier. Is there a good book out there that dives deep into eclipse from a tool-wonk's point of view? Thanks Peter
eclipse
books
null
null
null
08/01/2012 02:33:55
off topic
Eclipse book recommendation for release engineers? (run configuration wizardy, workspace generation) === Please recommend a book or a web site where I can find out more about automating eclipse. I'm a release engineer supporting eclipse users and I'm trying to get more information about run-configuration modification, workspace setup automation and other eclipse tasks. Our eclipse workspace generation process is lengthy and I'd like to make it one step process from an archetype. I'd also like to get more information on the internals of run-configuration so I can better customize them to make developer's lives easier. Is there a good book out there that dives deep into eclipse from a tool-wonk's point of view? Thanks Peter
2
4,386,766
12/08/2010 11:09:04
903,785
11/23/2010 17:51:25
13
0
Multiple Arrays
Is there a way to access/store multiple arrays or data which could be compared against and return a value to ensure a program is faster?
iphone
null
null
null
null
12/10/2010 03:37:56
not a real question
Multiple Arrays === Is there a way to access/store multiple arrays or data which could be compared against and return a value to ensure a program is faster?
1
498,358
01/31/2009 05:50:54
27,779
10/14/2008 09:12:12
569
22
How do I do date math in a bash script on OS X Leopard?
I realize I could whip up a little C or Ruby program to do this, but I want my script to have as few dependencies as possible. Given that _caveat_, how does one do date math in a bash script on OS X? I've seen a post (on another site) where someone did the following: <pre>date -d "-1 day"</pre> But this does not seem to work on OS X.
bash
osx
datemath
null
null
null
open
How do I do date math in a bash script on OS X Leopard? === I realize I could whip up a little C or Ruby program to do this, but I want my script to have as few dependencies as possible. Given that _caveat_, how does one do date math in a bash script on OS X? I've seen a post (on another site) where someone did the following: <pre>date -d "-1 day"</pre> But this does not seem to work on OS X.
0
10,711,047
05/22/2012 22:26:59
1,077,364
12/02/2011 12:10:42
837
41
The Completest cocos2d-x Tutorial & Guide List
I'm developing a game using cocos2d-x to Android and iphone. At the beggining, i had a lot of problems to start using this library, so, in this question, i want to collect all basic, medium and expert tutorials because there are a lot of info questions doing the same mistakes. When i [Started][1], i had to look a lot in many sites using my friend google. Hope this help people start now. **All in c++**. **Beginners** - Official wiki [links][2] - How to start in multi-platform [HERE][3] The best one. Amazing, XCODE (MAC) and ECLIPSE (LINUX) tutorial. - A simple guide to [Start][4] - Another multi-platform [Guide][5] **Medium** - Scrolling scenes. Using CCParallaxNode. [Space game example][6] - [Slider code][7] [HERE][8] the video. - Split screen using 2 layers [Here][9] **ADVANCED** - Integrating OpenFeint with cocos2d-x. I only found [This example][10], [Here][11] more details. **Extensions** - I have not tested all, but work fine [walzer's Extensions][12] - [MarkusPfundstein][13]'s extensions **Code Examples** - *Clawoo examples* - [Simple Game 1][14] - [Simple Game 1 - part 2][15] - [Simple Game 1 - part 3][16] - [BreakOut][17] - [Pong][18] - [Cute a pult][19] - [TileBased game][20] - [Asteroids][21] - *Bada.com* - [Ballon Ride][22] **TIPS** - If you use Linux, please, don't use cocos2d-android or cocos2d-android-1, **is decreated**. Try to use cocos2d-x - If you use Linux, and don't know how to use native code, [Take a look in development][23] - Iphone use RETINA to draw textures in HD, but don't are used on Android. My solution is use RETINA on iphone, and setscale compiling only in Android. [Multi-resolution Wiki][24]. In Example: <pre> #ifdef #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) this->setObjectScale(1); #endif // CC_PLATFORM_IOS </pre> - Your first example must be the official on the [WIKI][25] ** [OFFICIAL PAGE COCOS2D-X][26] ** What will need this question? - XML Tutorial, i have nothing in this area. Actually, i'm working in some code. I will do a Tutorial. The library can be use is [libxml2][27] - Creating menus example - Slider menu example If you have problems, use tag cocos2d-x in Stackoverflow, and i will try to help you. I have already read the [FAQ][28] but 90 % of questions cocos2d/android related present the same problem, using obsolete libraries. I just want help people to start using cocos2d-x. All additional info will be Welcome. [1]: http://stackoverflow.com/questions/9979795/where-can-i-find-a-good-tutorial-to-start-programming-using-cocos2d-x [2]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki [3]: http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started [4]: http://developer.bada.com/library/BalloonRide [5]: http://gameit.ro/2012/01/creating-an-iphone-and-android-cocos2d-x-hybrid-project-updated/ [6]: http://www.raywenderlich.com/11338/cocos2d-x-for-ios-and-android-space-game [7]: http://www.cocos2d-x.org/boards/6/topics/9803 [8]: https://www.youtube.com/watch?v=hvQOnk4RgmM [9]: http://blog.bigbunkerstudio.com/?p=154 [10]: http://blog.molioapp.com/2011/11/openfeint-and-admob-integrated-with.html [11]: http://www.cocos2d-x.org/boards/10/topics/9191 [12]: https://github.com/cocos2d/cocos2d-x-extensions [13]: https://github.com/MarkusPfundstein/Cocos2DX-Extensions [14]: https://github.com/clawoo/SimpleGameCocos2D-x [15]: https://github.com/clawoo/SimpleGamePart2Cocos2D-x [16]: https://github.com/clawoo/SimpleGamePart3Cocos2D-x [17]: https://github.com/clawoo/BreakoutCocos2D-x [18]: https://github.com/clawoo/PongCocos2D-x [19]: https://github.com/clawoo/CuteAPultCocos2D-x [20]: https://github.com/clawoo/TileBasedGameCocos2D-x [21]: https://github.com/clawoo/AsteroidsCocos2D-x [22]: http://developer.bada.com/library/BalloonRide [23]: http://developer.android.com/sdk/ndk/index.html [24]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_does_cocos2d-x_support_multi-resolution [25]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki [26]: http://www.cocos2d-x.org/ [27]: http://www.xmlsoft.org/ [28]: http://stackoverflow.com/faq
cocos2d-x
null
null
null
null
07/22/2012 02:48:27
not constructive
The Completest cocos2d-x Tutorial & Guide List === I'm developing a game using cocos2d-x to Android and iphone. At the beggining, i had a lot of problems to start using this library, so, in this question, i want to collect all basic, medium and expert tutorials because there are a lot of info questions doing the same mistakes. When i [Started][1], i had to look a lot in many sites using my friend google. Hope this help people start now. **All in c++**. **Beginners** - Official wiki [links][2] - How to start in multi-platform [HERE][3] The best one. Amazing, XCODE (MAC) and ECLIPSE (LINUX) tutorial. - A simple guide to [Start][4] - Another multi-platform [Guide][5] **Medium** - Scrolling scenes. Using CCParallaxNode. [Space game example][6] - [Slider code][7] [HERE][8] the video. - Split screen using 2 layers [Here][9] **ADVANCED** - Integrating OpenFeint with cocos2d-x. I only found [This example][10], [Here][11] more details. **Extensions** - I have not tested all, but work fine [walzer's Extensions][12] - [MarkusPfundstein][13]'s extensions **Code Examples** - *Clawoo examples* - [Simple Game 1][14] - [Simple Game 1 - part 2][15] - [Simple Game 1 - part 3][16] - [BreakOut][17] - [Pong][18] - [Cute a pult][19] - [TileBased game][20] - [Asteroids][21] - *Bada.com* - [Ballon Ride][22] **TIPS** - If you use Linux, please, don't use cocos2d-android or cocos2d-android-1, **is decreated**. Try to use cocos2d-x - If you use Linux, and don't know how to use native code, [Take a look in development][23] - Iphone use RETINA to draw textures in HD, but don't are used on Android. My solution is use RETINA on iphone, and setscale compiling only in Android. [Multi-resolution Wiki][24]. In Example: <pre> #ifdef #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) this->setObjectScale(1); #endif // CC_PLATFORM_IOS </pre> - Your first example must be the official on the [WIKI][25] ** [OFFICIAL PAGE COCOS2D-X][26] ** What will need this question? - XML Tutorial, i have nothing in this area. Actually, i'm working in some code. I will do a Tutorial. The library can be use is [libxml2][27] - Creating menus example - Slider menu example If you have problems, use tag cocos2d-x in Stackoverflow, and i will try to help you. I have already read the [FAQ][28] but 90 % of questions cocos2d/android related present the same problem, using obsolete libraries. I just want help people to start using cocos2d-x. All additional info will be Welcome. [1]: http://stackoverflow.com/questions/9979795/where-can-i-find-a-good-tutorial-to-start-programming-using-cocos2d-x [2]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki [3]: http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started [4]: http://developer.bada.com/library/BalloonRide [5]: http://gameit.ro/2012/01/creating-an-iphone-and-android-cocos2d-x-hybrid-project-updated/ [6]: http://www.raywenderlich.com/11338/cocos2d-x-for-ios-and-android-space-game [7]: http://www.cocos2d-x.org/boards/6/topics/9803 [8]: https://www.youtube.com/watch?v=hvQOnk4RgmM [9]: http://blog.bigbunkerstudio.com/?p=154 [10]: http://blog.molioapp.com/2011/11/openfeint-and-admob-integrated-with.html [11]: http://www.cocos2d-x.org/boards/10/topics/9191 [12]: https://github.com/cocos2d/cocos2d-x-extensions [13]: https://github.com/MarkusPfundstein/Cocos2DX-Extensions [14]: https://github.com/clawoo/SimpleGameCocos2D-x [15]: https://github.com/clawoo/SimpleGamePart2Cocos2D-x [16]: https://github.com/clawoo/SimpleGamePart3Cocos2D-x [17]: https://github.com/clawoo/BreakoutCocos2D-x [18]: https://github.com/clawoo/PongCocos2D-x [19]: https://github.com/clawoo/CuteAPultCocos2D-x [20]: https://github.com/clawoo/TileBasedGameCocos2D-x [21]: https://github.com/clawoo/AsteroidsCocos2D-x [22]: http://developer.bada.com/library/BalloonRide [23]: http://developer.android.com/sdk/ndk/index.html [24]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_does_cocos2d-x_support_multi-resolution [25]: http://www.cocos2d-x.org/projects/cocos2d-x/wiki [26]: http://www.cocos2d-x.org/ [27]: http://www.xmlsoft.org/ [28]: http://stackoverflow.com/faq
4
8,000,319
11/03/2011 18:51:26
1,028,338
11/03/2011 18:38:00
1
0
Show Link If Views Basic UI is Editable
I'm using Views Basic UI in Drupal 6 to allow users to edit a views header and title. I would like to cut back on the number of view templates that I have, so that in the future if I need to edit, I would only have to make changes in one place. To do that, I'd like the views template "views-view--page.tpl.php" to provide a link only if the view is editable as defined by the Views Basic UI: Edit Settings module. I'm just not sure what the code should look like. I think it'd be something along the lines of <?php if (in_array('views_basic_ui'): ?> <div class="page-edit"> ... I don't know what to put in that if statement though, in order to say "only print this button if the view has been selected as editable in the views basic ui settings". I'm guessing somebody that reads/writes code better than me could figure it out pretty quick, but I'd appreciate any help I could get. Thanks. ps - it's worth mentioning that the users will not have local tabs, so they won't see the 'view' and 'edit' tabs provided by the module.
drupal
drupal-6
drupal-views
null
null
null
open
Show Link If Views Basic UI is Editable === I'm using Views Basic UI in Drupal 6 to allow users to edit a views header and title. I would like to cut back on the number of view templates that I have, so that in the future if I need to edit, I would only have to make changes in one place. To do that, I'd like the views template "views-view--page.tpl.php" to provide a link only if the view is editable as defined by the Views Basic UI: Edit Settings module. I'm just not sure what the code should look like. I think it'd be something along the lines of <?php if (in_array('views_basic_ui'): ?> <div class="page-edit"> ... I don't know what to put in that if statement though, in order to say "only print this button if the view has been selected as editable in the views basic ui settings". I'm guessing somebody that reads/writes code better than me could figure it out pretty quick, but I'd appreciate any help I could get. Thanks. ps - it's worth mentioning that the users will not have local tabs, so they won't see the 'view' and 'edit' tabs provided by the module.
0
9,667,798
03/12/2012 13:20:46
807,239
06/20/2011 19:04:07
41
1
How to set up a Symfony Standard Edition application without vendor, but with PEAR
I'm following the basic description of [Symfony Standard Edition][1] on how to set up a new application with Symfony 2. The thing is, this and all other guides explains that I need to have a vendors directory, where I should place third part libraries, such as Doctrine, Swiftmailer and Symfony itself. However, Zend Server PEAR already comes with almost all of those libraries. As you know, I can even update my Symfony and Doctrine versions with the pear update command. The question is: how can I set up that basic application to effectively use my PEAR libraries and ignore the vendors directory? [1]: https://github.com/symfony/symfony-standard
symfony-2.0
doctrine2
pear
zend-server
null
null
open
How to set up a Symfony Standard Edition application without vendor, but with PEAR === I'm following the basic description of [Symfony Standard Edition][1] on how to set up a new application with Symfony 2. The thing is, this and all other guides explains that I need to have a vendors directory, where I should place third part libraries, such as Doctrine, Swiftmailer and Symfony itself. However, Zend Server PEAR already comes with almost all of those libraries. As you know, I can even update my Symfony and Doctrine versions with the pear update command. The question is: how can I set up that basic application to effectively use my PEAR libraries and ignore the vendors directory? [1]: https://github.com/symfony/symfony-standard
0
3,615,293
09/01/2010 05:37:50
436,619
09/01/2010 05:28:07
1
0
what is the future of ASP.NET?
i am beginner to asp.net...just want to know the future technology of asp.net....can one know that....
asp.net
null
null
null
null
09/01/2010 05:50:08
not a real question
what is the future of ASP.NET? === i am beginner to asp.net...just want to know the future technology of asp.net....can one know that....
1
4,721,045
01/18/2011 06:18:03
469,652
10/07/2010 22:00:17
715
3
Python dictionary manipulation
I got a list of object lst = [1,2,3] I want them in a dictionary with a default key 'number', and them put them in a list. The result will look like lst = [{'number':1},{'number':2},{'number':3} Use less code, please.
python
list
dictionary
null
null
null
open
Python dictionary manipulation === I got a list of object lst = [1,2,3] I want them in a dictionary with a default key 'number', and them put them in a list. The result will look like lst = [{'number':1},{'number':2},{'number':3} Use less code, please.
0
8,218,858
11/21/2011 21:35:26
471,232
10/09/2010 23:46:01
103
9
how to test sun rpc : rpcinfo ... what?
I want to test my network, to check rpc servers ( linux, and other systems too ). Just to start, on linux, I can send a broadcast query with rpcinfo -b prognum versnum With a network analyzer, I see rpcinfo sends rpc2 packets to udp port 111, with program = PORTMAP and procedure = CALLIT, followed by the user specified *prognum*. I am not familiar with rpc services and api. Is there some common prognum / versnum, usually running on every host ? Like RPC_PING, RPC_STATUS ...
rpc
null
null
null
null
11/22/2011 18:44:33
off topic
how to test sun rpc : rpcinfo ... what? === I want to test my network, to check rpc servers ( linux, and other systems too ). Just to start, on linux, I can send a broadcast query with rpcinfo -b prognum versnum With a network analyzer, I see rpcinfo sends rpc2 packets to udp port 111, with program = PORTMAP and procedure = CALLIT, followed by the user specified *prognum*. I am not familiar with rpc services and api. Is there some common prognum / versnum, usually running on every host ? Like RPC_PING, RPC_STATUS ...
2
2,154,301
01/28/2010 12:03:28
253,778
01/19/2010 06:38:03
30
11
binary to string converter in php?
binary to string converter in php
type-conversion
null
null
null
null
01/28/2010 12:18:33
not a real question
binary to string converter in php? === binary to string converter in php
1
11,660,760
07/26/2012 00:36:20
613,483
02/11/2011 18:30:59
349
8
Detect property selection in propertyGrid
Is it possible to detect when a property in a propertyGrid is selected? And if so, how? In the following picture, I would like to know which of the properties is selected at runtime. ![enter image description here][1] For example, The Grid knows that MyBool is selected, what can I do to get that information programatically instead of visually [1]: http://i.stack.imgur.com/9iOS5.png
c#
properties
selection
detect
propertygrid
null
open
Detect property selection in propertyGrid === Is it possible to detect when a property in a propertyGrid is selected? And if so, how? In the following picture, I would like to know which of the properties is selected at runtime. ![enter image description here][1] For example, The Grid knows that MyBool is selected, what can I do to get that information programatically instead of visually [1]: http://i.stack.imgur.com/9iOS5.png
0
6,457,557
06/23/2011 16:34:50
596,518
01/31/2011 07:54:42
20
1
Real World Optimization Problem
I and my classmates have this term project in our Discrete Math Modeling class where we need to find the actual problem and make an attempt to optimize it. We decided that we wanted to do something related to network optimization or optimized resource allocation between the cloud servers. Something along those lines. Does anyone know of a website or a company that could provide us with the problem that could be solved by us in 7 weeks?
math
optimization
networking
linear
null
06/23/2011 23:31:03
not constructive
Real World Optimization Problem === I and my classmates have this term project in our Discrete Math Modeling class where we need to find the actual problem and make an attempt to optimize it. We decided that we wanted to do something related to network optimization or optimized resource allocation between the cloud servers. Something along those lines. Does anyone know of a website or a company that could provide us with the problem that could be solved by us in 7 weeks?
4
6,192,113
05/31/2011 18:50:54
144,833
07/25/2009 01:41:17
1,784
65
Most important tips to make JavaScript pretty
CoffeeScript seems to be gaining traction from even non-python devs because of how it looks nice. I'm curious if anyone has a good tip(s) to make JavaScript look pretty by hand. I personally enjoy the JavaScript look, but just as an example part answer/part of an answer: var a = 'b'; var foo = 'bar'; var hello = function(){ alert('world'); } var lorem = 'ipsum'; Can (should) be written like: var a = 'b' , foo = 'bar' , hello = function(){ alert('world'); } , lorem = 'ipsum' This isn't nessacarily a disussion, but a question of, **"if you had a complete newbie at JavaScript as an intern, what are the most important methods of keeping your JavaScript clean and legible without any pseudo languages or parsers?"**
javascript
coding-style
coffeescript
null
null
05/31/2011 18:58:03
not constructive
Most important tips to make JavaScript pretty === CoffeeScript seems to be gaining traction from even non-python devs because of how it looks nice. I'm curious if anyone has a good tip(s) to make JavaScript look pretty by hand. I personally enjoy the JavaScript look, but just as an example part answer/part of an answer: var a = 'b'; var foo = 'bar'; var hello = function(){ alert('world'); } var lorem = 'ipsum'; Can (should) be written like: var a = 'b' , foo = 'bar' , hello = function(){ alert('world'); } , lorem = 'ipsum' This isn't nessacarily a disussion, but a question of, **"if you had a complete newbie at JavaScript as an intern, what are the most important methods of keeping your JavaScript clean and legible without any pseudo languages or parsers?"**
4
9,651,128
03/10/2012 23:31:42
163,022
08/25/2009 19:33:51
61
5
Mercurial clone is missing files
I have a seemingly normal mercurial repo, but doing a local clone of it leaves out bunches of files… bash-3.2$ hg verify repository uses revlog format 1 checking changesets checking manifests crosschecking files in changesets and manifests checking files 486 files, 23 changesets, 568 total revisions bash-3.2$ hg clone . /tmp/clone updating to branch default resolving manifests getting .hgignore getting data/Agricultural Marketing Service - Agricultural Marketing Service - Home.html getting data/SAMPLE_BIZ_FARMERS_MARKETS.XLS ... 130 files updated, 0 files merged, 0 files removed, 0 files unresolved bash-3.2$ So, I'm mystified, what is happening to all the other files? The cloned repository has a history that refers to them, but they aren't there. hg update and similar do not make them appear. There's no apparent pattern to which files are missing. Any clues appreciated.
mercurial
null
null
null
null
03/12/2012 21:19:49
too localized
Mercurial clone is missing files === I have a seemingly normal mercurial repo, but doing a local clone of it leaves out bunches of files… bash-3.2$ hg verify repository uses revlog format 1 checking changesets checking manifests crosschecking files in changesets and manifests checking files 486 files, 23 changesets, 568 total revisions bash-3.2$ hg clone . /tmp/clone updating to branch default resolving manifests getting .hgignore getting data/Agricultural Marketing Service - Agricultural Marketing Service - Home.html getting data/SAMPLE_BIZ_FARMERS_MARKETS.XLS ... 130 files updated, 0 files merged, 0 files removed, 0 files unresolved bash-3.2$ So, I'm mystified, what is happening to all the other files? The cloned repository has a history that refers to them, but they aren't there. hg update and similar do not make them appear. There's no apparent pattern to which files are missing. Any clues appreciated.
3
10,628,164
05/16/2012 23:37:58
1,295,171
03/27/2012 09:59:52
23
0
Interpret string with spaces encased in quotes as one "item"?
I'm making an ajax console for a site that I'm an admin on for other administrators to use. Anyway, I have a bunch of commands they can use like "getid someusername", but the usernames can also have spaces in them like "getid some other name". I know that command line PHP scripts take arguments with spaces when they are encased in quotes. Is this functionality included in PHP or will I need to write it myself?
php
null
null
null
null
05/17/2012 11:04:25
not a real question
Interpret string with spaces encased in quotes as one "item"? === I'm making an ajax console for a site that I'm an admin on for other administrators to use. Anyway, I have a bunch of commands they can use like "getid someusername", but the usernames can also have spaces in them like "getid some other name". I know that command line PHP scripts take arguments with spaces when they are encased in quotes. Is this functionality included in PHP or will I need to write it myself?
1