Obligatory XKCD: http://xkcd.com/1053/[^] Not implying that this was worth learning, of cause...
Tony Richards
Posts
-
BJOTD -
QA error messageThink I got the same error: http://i46.tinypic.com/2q0p0r6.png[^] Looking at the URL (http://www.codeproject.com/script/Common/Error.aspx?errres=art_EditLocked[^]), it appears that the it was an error with a post being locked. I was trying to edit this QA post[^]. When I opened the post it wasn't locked, but when I clicked Improve Question, I'm assuming someone had already started editing, and I got the message in my screenshot.
-
Inflating color valueWhat exactly is going wrong? Are you getting an exception or a compiler error or is it just not doing what you expect? One possible issue I can see is an overflow of the colour component. For example, with a
byte
, if you add 10 to 255 you'll actually end up with 9, andMath.Min
won't work as you expect. You can catch this problem by surrounding the code with achecked
statement, which will cause the runtime to throw on an overflow. The quickest solution to this would be to cast thebyte
to anint
first, do the addition, and cast the result back to a byte (once you're certain it'll fit). -
Recognizing Chart TrendsIf you know what form of equation the data should follow, least squares (Google has some good references) will fit an equation set of data. Can need some matrix juggling, but that's what computers are for...
-
Windows Phone 7 DevelopmentI think this answers a couple of your questions: 3. Windows Phone 7 uses a cut-down version of Silverlight (with a extra few phone-specific controls). 6. You can use the same standard TCP/IP classes as on Windows (with a few restrictions). 7. Software deployment to a phone works through the Marketplace. This provides notifications about possible updates, but doesn't seem to allow auto-update. 8. The dev software comes with a simulator, but it doesn't beat testing the software on a real device. You should be able to get more info from the Microsoft website.
-
What does the using System; line do ?The using keyword just makes your code a little simpler by allowing you to not specify namespaces when accessing classes. For example, if you have this class:
namespace Tester
{
class Test
{
private void TestMethod()
{
// Do Something
}
}
}Without a using statement, you would use it like this:
var x = new Tester.Test();
With a using statement, you can have:
// At the top of your file, with the rest of the using statements
using Tester;// In the function
var x = new Test();Provided you don't have a class name collision (which namespaces are used to avoid in the first place), you end up with 'simpler' code (for a given value of simpler). However, they aren't essential. The DLL references are managed by the project file and then passed directly to the compiler, not using these statements. Incidently, this isn't a specifically C# thing, the
using namespace
construct in C++ works in the same way. Does that answer your question? -
Where will you remember the fallen?We have a ceremony on Campus on the 11th that I plan to go to. I also have the honour of leading my St John Ambulance Cadet Unit in the local remembrance parade on Remembrance Sunday. It's sad, but I suspect there won't be that many people from the local Adult unit going to the parade. My Cadets are usually pretty keen (even when the weather is a bit grim), but the Adults just don't seem to care as much.
-
WTSSendMessage fails as RPC Server is unavailableImmediate suggestions that come to mind:
- Try disabling any and all firewalls on both PCs.
- Check the RPC services are all enabled and started and functioning properly (You'll have to look these up.)
- Try some of the Microsoft samples first and see if they run without problem.
-
How can i create one button for two events in C# 2008 vs?As an aside (ish): Please please please don't use the button text to work out what state you're in, use something like a boolean member variable instead (or, if you absolutly must use a property on the button, something like the Tag property). The code snippet you've given will break as soon as you try to localise your application, and just really isn't good practice. Something like:
private bool started = false;
private void button1_click(object sender, EventArgs e) {
if (!started) {
button1.Text = "Stop";
// Start the job
// ...started = true; } else { button1.Text = "Start"; // Stop the job // ... started = false; }
}
Also, if you're working in a different thread, don't forget cross-thread access issues.
-
Why Internet Explorer 9 Sucks TodayHave you tried their calibration tool?
-
DoubleplusungoodThe scale doesn't go any higher than 7: http://en.wikipedia.org/wiki/International_Nuclear_Event_Scale[^] Thankfully, Chernobyl is the only example of such an incident.
-
accessing folder from projectI think I understand the problem. If you don't specify an absolute file path, the .Net will try and find the image relative to your current program, hence moving the bitmaps solved the problem. If you don't want the images in the same folder as your program, the simplest solution is to specify their absolute path (e.g. c:\Folder\myImage.bmp) If you do want the images to be kept in your program folder, and they are part of your VS project, make sure their Copy To Output Directory property (right click the file, select properties) is set to Copy Always or Copy If Newer.
-
IntellisenseFirst, this doesn't really have anything to do with the Windows API. I'd suggest the specific forum for your language of choice. Second, the things you are going to have to research will be Auto Complete (sp?) (Intellisense is a MS product name, I believe). And third, I hope your IDE has a plugin framework, otherwise this is going to be a pain....
-
How can I block an http request?I'm chosing to assume you aren't doing this for malicious purposes. Please don't. A decent firewall will allow you to stop a program from accessing the internet.
-
how to use temporary valuesOkay, how are you storing the data in the table (which I'll call Results). I'm imagining something like this after the first result:
RowId Team1Id Team2Id Team1Score Team2Score
0 1 2 1 0It sounds like you are doing an INSERT when you submit the data, which will give you:
RowId Team1Id Team2Id Team1Score Team2Score
0 1 2 1 0
1 1 2 3 0When you want to update the score, use an UPDATE command instead of a INSERT command. You'll need the row's Primary Key (RowId in my example), and you'll end up with this:
RowId Team1Id Team2Id Team1Score Team2Score
0 1 2 3 0As you want.
-
Article Forum Post Expansion BugI'm also using Chrome 8 and can't replicate it either.
-
p/invoke _statHave you checked the calling convention? The last time I got an error like this, this was the reason. Oh, and please use <pre></pre> to make your code clearer
-
In related CP praiseAt the bottom of that header block, on the right hand side (IIRC).
-
Don't tell Christians' DNA... [modified]This blogger would tend to agree: http://scienceblogs.com/insolence/2011/01/the_nobel_disease_meets_dna_teleportatio.php[^] Apparently, the reaction they used to replicate DNA is extremely vulnerable to contamination.
-
Dynamic assembly informationNot neccesarily: 'Some countries will not accept the symbol alone, they also require the word Copyright to appear in order to consider the notice valid. Using the word ensures that there can be no confusion.' http://www.copyrightservice.co.uk/copyright/p03_copyright_notices[^]