instruction stringlengths 0 30k ⌀ |
|---|
If you're looking to detect non-UTF encodings (i.e. no BOM), you're basically down to heuristics and statistical analysis of the text. You might want to take a look at the Mozilla paper on universal charset detection <a href="http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html">here</a>. |
Advantages of VS 2008 over VS 2005 |
|visual-studio|ide| |
Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input. |
Here's the full stylesheet you need (since the namespaces are important):
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:z="foo">
<xsl:template match="root">
<root>
<xsl:apply-templates />
</root>
</xsl:template>
<xsl:t... |
if(typeof(CompetitorClass).GetFields(BindingFlags.Static))
{
// take necessary steps against cheater!
} |
When you instantiated the IsolatedStorageFile, did you scope it to IsolatedStorageScope.Machine? |
When you instantiated the IsolatedStorageFile, did you scope it to IsolatedStorageScope.Machine?
Ok now that you have illustrated your code style and I have gone back to retesting the behaviour of the methods, here is the explanation:
- GetMachineStoreForAssembly() - scoped to the machine and the assembly ident... |
There are several database compare tools out there. One that I've always like is SQLCompare by [Red Gate][1].
You can also try using:
SELECT name
FROM sys.objects
WHERE modify_date > @cutoffdate
In SQL 2000 that wouldn't have always worked, because using ALTER didn't update the date correctly, bu... |
The advantage for these other languages is that they get relatively easy access to lots of java libraries.
The advantage for Java people varies depending on language -- each has a story tell Java coders about what they do better. Some will stress how they can be used to add dynamic scripting to JVM-based apps, othe... |
The obvious choice..
[MSDN C# Generics][1]
[1]: http://msdn.microsoft.com/en-us/library/ms379564(VS.80).aspx
|
Different languages are tailored to different tasks. While certain problem domains fit the Java language perfectly, some are much easier to express in alternative languages. Also, for a user accustomed to Ruby, Python, etc, the ability to generate Java bytecode and take advantage of the JDK classes and JIT compiler has... |
I too prefer "Tests" prefixing the actual name of the assembly so that its easy to see all of my unit test assemblies listed alphabetically together when I mass-select them to pull into NUNit or whatever test harness you are using.
So if Website were the name of my solution (and assemblies), I suggest -
**Tests.W... |
What's the best automation or scripting tool to automate repetitive tasks with applications? |
|automation|scripting| |
I realise you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability.
I've used [AutoIt][1] but it's a bit clunky, especially when trying to debug why a script fails or stalls. Also, get... |
|scripting|automation|autoit| |
Not much of a difference, but there is some difference (mostly syntactical in nature). If your old site is VBScript, it's probably easier to go with VB.NET. |
In addition to the sampling issue, WAV is just a container format and the audio could be compressed in any of a myriad of audio formats (just like AVI is a container of video). So you could use a tool like [GSpot][1] to find out if your WAV is encoded in a non-standard format in and install the codec. Winamp has more c... |
Why is that bad practice? I don't think it is, as long as your code is still readable.
//not much use
int i, j, k;
//better
int counter,
childCounter,
percentComplete; |
Do you monitor the number of open mysql connections or threads? What is your mysql.ini settings for max_connections?
mysql> show status;
Look at Connections, Max_used_connections, Threads_connected, and Threads_created.
You may need to increase the limits in your mysql config, or perhaps rails ... |
Add some padding to the A element? Or if it's in a menu contained within a block-level element, make the A display as block too:
a {
display: block;
width: 100%;
}
|
How much resources does consume sleeping thread? |
|java|multithreading| |
I'm wondering, how expensive it is to have many threads in waiting state in java 1.6 x64.
To be more specific, I'm writing application which runs across many computers and sends/receives data from one to another. I feel more comfortable to have separate thread for each connected machine and task, like 1) sending dat... |
<http://nz.php.net/register-shutdown-function>
Probably less complicated if you just want a script to die and handle it when a user terminates.
( Ie: if it was a lengthy search, this would save you a bunch of operation cycles )
|
You could wrap the HttpServletResponse object and the OutputStream returned by the HttpServletResponse. When output starts writing you could set a startDate, and when it stops (or when it's flushed etc) you can set a stopDate.
This can be used to calculate the length of time it took to stream all the data back to t... |
It looks like you are attempting the [Single Table Inheritance][1] pattern, this is a pattern covered by the Object-Relational Structural Patterns section of the book [Patterns of Enterprise Application Architecture][2].
I would recommend the [Class Table Inheritance][3] or [Concrete Table Inheritance][4] patterns i... |
As Tom mentions, you can pass remote objects. You'd have to create a class to hold your list that implements Remote. Anytime you pass something that implements Remote as an argument, whenever the receiving side uses it, it turns around and makes a remote call *back* to the caller to work with that object. |
@Ed Thomas:
I've tried something very similar to your example and I get very different results:
String testString = "Friday, September 26, 2008 8:30 PM Pacific Standard Time";
DateFormat df = new SimpleDateFormat("EEEE, MMMM dd, yyyy hh:mm aa zzzz");
System.out.println("The default TimeZone is: " ... |
The Dependency Inversion Principle |
I know you say that you're not in favor of the Business Development Studio to do this, but I've found the built-in tools to be very reliable and easy to use. |
Throwing an exception in your case is fine. You can consider the case a true exception because something is trying to set an integer to a string (for example). The business rules lack of knowledege of your views means that they should consider this case exceptonal and return that back to the view.
Whether or not y... |
I guess you find this exception in the index server, right?
Are you able to browse to 'https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx' from the index server?
It seems like SSL is not properly provisioned on the front-end servers. This might solve your issue:
1. Remove the SSL... |
I guess you find this exception in the index server, right?
Are you able to browse to 'https://mushni-sptwb04q:56738/Shared%20Services%20Portal/Search/SearchAdmin.asmx' from the index server?
It seems like SSL is not properly provisioned on the front-end servers. This might solve your issue:
1. Remove the SSL... |
Choosing a provider needs to be much simpler.
At present there's no way to know how reliable, trustworthy or secure any of them are, or which will still be around in 6 months time.
|
How Does Relational Theory Apply in Ways I can Care About while Learning it? |
|discrete-mathematics|relational|graph-theory|finite-automata| |
So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty well, just not the more rigorous study of how relations and sets compeltely a... |
There's no way to explicitly clear the session if you don't communicate in some way between the client and the server at the point of window closing, so I would expect sending a special URI request to clear the session at the point of receiving a window close message.
My Javascript is not good enough to give you the... |
Multi-threading is not a good idea if you need to guarantee precise physical timing (like in your example). Other cons include intensive data exchange between threads. I would say multi-threading is good for really parallel tasks if you don't care much about their relative speed/priority/timing. |
I recommend [Rails Authorization][1] which will work with Restful Authentication quite nicely.
[1]: http://blog.gingertech.net/2008/05/21/rails-authorization-plugin/ |
Perl::Critic: Life after Moose? |
|perl|tidy|critic|moose| |
I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each each other as much as they used to.
Are there docs anywhere on how to make critic/tidy be more appreciative if the Moose dialect? What to most Moose u... |
|perl|tidy|critic|moose| |
Do you chat online for work purposes? |
|im|chat|communication|collaboration| |
I've worked with folks who are chatting online with their peers, constantly batting around ideas. I've also worked with folks who adamantly refuse and think it's a waste of time.
Are online live chatting forums of particular use to you? Why or why not?
Internal to your company, or external and world-wide?
Does yo... |
|collaboration|communication|chat|im| |
I've worked with folks who are chatting online with their peers, constantly batting around ideas. I've also worked with folks who adamantly refuse and think it's a waste of time.
Are online live chatting forums of particular use to you? Why or why not?
Internal to your company, or external and world-wide?
Does yo... |
Easy way to set CurrentCulture for the entire application? |
|.net|winforms|localization| |
In a .net 2 winforms application, what's a good way to set the culture for the entire application?
Setting CurrentThread.CurrentCulture for every new thread is a real PITA.
Ideally I'd like to set it when the app starts and forget about it. |
Don't know how to do locale, but javascript is a client side technology.
usersLocalTime = new Date();
will have the client's time and date in it (as reported by their browser, and by extension the computer they are sitting at). It should be trivial to include the server's time in the response and do some sim... |
The class you want to look into extending to create your own behavior is DefaultTableModel. That will allow you to define your own behavior. A decent tutorial can be found <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data">on sun's site</a>. |
Turn off email, cell phone and instant messaging apps for core code time. 10am to 1pm, 2pm to 5pm might be good blocks for this.
Order food, drinks for team when they are in "the zone".
Cancel all other meetings for the days of, before and after the planning session and the review days.
|
Error BC30002 - Type XXX is not defined |
|vb.net|asp.net| |
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.
The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message :
> Error BC... |
|asp.net|vb.net| |
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.
The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message :
> Error BC... |
We used the following:
Store files in the directory returned by GetBurnPath, then write using Burn. GetCDRecordableInfo is used to check when the CD is ready.
#include <stdio.h>
#include <imapi.h>
#include <windows.h>
struct MEDIAINFO {
BYTE nSessions;
BYTE nLastTr... |
Learning something with a flexible OOP system, like Lisp or Perl (see Moose), will allow you to better expand and understand your thoughts on software engineering. Ideally, every language has some unique facet (whether it be CLOS or some other technique) that enhances, extends and grows your abilities as a programmer. |
I would recommend that you compile up a linux version and run it under [Valgrind][1].
Valgrind will track memory leaks, uninitialized memory reads and many other code problems. I highly recommend it.
[1]: http://valgrind.org/ |
|oop| |
What is the Dependency Inversion Principle and why is it important? |
|oop|glossary| |
|oop|glossary|principles| |
Your script was really close to correct (and really appreciated).
The following script is what I used to solve my problem.:
$from = [ADSI]"LDAP://CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca"
$to = [ADSI]"LDAP://OU=Temporarily Moved Groups, DC=Company,DC=ca"
$from.PSBa... |
Your script was really close to correct (and I really appreciate your response).
The following script is what I used to solve my problem.:
$from = [ADSI]"LDAP://CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca"
$to = [ADSI]"LDAP://OU=Temporarily Moved Groups, DC=Company,DC=ca"
... |
I am not that familiar with SQL Server, but I know with Oracle you can specify Constraints that you could use to do what you are looking for. I am pretty sure you can define constraints in SQL server also though. |
I am not that familiar with SQL Server, but I know with Oracle you can specify Constraints that you could use to do what you are looking for. I am pretty sure you can define constraints in SQL server also though.
EDIT: I found this [link][1] that seems to have a lot information, kind of long but may be worth a read.... |
You could check out the Microsoft Enterprice Library. It features stuff like logging and caching. The logging is made easy by the fact you always include the logging code but the actual logging beneath it is controlled by the settings.
http://msdn.microsoft.com/en-us/library/cc467894.aspx
You can find other cool ... |
You could check out the Microsoft Enterprise Library. It features stuff like logging and caching. The logging is made easy by the fact you always include the logging code but the actual logging beneath it is controlled by the settings.
http://msdn.microsoft.com/en-us/library/cc467894.aspx
You can find other cool ... |
How do you prevent over complicated solutions or designs? |
|complexity-theory|analysis| |
Many times we find ourselves working on a problem, only to figure out the solution being created is far more complex than the problem requires. Are there controls, best practices, techniques, etc that help you control over complication in your workplace? |
The biggest issue with polyglot solutions is that the more languages involved, the harder it is to find programmers with the proper skill set. Particularly if any of the languages are even slightly esoteric, or hail from entirely different schools of design (e.g. - functional vs procedural vs object oriented). Yes, any... |
What's the fastest way to copy the values and keys from one dictionary into another in C#? |
|c#|dictionary|copy|foreach| |
There doesn't seem to be a dictionary.Copy() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop.
I'm using the System.Collections.Generic.Dictionary. |
There doesn't seem to be a dictionary.Copy() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop.
I'm using the System.Collections.Generic.Dictionary. This is for .NET 2.0. |
There doesn't seem to be a dictionary.AddRange() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop.
I'm using the System.Collections.Generic.Dictionary. This is for .NET 2.0. |
Benefits of SQL Server 2005 over 2000 |
|sql-server|sql-server-2005|sql-server-2000| |
Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input. |
Unit testing a java servlet |
|java|unit-testing| |
I would like to know what would be the best way to do unit testing of a servlet.
Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters?
... |
|java|unit-testing|servlets| |
Try to look at [MojoPortal][1] ([http://www.mojoportal.com/][2])
[1]: http://www.mojoportal.com/
[2]: http://www.mojoportal.com/ |
I hear [Chyrp](http://chyrp.net/) is nice. [Textpattern](http://textpattern.com/) gets some praise too. |
Looks like a good approach. I second what adrianh and jedidja said about possibly shorter iterations. I like 1 weekers myself. As well as better estimation, it also keeps the idea of "working software" on a much shorter cycle.
A few questions:
Why are code reviews left until the end? Either pair program, or d... |
Measure Total Network Transfer Time from Servlets |
|java|tomcat|servlet|sockets|time| |
How do i measure how long a client has to wait for a request.
On the server side it is easy, through a filter for example.
But if we want to take into accout the total time including latency and data transfer, it gets diffcult.
is it possible to access the underlying socket to see when the request is finished?
... |
|graph-theory|relational|finite-automata|discrete-mathematics| |
So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty well, just not the more rigorous study of how relations and sets compeltely a... |
As the problem is with writes, I would look more towards >removing< any unneeded indexes on the tables. As is common in RDBMS, every index on a FoxPro table slows down a write operation as the indexes need to be updated, and as you aren't reading directly from (or presumably directly querying) the table you shouldn't n... |