instruction stringlengths 0 30k ⌀ |
|---|
I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here? |
I would suggest not, as you're circumventing the source control mechanism.
But perhaps you can explain 'why'? |
You could also just check out two working copies (at least with SVN) to say work/copy1 and work/copy2 and work on the two versions in parallel.
I wonder though what it is you are trying to achieve, since copying may not be the best solution to your problem. |
what about this css property
min-width: 100px
but it doesn't really work in IE6 if not mistaken
if you don't want to do it in the css way, I suppose you can add this attribute
nowrap="nowrap"
in your table data tag |
The best solution to this is to do your own string parsing as Regular Expressions don't really support what you are trying to do. (rep @Frank Krueger if you go this way, I'm just repeating his advice)
I did however take a shot at a exclusionary regex. This will match all strings that do not fit your criteria of a "\... |
Use [nmap][1] to get a list of open services on the machine and parse the results to make sure what you need is active. It's also useful to make sure that things you _don't_ need are _not_ active.
[1]: http://nmap.org/download.html |
It will depend on the VCS. I know in CVS that it stores (hidden) directories inside every version-controlled directory. These files are, of course, then copied with any copy of that directory.
It's so frequently the case that you do NOT want to copy those hidden files that the rsync tool comes with an option (-C) to... |
[nProf][1] - Free, does that for .NET.
Gets the job done, at least enough to see the 80/20. (20% of the code, taking 80% of the time)
[1]: http://nprof.sourceforge.net/Site/Description.html |
I'd go for Test::More, or in general, anything that outputs [TAP][1]
[1]: http://en.wikipedia.org/wiki/Test_Anything_Protocol |
There's a great page on breadcrumbs at the [Diemen Repository of Interaction Design Patterns][1]
[1]: http://visiblearea.com/cgi-bin/twiki/view/Patterns/Homeward_path |
select * from myTable limit 10 does not work.
Have discovered one possible solution:
<pre>
TIDs are "tuple identifiers" or row addresses. The TID contains the
page number and the index of the offset to the row relative to the
page boundary. TIDs are presently implemented as 4-byte integers.
... |
Try:
<fileset baseDir="../src/PrecompiledWeb"><includes name="**/*" />
|
I'm not sure if this would fit with the rest of your styling, but perhaps if you changed the css on the text div so it was the same size as the image, or fixed the size of the outer div, then when the mouseover event fired, the size of the outer div wouldn't change so much as to cause the mouseout event.
Does this m... |
Maybe it would be easier to just hide the old element and create a clone with your event handlers attached? Then just swap back in the old element when you're done.. |
Free text search integrated with code coverage |
|language-agnostic|search|debugging|code-coverage| |
Is there any tool which will allow me to perform a free text search over a system's code, but only over the code which was actually executed during a particular invocation?
To give a bit of background, when learning my way around a new system, I frequently find myself wanting to discover where some particular value ... |
Joshua Bloch's new [Effective Java][1] is a good resource.
[1]: http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1220880267&sr=8-1 |
With an array, I'd use either quicksort or possibly heapsort, and just change the comparison to use TExample.SortOrder, the swap part is still going to just act on the array and swap pointers. If the array is very large then you may want a linked list structure if there's a lot of insertion and deletion.
C based rou... |
Keep these goals in mind (adapted from the book xUnit Test Patterns by Meszaros)
- Tests should reduce risk, not
introduce it.
- Tests should be easy to run.
- Tests should be easy to maintain as
the system evolves around them
Some things to make this easier:
- Tests should only fail becaus... |
My experience with BizTalk was basically a frustrating waste of time.
There are so many edge cases and weird little business logic tweaks you have to make when you are doing B2B data integration (which is probably the hardest part of any enterprise application) that you just need to roll your own solution.
How ha... |
it doesnt look like they're built in but here's a couple snippets. it looks like it'd be pretty easy to create these helpers:
[http://www.djangosnippets.org/snippets/441/][1]
[1]: http://www.djangosnippets.org/snippets/441/ |
On the XP machine, find your IP address by going to the command prompt and typing "ipconfig". Try replacing the last digit with 1 or 2. For example, if your IP address is 192.168.78.128, use http://192.168.78.1:3000. |
On the XP machine, find your IP address by going to the command prompt and typing "ipconfig". Try replacing the last number with 1 or 2. For example, if your IP address is 192.168.78.128, use http://192.168.78.1:3000. |
Tests should be isolated. One test should not depend on another. Even further, a test should not rely on external systems. In other words, test *your* code, not the code your code depends on.You can test those interactions as part of your integration or functional tests. |
MVC.net JQuery Validation |
|jquery|validation|asp.net-mvc| |
After trying to avoid JavaScript for years, Iv started using JQuery for [validation][1] in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good JQuery is.
Firstly is there a way to get intellisense working for JQuery and its validation plugin, so that i don have ... |
Yes, it's definately worth the upgrade. I would actaully say go straight to VS2008 SP1 as well. There have been a lot of IDE improvements (usability features and speed) and improvements in the web development experience as well including better JS and CSS support. |
Strictly speaking, you need nothing. XML, even without a schema definition, works.
A schema definition (in XSD, RelaxNG or DTD) helps various tools that work with the XML, because they can verify that the structure of the XML conforms to what you want.
An XSLT translation to HTML is nice if the XML contains infor... |
If you have a release within a month, I'd suggest **not** upgrading. Make the upgrade to 2k8 part of the next major release ... no reason you should risk something not working quite the same or some other complication if everything is working as is. |
I recently built an asp.net webservice with NLog, which I use for all my desktop apps. The logging works fine when I'm debugging in Visual Studio, but as soon as I switch to IIS the log file isn't created; I've not yet determined why, but it the fact that I need to look for a solution makes me want to try something el... |
Writing C# client to consume a Java web service that returns array of objects |
|c#|java|web-services| |
I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok.
The service was changed to return an array of objects, and the client does not properly parse the returned SOAP message.
MyRespo... |
I am writing a C# client that calls a web service written in Java (by another person). I have added a web reference to my client and I'm able to call methods in the web service ok.
The service was changed to return an array of objects, and the client does not properly parse the returned SOAP message.
MyRespo... |
FormName.WindowState = FormWindowState.Minimized; |
<form>.WindowState = FormWindowState.Minimized; |
Form myForm;
myForm.WindowState = FormWindowState.Minimized; |
I agree, perfmon.exe allows you to add counters (right click on the right panel) for any process you want to monitor.
Performance Object: Process
Check "Select instances from list" and select firefox. |
if your treeview control requires different templates for your items, you should implement DataTemplateSelector class and set it's instance to your tree view. as far as i remember there is a property of DataTemplateSelector. |
Start with one database. Split data/functionality when project requires it.
Here is what we can learn from LinkedIn:
- A single database does not work
- Referential integrity will not be possible
- Any data loss is a problem
- Caching is good even when it's modestly effective
- Never underestimate g... |
Protocol Buffers seems to have a more compact representation, but that's only an impression I get from reading the Thrift whitepaper. In their own words:
> We decided against some extreme storage optimizations (i.e. packing
small integers into ASCII or using a 7-bit continuation format)
for the sake of simplicity... |
In C#, this would create a stackoverflow...
static void Main()
{
Main();
} |
WMI is Windows Management Instrumentation, and it's built into all recent versions of Windows. It allows you to programmatically track things like CPU usage, disk I/O, and memory usage.
Perfmon.exe is a GUI front-end to this interface, and can monitor a process, write information to a log, and allow you to analyze t... |
They both offer many of the same features; however, there are some differences:
- Thrift supports 'exceptions'
- Protocol Buffers have much better documentation/examples
- Thrift has a builtin `Map` and `Set` type
- Protocol Buffers allow "extensions" - you can extend an external proto to add extra fields... |
If you can access the command line with enough privileges, restart the MySQL server or the Apache (assuming that you use Apache) server - because probably it is keeping the connections open. After you successfully closed the connections, make sure that you are not using persistent connections from PHP (the general opin... |
|asp.net-mvc|jquery|validation| |
After trying to avoid JavaScript for years, Iv started using JQuery for [validation][1] in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good JQuery is.
Firstly is there a way to get intellisense working for JQuery and its validation plugin, so that i don have ... |
There is a Visual Studio 2008 hotfix for [JQuery IntelliSense][1] in [VS2008][2] . This might have been bundled with SP1 as well.
[1]: http://weblogs.asp.net/bradvincent/archive/2008/04/28/better-jquery-intellisense-in-vs2008.aspx
[2]: http://weblogs.asp.net/scottgu/archive/2007/06/21/vs-2008-javascript-intel... |
Probably the safest way to avoid the problem would be to use a signed 32-bit value. To use your example:
const int32 print_interval = 5000;
static int32 last_print_time; // I'm assuming this gets initialized elsewhere
int32 delta = ((int32)ms_timer()) - last_print_time; //allow a negative interval
... |
The post has been properly answered, but I would like to offer an alternative one liner that perhaps could be of some use.
For assigning space separated values from echo (or stdout for that matter) to shell variables, you could consider using shell arrays:
$ var=( $( echo 'hello world' ) )
$ echo ${var[0... |
I dont know much about vb.net but in C# you should use datasource and then bind it by calling listbox.bind() would do the trick |
This seems to work for intervals up to 64k/2, which is suitable for me:
const uint16_t print_interval = 5000; // milliseconds
static uint16_t last_print_time;
int next_print_time = (last_print_time + print_interval);
if((int16_t) (x - next_print_time) >= 0)
{
printf("Fault!\n"... |
I do this occasionally in SVN and I haven't run into any problems. I believe that in SVN all that is stored is the original state of the directory and a pointer to the repository directory it came from.
So basically it works as you would think it should.
- If File1 in Copy1 changes and File2 in Copy2 changes... |
IE 8b2 offers a [simple display][1] of the call tree for javascript that I believe is much more useful than the GraphViz chart.
The GraphViz chart is wonderful for visualizing the call tree but makes it very difficult to visualize timing issues (IMHO the more important data).
[1]: http://blogs.msdn.com/ronang... |
IE 8b2 offers a [simple display][1] of the call tree for javascript that I believe is much more useful than the GraphViz chart.
The GraphViz chart is wonderful for visualizing the call tree but makes it very difficult to visualize timing issues (IMHO the more important data).
**Edit: I thought it is worth pointin... |
Windows (.NET and Native Exes): [AQTime][1] is a great tool for the money. Standalone or as a Visual Studio plugin.
Java: I'm a fan of [JProfiler][2]. Again, can run standalone or as an Eclipse (or various other IDEs) plugin.
I believe both have trial versions.
[1]: http://www.automatedqa.com/products/aqti... |
This CSS should suffice:
td { min-width: 100px; }
However, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal). |
This CSS should suffice:
td { min-width: 100px; }
However, it's not always obeyed correctly (the min-width attribute) by all browsers (for example, IE6 dislikes it a great deal).
**Edit:** As for an IE6 (and before) solution, there isn't one that works reliably under all circumstances, as far as I know. U... |
In C# (or any langauge) what is/are your favourite way of removing repetition? |
|c#|refactoring|coding-style|tips-and-tricks| |
I've just coded a 700 line class. Awful. I hang my head in shame. It's as opposite to [DRY][1] as a British summer.
It's full of cut and paste with minor tweaks here and there. This makes it's a prime candidate for refactoring. Before I embark on this, I'd thought I'd ask when you have lots of repetition, what ar... |
|c#|coding-style|refactoring|tips-and-tricks| |
I've just coded a 700 line class. Awful. I hang my head in shame. It's as opposite to [DRY][1] as a British summer.
It's full of cut and paste with minor tweaks here and there. This makes it's a prime candidate for refactoring. Before I embark on this, I'd thought I'd ask when you have lots of repetition, what ar... |
In C# (or any language) what is/are your favourite way of removing repetition? |
A couple of years ago I found an ARM disassembler I used while doing some embedded work. However, I don't remember its name - though I think it was part of a larger package like an emulator or something.
In your case, could you ask your compiler to generate an assembly listing of the compiled code? That might help g... |
A couple of years ago I found an ARM disassembler I used while doing some embedded work. However, I don't remember its name - though I think it was part of a larger package like an emulator or something.
In your case, could you ask your compiler to generate an assembly listing of the compiled code? That might help g... |
Shameless PowerShell plug (because I think the learning curve is a pain, so teaching something at any opportunity can help)
Get-Content file1,file2
Note that `type` is an alias for Get-Content, so if you like it better, you can write:
type file1,file2
|
As of now, we use Test::More but current issue is that we have to run all the test files manually for testing. What I am looking for is a more of automated framework which can do incremental testing/build checks etc.
A wrapper around Test::More for that would be ideal but anything better and more functional would be... |
I use [Subversion][1] and [TortoiseSVN][2] — both are free. Your repository can be on the local machine. You don't have to work over a network.
However, for disaster recovery or even simple machine fault, it's probably a good idea to store your repository on a different computer and also back it up.
You m... |
Hey Craig. I'm sorry, I made a Ninja Edit.
No, Limit 10 does not work, I was mistaken in thinking it was standard SQL supported by everyone. Ingres uses (according to doc) "First" to solve the issue. |
You might find [Mercurial](http://www.selenic.com/mercurial/wiki/) to be pretty nice for that purpose. You won't have to set up a server and creating the repository is as simple as doing "hg init" in the directory where your work is. |
Hey Ninja editor from Stockholm! No worries, have confirmed that "first X" works well and a much nicer solution than I came up with. Thankyou! |
I am also a lone developer, and I use Subversion and TortoiseSVN.
Setup of Subversion is quick and painless; it can be done in less than half an hour including setting up the repository.
There is no requirement by Subversion to run on a server, I actually run it on my local machine and keep my repositories on a s... |
From what I understand, and at the risk of sounding like a fanboy, you might want to consider a DVCS (distributed version control system) like git or mercurial. They essentially take away the central repository part, so it should be ideal to use when you're a solo developer.
Another advantage is that when you decide... |
Is knowing blend required? |
|wpf|expression|blend| |
Do you expect your WPF developers to know expression blend?
Any good resources for learning more about Blend? |
|wpf|xaml|expression|blend| |
Do you expect your WPF developers to know expression blend?
Any good resources for learning more about Blend?
[UPDATE] Does knowing blend make you more productive? |
Here is a code snippet that should help get the job done for you. You may need to do some additional validation to avoid any exceptions (ensuring the profile actually exists, ensuring the image URL actually exists, etc...):
//get current profile manager
UserProfileManager objUserProfileManager = ne... |
Using imaps was a great suggestion. Neither of the answers provided just worked for me, so I googled some more and found something that worked. Here's how my code looks now.
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
try {
Session session = Sess... |
Timestretching is quite hard. The more you slow down or speed up the sound the more artifacts you get. If you want to know what they sound like listen to "Funk Soul Brother" by Fat Boy Slim. There are a lot of ways to do it that all have their own strengths and weaknesses. The math can get really complex. That's why th... |
Timestretching is quite hard. The more you slow down or speed up the sound the more artifacts you get. If you want to know what they sound like listen to "The Rockafeller Skank" by Fat Boy Slim. There are a lot of ways to do it that all have their own strengths and weaknesses. The math can get really complex. That's wh... |
Is a Flex debugger included in the sdk? |
|apache-flex| |
I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes...
Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs and compiling with ant).
If not, ... |
In svn, it's no problem. You can just working with the copy as if you had made a second checkout.
I'd recommend just checking out a second time, though. If you want a copy without the .svn files, svn export will create one. |
You can poll some core service to see if it has started:
sc "\\server_name" query EventSystem
Or, from code:
//status will contain a string description of the service status
status := TranslateServiceStatus(ServiceGetStatus(cboMachines.Text,cboSvcName.Text));
...
func... |
You can poll some core service to see if it has started:
sc "\\server_name" query EventSystem |
How can I get rid of Windows Update reboot prompt? |
|windows|windows-vista|windows-update| |
I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours).
I have performed the registry hack described [here][1] to prevent Windows forcibly rebooting my machine, w... |
Keep a detailed prioritized feature list/bug list. review it often then balance the fun work with bugs/features that need to get done. |
This is the idiomatic way of testing the xml response from a controller.
class ProductsControllerTest < ActionController::TestCase
def test_should_get_index_formatted_for_xml
@request.env[‘HTTP_ACCEPT’] = ‘application/xml’
get :index
assert_response :success
end
end |
With a backlog. That way you'll always have in mind what *needs* to be done before you can start doing what you *want* to do. |
[ChARMeD][1] is a Windows Mobile / Pocket PC / Win CE (for ARM CPUs) Disassembler and Assembler
You might also look at BDASM, a shareware disassembler - later versions have ARM plugins. The website seems to be down, but if you search for it you'll find the shareware distribution.
The source code for the simple ... |
My first Lisp macro; is it leaky? |
|lisp|macro| |