instruction stringlengths 0 30k ⌀ |
|---|
|monitoring|msmq| |
Is there anything which can help with msmq monitoring? I'd like to get some event/monit when a message appears in queue and the same on leave. |
Have you considered building your data ahead of time? In otherwords are there groups of data that are requested again and again? If so have them ready before the user asks. I'm not exactly talking about caching, but I think that is part of the equation.
It might be worth it to take a step back from the code and... |
Joseph's code is good but, if you don't want or need to use a VBA function, try this.
Assuming that the value of n is in cell A2
Use this function:
- =MID(ADDRESS(1,A2),2,LEN(ADDRESS(1,A2))-3) |
As Webjedi says, metrics are your friend.
Also look at your stack and see where there are opportunities for caching - then employ mercilessly wherever possible! |
As I said in [another question][1]:
> **Use a profiler.** Yes they cost money, and using them can occasionally be a bit awkward, but they do provide you with a great deal more real evidence rather than guesswork.
> Human beings are universally bad at guessing where performance bottlenecks are. It just seems to be... |
How to configure a Java Socket to fail-fast on disconnect |
|java|socket|networking|exception| |
I have a listening port on my server that I'm connecting to using a Java class and the Socket interface, i.e.
Socket mySocket = new Socket(host,port);
I then grab an OutputStream, decorate with a PrintWriter in autoflush mode and I'm laughing - except if the listening port closes. Then I get
tcp4 ... |
Configure a Java Socket to fail-fast on disconnect? |
|java|exception|sockets|networking| |
I'd be curious if the System.DirectoryServices.AccountManagement is fully managed. I've used System.DirectoryServices.ActiveDirectory which is a wrapper for COM Interop which has led to many headaches... |
I found Bruce Eckel's Thinking in Java to be very helpful. He compares the different collections very well. I used to keep a diagram he published showing the inheritance heirachy on my cube wall as a quick reference. One thing I suggest you do is keep in mind thread safety. Performance usually means not thread safe... |
From the testing Bible:
[Testing Computer Software][1]
![Testing Computer Software][2]
p. 31: "Testing [...] accounts for 45% of initial development of a product." A good rule of thumb is thus to allocate about half of your total effort to testing during initial development.
[1]: http://www.amazon.com/gp/pr... |
The July release of [TFS 2008 PowerTools][1] adds an "Alert Editor" to Team Explorer. Adding Alerts is a breeze. It has a query tool similar to the Query tool.
[1]: http://msdn.microsoft.com/en-us/tfs2008/bb980963.aspx |
I'm not sure a singleton class is absolutely necessary, do you absolutely need global access at all times? Is the list large?
I assume you will have a refresh method on the singleton class for when the properties need to change and also that you have some way of notifying the singleton to update when the list chang... |
How Much Time Should be Allotted for Testing & Bug Fixing |
|project-management|estimation| |
Every time I have to estimate time for a project (or review someone else's estimate), time is allotted for testing/bug fixing that will be done between the alpha and production releases. I know very well that estimating so far into the future regarding a problem-set of unknown size is not a good recipe for a successful... |
Every time I have to estimate time for a project (or review someone else's estimate), time is allotted for testing/bug fixing that will be done between the alpha and production releases. I know very well that estimating so far into the future regarding a problem-set of unknown size is not a good recipe for a successful... |
Here's one that works - I don't know if it's more efficient, and it's SQL Server 2005+
with scores as (
select 1 userid, 100 points
union select 2, 75
union select 3, 50
union select 4, 50
union select 5, 50
union select 6, 25
),
results as (
... |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="Ch... |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="Ch... |
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false.
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="Ch... |
var result = from o in objList where intList.Contains(o.ID) select o
The other code doesn't work. |
var result = from o in objList where intList.Contains(o.ID) select o
/EDIT: bogus. |
Filter linq list on property value |
|linq|linq-to-objects|.net| |
I have a `List<int>` and a `List<customObject>`. The customObject class has an ID property. How can I get a `List<customObject>` containing only the objects where the ID property is in the `List<int>` using LINQ?
|
I've used SQL Reporting Services for this purpose. You can design a report template in Visual Studio or generate the XML for the report on the fly in code. You can then have SSRS export the report to about 10 different formats and send to the client including pdf, excel, html, etc. You can also write your own plugin to... |
public static final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
public static final String IPV6_HEX4DECCOMPRESSED_REGEX = "\\A((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?) ::((?:[0-9A-Fa-f]{1,4}:)*)(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\... |
javascript can match regex:
emailAddress.match( / some_regex /);
Here's an RFC22 regular expression for emails:
`^((?>[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+\x20*|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*"\x20*)*(?<angle><))?((?!\.)(?>\.?[a-zA-Z\d!#$%&'*+\-/=?^_`{|}~]+)+|"((?=[\x01-\x7f])[^"\\]|\\[\x01-\x7f])*")@(... |
var q = from x in list
group x by x.Bar into g
select g
|
var q = from x in list
group x by x.Bar into g
select g;
foreach (var group in q)
{
Console.WriteLine("Group " + group.Key);
foreach (var item in group)
{
Console.WriteLine(item.Bar);
}
}
|
Do you have
<pre>
(setq-default indent-tabs-mode nil)
</pre>
in your <tt>.emacs</tt>? It works fine for me in emacs 23.0.60.1 when I do that. js2-mode uses the standard emacs function <tt>indent-to</tt>, which respects <tt>indent-tabs-mode</tt>, to do its indenting. |
How long are your strings? Unless you choose an int representation that's longer than the string, collisions will always be possible no matter what conversion you're using. So if you're using a 32 bit integer, you can only uniquely represent strings of up to 4 bytes. |
Chrome has a bug where it [obeys alternate stylesheets][1]. Do you have an alternate stylesheet that makes links red?
[1]: http://jeremyjarratt.com/2008/09/03/google-chrome-obeys-alternate-css/ |
Error in TFS Merge |
|teamfoundationserver|merge| |
I agree with [this comment](http://stackoverflow.com/questions/44905/c-switch-statement-limitations-why#44941) that using a table driven approach is often better.
In C# 1.0 this was not possible because it didn't have generics and anonymous delegates.
New versions of C# have the scaffolding to make this work. Havin... |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one. |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one.
`EDIT:` For number one you can use [the `position` function](http://www.cs.cmu.edu/afs/cs/pr... |
I'm a noob myself, but you can use `setf` and `nth` to do number 2 and 3.
(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
No clue about number one.
`EDIT:` For number one you can use [the `position` function](http://www.cs.cmu.edu/afs/cs/pr... |
If your asking what I think your asking, you can find them [Here][1]. Page 476 and on.
It's written around optimization techniques for python, It's mostly Big-O notation of time efficiencies not much memory.
Hope it still helps.
Brian Gianforcaro
[1]: http://books.google.com/books?id=vpTAq4dnmuAC&pg=RA... |
You might want to take a look at the [March/April issue](http://www.acmqueue.org/modules.php?name=Content&pa=list_pages_issues&issue_id=48) of ACM's [*Queue*](http://www.acmqueue.org) magazine, which has several articles on GPUs and how best to use them (besides doing graphics, of course). |
Please don't vote up Professor Internet's answer -- he posted a few times with fake/misleading information. That one just seems to have slipped through the cracks. It is certainly not industry standard.
There are two common ways to do this: use JNI to set urgency hints on the taskbar's window, and create a notificat... |
You can't just ORDER BY RAND(), as you know, because it will only generate one value. So use a key for a seed value.
<pre>
SELECT RAND(object_id), object_id, name
FROM sys.objects
ORDER BY 1
</pre> |
How do I generate Emma code coverage reports using Ant? |
|ant|code-analysis|emma| |
How do I setup an Ant task to generate [Emma](http://emma.sourceforge.net) code coverage reports? |
@Domenic this does not work. width auto does nothing more then the default behavior of that element because the initial value of width is auto ( see page 164, Cascading Style Sheets Level 2 Revision 1 Specification). Assigning a display of type block does not work either, this simply tell the broswer to use a block bo... |
What about this:
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); |
This is a duplicate of [SO# 19412][1]. Here's the answer I gave there:
select top 1 * from mytable order by newid()
In SQL Server 2005 and up, you can use TABLESAMPLE to get a random sample that's repeatable:
SELECT FirstName, LastName FROM Contact TABLESAMPLE (1 ROWS) ;
[1]: http://stackoverflo... |
I'm not sure if I understand the question... My assumption is that you have *n* number of records coming into SSIS from your data source, and you want your output to have *n**2 records.
In order to do this, you can do the following:
- multicast to create multiple copies of your input data
- derived column tr... |
I'm not sure if I understand the question... My assumption is that you have *n* number of records coming into SSIS from your data source, and you want your output to have *n* * 2 records.
In order to do this, you can do the following:
- multicast to create multiple copies of your input data
- derived column ... |
string path = Path.GetDirectoryName(typeof(DaoTests).Module.FullyQualifiedName); |
One of the things I've discovered is that how you as a developer design your code greatly affects what the designer can do with it. Often you download a Silverlight or WPF sample application from the web and open it up in Blend, just to have Blend crash on you because the code doesn't run well inside the designer. If i... |
Okay, I found a way to make the balloon clickable, and clicking it does indeed stop it from popping up again. (On the other site I referenced in the original question the question asker claims that this is not the case. Though he was in VS2005 and I'm using VS2008.)
Anyway, I inserted a pause line in the macro so it... |
The easy way to do it is to use background-image then just put an <img> in that element.
The other way to do is using css layers. There is a ton a resources available to help you with this, just search for [css layers][1].
[1]: http://www.google.com/search?q=css+layers |
php execute a background process |
|php| |
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it take for the copy to complete.
Any suggestions would be much appreciated. |
I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the user being aware of the time it takes for the copy to complete.
Any suggestions would be much appreciated. |
This is a barebones look at what I've done to float one image over another.
<style type="text/css">
.imgA1 { position:absolute; top: 25px; left: 25px; z-index: 1; }
.imgB1 { position:absolute; top: 75px; left: 80px; z-index: 3; }
</style>
<img class=imgA1 src="http://full.path.to/ima... |
This is a barebones look at what I've done to float one image over another.
<style type="text/css">
.imgA1 { position:absolute; top: 25px; left: 25px; z-index: 1; }
.imgB1 { position:absolute; top: 25px; left: 25px; z-index: 3; }
</style>
<img class=imgA1 src="http://full.path.to/ima... |
If the backend database is Oracle 10g it will probably be easier for you to use Oracle Lite - that way you don't have to use two completely different SQL dialects in the same project.
BTW, In my product I use SQLite as the desktop database |
You might want to experiment with a not-strictly-database solution like a [Java Content Repository][1] implementation (e.g. [Apache Jackrabbit][2]) and use a search engine built on top of that like [Apache Lucene][3].
This solution with the appropriate caching mechanisms would possibly yield better performance than ... |
|.net|linq|linq-to-objects| |
I have a `List<int>` and a `List<customObject>`. The customObject class has an ID property. How can I get a `List<customObject>` containing only the objects where the ID property is in the `List<int>` using LINQ?
**Edit**: I accepted Konrads answer because it is easier/more intuitive to read. |
This gets part of the way there (using a whitelist of valid characters):
new Regex("[^a-zA-Z-_]").Replace(s, "-")
It does, however, give you a string that ends with "--". So perhaps a second regex to trim those from the beginning/end of the string, and maybe replace any internal "--" to "-". |
**Bourne Shell: Functional:**
factorial() {
if [ $1 -eq 0 ]
then
echo 1
return
fi
a=`expr $1 - 1`
expr $1 \* `factorial $a`
}
|
**Bourne Shell: Functional**
factorial() {
if [ $1 -eq 0 ]
then
echo 1
return
fi
a=`expr $1 - 1`
expr $1 \* `factorial $a`
}
Also works for Korn Shell and Bourne Again Shell. :-) |
SugarCRM 5 - Create a sub panel for invoices in Account Panel |
|sugar|crm| |
I'm customizing a SugarCRM 5, and in my **SugarCRM database** I've all invoices, which were imported from our ERP. Now, I would like to know if it is possible to create a new Sub panel in the Accounts Panel **without editing the original SugarCRM files**, so that my client invoices index are visible in that interface.
... |
|sugarcrm|crm| |
|crm|sugar-crm| |
Viewing event log via a web interface |
|asp.net|iis|logging|monitoring| |
I'd like to be able to view the event log for a series of asp.net websites running on IIS. Can I do this externally, for example, through a web interface? |
Good reasons NOT to use a relational database? |
|sql|database| |
Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? Imo most applications rarely use full power of SQL, it would be interesting to see how to build a SQL-free application. |
O'Reilly's Practical RDF has a chatper titled [Commercial Uses of RDF/XML](http://safari.oreilly.com/0596002637/pracrdf-CHP-15-SECT-1). The table at the left lists the subsections: [Chandler](http://chandlerproject.org/), [RDF Gateway](http://www.intellidimension.com/), [Seamark](http://siderean.com/), and Adobe's [XMP... |
How do I implement a chromeless window with WPF? |
|wpf|user-interface| |
What is the best way to gzip and cache static images in Asp.net mvc |
|asp.net-mvc|.net-2.0| |
I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are:
1. Find why images are not cached and gzipped direcly from IIS6
2. Write a specialized ht... |
|asp.net|asp.net-mvc|.net-2.0|gzip| |
Asp.net MVC User Control ViewData |
|asp.net-mvc|viewdata|viewusercontrol| |
When a controller renders a view based on a model you can get the properties from the ViewData collection using the indexer (ie. ViewData["Property"]). However, I have a shared user control that I tried to call using the following:
return View("Message", new { DisplayMessage = "This is a test" });
and on my ... |
|asp.net|asp.net-mvc|viewdata|viewusercontrol| |
user controls and asp.net mvc |
|asp.net-mvc|user-controls| |
Here is one trivial question, but I am not sure how to handle that.
I need to display list of categories on every page, and to be able to choose items from specific category to be displayed. I use asp.net mvc, and chosen to create user control that will display categories. My question is: What is the best approach to ... |
|asp.net|asp.net-mvc|user-controls| |
SqlHelper class from the older version of the MS Enterprise App Blocks. It is far from perfect, but hard to beat its simplicity for simple CRUD apps. |
The only minor problem I had was that I installed 03 after 08, and all my solutions then became assigned to 03. Assigning them to the version selector instead was all I needed to do. |