instruction
stringlengths
0
30k
Is the an easy way of finding out the host name of a machine than generated a user mode dump file via WinDbg? Or at least any piece of identifying information to try and confirm that two dump files came from the same system.
While it's a bit of a fringe language, I'm compelled to mention <a href="http://www.erlang.org/index.html">Erlang</a>. Erlang is an excellent language to have in your toolbox since it's unusual strengths tend to compliment other programming platforms. Erlang is very useful for building distributed, multi-threaded, fa...
While it's a bit of a fringe language, I'm compelled to mention <a href="http://www.erlang.org/index.html">Erlang</a>. Erlang is an excellent language to have in your toolbox since it's unusual strengths tend to compliment other programming platforms. Erlang is very useful for building distributed, concurrent, fault-...
*Update (2008-09-19 10:05) - Solution:* **My Solution:** Social engineering, I dug real hard and found someone who knew the schema name. **Technical Solution:** Searching the .dmp file **did** yield the schema name. Once I knew the schema name, I searched the dump file and learned where to find it. Places...
It seems that you're talking about MS SQL. Start the profiler and record tehe most common queries you run on the database. Then run those queries with the Execution Plan turned on and you will see what (if anything) is slowing your queries down. You could then go and optimize the queries or add more indexes on your...
What's the best way to determine the name of your machine in a .NET app?
|.net|
I need to get the name of the machine my .NET app is running on. What is the best way to do this?
Hello I am developing a win32 application and I would like to use an RSA encryption library. **What Library would you reccomend?**
You can hook up on two events on your datagridview. 'ItemCreated' and 'ItemDatabound' Each will pass you an eventarg that can access your itemtemplate. Within that you can .FindControl("ControlId") or step through the .Controls collections to find the cell. Once you got that cell you can do whatever you want - both bor...
What embedded database with Isolated Storage support can you recommend?
|database|embedded|isolatedstorage|
I'm looking for embedded database engine supporting [isolating storage][1]. Currently I'm aware of VistaDB. What else you can recommend? Requirements are pretty simple: * xcopy deployment * support for isolated storage * preferably free [1]: http://msdn.microsoft.com/en-us/library/3ak841sy(VS.80)....
I'm looking for embedded database engine supporting [isolating storage][1]. Currently I'm aware of VistaDB. What else you can recommend? Requirements are pretty simple: * xcopy deployment * support for isolated storage * preferably free Note that you don't know exact path to the file when using IS...
How should I best emulate and/or avoid enum's in Python?
|python|enums|
I've been using a small class to emulate Enums in some Pyhton projects. Is there a better way or does this make the most sense for some situations? Class code here: class Enum(object): '''Simple Enum Class Example Usage: >>> codes = Enum('FOO BAR BAZ') # codes.BAZ will be 2 and so on ...''' ...
Whether or not you would get a performance gain by partitioning the data depends on the data and the queries you will run on it. You can store many millions of rows in a table and with good indexes and well-designed queries it will still be super-fast. Only consider partitioning if you are already confident that your i...
You might also want to look into probabilistic matching.
Not sure if this is what you are looking for but the below is a working code sample to authenticate using the client credentials. Dim client As ProductServiceClient = New ProductServiceClient("wsHttpProductService") client.ClientCredentials.UserName.UserName = "username" client.ClientCreden...
I'm not entirely sure if this is what you are looking for but here you go. MyClient client = new MyClient(); client.ClientCredentials.UserName.UserName = "u"; client.ClientCredentials.UserName.Password = "p";
|apache-flex|actionscript-3|flash|
|apache-flex|flash|actionscript-3|
I am seeing strange behaviour with the flash.media.Sound class in Flex 3. var sound:Sound = new Sound(); try{ sound.load(new URLRequest("directory/file.mp3")) } catch(e:IOError){ ... } However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound con...
I am seeing strange behaviour with the flash.media.Sound class in Flex 3. var sound:Sound = new Sound(); try{ sound.load(new URLRequest("directory/file.mp3")) } catch(e:IOError){ ... } However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound con...
If it's something where you're going to need tons of threads and need better concurrent performance, check out [Stackless Python][1]. Otherwise you could just use the [SOAP][2] or [XML-RPC][3] protocols. In response to Ben's post, if you don't want to look over the BitTorrent source, you could just look at the article ...
RAM is relatively cheap (not that this is an excuse for poor memory managmentment). Unused memory is essentially WASTED memory. If you're hitting limits and the IDE is the problem consider less multitasking, adjusting your memory reqs, or buy more. I wouldn't cripple Eclipse if that's your bread-and-butter IDE.
Return to an already open application when a user tries to open a new instance
|.net|
This has been a problem that I haven't been able to figure out for sometime. Preventing the second instance is trivial and has many methods, however, bringing back the already running process isn't. I would like to: - Minimized: Undo the minimize and bring the running instance to the front. - Behind other win...
|c#|.net|windows|vb.net|
This has been a problem that I haven't been able to figure out for sometime. Preventing the second instance is trivial and has many methods, however, bringing back the already running process isn't. I would like to: - Minimized: Undo the minimize and bring the running instance to the front. - Behind other win...
You **might** be able to do it on the server side. Alternately you could attach an onload event to swap the image src out. I guess the question then becomes, why would you have to use Javascript in the first pace?
Is there a way to ensure entire code block execution in a .NET thread?
|.net|multithreading|
In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments, i...
In my C# program, I have a thread that represents a running test, which can be aborted by a click on a button labeled "Interrupt execution". In order for the thread (and therefore the test) to terminate in an elegant manner (and do some vital work beforehand), this button is enabled only in some well-defined moments, i...
If I'm understanding correctly, I would add the BoxItemTasks table (just an enumeration table, right?), then a BoxItemActions table with foreign keys to BoxItems and to BoxItemTasks for what type of task it is. If you want to make it so that a particular task can only be performed once on a particular box item, just m...
If I'm understanding correctly, I would add the BoxItemTasks table (just an enumeration table, right?), then a BoxItemActions table with foreign keys to BoxItems and to BoxItemTasks for what type of task it is. If you want to make it so that a particular task can only be performed once on a particular box item, just m...
If I'm understanding correctly, I would add the BoxItemTasks table (just an enumeration table, right?), then a BoxItemActions table with foreign keys to BoxItems and to BoxItemTasks for what type of task it is. If you want to make it so that a particular task can only be performed once on a particular box item, just m...
As an alternative, you could try using the **mx.core.Application.application.parameters** object. From the LiveDocs page for [mx.core.Application][1]: > **application** : Object > <br/>[static] [read-only] A reference to the top-level application. > <br/> > <br/>**parameters** : Object > <br/>[read-only] The ...
Note that you may be running into PHP's Magic Quotes "feature" where incoming backslashes are turned to \\. See http://us2.php.net/magic_quotes
How do I position the content of a tabpage in Silverlight?
|silverlight|c#|
When I place a control on a tabpage in Silverlight the control is placed ~10 pixels down and ~10 pixels right. For example, the following xaml: print("<System_Windows_Controls:TabControl x:Name=TabControlMain Canvas.Left="0" Canvas.Top="75" Width="800" Height="525" Background="Red" HorizontalContentAlignment="L...
|c#|silverlight|
When I place a control on a tabpage in Silverlight the control is placed ~10 pixels down and ~10 pixels right. For example, the following xaml: <System_Windows_Controls:TabControl x:Name=TabControlMain Canvas.Left="0" Canvas.Top="75" Width="800" Height="525" Background="Red" HorizontalContentAlignment="Left" Ver...
Sure 100% coverage is a good **goal** when working on a large project, but for most projects fixing one or two bugs before deployment isn't necessarily worth the time to create exhaustive unit tests. Exhaustively testing things like forms submission, database access, FTP access, etc at a very detailed level is often...
|gnuradio|
Why are there two A/D converters on the USRP2 board if you can only use one RX daughtercard?
|gnuradio|usrp|
Responding to the C# code ... Overall, good job on getting the imaging going. I've had to do similar things with some of my apps in the past. One piece of advice, however: All graphics objects in .NET are based on Windows GDI+ primitives. This means these objects require correct disposal to clean up their non-memory...
Avoid using the heap. Use obstacks or pool-allocator for identical sized objects. Put small things with short lifetime onto the stack. alloca still exists.
Pre-mature optimization is the root of all evil! ;)
Since I've switched from Ant to Maven as my build system, [Continuum][1] is the obvious choice. It's very clean and offers all the features that I need. [1]: http://continuum.apache.org/
Perhaps you can modify your client to round-robin ports (say) 1000-1009 and run 10 copies of the process? Alternatively there must be some way of internally refactoring it. It's possible for several processes to listen to the same socket at once by having it opened before calling fork(), but (if it's a TCP socket...
I went ahead and tried the solution of allocating a temporary pointer and passing it to a simple global function similar to kernel1. The good news is that it does work :) However, I think it confuses the compiler as I now get "Advisory: Cannot tell what pointer points to, assuming global memory space" whenever I ...
Switch statement is faster to execute than the if-else-if ladder. This is due to the compiler's ability to optimise the switch statement. In the case of the if-else-if ladder, the code must process each if statement in the order determined by the programmer. However, because each case within a switch statement does not...
We use machine.config on our production server to set/remove specific configuration that are important for production and we never want to forget to set them. These are the 2 most important: <system.web> <deployment retail="true" /> <healthMonitoring enabled="true" /> </system.web>
What might cause CSS to fail to load occassionally on all browsers?
|css|iplanet|tomcat|
I'm working on a webapp, and every so often we run into situations where pages will load without applying CSS. This problem has shown up in IE6, IE7, Safari 3, and FF3. A page refresh will always fix the problem. There are 3 CSS files loaded, all within the same style block using @import: <STYLE type="text...
|css|tomcat|iplanet|
I'm working on a webapp, and every so often we run into situations where pages will load without applying CSS. This problem has shown up in IE6, IE7, Safari 3, and FF3. A page refresh will always fix the problem. There are 3 CSS files loaded, all within the same style block using @import: <STYLE type="text...
There are two main types of drawing context in CSS that can be assigned to elements. One, `display: block`, creates positionable boxes. The other, `display: inline` flows the content as a series of lines within a box. By default, a block takes up all horizontal space, so a series of blocks will be displayed one be...
Here you go: using System.Text.RegularExpressions; /// <summary> /// Validate that a string is a valid GUID /// </summary> /// <param name="GUIDCheck"></param> /// <returns></returns> private bool IsValidGUID(string GUIDCheck) { if (!string.IsNullOrEmpt...
While it *is* true that using errors is more expensive, most people believe that a majority of their GUIDs are going to be computer generated so a `TRY-CATCH` isn't too expensive since it only generates cost on the `CATCH`. You can prove this to yourself with a simple test of the [two][1] (user public, no password). ...
From [Microsft](http://research.microsoft.com/fsharp/manual/quicktour.aspx?0sr=a): > Function types are the types given to > first-class function values and are > written int -> int. They are similar > to .NET delegate types, except they > aren't given names. All F# function > identifiers can be used as first-...
From [Microsoft](http://research.microsoft.com/fsharp/manual/quicktour.aspx?0sr=a): > Function types are the types given to > first-class function values and are > written int -> int. They are similar > to .NET delegate types, except they > aren't given names. All F# function > identifiers can be used as first...
Unit test the web service to ensure its signatures don't break. When you write code that breaks the method signature, you'll know and can adjust the other applications accordingly. Or just don't break the web services and publish them in a way that enable syou to version them. As in http://services.domain.com/MyServ...
What are the main differences between CLTL2 and ANSI CL?
|lisp|common-lisp|
Any online links / resources?
Typically one doesn't validate against the WSDL. If the WSDL is designed properly there should be an underlying xml schema (XSD) to validate the body of the request against. Your XML parser should be able to do this. The rest is up to how you implement the web service and which SOAP engine you are using. I am not...
Typically one doesn't validate against the WSDL. If the WSDL is designed properly there should be an underlying xml schema (XSD) to validate the body of the request against. Your XML parser should be able to do this. The rest is up to how you implement the web service and which SOAP engine you are using. I am not...
If you want to UPSERT more than one record at a time you can use the ANSI SQL:2003 DML statement MERGE. MERGE INTO table_name USING table_name ON (condition) WHEN MATCHED THEN UPDATE SET column1 = value1 [, column2 = value2 ...] WHEN NOT MATCHED THEN INSERT (column1 [, column2 ...]) VALUES (value1 [, v...
The schoolbook way of doing it would be to identify the bottlenecks with real empirical data. Is it the [database][1], apache, network, cpu, memory,io? Do you need more ram, [sharding][2]([+][3]), is the DiskIO, the NFS network load, cpu for doing full table scans? When you find out where the problem is you might...
I know you probably aren't looking for links that you can find on google yourself, but these cover reporting services in great detail and should cover most of your questions. 1. [Reporting Services Tutorials][1] 2. [Intro to reporting services][2] 3. [Reporting Services in Action][3] 4. [Webcasts on Reporting Ser...
Have you looked at the [UIElement.Clip][1] property? For non-rectangular text wrapping, you could try setting a TextBlock.Clip property to a non-rectangular Geometry object. I haven't tried this, but I suspect it will work as expected. Charles Petzold [mentions this technique][2]. [1]: http://msdn.microsof...
Have you looked at the [UIElement.Clip][1] property? For non-rectangular text wrapping, you could try setting a TextBlock.Clip property to a non-rectangular Geometry object. I haven't tried this; either it will not draw text outside the clip region or it will wrap text to fit within the clip. Charles Petzold [men...
I had to do this years ago. I used pymedia. I am not sure if it is still around any way here is some test code I wrote when I was playing with it. It is about 3 years old though. import pymedia import time demuxer = pymedia.muxer.Demuxer('mp3') #this thing decodes the multipart file i call it a d...
I had to do this years ago. I used pymedia. I am not sure if it is still around any way here is some test code I wrote when I was playing with it. It is about 3 years old though. **Edit:** The sample code plays an MP3 file import pymedia import time demuxer = pymedia.muxer.Demuxer('mp3') #this...
I like writing plain old servlets+[winstone](http://winstone.sourceforge.net/) servlet container. From there I bolt on templating (velocity, XSLT, etc) and DB access (hibernate, torque, etc) libraries as I need them rather than going in for an actual framework.
I usually put together a PowerPoint deck fairly early in a project, giving a high-level overview of the project, along with some architectural diagrams (the simpler the better) and screen mockups/wireframes. Then I have a "kick-off" meeting for requirements review, and talk through the business problem and proposed so...
Prevent people from pushing a git commit with a different author name?
|git|
In git, it is up to each user to specify the correct author in their local git config file. When they push to a centralized bare repository, the commit messages on the repository will have the author names that they used when committing to their own repository. Is there a way enforce that a set of known authors for...
How best to test the validity of XML from a method?
|c#|.net|xml|unit-testing|xsd|
I have some WCF methods that are used to transmit information from a server application to a website frontend for use in binding. I'm sending the result as an XElement that is a root of an XML tree containing the data I want to bind against. I'd like to create some tests that examine the data and ensure it comes ac...
I like to set up a screen session with descriptive names for the windows. ^a A will let you give a name to the current window and ^a " will give you a list of your windows. When done, detach the screen with ^a d and re-attach with screen -R
Your're searching for http://grails.org/ You code it with groovy, a dynamic language based upon Java and runs smoothly together with Java code, classes and libraries. The syntax is neither hard to learn nor far away from Java. Give it a try, it's some minutes to get a web site up and running. Just follow http://grai...
Your question is actually two questions in one: 1) How do I write my C++ code to include the right include files on the right platform? 2) How do I write my Makefile to work on different platforms? The C++ code question is already answered - find the platform-specific defines and use them to figure out what pl...
LINUX Recursively list all files in a directory including files in symlink directories
|linux|
Suppose i have a directory /dir inside which there are 3 symlinks to other directories /dir/dir11, /dir/dir12 , /dir/dir13 etc., I want to list all the files in dir including the ones in dir11, dir12 and dir13. To be more generic, i want to list all files including the ones in the directories which are symlinks. ...
Your use of it isn't a hack, though like many things in C++, mutable *can* be hack for a lazy programmer who doesn't want to go all the way back and mark something that shouldn't be const as non-const.
What you could do is create a table with keys (member\_id,position) that maps to another member\_id. Then you can store the ordering in that table separate from the member list itself. (Each member retains their own list ordering, which is what I assume you want...?) Supposing that you have a member table like this:...
Web designer for VS.NET ReporViewer
|designer|rdl|