I am working with the Parallel libraries in .net 4 and I am creating a Partitioner and the example shown in the MSDN only has a chunk size of 1 (every time a new result is retrieved it hits the data source instead of the local cache. The version I am writing will pull 10000 SQL rows at a time then feed the rows from the cache until it is empty then pull another batch.
Each partition in the Partitioner has its own chunk. I know every time I call to the IEnumerator in from the SQL data-source that needs to be thread safe but for use in a Parallel.ForEach do I need to make every call to the cache for the chunking thread safe?
I am developing an iPhone application for a university project and I'm new to iPhone development. I have looked through Apple's MapCallouts code but it doesn't seem feasible to implement it.
So far my code displays a map, drops annotations, displays the title and it displays the right call out button. But this is where I encounter problems.
When I press on the callout button, it displays a blank view controller but it should display a different image for every callout that's tapped and this isn't happening so far.
I have added my code below:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
//NSUInteger tag = ((UIButton *)control).tag;
if (self.detailController==nil)
{
DetailViewController* detailViewController = [[DetailViewController alloc] init];
[self.navigationController pushViewController:detailViewController animated:YES];
}
// self.detailController.tag =1; //to identify image required
// self.detailController.tag = tag;
[self.navigationController pushViewController:detailController animated:YES];
}
Currently I have a webform that has a series of links. What I'd like to be able to do is add a webcontrol's content when one of the links is clicked. Is this kind of thing even possible?
If not, what's the best strategy for loading a set of controls (one textbox and one dropdown with values from one link, two textboxes and a checkbox from another link, etc.). I'd need to be able get the values of each of these controls on postback.
Ideally, I'd like to be able to add that new content to an acordian control, most likely the jQuery UI acordian. So each clickable link would add new content to an acordian control.
What's everybody's thoughts on this?
We're going global. I've been tasked with refactoring our existing products to support localization. Last week I shunned using resource files (.resx) in favor of a home-baked database look-up method. After hitting a serious snag with that, I'm back to the microsoft way of using resx.
All the documentation I've seen so far details how to create new "World-Ready" applications, but I don't see anything on changing existing applications. Is my only recourse to touch the application form by form and control by control to have it point to newly created resource files?
Any good sources/links for internationalizing your apps?
Is it possible to take a screenshot of a web page with ASP.net with C# Code and then submit that back to the server?
In this code access only local host only, but same source code not access to the IIS, CopyFromScreen error ware occurred. What is the reason is it possible?
Sample Source Code:
Bitmap Bitmap;
Graphics Graps;
Bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height - 110, PixelFormat.Format32bppArgb);
Graps = Graphics.FromImage(Bitmap);
Graps.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, 110, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Bitmap.Save(Server.MapPath("~") + "/YourShot.gif");
So, I have a control. It displays an image based some xml document and an optional parameter
"Document" - XML document
"RenderingOption" - optional image-rendering ( sharpen, soften )
So:
<XMLRenderingWidget Document="xxxxxx"/>
The above will render the document once
<XMLRenderingWidget Document="xxxxxx" RenderingOption="Sharpen"/>
The above will, sometimes render the document once, more oftentimes:
Perform the rendering of the document as if no Rendering was set
then, re-render the document with the Sharpen option
I do the rendering on the PropertyChangedCallback assigned to the property.
How do I tell the control to "hey, before doing the rendering, apply the changes on the other properties being set, too"
Is this not possible? Should I bundle them up as one property instead?
Hello guys, there are three (open) questions about the internationalization of GWT, I have:
1) Is it a (huge) performance issue, to use only "Messages" for constant and parameterized text (that's possible), where you would use both "Messages" and "Constants" usually?
2) Is there a way to specify the original text in the source code, whose translations can then be specified somewhere? (e.g. Translate("Hello") in the source code and than in a properties file for e.g. spanish: Hello = ¡Hola!)
3) Do you know any translation-tools, which generate the properties and interfaces for you?
Thanks in Advance!
TeX/LaTeX is great, I use it in many ways. Some of it's advantages are:
it uses text files, this way the input-files can be diffed and many tools exist to work with text
it is very flexible
it has a stable layout: if I change something at the start of the document, it doesn't affect other things at the end of the document
it has many extensions to reach different goals (a successor would start without extensions, but would have a good extension-system)
you can use standard build control tools to support complicated documents (thanks dmckee)
you can encapsulate solutions and copy&paste them to new documents or send them to others to learn from (thanks dmckee)
But on the other hand some little things are not so good:
it is hard to learn at the beginning
it is complicated to control position of images
a few things are a little counter-intuitive
sometimes you have to type too much (begin{itemize} ... \end{itemize})
So, does there exist a successor/alternative to LaTeX or at least is some hot candidate for an alternative in development. A real successor/good alternative would keep the advantages and fix the disadvantages, or at least some of them.
I've played around with the WPF Popup Control and as far as I can see, the Visibility property is superfluous.
If you have a Popup with IsOpen = True, it will be visible even if its Visibility = Collapsed.
If you have a Popup with IsOpen = False, then its Visibility will be Collapsed, and will remain "Collapsed" when IsOpen changes to true, and it will appear. (i.e. you'll have something that appears on your screen, even though Snoop says it is Collapsed.)
Why does the Popup control have both these properties? Am I missing something here?
Hello All,
I have a desktop application that has a control with a WebBrowser control inside. Everything works fine except with Siebel CMR popups. When it opens a new popup , Siebel tries to load an applet in the popup window but it doesn't work , it works fine in the main browser. This works perfectly with IE also. It seems to be related to some security setting but i am quite lost.
Does anyone know if there is any way to modify or check the security when a new popup is opened?
Thanks in advance!
Fede
I have three seperate projects:
-MyUserControl (Needs a reference to a service implementing IMyService)
-MyService (Implements IMyService)
-MySharedInterfaces (IMyUserControl and IMyService)
-MyWebApp
The user control needs to be dynamically loaded at runtime. This implements IMyUserControl and has a property of type IMyService which will be set at runtime.
The trouble is even with the option to reuse types the WebApp isn't reusing the IMyServiceType, it always generates it again from the Service Reference. This wouldn't be an issue if I could cast it to MySharedInterfaces.IMyService (which I can't understand, since it should be exactly the same).
The user control is expecting something of type IMyService, is there anyway to either cast the WebServiceReference.IMyService back to MySharedInterface.IMyServiceReference or force the WebServiceReference to reuse the MySharedInterface.IMyServiceReference?
Thanks
I am using jQuery to detect drop on target, the target in question is a image. If i drag one image upon another, and then drop it, it shall replace the target source with the dropped source. This works fine until two images lies upon each other.
Some of the images lies next to each other and some times the target images overlap. if i drop, both the visible image and the image beneath is replaced with the dragged image.
I hope the problem is clear and their is any good solution
Having problems with this code and cant figure out why. It works fine the first time through but crashes with a Parameter is not Valid error the 2nd time on this line.
Dim tbx As TextBox = New Windows.Forms.TextBox
Any help is appreciated.
Dim tbx As TextBox = New Windows.Forms.TextBox
tbx.Name = tbxName
tbx.Size = New System.Drawing.Size(55, 12)
tbx.BorderStyle = BorderStyle.None
tbx.TextAlign = HorizontalAlignment.Center
Using f As Font = tbx.Font
tbx.Font = New Font(f.FontFamily, 8, FontStyle.Bold)
End Using
tbx.Location = New System.Drawing.Point(xCords, 44)
Select Case tbx.Name
Case "tbxBulk01" : tbx.Text = Bulk01Label
Case "tbxBulk02" : tbx.Text = Bulk02Label
End Select
Me.Controls.Add(tbx)
Stack trace as follows.
at System.Drawing.Font.GetHeight(Graphics graphics)
at System.Drawing.Font.GetHeight()
at System.Drawing.Font.get_Height()
at System.Windows.Forms.Control.get_FontHeight()
at System.Windows.Forms.TextBoxBase.get_PreferredHeight()
at System.Windows.Forms.TextBoxBase.get_DefaultSize()
at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
at System.Windows.Forms.TextBoxBase..ctor()
at System.Windows.Forms.TextBox..ctor()
I have a method which compares two objects and returns a list of all the property names which are different.
public static IList<string> GetDifferingProperties(object source, object)
{
var sourceType = source.GetType();
var sourceProperties = sourceType.GetProperties();
var targetType = target.GetType();
var targetProperties = targetType.GetProperties();
var properties = (from s in sourceProperties
from t in targetProperties
where s.Name == t.Name &&
s.PropertyType == t.PropertyType &&
s.GetValue(source,null) != t.GetValue(target,null)
select s.Name).ToList();
return properties;
}
For example if I have two classes as follows:
public class Address
{
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
public class Employee
{
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public Address EmployeeAddress { get; set; }
}
I am trying to compare the following two employee instances:
var emp1Address = new Address();
emp1Address.AddressLine1 = "Microsoft Corporation";
emp1Address.AddressLine2 = "One Microsoft Way";
emp1Address.City = "Redmond";
emp1Address.State = "WA";
emp1Address.Zip = "98052-6399";
var emp1 = new Employee();
emp1.FirstName = "Bill";
emp1.LastName = "Gates";
emp1.EmployeeAddress = emp1Address;
var emp2Address = new Address();
emp2Address.AddressLine1 = "Gates Foundation";
emp2Address.AddressLine2 = "One Microsoft Way";
emp2Address.City = "Redmond";
emp2Address.State = "WA";
emp2Address.Zip = "98052-6399";
var emp2 = new Employee();
emp2.FirstName = "Melinda";
emp2.LastName = "Gates";
emp2.EmployeeAddress = emp2Address;
So when I pass these two employee objects to my GetDifferingProperties method currently it returns FirstName and EmployeeAddress, but it does not tell me which exact property (which in this case is Address1) in the EmployeeAddress has changed. How can I tweak this method to get something like EmployeeAddress.Address1?
Hi,
I need to extend the behavior of an instance, but I don't have access to the original source code of that instance. For example:
/* I don't have the source code for this class, only the runtime instance */
Class AB
{
public void execute();
}
in my code I would to intercept every call to execute, compute some sutff and then call the original execute, something like
/* This is how I would like to modify the method invokation */
SomeType m_OrgExecute;
{
AB a = new AB();
m_OrgExecute = GetByReflection( a.execute );
a.execute = MyExecute;
}
void MyExecute()
{
System.Console.Writeln( "In MyExecute" );
m_OrgExecute();
}
Is that possible?
Does anyone have a solution for this problem?
When the CacheRolesInCookie property is set to true in the Web.config file, role information for each user is stored in a cookie. When role management checks to see whether a user is in a particular role, the roles cookie is checked before the role provider is called to check the list of roles at the data source. The cookie is dynamically updated to cache the most recently validated role names.
a) As far as I understand the above text, even though role management checks the roles cookie, role provider still checks the list of roles at the data source?
b) Above text talks about role management, which is invoked before role provider is called. What class acts as a role management?
thanx
I'm hoping to make an app that streams live video that has a view placed on top with labels and a button on it.
From my research and testing of the http video streaming feature (available since iPhone 3.0 OS), it seems that you create a webview that points to the index html that contains the converted video stream, and this displays as a quicktime video in the app. This means that I don't have control over the Media Player that is opened. Does anyone know how you can control this?
I know that the Apple's MoviePlayer sample code shows you how to place views on top of a MediaPlayer video, but how can this be done with a http live stream?
Thanks in advance.
I'm trying to control positioning of a jQuery datepicker element. I like the solution offered at http://stackoverflow.com/questions/1818670/how-to-control-positioning-of-jqueryui-datepicker for overriding the _checkOffset fn:
$.extend(window.DP_jQuery.datepicker,{_checkOffset:function(inst,offset,isFixed){return offset}});
However, this results in a 'window.DP_jQuery is undefined' error. Upon inspection, I can see that the DP_jQuery object in the DOM gets named with a random string, like so: DP_jQuery_123456. If I use this full name in the above code, it works wonderfully.
My question is whether there's a way to exend the _checkOffset fn for a datepicker instance without knowing before-hand what the instance name is? For example, can I use some sort of wildcard to select all datepicker instances that begin with 'DP_jQuery_'?
Thanks
A few of the classes on a VS 2010 class diagram are displayed with a red title. The Class Details window shows all of the methods, properties, fields and correctly shows no events. However, there's an entry under each of methods, properties, fields and events that states where the name should be:
"The type cannot be edited because the
source code file contains an error."
However, the source file builds with no errors or warnings.
Anyone seen this? Any idea how to fix it?
Hi folks,
I am trying to deploy an azure cloud application on Windows Azure.
Application specifications are --
It has one WebRole - ASP.Net MVC Application (ASP.Net charting control is used in this MVC application)
It does not contain any worker role.
Third party references are set with property "copy Local" to "true"(MVC,ASP Charting control & ASP Provider DLLs)
There is no DiagnosticsConnectionString in service configuration file
It uses ASP provider for session state management.
This application runs successfully on local dev fabric but when I try to deploy it on Windows Azure it gets stuck in a loop with status being changed between Initializing, Busy, Stopping states. It never goes into READY state. It seems that there are no ERROR logs for conveying the deployment issues to user.
So is there any way to diagnose deployment issues ? Is there any way to get deployment ERROR logs ?
Any kind of help will be appreciated.
Thanks,
Kushal
Hello
normal validation is always related to some control, but in my case there is no control to fire validation when its content changes and to show errortemplate to the user. because the data to be validated is in the cipboard. when the user presses "PASTE" button viewmodel processes the data and finds it to be invalid. but what is the best way to invoke WPF validation in this case? as far as i understand using IDataErrorInfo is the way to go, but what is the best way to start validation. and whst is the best way of displaying the error? errortemplate of the button element?
Thanks a lot for help.
Peter
I am trying to get a specific colour used by Windows XP in my .NET application.
In Windows XP, if you go the Control Panel in 'category view', on the left hand side you have some 'See Also' options (Windows Update, Help and Support, Other Control Panel Options). The colour I'm trying to get is the light blue background colour shown behind these options.
I don't need the hex/RGB value of the colour, as it can change depending on the style settings used on the desktop.
My question is - is it possible to programmatically get hold of this colour in a .NET app?
The colour doesn't appear to be in SystemColors, although it's very similar to SystemColors.InactiveCaptionText (and I think I can probably get away with using this). I'm just wondering if there is a way to get hold of the exact colour.
What are the advantages/disadvantages of keeping SQL in your C# source code or in Stored Procs? I've been discussing this with a friend on an open source project that we're working on (C# ASP.NET Forum). At the moment, most of the database access is done by building the SQL inline in C# and calling to the SQL Server DB. So I'm trying to establish which, for this particular project, would be best.
So far I have:
Advantages for in Code:
Easier to maintain - don't need to run a SQL script to update queries
Easier to port to another DB - no procs to port
Advantages for Stored Procs:
Performance
Security