instruction stringlengths 0 30k ⌀ |
|---|
Profiling #c/.net applications |
|c#|.net|visual-studio| |
How do you trace/profile your .net applications?
The msdn online help mentions Visual Studio Team (which I do not possess) and there is the Windows Performance Toolkit. But, are there other solutions you can recommend? Preferably (of course) a solution that works without changing the code (manually) and that can be in... |
This question is mostly a duplicate of http://stackoverflow.com/questions/12328/what-bug-tracking-software-do-you-use which has *a lot* of answers - tasks are not necessarily bugs, but good tools let you specify other task types than 'bug'. |
Happy birthday:
http://www.jetbrains.com/profiler/
|
Yes, you can do this via the import element.
<import resource="services.xml"/>
Each element's resource attribute is a valid path (e.g. classpath:foo.xml) |
I like dotTrace3.1
It has worked really well for me. |
From the [Spring Docs (v 2.5.5 Section 3.2.2.1.)][1]:
> It can often be useful to split up
> container definitions into multiple
> XML files. One way to then load an
> application context which is
> configured from all these XML
> fragments is to use the application
> context constructor which takes
> multipl... |
Your larger problem is blocking in signal handlers.
This is usually discouraged since it can lead to strange timing conditions. But it's not quite the cause of your problem since the timing condition you're vulnerable to exists because of your choice of signal handlers.
Anyway, here's how to at least minimize th... |
With the "select" method on Array. To wit:
`[1, 2, 3, 4, 5, 6, 7].select{|e| e%2 == 0}`
gives us `[2,4,6]` back. |
I had originally suggested using the `select` method on Array. To wit:
`[1, 2, 3, 4, 5, 6, 7].select{|e| e%2 == 0}`
gives us `[2,4,6]` back.
But if you want the first such object, use `detect`.
`[1, 2, 3, 4, 5, 6, 7].detect{|e| e>3}` gives us `4`.
I'm not sure what you're going for here, though. |
Sprites on the DS can be alpha blended using the [blend control registers][1]. TONC gives the necessary information for getting blending working on the main screen because the register locations are the same. Alpha blending on the subscreen uses the same process with different registers at a 1000h offset.
The regi... |
Sprites on the DS can be alpha blended using the [blend control registers][1]. TONC gives the necessary information for getting blending working on the main screen because the register locations are the same. Alpha blending on the subscreen uses the same process with different registers at a 1000h offset.
The regi... |
It is true that autotools can be brittle and version specific. But remeber that you only need to use these tools on your development machines. Deploying the project to the target machine doesn't require that any of the tools are installed on the target. Even test machines don't need any of the tools. They are reall... |
I always add a /? parameter to get help and I always try to have a default (i.e. most common scenario) implementation.
Otherwise I tend to use the "/x" for switches and "/x:value" for switches that require values to be passed. Makes it pretty easy to parse the parameters using regular expressions. |
Make sure you set the permissions on the application as well as the entity. |
The following code will do what you want:
(define get-n-items
(lambda (lst num)
(if (> num 0)
(cons (car lst) (get-n-items (cdr lst) (- num 1)))
())))
(define slice
(lambda (lst start count)
(if (> start 1)
... |
The following code will do what you want:
(define get-n-items
(lambda (lst num)
(if (> num 0)
(cons (car lst) (get-n-items (cdr lst) (- num 1)))
'()))) ;'
(define slice
(lambda (lst start count)
(if (> start 1)
... |
ColdFusion has the encrypt and decrypt functions capable of handling a range of algorithms and encodings, including the AES recommended above.
Information at: <http://www.cfquickdocs.com/cf8/?getDoc=encrypt#Encrypt>
Quick example code:
Key = generateSecretKey( 'AES' , 128 )
EncryptedText = encrypt( Text ,... |
One thing I like about certain CLI is the usage of **shortcuts**.
I.e, all the following lines are doing the same thing
myCli.exe describe someThing
myCli.exe descr someThing
myCli.exe desc someThing
That way, the user may not have to type the all command every time. |
[Ed Haber said][1]
> I would use AES for the bulk data
> encryption and RSA for encrypting the
> AES Key. If the data is small enough
> then just encrypt the whole thing with
> RSA.
I think this is a good solution. What I would do is have your application publish an API for getting a public RSA key. When I thir... |
[HAML][1] is a must have. You'll never think of HTML in the same way again -- No more tag soup.
[1]: http://haml.hamptoncatlin.com/docs/ |
Error Message Text - Best Practices |
|user-interface|error-handling|usability| |
We are changing some of the text for our old, badly written error messages. What are some resources for best practices on writing good error messages (specifically for Windows XP/Vista). |
Linux has the GPL (v2) as its licence, which means you have to open source any derivative works.
You may want to use BSD, its license is a lot les restrictive in what you can do with derived works |
Generics in C# are truly generic types from the CLR perspective. There should not be any fundamental difference between the performance of a generic class and a specific class that does the exact same thing. This is different from Java Generics, which are more of an automated type cast where needed or C++ templates tha... |
Use the [AccessControl][1] plugin and then add this to the script, where the "logs" directory is in the install directory.
AccessControl::GrantOnFile "$INSTDIR\logs" "(BU)" "FullAccess"
That gives full access to the folder for all users.
[1]: http://nsis.sourceforge.net/AccessControl_plug-in
|
Groovy is the best Java alternative I've seen that includes features of dynamic languages including closures, run-time class extension, etc. While Ruby has a slight design advantage imho, I'd have to say the fact that Groovy compiles into Java byte-code and interacts with Java without ANY interface code is a huge plus... |
I don't know Python, but for windows the underlying api is [GetUserNameEx][1], I assume you can call that in Python if os.environ.get( "USERNAME" ) doesn't tell you everything you need to know.
[1]: http://msdn.microsoft.com/en-us/library/ms724435(VS.85).aspx |
Master Pages are based upon Usercontrols, therefore they cannot be shared across applications.
That said, Dan Wahlin has a way around that particular limitation [listed on his blog][1].
[1]: http://weblogs.asp.net/dwahlin/archive/2005/11/16/430779.aspx |
Try out [BackgroundWorker][1]. It supports progress updates and cancellation of a running task.
If you're determined to roll your own, you can just have a field somewhere which both threads have access to. Mark it volatile, e.g.:
private volatile bool cancelling;
Have the main thread set it to true, and ha... |
Check credibility on forums like http://www.webhostingtalk.com/
I am about to purchase a VPS and after some research I selected http://www.servint.com/
- Many years in the market
- Seem credible on webhostingtalk
- Managed servers: http://www.servint.net/vps/faq.php#14 |
Finding the right VPS |
|vps| |
The market is flooded with VPS (virtual private server) hosting options. It seems everyone and their mother has a overloaded server in his/her closet. Enterprise options always seem priced insanely high, which make the ones that are cheap and claim enterprise level seem shaky.
What do you look for in a quality VPS... |
|vps| |
It is just slightly horrible.
If you are showing an error to the end user, the user is supposed to be able to act about it. In "The list of customer names your requested could not be displayed." case, your user will just think "so what?" On all of these cases, just display a "something bad happened" message. You do ... |
It is just slightly horrible.
If you are showing an error to the end user, the user is supposed to be able to act about it. In "The list of customer names your requested could not be displayed." case, your user will just think "so what?" On all of these cases, just display a "something bad happened" message. You do ... |
I've looked into the various ones suggest, but they all seemed a little fiddly to get going.
I've since found [Hudson][1] , from playing around with it, it seems very nice, coupled with [tap-to-junit-xml][2] it took me about 30 minutes to get a basic build happening. Very nice.
[1]: https://hudson.dev.java.ne... |
Should I bind directly to objects returned from a webservice? |
|c#|web-services|serialization|data-binding| |
These are interesting times for "the person backup question".
There are several schools of thought now:
1. Frequent Automated Local Backup + Periodic Local Manual Backup
>Automated: Scheduled Nightly backup to external drive.
Manual: Copy to second external drive once per week / month / year / _oops-forgot_ ... |
These are interesting times for "the person backup question".
There are several schools of thought now:
1. Frequent Automated Local Backup + Periodic Local Manual Backup
>Automated: Scheduled Nightly backup to external drive.
Manual: Copy to second external drive once per week / month / year / _oops-forgot_ ... |
These are interesting times for "the person backup question".
There are several schools of thought now:
1. Frequent Automated Local Backup + Periodic Local Manual Backup
>Automated: Scheduled Nightly backup to external drive.
Manual: Copy to second external drive once per week / month / year / _oops-forgot_ ... |
I'll favor OO design over code coverage, ans see if I cannot move those fields to the class that needs them. So I would try to see if those getters and setters can be removed, as suggested before.
getters and setters are [breaking encapsulation][1].
[1]: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-to... |
Although I personally use the layout recommended in the SVN book, you probably should not restrict yourself to it if your layout works better for you. I would keep the **branch** directory since its usage and purpose is pretty clear from the name. Apart from that, really, anything goes if it works for you.
|
There's also [Lahey Fortran][1]. They support 32- and 64-bit Windows and Linux. It costs money, but sometimes it's cheaper to buy a commercial product that has support than to spend 3 weeks to try to figure out some bug in the deep dark depths of an open source compiler. We've had more than a couple problems with g7... |
I'd like the ability to concatenate and nest TAP streams. |
You've described the two pretty much standard models for repository organization: dev-test-prod and trunk-branch. Eric Sink does a nice job of describing them in his [Source Control HOWTO][1]. One thing to note is that the way most people use trunk-branch is to create a branch for each version as it is released to cu... |
> The conventions that you use for you application would depend on
>
> 1) What type of application it is.
> 2) What operating system you are using.
This is definitely true. I'm not certain about dos-prompt conventions, but on unix-like systems the general conventions are roughly:
1) Formatting is
>> appName ... |
The conventions that you use for you application would depend on
1) What type of application it is.
2) What operating system you are using.
What I would suggest is look at other command line interfaces for other commands on your system, paying special attention to the parameters passed.
Without know what e... |
The conventions that you use for you application would depend on
1) What type of application it is.
2) What operating system you are using. Linux? Windows? They both have different conventions.
What I would suggest is look at other command line interfaces for other commands on your system, paying special a... |
I'm not a MySQL expert, but my guess is that integers always take up four bytes of space where enums take up varying amounts of space based upon the range of data needed. Since you only need 13 items, it could get away with using 1 byte for your column. |
To be honest, the best distro for VMWare is the one the admin has the most experience with. With the GUI stuff all disabled I've not found any difference in performance between RedHat, Centos and Ubuntu when running VMWare.
Picking the distro that you can adminster easiest will save you hassle. If you already ha... |
I can think of the following reasons:
* Keeping the set of thrown exception types fixed, as part of the API, so that the callers only have to worry about the fixed set of exceptions. In Java, you are practically forced to do that, because of the checked exceptions mechanism.
* Adding some context information to t... |
The application will most likely be catching those exceptions re-thrown higher up the call stack and so re-throwing them allows that higher up handler to intercept and process them as appropriate. It is quite common for application to have a top-level exception handler that logs or reports the expcetions.
Another al... |
The application will most likely be catching those exceptions re-thrown higher up the call stack and so re-throwing them allows that higher up handler to intercept and process them as appropriate. It is quite common for application to have a top-level exception handler that logs or reports the expcetions.
Another al... |
The application will most probably be catching those re-thrown exceptions higher up the call stack and so re-throwing them allows that higher up handler to intercept and process them as appropriate. It is quite common for application to have a top-level exception handler that logs or reports the expections.
Another ... |
Full details of Authentication in the Windows API can be found on MSDN:
http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx
|
Check out fructose: http://sourceforge.net/projects/fructose/
It's a very simple framework, containing only header files and thus easy portable.
|
Atlassian Fisheye http://www.atlassian.com/software/fisheye/ is a commercial one that I can't live without!
(full disclosure...I am employed by Atlassian, but I say without bias that Fisheye is the best one out there that I've used) |
Use network install. It does save you something and even if you do multiple installations you'll probably want the newest packages anyway.
And no the network installer will not download the 600MB without asking you that would make no sense. |
I think you mean "Networked Apps"? Distributed means an app that can split its workload among multiple worker clients over the network.
You probably want.
[Twisted][1]
[1]: http://twistedmatrix.com/trac/ |
[SQLCompare][1] is the best tool that I have used for finding differences between databases and getting them synced.
To keep the databases synced up, you need to have several things in place:
1) You need policies about who can make changes to production. Generally this should only be the DBA (DBA team for large... |
Should I bind directly to objects returned from a webservice or should I have client-side objects that I bind to my gridcontrols? For instance if I have a service that returns object Car should I have a client side Car object that I populate with values from the webservice Car object?
What is considered best-practice... |
If I understand your question correctly, I've tackled this problem using the quasi-hacky approach of comparing the Marshaled objects to determine if any attributes vary. The inject at the end of the following code would be an example:
class Foo
attr_accessor :foo, :bar, :baz
def initialize(fo... |
You need to start further down the line. You need to know the container format and how it specifies the codec.
So I'd start with a program that identifies the container format (not just from the extension, go into the header and determine the real container).
Then figure out which containers your program will sup... |
1. You cannot turn off [anti-alias][1].
2. Your users need Vista or XP SP2 with .net 3.x framework.
3. If you want to use winforms be aware of the Air Space (one solution [here][2]).
These are the major issues for me. Other than that, I'm all for it, its way more than looks.
[1]: http://social.msdn.mi... |
1. You cannot turn off [anti-alias][1].
2. Your users need Vista or XP SP2 with .net 3.x framework.
3. If you want to use winforms be aware of the Air Space (one solution for D3D [here][2]).
These are the major issues for me. Other than that, I'm all for it, its way more than looks.
[1]: http://social... |
The answers to this question do make for some interesting reading - it seems that we can't get good convergence on what defines an expert here. What hope is there going to be in a broader forum like a jobs fair? :-)
But to put my own 2 cents in...
I think there's two kinds of C expert.
- There's the expert in... |
Try out [BackgroundWorker][1]. It supports progress updates and cancellation of a running task.
If you want one thread to wait until another thread has finished doing its thing, then Monitor.Wait and Monitor.Pulse are good, as is ManualResetEvent. However, these are not really of any use for cancelling a running tas... |
What is the Best Way to Dynamically Create an MSMQ Listener? |
|msmq| |
I was using Spring.NET to create a message listener at application startup. I now need the ability to create 0-n listeners, some of which could be listening to different queues. I will need to be able to create/destroy them at run-time. What would be the best way to go about doing this? My previous spring configura... |
In my previous work we had real genius huy on deployment duties, he deployed application (Python, SQL, Perl and Java code) as set of deb files built for Ubuntu. Unfortunately now, I have no such support. We are deploying apps manually to virtualenv-ed environments with separate nginx configs for FastCGI. We use [paver]... |
It's 2,147,483,647. Easiest way to memorize it is via a tattoo. |
[CLR Profiler](http://www.microsoft.com/downloads/details.aspx?FamilyId=A362781C-3870-43BE-8926-862B40AA0CD0&displaylang=en) is quite good. |
Get a good UPS, with decent power conditioning. Run on stable and redundant hardware.
I don't trust MyISAM tables to ever survive a crash during a write, so I think your best bet is on reducing the occurrence of crashes (and writes). |
I think the main performance issue here is, that in the switch block, you compare strings, and that in the if-else block, you check for types... Those two are not the same, and therefore, I'd say you're "comparing potatoes to bananas".
I'd start by comparing this:
switch(childNode.Name)
{
case "... |
If you are looking for something free, I use NProf. Although its pretty limited and may crash or hang on certain programs.
http://nprof.sourceforge.net/Site/Description.html
|
[FasterCSV](http://fastercsv.rubyforge.org/classes/FasterCSV.html) is definitely the way to go, but if you want to serve it directly from your Rails app, you'll want to set up some response headers, too.
I keep a method around to set up the filename and necessary headers:
def render_csv(filename = nil)
... |
I use Maven to filter out the resources under src/main/resources in my project. I use this in combination with property files to pull in customized attributes in my Spring-based projects.
For default builds, I have a properties file in my home directory that Maven then uses as overrides (so things like my local Tom... |
How can I add pulldowns and checkboxes in a MS Outlook email? |
I'd like to suggest a diffrent approach:
My suggestion uses only two threads.
* one thread checks for incomming connections.
* When a new connection opened this info is written to a shared data structure that holds all of the current open connections.
* The 2nd thread enumerate that data structure and for ea... |
Resharper will catch errors in code ofASPX pages, all without compiling. works well imo, and better than later compiling. |
Resharper will catch errors in code ofASPX pages, all without compiling. works well imo, and better than later compiling.
EDIT: Resharper also has a Solution wide error checker. 'Resharper->Windows->Errors in solution'. It will analyze your entire solution and give a consolidated list of everything it finds, INCLUD... |
You might consider the [Caching Application Block][1] or [System.Web.Caching][2]. Both have methods for connecting them to a SQL Server database as the backing store.
The other method would be to simply serialize the object using a XML or Binary Formatter. (which can be used for deep cloning by the way)
[... |
Looks like it's a reported bug in 2.5,
[http://social.expression.microsoft.com/forums/en-US/blend/thread/db02b75c-922e-4de1-8943-bd525d9862c0/][1]
Their suggested workaround is to use 2.0 for SL1. Still, I expect there will be a new version of Blend released fairly shortly, since SL2 is likely to be released arou... |
Command line conventions vary from OS to OS, but the convention that's probably gotten both the most use, and the most public scrutiny is the one supported by the GNU getopt package. See <a href="http://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html">http://www.gnu.org/software/libc/manual/html_node/Usin... |
How to implement Type-safe enumerations in Delphi ? |
|delphi| |
How could i implement in delphi Type-Safe Enumerations ? Basically, i'd like to replace a set of primitive constants of a enumeration with a set of static final object references encapsulated in a class ? .
In Java, we can do something like:
public final class Enum
{
public static final Enum ENUM... |
[Sharing Master Pages Across IIS Applications][1] by Dan Wahlin will give you some ideas..
Also, check this [excellent article][2] by Scott Allen. You can check the last section at the end on sharing master pages.
[1]: http://weblogs.asp.net/dwahlin/archive/2005/11/16/430779.aspx
[2]: http://odetocode.com/... |
By using a network sniffer like Wireshark or a proxy you can monitor the traffic and see if it's the loading of images and/or scripts that are slowing down you site. If you're unsure - turn of or comment out your javascripts to rule out that it's the processing of them that are slowing down.
If you can't see any ind... |
There are no pretty solutions to this problem.
What you can do is put it into a separate web application project and pre-compile it. Then take the precompiled dlls and ILMerge them into a single dll that you can reference in your app.
The actual master page that you reference will have a class name like this: M... |
Always include suggestions to Remedy the error. |
Under Windows, the closing thing you're going to get to fork() is loading your program as a Windows service, I think.
Here is a link to an intro article on Windows services...
[CodeProject: Simple Windows Service Sample][1]
[1]: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx |
When have we any practical use for hierarchical namespaces in c++? |
|c++|namespaces| |