I am creating a rounded rectangle GraphicsPath (see red outline image below), and then using this as a clip region both when drawing graphics, and as the Region of a Form.
Unfortunately, although the path looks good, it doesn't work well as a region (see solid black image below)
Is there a way that I can generate a clipping region from the path that includes all the 'outline' pixels of the path? Do I need to generate a bitmap and then process this to create a region?
The rounded rectangle path:
When used as a clip region:
The discrepancy (red pixels are in the path outline, but outside the region. blue pixels are in both):
My method looks as follows
''' <summary>
''' Adds the activity.
''' </summary>
''' <param name="userid">An that is derived from the <see cref="Domain.User.ID" /></param>
''' <param name="activity">The activity integer that is to be derived from the <see cref="ActivityLogService.LogType" />.</param>
''' <param name="ip">An IP V4 IP Address.</param>integer
''' <remarks></remarks>
Public Sub AddActivity(ByVal userid As Integer, ByVal activity As Integer, ByVal ip As String) Implements IActivityLogService.AddActivity
Dim _activity As ActivityLog = New ActivityLog
_activity.Activity = activity
_activity.UserID = userid
_activity.UserIP = ip.IPAddressToNumber
_activity.ActivityDate = DateTime.UtcNow
ActivityLogRepository.AddActivity(_activity)
End Sub
But when I run Sandcastle, my documentation ends up looking like this
userid
Type: System..::..Int32
[Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"]
activity
Type: System..::..Int32
[Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"]
ip
Type: System..::..String
[Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"]
What am I doing wrong?
I have a series of points in a GraphicsPath; for our purpose lets assume its the outline of an uppercase B. I want to be able to be able to draw only the bottom portion that would resemble an uppercase L.
I'd like to be able to select a window of points from the GraphicsPath. Is there a handy way to do this without doing point interpolation?
how to get a list of files / folders as an IEnumerable and not an array?
the reason I want to do this is a have many folders with 20,000+ files in them, and i need to loop through all of them but do not want to wait for them to be compiled into an array. but just want to go through one at a time.
also i'm using .net 3.5 not v4
<?php
$Odd = "even";
$query = $MySQLi->query("SELECT id, look, username, motto FROM users WHERE rank = '7'");
if($query->num_rows > 0):
while($UserRow = $query->fetch_assoc())
{
$Odd = ($Odd == "even") ? "odd" : "even";
?>
I'm using a CMS for some web. But i can't stand this code exactly. Well i do know what does it do. But im not sure how to work with it. Mostly this line:
$Odd = ($Odd == "even") ? "odd" : "even";
Can you guys help me?
I always thought that varibales are mapped to stack locations once your Java source is compiled; additionally, they may include the info about the variable names and their scope in classfiles, but that's optional AFAIK.
The question is - how do my Eclipse/IDEA IDEs allow me to set a watch expression containing the local variable name? To me, it's hard to understand :)
The method definition of IObservable.Create is:
public static IObservable<TSource> Create<TSource>(
Func<IObserver<TSource>, Action> subscribe
)
I get that the function is called once the observable is subscribed to, where by I can then call OnNext, OnError and OnComplete on the observer. But why do I need to return an Action from the subscibe parameter and when will it actually be called?
Psuedo code for mapping configuration (as below) is not possible since the lambda only lets us access Type IDataReader, wheras when actually mapping, AutoMapper will reach into each "cell" of each IDataRecord while IDataReader.Read() == true:
var mappingConfig = Mapper.CreateMap<IDataReader, IEnumerable<MyDTO>>();
mappingConfig.ForMember(
destination => destination.???,
options => options.MapFrom(source => source.???));
Can anyone think of a way to do this using AutoMapper configuration at runtime or just some other dynamic approach that meets the requirement below.
The requirement is to support any incoming IDataReader which may have column names that don't match the property names of MyDTO and there is no naming convention I can rely on. Instead we'll ask the user at runtime to cross-reference the expected column names with the actual column names found in the IDataReader via IDataReader.GetSchemaTable().
I need a simple way of checking how much ram and fast the CPU of the host PC is. I tried WMI however the code I'm using
private long getCPU()
{
ManagementClass mObject = new ManagementClass("Win32_Processor");
mObject.Get();
return (long)mObject.Properties["MaxClockSpeed"].Value;
}
Throws a null reference exception. Furthermore, WMI queries are a bit slow and I need to make a few to get all the specs. Is there a better way?
My question here is similar to the question here, except that I am working with C#.
I have two colors, and I have a predefine steps. How to retrieve a list of Colors that are the gradients between the two?
This is an approach that I tried, which didn't work:
int argbMax = Color.Chocolate.ToArgb();
int argbMin = Color.Blue.ToArgb();
var colorList = new List<Color>();
for(int i=0; i<size; i++)
{
var colorAverage= argbMin + (int)((argbMax - argbMin) *i/size);
colorList.Add(Color.FromArgb(colorAverage));
}
If you try the above code, you will find that a gradual increase in argb doesn't correspond to a visual gradual increase in the color.
Any idea on this?
I have a contact form on a website (a general form: name, email, subject, message) in which mails are sent using google apps smtp to the admins.
Currently if an administrator wants to reply to the mail directly selecting the reply option, the person's reply's To field will be filled by the sender's address automatically.
What I wan't to ask is, Is there any standardized way to pass on some additional info with the mail which would define any reply to the mail should go to this address instead of the sender's?
It does seems that there is a little chance for this option as it may lead to some problems due to spammers (They may define a custom reply field in their mail and a general user might not look where they are replying).
So as an alternative what I thought is to find a way to create a filter with sender's account which figures out the reply email address from the format and forwards the mail (Doesn't seems like a good solution and I have no idea how to achieve this).
I have tagged django, though this is not directly related with this, as I will finally implement this through django.
Hi,
I would like to know how kernel programmer thinks about memory vs user mode programmer. I would also like to know few more differences between kernel programming and user mode programming.
Thanks & Regards,
Mousey.
After creating a child process and exiting it immediately (_exit()), I want to perform a wait and check the status. Now I wonder if in the 'else' branch of the if/else construct I also need to check for WIFSIGNALED. As far as I understand, if I perform a wait, a) an error could have occured (-1), the child could have terminated normally by an (exit() or _exit()), or it could have been terminated by a signal, so the check could be omitted, right?
//remainder omitted
int status;
pid_t t_pid = wait(&status);
if (t_pid == -1) {
perror("wait");
exit(EXIT_FAILURE);
}
if (WIFEXITED(status)) {
printf("child terminated normally, status = %d\n",
WEXITSTATUS(status)
);
} else { // <-- do it have to check for WIFSIGNALED() here?
printf("child was terminated by a signal, signum = %d\n",
WTERMSIG(status)
);
}
This shows how to have a static variable inside an object or context:
http://www.mail-archive.com/[email protected]/msg04764.html
But the scope is too large for some needs, is it possible to have a static variable inside an object function ?
Hi!
I am looking for an elegant way to get the OS version like: "Windows XP Professional Service Pack 1" or "Windows Server 2008 Standard Edition" etc. Is there an elegant way of doing that? I am also interested in the processor architecture (like x86 or x64).
cheers
I have a Book class and need to implement a yes/no voting functionality. My domain classes look like this:
class Book {
String title
static hasMany = [votes: Vote]
}
class User {
String name
static hasMany = [votes: Vote]
}
class Vote {
boolean yesVote
static belongsTo = [user: User, book: Book]
}
What is the best way to implement a voting for the book class. I need the following informations:
What is the average yesVote for a book over all votes (either yes or no)?
How to check if a specific user has done a vote?
What is the best way to implement the computation of the average yesVote such that the performance does not drop?
Codeplex gave me the relevant information for proper connection, and I connected to my repository using the Team Connect to Team Foundation Sever in VS 2010 Ultimate.
Here is what I see:
How can I push the code I have made on my machine, to the repository on CodePlex?
Hi,
Not 100% sure how to frame this question but here goes...
I currently work as a Rails developer but want to work on more substancial / "meaty" projects and have always been very interested in embedded systems, especially systems that run on aircraft and especially submarines.....I know strange combination.
I have been doing some searching & found lockheed martin produces a lot of underwater systems for various navys around the world e.g. http://www.naval-technology.com/projects/nssn/
However, there is very little information about what software is used within these systems, what OS's they use or anything else "technical", presume there is a lot of C / C++ involved but that is just a guess... so its hard to know where to even begin learning what is required to potential work in these areas.
Just wondering if anyone has any experiance working with or more information about embeddeed systems in either the airline (onboard flight systems) or especially submarine systems?
Thanks!
I have a doubt in context switching.
In multi threading, when the context switching occurs, what will be the time between two context switches? Is it fixed time interval?
I have a school project to do which requires us to develop an online voting website. how do i ensure one user has voted once only?
the website is supposed to be in booths in public places which means i cannot use ip addresses or cookies. i was planning to use fb login id or maybe some other email id but i cannot find relevant codes/links. i just want people to go through the procedure of entering the log in id but not go to fb directly.
my website cannot be published online.
could you please suggest how i can achieve this? it is a bit urgent, thank you!
WP7 APP
Using an observable from event, I download the lateset weather from a web service. I tested this out on the phone and emulator at home and it works fine. I brought the project with me to work and ran it using the emulator there. Now i'm not sure it its a firewall or what but it doesn't seem to get the weather, it just sits there for ever trying. So it got me thinking that if there was ever to happen on a phone then I need some kind of timeout in that if it can't get the weather in say 10 - 15 seconds then just give up.
Here is the example code so far
IObservable<IEvent<MyWeather.GetWeatherCompletedEventArgs>> observable =
Observable.FromEvent<MyWeather.GetWeatherCompletedEventArgs>(Global.WeatherService, "MyWeather.GetWeatherCompleted").Take(1);
observable.Subscribe(w =>
{
if (w.EventArgs.Error == null)
{
// Do something with the weather
}
});
Global.WeatherService.GetWeatherAsync(location);
How can I get this to time out safely after a given time if nothing is happening?
Hi everyone !
We have been given a little project (As part of my OS course) to make a Windows program that modifies keyboard input, so that it transforms any lowercase character entered into an uppercase one (without using caps-lock) ! so when you type on the keyboard you'll see what you're typing transformed into uppercase !
I have done this quite easily using Turbo C by calling geninterrupt() and using variables _AH, _AL, i had to read a character using:
_AH = 0x07; // Reading a character without echo
geninterrupt(0x21); // Dos interrupt
Then to transform it into an Upercase letter i have to mask the 5th bit by using:
_AL = _AL & 0xDF; // Masking the entered character with 11011111
and then i will display the character using any output routine.
Now, this solution will only work under old C DOS compilers. But what we intend to do is to make a close or similar solution to this by using any modern C/C++ compiler under Windows XP ! What i have first thought of is modifying the Keyboard ISR so that it masks the fifth bit of any entered character to turn it uppercase ! But i do not know how exactly to do this. Second, I wanted to create a Win32 console program to either do the same solution (but to no avail) or make a windows-compatible solution, still i do not know which functions to use !
Third I thought to make a windows program that modifies the ISR directly to suit my needs ! and i'm still looking for how to do this !
So please, If you could help me out on this, I would greatly appreciate it !
Thank you in advance !
(I'm using Windows XP on intel X86 with mingw-GCC compiler.)