instruction stringlengths 0 30k ⌀ |
|---|
Other applications if run this way (i.e. from a timer job with explicit credentials) are failing the same way with "The application failed to initialize propely". I just worte a simple app which takes a path of another executable and its arguments as parameres and when run from that timer job it fails the same way.
... |
@Justin:
When executing a macro, it's a little different... incremental searches will just happen once, and you will have to execute the macro again if you want to search again. You can do more powerful and complex things though, such as search for a keyword, jump to the beginning of the line, mark, go to end of th... |
@Justin:
When executing a macro, it's a little different... incremental searches will just happen once, and you will have to execute the macro again if you want to search again. You can do more powerful and complex things though, such as search for a keyword, jump to the beginning of the line, mark, go to end of th... |
In languages that use C-style (null-terminated) strings, comparing to `""` will be faster. That's an O(1) operation, while taking the length of a C-style string is O(n).
In languages that store length as part of the string object (C#, Java, ...) checking the length is also O(1). In this case, directly checking the... |
I might be mistaken, but I'm pretty sure IE6 and less just don't do transparency with PNG files.
I have two "solutions" that I use. Either create GIF files with transparency and use those everywhere, or just use them for IE 6 and older with conditional style sheets. The second really only works if you are using th... |
There is another way which avoids tempdata. The pattern I like involves creating 1 action for both the original render and re-render of the invalid form. It goes something like this:
var form = new FooForm();
if (request.UrlReferrer == request.Url)
{
// Fill form with previous request's... |
In .Net a `decimal` will be the most precise datatype that you could use for position. I would just write a class for the position:
public class Position
{
decimal x;
decimal y;
decimal z;
}
As for time, your processor can't give you anything smaller than one tick.
Sou... |
I think you should be able to get away with the Decimal data type with no problem. It has the most precision available. However, the double data type should be just fine.
Yes, a tick is the smallest I'm aware of (using the System.Diagnostics.Stopwatch class). |
I was trying to come up with a cool way to build a navigation control for a website I was building. I wanted to use regular HTML unordered list elements (employing the standard [CSS "Sucker Fish" look][1]) with a top-navigation mouse-over effect that reveals the drop down items. I had a sql dependent cached DataSet wit... |
This changed in [gcc-3.4][1]. The C++ parser got much more strict in that release -- per the spec but still kinda annoying for people with legacy or multi-platform code bases.
[1]: http://gcc.gnu.org/gcc-3.4/changes.html |
This changed in [gcc-3.4][1]. The C++ parser got much more strict in that release -- per the spec but still kinda annoying for people with legacy or multi-platform code bases.
[1]: http://gcc.gnu.org/gcc-3.4/changes.html#cplusplus |
MS's solutions used to be called MOM - looks like it's be [redesigned a bit](http://www.microsoft.com/systemcenter/operationsmanager/en/us/default.aspx) since I last used it. |
the MySQL C API has it's own mysql_escape_string(). Using it or it's equivalent would be best. |
How to host a WPF form in a MFC application |
|c#|wpf|mfc| |
I'm looking for any resources on hosting a WPF form within an existing MFC application. Can anyone point me in the right direction on how to do this?
Thanks,
--Mark |
Wow. C++ never ceases to surprise me with its weirdness.
> In a template definition, unqualified names will no longer find members of a dependent base (as specified by [temp.dep]/3 in the C++ standard). For example,
template <typename T> struct B {
int m;
int n;
int f ();
int g ();
};
int n;... |
[IE7.js][1] will provide support for PNGs (including transparency) in IE6.
[1]: http://code.google.com/p/ie7-js/ |
> And again, let me emphasize, the C++ stuff is veerrrryyyy expensive. Would it make sense to do what I mentioned above? (.NET forms hiding heavy lifting C++)
As noted before, I personally haven't noticed any system wide slow downs due to WinForms in applications written in both VB.NET and C#. However, if the applic... |
What are the useful new ASP.NET features in the .NET Framework 3.5? |
|asp.net| |
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership fra... |
I have come to see that the best way to advertise yourself is to put quality content out there. If you write about the technology that you have experience in, maybe create a few tutorials, and if you do all that often enough, that shows some authority in your chosen field of work.
This alone is one of the best adver... |
I use this to read from a file
string filename = @textBox1.Text;
string[] fields;
string[] delimiter = new string[] {"|"};
using (Microsoft.VisualBasic.FileIO.TextFieldParser parser =
new Microsoft.VisualBasic.FileIO.TextFieldParser(filename)) {
p... |
Two things to consider.
###1. How long will it take to process a record?
If record processing is very quick, the overhead of handing off records to threads can become a bottleneck. In this case, you would want to bundle records so that you don't have to hand them off so often.
If record processing is reasonably... |
I was trying to come up with a cool way to build a navigation control for a website I was building. I wanted to use regular HTML unordered list elements (employing the standard [CSS "Sucker Fish" look][1]) with a top-navigation mouse-over effect that reveals the drop down items. I had a sql dependent cached DataSet wit... |
I was trying to come up with a cool way to build a navigation control for a website I was building. I wanted to use regular HTML unordered list elements (employing the standard [CSS "Sucker Fish" look][1]) with a top-navigation mouse-over effect that reveals the drop down items. I had a sql dependent cached DataSet wit... |
From what I understand (haven't tried myself), it's almost as simple as just giving the WPF control the parent's handle. Here's a walkthrough:
http://msdn.microsoft.com/en-us/library/ms744829.aspx |
David Joyner had the history, here is the reason.
The problem when compiling B<T> is that its base class A<T> is unknown from the compiler, being a template class, so no way for the compiler to know any members from the base class.
Earlier versions did some inference by actually parsing the base template class, b... |
Actually it ships with .NET 3.5 SP1. So yes, the stored procs can use 3.5 features and libraries. |
import math
def encodeOnesDigit(num):
return ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'][num]
def encodeTensDigit(num):
return ['twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'][num-2]
def encodeTeens(num):
if... |
import math
def encodeOnesDigit(num):
return ['', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'][num]
def encodeTensDigit(num):
return ['twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'][num-2]
def encodeTeens(num):
if ... |
Ok first as a little disclaimer: I know nothing about 3D programming.
Now my purely mathematical idea:
Given a plane by a normal N (of unit length) and a distance L of the plane to the center (the point [0/0/0]). The distance of a point X to the plane is given by the scalar product of N and X minus L the distance... |
Well, there are several approaches that would work. You could write your own data structure that did this. Or you can try and use SortedList. You can also return the DataSets in code, and then use .Select() on the table. Granted, you would have to do this on both tables. |
I use curly braces around every statement if and only if at least one of them requires it.
|
It depends ...
- The Ant process doesn't have enough permissions to delete the files (typically because they were created by a different user, perhaps a system user). Try running your Ant script as an administrative user, using Run As.
- Windows is really bad at cleaning up file locks when processes die or are... |
Go to Control Panel\System and then under Windows Activation click "Change Product Key". |
I know in Vista this is done from the system control panel. I would check there in Server 2008. |
You can easily use a SortedList<string> to do fast lookups. If the data you are loading is already sorted, insertions into the SortedList should not be slow. |
'id' is a bad variable name in Python |
|python| |
Why is it bad to name a variable 'id' in Python? |
I knew about the noise words file, but I'm not why your "Terminator 2" example is still giving you issues. You might want to try asking this on the [MSDN Database Engine forum][1] where people that specialize in this sort of thing hang out.
[1]: http://forums.microsoft.com/Forums/ShowForum.aspx?ForumID=93&SiteID... |
newLisp has support for mysql5 and if you look at <a href="http://www.newlisp.org/code/modules/mysql5.lsp.html">the mysql5 function calls</a>, you'll see that it's close to PDO. |
One reason to use g++ or MingW/Cygwin that hasn't been mentioned yet is that starting and IDE will hide some of what is going on. It will be incredibly useful down the road to understand the differences between compiling and linking for instance. Learn it and understand it from the start, and you won't even know you s... |
[http://igoro.com/archive/extended-linq-additional-operators-for-linq-to-objects/][1]
[http://igoro.com/archive/7-tricks-to-simplify-your-programs-with-linq/][2]
[1]: http://igoro.com/archive/extended-linq-additional-operators-for-linq-to-objects/
[2]: http://igoro.com/archive/7-tricks-to-simplify-your-p... |
Correct syntax is WHERE database.foobar IS NULL. See [http://msdn.microsoft.com/en-us/library/ms188795.aspx][1] for more info
[1]: http://msdn.microsoft.com/en-us/library/ms188795.aspx |
I would agree with [Kibbee][1]. I wanted to jump in with SVN so I installed the daemon and had everything up and running in no time. It took me longer to get all the commands down for adding and committing files than the installation.
[1]: http://stackoverflow.com/users/1862/kibbee |
I'm not sure I understand your last question, could you please clarify? |
I'm not sure I understand your last question, could you please clarify?
Edit:
I might still not understand, but you can use any type you want (for example, doubles) to represent time (if what you actually want is to represent the discretization of time for your physics problem, in which case the tick is irrelevan... |
Xcode is the standard for editing source files, though you can use another editor in conjunction with the command line xcodebuild tool if you really want. I used Vim for all my Cocoa editing before finally giving in to Xcode. It's not the greatest IDE in the world, but it gets the job done, and the recent 3.x release... |
I would simply go with installing SVN, and using the SVN Daemon, and completely ignoring Apache. There should be no appliance needed. Very simple to install, very easy to configure. Just take a vanilla windows/windows box and install the subversion server. It'll probably take all of 1/2 and hour to set up. |
I would simply go with installing SVN, and using the SVN Daemon, and completely ignoring Apache. There should be no appliance needed. Very simple to install, very easy to configure. Just take a vanilla windows/linux box and install the subversion server. It'll probably take all of 1/2 and hour to set up. |
Is it an SQL Server database?
If so, use `IS NULL` instead of making the comparison ([MSDN][1]).
[1]: http://msdn.microsoft.com/en-us/library/aa933227(SQL.80).aspx |
It's his Mentor's responsibility to Teach him/her. How well are you teaching him/her HOW to test. Are you pair programming with him? The Junior more than likely doesn't know HOW to set up a good test for xyz.
As a Junior freshout of school he knows many Concepts. Some technique. Some experience. But in the end... |
Delimited string parsing framework |
|parsing| |
I'm looking at parsing a delimited string, something on the order of
a,b,c
But this is a very simple example, and parsing delimited data can get complex; for instance
1,"Your simple algorithm, it fails",True
would blow your naiive string.Split implementation to bits. Is there anything I can freely use/stea... |
Delimited string parsing framework for .NET |
I'm looking at parsing a delimited string, something on the order of
a,b,c
But this is a very simple example, and parsing delimited data can get complex; for instance
1,"Your simple algorithm, it fails",True
would blow your naiive string.Split implementation to bits. Is there anything I can freely use/stea... |
I'm still learning ASP.net so I can't tell you exactly, but if you look through [http://www.asp.net/learn/][1] you'll probably find a few new gems, there's even a 3.5 section.
[1]: http://www.asp.net/learn/ |
When should I not use the ThreadPool in .Net? |
|.net|multithreading| |
When should I not use the ThreadPool in .Net?
it looks like the best option is to use a ThreadPool. In which case, why is it not the only option.
What are your experiences around this? |
Check out the [MVC framework][1] which is built ontop of 3.5. Big improvement over the traditional webforms model.
[1]: http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx |
When you're going to perform an operation that is going to take a long time, or perhaps a continuous background thread.
I guess you could always push the amount of threads available in the pool up but there would be little point in incurring the management costs of a thread that is never going to be given back to the ... |
I'd suggest using an array of void*, with the last entry always void.
say you need 3 parameters you could do this:
void MoveHandler (void** DataArray)
{
// data1 is always chess_move
chess_move data1 = DataArray[0]? (*(chess_move*)DataArray[0]) : NULL;
// data2 is always float
... |
Recall that "unit testing" is only one kind of testing. You should be able to unit test the **internal** pieces of your code generator. What you're really looking at here is system level testing (a.k.a. regression testing). It's not just semantics... there are different mindsets, approaches, expectations, etc. It's... |
using System;
namespace HumanReadable
{
public static class HumanReadableExt
{
private static readonly string[] _digits = {
"", "one", "two", "three", "four", "five",
... |
Read [Testing for Null Values][1], you need IS NULL not = NULL
[1]: http://wiki.lessthandot.com/index.php/SQL_Server_programming_Hacks_-_Testing_for_Null_Values |
For a simulation you're probably better off using a decimal/double (same type as position) for a dimensionless time, then converting it from/to something meaningful on input/output. Otherwise you'll be performing a ton of cast operations when you move things around. You'll get arbitrary precision this way, too, becau... |
The closest thing to a scripting environment on Windows Mobile is the Configuration Service Provider interface. While it is not a scripting language *per se*, it does allow one to do a lot of the same type of things such as modify registry settings, copy and delete files and directories, install and uninstall applicat... |
I've never attempted it myself, but hearing plenty about other people who've tried, it's not a road you want to go down.
There is the alternative of putting the gui in pygame itself. There are plenty of gui toolkits built specifically for pygame that you could use. Most of them are rather unfinished, but there are 2... |
[YUICompressor][1] is the way to go...great compression rate, well tested and in use among many top sites, and, well, personally recommended by me.
I've used it for my projects without a single JS error or hiccup. And it has nice documentation.
I've never used its CSS compression capabilities, but they exist as ... |
[JSMin](http://crockford.com/javascript/jsmin) is another one. |
Try [JSMin][1], got C#, Java, C and other ports and readily available too.
[1]: http://www.crockford.com/javascript/jsmin.html |
Java and manually executing finalize |
|java| |
If I call finalize on an object from my program code, will the JVM still run the method again when the garbage collector processes this object? |
If I call finalize on an object from my program code, will the JVM still run the method again when the garbage collector processes this object?
This would be an approximate example:
MyObject m = new MyObject();
m.finalize();
m = null;
System.gc()
Would the explicit call to finalize make the JVM's garb... |
I've always found the custom dialogs in visual studio setup projects to be woefully limited and barely functional.
By contrast, I normally create custom actions that display winforms gui's for any remotely difficult tasks during setup. Works really well and you can do just about anything you want by creating a cust... |
Well it is a little bland, but I would vote for Get-Help. |
I did some programming in .NET (using C#) and I realized that often times I craved more control over a number of the Controls. These required knowledge that extended beyond the .NET framework.
For example when I was working with the WebBrowser control to produce an automated testing tool for web applications, I rea... |
You need to create your own exchange message sink to do this. |
You need to create your own exchange message sink to do this. Here's a classic VB example from MS KB:
[http://support.microsoft.com/kb/317327][1]
[1]: http://support.microsoft.com/kb/317327 |
You need to create your own exchange message sink to do this. Here's a classic VB example from MS KB:
[http://support.microsoft.com/kb/317327][1]
If you're running Exchange 2007 then you can use Transport Rules:
[http://msexchangeteam.com/archive/2006/12/12/431879.aspx][2]
[http://www.msexchange.org/tutoria... |
You need to create your own exchange message sink to do this. Here's a classic VB example from MS KB:
[http://support.microsoft.com/kb/317327][1]
and a VB Script one:
[http://support.microsoft.com/kb/317680][2]
And lots of goodness from MSDN about Exchange 2003 Transport Event Sinks:
[http://msdn.microso... |
I've also been investigating wiki software for use as a KB, but it is tricky to find something that is easy to use for non-technical people. There are many wikis that attempt to provide WYSIWYG editing, but most of the software I've found generates nasty inefficient html markup from the WYSIWYG editor. One notable ex... |
I've worked on a project using MSQL Server in conjunction with a Java Stack. It works very well and as long, since JDBC shouldn't really care about your database. We used ehcache together with Hibernate and had problems with the MS JDBC Driver, so we switched to jtds and it works really good.
It's quite a while ago,... |
On the assumption that you're building apps targeted at Windows:
- it can sure be informative to understand lower levels of the system - how they work, how your code interacts with them (even if only indirectly), and where you have additional options that aren't available in the higher-level abstractions
- ther... |
Are there any decent free JAVA data plotting libraries out there? |
|java|data|plot|configuration|reverseengineering|freeware| |
On a recent JAVA project, we needed a free JAVA based plot utility. After much searching, we found this tool called the [Scientific Graphics Toolkit or SGT][1] from NOAA. It seemed pretty robust, but we found out that it wasn't terribly configurable. Or at least not configurable enough to meet our needs. We ended u... |
You can try:
Bitmap.InterpolationMode = InterpolationMode.HighQualityBicubic;
and
Bitmap.CompositingQuality = CompositingQuality.HighQuality;
Which does keep the quality fairly high, but not the highest possible. |
I like [vxl](http://vxl.sourceforge.net/) |
Getting the process id of a Carbon C++ application |
|c++|macos|macos-carbon| |
Is there a way of getting the process id of my C++ application? I am using the Carbon framework, but not Cocoa |
Fundamentally you won't be able to keep the same quality because jpg is (so far as I'm aware) always lossy even with the highest possible quality settings.
If bit-accurate quality is really important, consider using png, which has some modes which are lossless. |
I've used C++ namespaces the same way I do in C#, Perl, etc. It's just a semantic separation of symbols between standard library stuff, third party stuff, and my own code. I would place my own app in one namespace, then a reusable library component in another namespace for separation. |