Hi all, I'm working on a large file transfer(P2P) in UDP air application. I want to connect client and server using TCP. Can anybody tell me how to connect both both in TCP. Thank you.
Is it possible to modify the height of detail band dynamically in jasper report? Because in my application i need to create pdf document.I have used one main document inside detail band of that main document i used one subreport. Sub report will take java bean as data source. This java bean return a list of field. So if we fixed the size of band then some time all values are not stretch in the document. Is it possible to change the detail band dynamically.
Hi,
I am trying to convert a SQL query to LINQ. Somehow my count(distinct(x)) logic does not seem to be working correctly. The original SQL is quite efficient(or so i think), but the generated SQL is not even returning the correct result.
I am trying to fix this LINQ to do what the original SQL is doing, AND in an efficient way as the original query is doing. Help here would be really apreciated as I am stuck here :(
SQL which is working and I need to make a comparable LINQ of:
SELECT [t1].[PersonID] AS [personid]
FROM [dbo].[Code] AS [t0]
INNER JOIN [dbo].[phonenumbers] AS [t1] ON [t1].[PhoneCode] = [t0].[Code]
INNER JOIN [dbo].[person] ON [t1].[PersonID]= [dbo].[Person].PersonID
WHERE ([t0].[codetype] = 'phone') AND (
([t0].[CodeDescription] = 'Home') AND ([t1].[PhoneNum] = '111')
OR
([t0].[CodeDescription] = 'Work') AND ([t1].[PhoneNum] = '222') )
GROUP BY [t1].[PersonID] HAVING COUNT(DISTINCT([t1].[PhoneNum]))=2
The LINQ which I made is approximately as below:
var ids = context.Code.Where(predicate);
var rs = from r in ids
group r by new { r.phonenumbers.person.PersonID} into g
let matchcount=g.Select(p => p.phonenumbers.PhoneNum).Distinct().Count()
where matchcount ==2
select new
{
personid = g.Key
};
Unfortunately, the above LINQ is NOT generating the correct result, and is actually internally getting generated to the SQL shown below. By the way, this generated query is also reading ALL the rows(about 19592040) around 2 times due to the COUNTS :( Wich is a big performance issue too. Please help/point me to the right direction.
Declare @p0 VarChar(10)='phone'
Declare @p1 VarChar(10)='Home'
Declare @p2 VarChar(10)='111'
Declare @p3 VarChar(10)='Work'
Declare @p4 VarChar(10)='222'
Declare @p5 VarChar(10)='2'
SELECT [t9].[PersonID], (
SELECT COUNT(*)
FROM (
SELECT DISTINCT [t13].[PhoneNum]
FROM [dbo].[Code] AS [t10]
INNER JOIN [dbo].[phonenumbers] AS [t11] ON [t11].[PhoneType] = [t10].[Code]
INNER JOIN [dbo].[Person] AS [t12] ON [t12].[PersonID] = [t11].[PersonID]
INNER JOIN [dbo].[phonenumbers] AS [t13] ON [t13].[PhoneType] = [t10].[Code]
WHERE ([t9].[PersonID] = [t12].[PersonID]) AND ([t10].[codetype] = @p0) AND ((([t10].[codetype] = @p1) AND ([t11].[PhoneNum] = @p2)) OR (([t10].[codetype] = @p3) AND ([t11].[PhoneNum] = @p4)))
) AS [t14]
) AS [cnt]
FROM (
SELECT [t3].[PersonID], (
SELECT COUNT(*)
FROM (
SELECT DISTINCT [t7].[PhoneNum]
FROM [dbo].[Code] AS [t4]
INNER JOIN [dbo].[phonenumbers] AS [t5] ON [t5].[PhoneType] = [t4].[Code]
INNER JOIN [dbo].[Person] AS [t6] ON [t6].[PersonID] = [t5].[PersonID]
INNER JOIN [dbo].[phonenumbers] AS [t7] ON [t7].[PhoneType] = [t4].[Code]
WHERE ([t3].[PersonID] = [t6].[PersonID]) AND ([t4].[codetype] = @p0) AND ((([t4].[codetype] = @p1) AND ([t5].[PhoneNum] = @p2)) OR (([t4].[codetype] = @p3) AND ([t5].[PhoneNum] = @p4)))
) AS [t8]
) AS [value]
FROM (
SELECT [t2].[PersonID]
FROM [dbo].[Code] AS [t0]
INNER JOIN [dbo].[phonenumbers] AS [t1] ON [t1].[PhoneType] = [t0].[Code]
INNER JOIN [dbo].[Person] AS [t2] ON [t2].[PersonID] = [t1].[PersonID]
WHERE ([t0].[codetype] = @p0) AND ((([t0].[codetype] = @p1) AND ([t1].[PhoneNum] = @p2)) OR (([t0].[codetype] = @p3) AND ([t1].[PhoneNum] = @p4)))
GROUP BY [t2].[PersonID]
) AS [t3]
) AS [t9]
WHERE [t9].[value] = @p5
Thanks!
I am getting AJAX Control Toolkit is undefined error when I have the CombineScripts="true" on the ToolkitScriptManager:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" EnablePageMethods="false" ScriptMode="Release"
LoadScriptsBeforeUI="false" runat="server" CombineScripts="true">
<CompositeScript>
<Scripts>
<asp:ScriptReference Path="~/JavaScript/jquery-1.4.1.min.js" />
<asp:ScriptReference Path="~/JavaScript/Custom.js" />
</Scripts>
</CompositeScript>
</ajaxToolkit:ToolkitScriptManager>
But when I set the CombineScripts to false everything seems to work. Why is this happening?
I need to convert mediawiki into LaTeX syntax. The formulas should stay the same, but I need to transform, for example = something = into \chapter{something}.
Although this can be obtained with a bit of sed, things get a little dirty with the itemize environment, so I was wondering if a better solution can be produced. Anything that can be useful for this task ?
This is the reverse of this question (graciously copied). Pandoc was the answer to that question, but probably not yet for this.
I have two browser tabs, tab1 and tab2.
I have a function called execute in tab1, which I would like to call from the page in tab2.
Is that possible and if so how?
hello friends,
<div>
<label>
Date:
<span><input type="text" id="date" /></span>
<%--<%=Html.EditorFor(model=>model.Date) %>--%> // Should I use this as Input type?
</label>
<label>
Number#:
<%=Html.TextBox("Number", ViewData["inq"] ?? "")%>
</label>
<label>Comment</label>
<span>
<%=Html.TextArea("value")%>
<%=Html.ValidationMessage("value")%>
</span>
</div>
I am trying to get these three fields on the screen while user enters I am retreving the user enter data on front end.. when I am debugging I am not seeing these fields..
On the view I am using beginForm
<% using (Html.BeginForm("Update", "Home", FormMethod.Post, new { @id = "id" }))
{ %>
my method..
public JsonResult Update(StudentInfo info)
{
Update///
return Json(Status.ToString());
}
when I see in info I am not getting these three fields..
can any one help me out thanks
I am trying to build a web application in ASP.NET MVC and need build a pretty complex search feature. When a user enters a search term I want to search a variety of data sources which include documents, tables in the database, webpage urls and some APIs like facebook. Any tips, tutorials and hints would be greatly appreciated.
How to invoke a dll that is dynamically created (during runtime) in a sharepoint site? i am recieving an error that i dont have the load permissions.
Any help on this will be grateful.
this code works fine in Firefox but not in IE6.. i made changes using boolean true, false but still..
$('#PbtnSelectAll').click(function() {
$('#PricingEditExceptions input[type=checkbox]').attr('checked', 'checked');
$('#PbtnSubmit').show();
$('#PbtnCancel').show();
$('fieldset').find("input:not(:checkbox),select,textarea").attr('disabled',true);
$('#genericfieldset').find("input,select,textarea").removeAttr('disabled');
});
the problem is i am having the view with Fieldsets.. each fieldset having the checkbox when i click onselect all buton its should select all the fieldset checkboxes..but its not doing its allwasy doing for first fieldset which is closest....other things are igonring
but its working in firefox..
thanks
Hi everyone...
i have a webservice that i want to test by typing the url in the address bar in the web browser
localhost:1981/myProject/admin/autocomplete.asmx
and when i do this it gives this compilation error
CS0234: The type or namespace name 'Oledb' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
i know this is because we added this in our web.config
<add namespace="System.Data.Oledb"/>
<add namespace ="System.Data"/>
in the namespaces section.....
when i call this web service through ajax it works but if i try to test it it gives this error.
Is there any way to prevent this?
How to apply limit in php, mongodb when using mapreduce function?
I tried this
$cmd=array(// codition array
"mapreduce" => "user",
"map" => $map,
"reduce" => $reduce,
"out" => array("inline" => 1),
"limit"=>2
);
$db=connect();
$query = $db->command($cmd);// run command
But its not working it gives 2 documents.I can't use limit on sub documents.
If I have 100's of sub documents and then I want paging in sub documents.Then it fails.Is it possible to apply limit on sub documents?
Hi all, I'm trying to send large files using UDP Adobe air to CPP. While transferring large files some packets are missing. How can I retrieve the missing packets data? I'm first of all connecting client(air) with server(cpp) using tcp. After connection establishment I'm starting file transfer. I am planning to get the file missing data using tcp and then resending the missing packets using tcp. Can anybody tell me how can i come to know which packets are missing while transferring. Thank you.
hello friends,
i have
public jsonresult update(studentinfo s)
{
for(i=0;i>0;i++)
{
var x = // i am getting some x so i am checking again
if( x != null)
{
var updateuser = student.update(s.student,"","");
**return json(updateuser.ToString());** // if i keep it here i am getting exceptoin saying not all code paths return value bec this return i can not keep it out for loop bec each and evary updateuser i need to return json..
}
}
}
how to overcome this type of things?
thanks
Hello friends..
colNames: ['A','B','C','D'],
colModel: [
{ name: 'A', index: 'A', width: 90 },
{ name: 'B', index: 'B', width: 100 },
{ name: 'C', index: 'C', width: 70 },
{ name: 'D', index: 'D', edittype: 'select', width: 100, editoptions: { value: { 1: 'Yes', 2: 'No'}} }
],
My concersn here is.. I am displying A B C D values from db2... for Last Column D I need to put defalut drop down list for all the rows.
Thanks can any body help me out..
thanks
Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
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.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
in jquery gird on button click i am displaying something like 28000 rows?
I know some of them are sujjested to define the JsonmaxLength in web config file.. but its not working for me?
can anybody tell me about this?
thanks
Exactly I ned to do something like this is this possible?
<%
var Controller = null;
if (Model.ID== "ABC")
{
Controller = "Name";
}
else
{
Controller = "Detail";
}
%>
<% using (Html.BeginForm("edit", Controller, FormMethod.Post, new { @id="exc-" + Model.SID}))
{%>
<%= Html.Summary(true)%>
is this possible?
if i do I am getting exception...
ERROR: Cannot assign to an implicitly-typed local variable
Invoke does not exist in the current context. The same method was not giving any error in Form.cs class but when I used in other class in same project it gives error. i am using threading on forms control.
private void UpdateText(object fileName)
{
if (Textbox.InvokeRequired)
{
UpdateTextCallback back = new UpdateTextCallback(UpdateText);
this.Invoke(back, new object[] { fileName });
}
}
I am trying this code to fetch data from wsdl.
Querying the website for the zipid("60630") works fine but in my code it gives the error as
"Invalid ZIP"
wsdlFile = 'http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl'
wsdlObject = WSDL.Proxy(wsdlFile)
wsdlObject.show_methods()
zipid = "60630"
result = wsdlObject.GetCityWeatherByZIP(ZIP=zipid)
print result[1]
Can someone please help whats wrong here and why the code is not working correctly.
Thanks !!!