Hi I have a social networking site I want a generic recommendation engine that can work with any feature. Like I can add it for pic, video or application. Pls suggest...........
I am trying to upload a PGP encrypted file through FTP. But I am getting an error message as follows:
The underlying connection was closed: An unexpected error occurred on a receive.
I am using the following code and getting the error at line:
Stream ftpStream = response.GetResponse();
Is there any one who can help me out ASAP.
Following is the code sample:
FtpWebRequest request =
WebRequest.Create("ftp://ftp.website.com/sample.txt.pgp") as FtpWebRequest;
request.UsePassive = true;
FtpWebResponse response = request.GetResponse() as FtpWebResponse;
Stream ftpStream = response.GetResponse();
int bufferSize = 8192;
byte[] buffer = new byte[bufferSize];
using (FileStream fileStream =
new FileStream("localfile.zip", FileMode.Create, FileAccess.Write))
{
int nBytes;
while((nBytes = ftpStream.Read(buffer, 0, bufferSize) > 0)
{
fileStream.Write(buffer, 0, nBytes);
}
}
Regards,
Sumeet
What are your favourite network-tools, which you use to troubleshoot or design (as in conceptualize) your network-application code.
Ethereal/Wireshark
Nmap
any particular simulators (e.g. ns)
any special purpose sniffer
any particular frameworks, (e.g. iptables)
I am looking at must have, and good/advantage to have tools/framework in ones profile/skill set. I think Wireshark and Nmap are must haves.
hi im working on an window application form in which i have to save the data in text file which should contains the data the user would write in the richtextbox in that form......
Why I am not able to update the column based on a condition which is not the primary key.
I am trying to update the constituencies table where name matches a specific criterial as shown below but the below queries shows an error
Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table constituencies set city_id = '1' where constituencies.name = "East Delhi"' at line 1
update table constituencies set city_id = '1' where constituencies.name = "East Delhi";
update table constituencies set city_id = '1' where constituencies.name = "South Delhi";
update table constituencies set city_id = '1' where constituencies.name = "Delhi Sadar";
update table constituencies set city_id = '1' where constituencies.name = "Karol Bagh";
update table constituencies set city_id = '1' where constituencies.name = "New Delhi";
update table constituencies set city_id = '1' where constituencies.name = "Outer Delhi";
update table constituencies set city_id = '1' where constituencies.name = "North East Delhi";
update table constituencies set city_id = '1' where constituencies.name = "North West Delhi";
update table constituencies set city_id = '1' where constituencies.name = "West Delhi";
Is it necessary that the condition should be checked with a primary key only ?
Please throw some light on the above.
The code for the asp.net page is:
<div class="facebox_content">
<% if (CurrentUser.Role == "Free")
{
%>
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:380px;">
<tr>
<td>
User Name :
</td>
<td>
Membership Cost :
</td>
</tr>
<tr>
<td style="width:190px;">
<asp:TextBox ID="txtUserName" Enabled="false" runat="server" Text="<%= CurrentUser.Name %>"/>
</td>
<td style="width:190px;">
<asp:TextBox ID="txtCost" Enabled="false" runat="server" Text="2000"/>
</td>
</tr>
<tr>
<td>
<br />
Cheque / Draft No.:
</td>
<td>
<br />
Bank Drawn On :
</td>
</tr>
<tr>
<td style="width:190px;">
<asp:TextBox ID="txtChqNo" runat="server"></asp:TextBox>
</td>
<td style="width:190px;">
<asp:TextBox ID="txtBankName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<br />
Date :
</td>
<td>
<br />
City :
</td>
</tr>
<tr>
<td style="width:190px;">
<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
</td>
<td style="width:190px;">
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
</td>
</tr>
</table>
<%
}
else if(CurrentUser.Role == "Pending")
{
%>
<p style="text-align:justify;">
Your Request is pending with our Administrators.
Please be patient while your request is processed.
Usually it takes 2-4 Days for your request to be processed after the payment has been received.
</p>
<%
}
else if(CurrentUser.Role == "Paid")
{
%>
<p style="text-align:justify;">
You are already a Paid Member of Website
</p>
<%
}
%>
The code for the C# file is:
protected void Page_PreInit(object sender, EventArgs e)
{
this.Theme = CurrentUser.Theme;
}
protected void Page_Load(object sender, EventArgs e)
{
txtUserName.Text = CurrentUser.Name;
ConfirmButton.Attributes.Add("onclick", "javascript:document.getElementById('" + lblMsg.ClientID + "').style.display='none';");
if (CurrentUser.Role != "Free")
ConfirmButton.Visible = false;
}
The code is giving the following error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
System.Web.UI.ControlCollection.Add(Control child) +8678903
System.Web.UI.PageTheme.SetStyleSheet() +478
System.Web.UI.Page.OnInit(EventArgs e) +8699660
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
Please some one help me out..!!
Hi, can anyone tell me, how to retrieve joined result from multiple tables in cakePHP ( using cakePHP mvc architecture). For example, I have three tables to join (tbl_topics, tbl_items, tbl_votes. Their relationship is defined as following: a topic can have many items and an item can have many votes. Now I want to retrieve a list of topics with the count of all votes on all items for each topic. The SQL query for this is written below:
SELECT Topic.*, count(Vote.id) voteCount
FROM
tbl_topics AS Topic
LEFT OUTER JOIN tbl_items AS Item
ON (Topic.id = Item.topic_id)
LEFT OUTER JOIN tbl_votes AS Vote
ON (Item.id = Vote.item_id);
My problem is I can do it easily using $this-><Model Name>->query function, but this requires sql code to be written in the controller which I don't want. I'm trying to find out any other way to do this (like find()).
Hi All,
I am getting an Access is denied error while I am trying to run the .pyo file by double click or from the command prompt.
Lets say I have abc.py (keeping main method entry point) which imports files xyz.py and imports wx etc.
I generate the .pyo file. But once I try to run abc.pyo I get the access is denied error.
I am not getting why this happening? Any help will really appreciated.
Thanks
I am trying to implement a dynamic search jquery and php, but I am not able to change the value of a javascript variable on my onclick event.
<script type="text/javascript">
var main_category = '<?php echo $main_category?>';
var main_url = '<?php echo $url?>get/' + encodeURIComponent(main_category) + '/';
var container_id = '<?php echo $unique_id?>content_area';
//name
$('#<?php echo $unique_id?>search_by_name').autocomplete('<?php echo $url?>get_autocomplete_data/' + encodeURIComponent(main_category) + '/names/', {
matchContains: "word",
autoFill: true,
width: 310
});$('#<?php echo $unique_id?>search_by_name').result(function (event, data){
var url = main_url + 'search/title/' + encodeURIComponent(data);
load_div(container_id, url);
});
//on click of displayed categories
$('[rel="<?php echo $unique_id?>sub_category"]').click(function (){
window['main_category'] = this.title;
$('#<?php echo $unique_id?>category').html('' +main_category+ '');
return false;
});
});
</script>
It changes the value when on click is fired
//on click of displayed categories
$('[rel="<?php echo $unique_id?>sub_category"]').click(function (){
window['main_category'] = this.title;
$('#<?php echo $unique_id?>category').html('' +main_category+ '');
return false;
});
but when after that i add data for the search it still searches for the old category
$('#<?php echo $unique_id?>search_by_name').result(function (event, data){
var url = main_url + 'search/title/' + encodeURIComponent(data);
load_div(container_id, url);
});
"main_category" value is not changing in the "main_url"
dear all,
i want to read a mp3 file using java and want to download it in jsp,i want to return byte array or i can only return one byte at a time?.please suggest
All,
To comment liberally or not to?? Pros and Cons. I personally prefer commenting as it leaves nothing to the fancies of the people reading it.
Thanks
almost all the software companies across the globe offer an evaluation version for download. Often the terms and conditions are so many that it's not feasible to go through them. we usually skim through the pages to get to the download link.
I was wondering how safe is that? I recently downloaded Rational PurifyPlus for evaluation and I expect that it would cease to function beyond the evaluation period.
Are there any changes that the software would quietly move beyond the evaluation period without letting me know thus making me liable?
Thanks
<asp:Repeater ID="rptrParent" runat="server">
<ItemTemplate>
<li>
<a href="<% =ResolveUrl("~/cPanel/UserView.aspx?User=")%><%# Eval("StudentUserName") %>">
<span>
<% ProfileCommon pc = new ProfileCommon();
pc.GetProfile(Eval("StudentUserName").ToString());
Response.Write(pc.FirstName + "" + pc.LastName);
%>
<%# Eval("StudentUserName") %>
</span>
</a>
</li>
</ItemTemplate>
The following error
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
is coming in this part
<% ProfileCommon pc = new ProfileCommon();
pc.GetProfile(Eval("StudentUserName").ToString());
Response.Write(pc.FirstName + "" + pc.LastName);
%>
ghost noscript tag more info here
I am facing exactly this issue, how shall I handle this for Internet Explorer browsers :-( ?
Explanation:
I have included the following noscript tag in my application's layout
<noscript style="background:#ffcc00;font-size:200%;font-family:verdana;text-align:center;text-transform:uppercase;font-weight:bold;padding:0.8em;">javascript is disabled, please enable it first.</noscript>
Now when I view this layout in IE8 the noscript tag CSS is displaying at the top of the page without the content in it, making the layout look faulty.
Please help...
Hey all.
I'm using SWFUpload on a Rails site to allow for MP3 Uploads direct to Sound Cloud. To avoid having to first upload a large file to my server and push to Sound Cloud, I'm hitting their API directly via SWFUpload, passing necessary OAuth token data.
Everything works - EXCEPT - Flash can't handle the HTTP response code that Sound Cloud's API returns (201). This ALWAYS triggers an unhandled IO Error with Flash. Even though SWFUpload allows me to override that in the JS, it breaks any response data (the URI to the uploaded file).
Does anyone know how I could somehow intercept the 201 code so that I can make it a 200 code for flash? I'm at a loss at how I can avoid this IO Error. I've tried try/catch statements around everything and have even recompiled SWFUpload to try new things to no avail. Any help would be greatly appreciated.
I am seriouly looking for your valuable help first time here. If possible, plese help me.
I am developing a VB.NET app in which i read "real time data" from a excel sheet
using "Microsoft.Office.Interop.Excel" i.e. excel automation.
All cells in excel sheet are fetching stock data from some LOCAL DDE Server
like "=XYZ|Bid!GOLD", "=XYZ|Bid!SILVER", "=XYZ|Ask!SILVER" and so on...
Some cells also having fixed values like "Symbol", "Bid Rate", "32.90" etc.
Values of DDE mapped cells (i.e. =XYZ|xxxx!yyy) are continuously changing.
THE PROBLEM is here..."FIXED values" from excel cells are coming quite ok to my app
but all DDE mapped cells values are coming "-2146826246" (When datasource local dde server ON) or "-2146826265" (OFF).
Although, if i use C#.NET, it's all ok but not with Vb.NET.
I want to display range of excel (A1 to J50) into VB.NET ListView which are changing
in every 200ms (5 times in every 1 second)
================ Important ======================================================
Is it possible to BIND "listview items/columns values" with "excel cells" or some local memory variables ??
Currently, i am reading excel "cell by cell" and trying to put values in .NET listview but CPU USES are very high
as well as it's toooo slow process.
If yes, then how please ?
I am a VFP developer but new to .NET
It's very easy in VFP then why not in .NET ??
Please guide me, if someone has the solution...
Hello everyone,
I have defined the following rule in the router.php file of my cakephp 1.3 based application
Router::connect('/tags/*',array('plugin' => 'tags', 'controller' => 'Tags', 'action' => 'index', 'admin' => false));
I have used the tags plugin. When I display the tags related to a topic then the URL on the tags appears something like this
http://localhost/testapp/tags/Tags/view/{tag_key_name}
I want to make this url for any action to tags plugin like this
http://localhost/testapp/Tags/{action}/{tag_key_name} for (view, admin_view and admin_edit)
and
http://localhost/testapp/Tags/{action} for (index, admin_index and any other action that does not require an id or keyname for execution)
hello i am manish
my problem is i have created a website with login control
in ASP.net it works properly first few time after some time it
generates an error "your login attemt was not successfully plaese try again"
this type of message i got when i tried to login after some times.
can anyone solve this problem.
i am using sqlserver2008.
Hi all,
I wanted bake command to bake a view of my liking. So I searched bakery and found this Modify-default-HTML-produced-by-baked-templates.
But after reading this I was not able to modify the template because I wanted to define some CSS in it and those files are not containing any CSS code (they contain only php code inside them).
Also if I have designed my own CSS file for the new template then how do I tell bake command to pick that specified css file for new template ?
I am totally confused over here. Has anybody done this similar kinda work using cakePHP.
Any help would be greatly appreciable.
NOTE: I am using cakePHP v 1.3 latest stable release.
Thanks
I have seen in cakephp that foreach loop is used like this
foreach($tags as $tag) :
\\code here
endforeach;
and I used to write this style of foreach
foreach($tags as $tag)
{
//code here
}
what is the difference between these two foeach loops and which one is better and makes more sense to implement ?
Thanks
Hello Everyone,
I have created a website using modx evolution v1.0.2.
The website that I have developed has 12 different types of users (categorized in groups). Each user will be shown a different price depending on the group to which he belongs.
Till now I have been able to fetch the group name of current logged in user (created a snippet for that), but how can I achieve the above mentioned functionality so that each user should be able to see only the price that I have coded according to his group.
For example:
If a user is associated with the 'ocassional' group then he should be shown the price as , say, 50 bucks
and if a user is associated with the 'regular' group then he should be shown the price as, say, 40 bucks
I can easily do this by coding a single snippet for every product's variant, but there are a lot of variants (more than 100 and growing).
I have created a resource(page) for every product and it's variant. Every variant has a price. It is this price that I want to be shown according to the logged in user group membership.
I hope I am able to explain my query clearly.
Please help me do this functionality.
Thanks
There are many inbulit functions like int(octal) which can be used to convert octal numbers into decimal numbers on command line but these doesn't work out in script .
int(0671) returns 0671 in script, where as it represent decimal form of octal number on python command line.
Help???
Thank You
I have to build a string like this
{ name: "john", url: "www.dkd.com", email: "[email protected]" }
where john, www.dkd.com and [email protected] are to be supplied by variables
I tried to do the following
s1 = "{'name:' {0},'url:' {1},'emailid:' {2}}"
s1.format("john","www.dkd.com","[email protected]")
I am getting the following error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: "'name"
Dont able to understand what I am doing wrong
My website currently working in ASP.NET 1.1
Old Process
In our database we have huge amount of data stored for a decoding purpose. We have to update this huge set of data table each week(Data is supplied from a vendor).
In our website (in asp.net 1.1) we query our database to decode information.
New process
Now instead of storing data in our database and query them, we want to replace this through the web service, AS now the vendor is supplying us a DLL, which will give us the decoded information.
Information on the DLL provided by the vendor
The DLL provided, can only be added in 4.0 sites. SO that also impleies that i can not directly add the dll to my 1.1 site.
This DLL is exposing certain methods, we simply have to add the DLL refernce in our web service and call the method and fetch the needed information.
Thus we will not have to store those information in our database.
So which type of web service I should go for (asmx OR WCF) that will use the DLLs provided by vendor to fetch the decoded information ??
Flexibility i am looking for in the web service are:
It can be consumed from asp.net 1.1 site directly and also using jQuery ajax.
It can be consumed from other web services running on the server.
It can be consumed from some windows services running from the server.
NOTE : Moreover we have a plan to migrate our website from asp.net 1.1 to 4.0 version in future.So it should be that much supportive for future upgrade.