instruction stringlengths 0 30k ⌀ |
|---|
|.net|language|culture|globalization| |
The application I'm writing is almost complete and I'd like people who speak different languages to use it.
I'm not sure where to start, what's the difference between globalisation and culture in regards to programming?
How does one take uncommon phrases such as "this application was built to do this and that" in... |
[umbraco][1] gets my vote as a good CMS that comes close to Joomla in maturity and out of the box functionality. I'm not that fond of DNN, but it's been at least a year since I ran it thru its paces.
[1]: http://www.umbraco.org/ |
Google's hosted dojox.gfx |
|dojo| |
I'm using the following html to load dojo from Google's hosting.
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("dojo", "1.1.1");</script>
<script type="text/javascript">
dojo.require("dojox.gfx");
...
This errors out on the requre line with ... |
You should be aware of the fact that your original attempt
<pre>int count = map.containsKey(word) ? map.get(word) : 0;</pre>
contains two potentially expensive operations on a map, namely <code>containsKey</code> and <code>get</code>. The former performs an operation potentially pretty similar to the latter, so you'... |
You should be aware of the fact that your original attempt
<pre>int count = map.containsKey(word) ? map.get(word) : 0;</pre>
contains two potentially expensive operations on a map, namely <code>containsKey</code> and <code>get</code>. The former performs an operation potentially pretty similar to the latter, so you'... |
My experience is that continuous testing within the IDE can become unwieldy and distracting, so I prefer to use something like [CruiseControl](http://cruisecontrol.sourceforge.net/) to do this kind of testing. One tool I have found very useful is [EclEmma](http://www.eclemma.org/), which gives you a very fast coverage ... |
SQLServer tempDB growing infinitely |
|sql-server|database| |
we have several _"production environments"_ (three servers each, with the same version of our system. Each one has a SQL Server Database as production database).
In one of this environment the _tempdb_ transaction log starts to grow fast and infinitely, we can´t find why. Same version of SO, SQL Server, application... |
Where do I start learning about GUI programming? |
|user-interface| |
I have a pretty good knowledge of programming languages like C/C++, Java, Python. But they were all mostly learnt in a college / high school class room setting where the best user interface was a numbered menu. You know, the standard data structures, implementation of various algorithms, file handling and the like.
... |
Make sure people know, that you know, that there are problems. That there are bugs. And give them an easy way to proide feedback.
What about having a "closed beta" with the "4 or 5 users" who suggested the feature in the first place? |
You need to think of this from your user's perspective - which will cause less frustration? Buggy code is usually more frustrating than missing features. |
If it doesn't break anything else, why not ship it? It sounds like you have a good relationship with your customers, so those who want the feature will be happy to get it even if it's not all the way there, and those who don't want it won't care. Plus you'll get lots of feedback to improve it in the next release! |
Can you not put the CustomValidator inside the repeater? If not, you can create it dynamically when the repeater is bound and user FindControl()
protected MyDataBound(object sender, RepeaterItemEventArgs e) {
(CheckBox)cb = (CheckBox)e.Item.FindControl("myCheckboxName");
(TextBox)tb = (TextBox)e.It... |
You should be aware of the fact that your original attempt
<pre>int count = map.containsKey(word) ? map.get(word) : 0;</pre>
contains two potentially expensive operations on a map, namely <code>containsKey</code> and <code>get</code>. The former performs an operation potentially pretty similar to the latter, so you'... |
In Management Studio, right click the database you want a line count for... select Tasks -> Generate Scripts, you can select script options in the Scripts Wizard to include or exclude objects, when you have it set the way you like it can generate to a new query window
|
aNullableDouble = double.TryParse(aString, out aDouble) ? (double?)aDouble : null; |
In the C++ standard, Table 65 in 23.1 (Container Requirements) lists begin() and end() as requiring constant time. If your implementation violates this, it isn't conforming. |
You could a separate field that indexes the email address reversed:
Index 'foo@gmail.com' as 'moc.liamg@oof'
Which enables you to do a query for "moc.liamg@*"
|
Using the Google AppEngine GData services, you can request the user to give you access to their Google Mail, Calendar, Picasa, etc. Check it out [here][1].
[1]: http://code.google.com/appengine/docs/usinggdataservices.html |
Volumetric particles |
|graphics|3d|effects| |
Best way to debug an ODBC driver on Windows |
|windows|odbc| |
What is the best way to debug a custom ODBC driver on Windows? A former member of our team wrote the driver so we have the source available.
How do you attach a debugger to the driver? Or is it easier to just add "trace prints" to the driver to see what is going on?
|
Trees don't work well with SQL. If you have very (very very) few write accesses, you could change the tree implementation to use nested sets, that would make this query incredibly easy (SELECT SUM(points) FROM users where left > x and right < y, if I'm not mistaken). However, any changes on the tree require touching a ... |
The following statement should give the children and all of their descendents. I have tested it on an Oracle 10 database.
SELECT level, main.table_name parent,
link.table_name child
FROM user_constraints main, user_constraints link
WHERE main.constraint_type IN ('P', 'U')
AND link.r_constraint_name = main.... |
Could you compare the output of this?
ls -A /some/dir | wc -l |
The question is not really clear, but is this what you're after?
DECLARE @Xml AS XML
SET @Xml =
N'
<Books>
<Book ID="1">Book1</Book>
<Book ID="2">Book2</Book>
<Book ID="3">Book3</Book>
... |
The question is not really clear, but is this what you're looking for?
DECLARE @Xml AS XML
SET @Xml =
N'
<Books>
<Book ID="1">Book1</Book>
<Book ID="2">Book2</Book>
<Book ID="3">Book3</Book>
... |
It's basic, but you could stick alerts or document.write calls in when you trigger something. |
Actually your example outputs:
foo {0}
For you to output {1, 2, 3} you have to do something like:
string t = "1, 2, 3";
string v = String.Format(" foo {{{0}}}", t); ;
To put a { you use {{ and to put a } you use }}. |
|windows|apache|http-status-code-403|virtualhost| |
Edit: Apparently this isn't clear enough, I am using Windows (XP).
I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file:
... |
I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the apachefriends release. This is my httpd-vhosts.conf file:
<pre><code>
NameVirtualHost 127.0.0.1
<VirtualHost 127.0.0.1>... |
The algorithms should match; if you're getting different results it may have to do with the way you're handling the keys and the text. Also keep in mind that Java characters are 2 bytes long, which C++ chars are 1 byte, so that may have something to do with it. |
I found struct.unpack to be a godsend for unpacking binary data formats after I learned of it! |
use the webrequest class
this is to get an image
Try
Dim _WebRequest As System.Net.WebRequest = Nothing
_WebRequest = System.Net.WebRequest.Create(http://api.hostip.info/?ip=68.180.206.184)
Catch ex As Exception
Windows.Fo... |
Most lock-free algorithms or structures start with some atomic operation, i.e. a change to some memory location that once begun by a thread will be completed before any other thread can perform that same operation. Do you have such an operation in your environment?
See [here][1] for the canonical paper on this subje... |
I'm toying with the idea of volumetric particles. By 'volumetric' I don't mean actually 3D model per particle - usually it's more expensive and harder to blend with other particles. What I mean is 2D particles that will look as close as possible to be volumetric.
Right now what I/we have tried is particles with add... |
Mixing ActiveRecord find Conditions |
|ruby|ruby-on-rails|activerecord| |
I want to find records on a combination of created_on >= some date AND name IN some list of names.
For ">=" I'd have to use sql condition. For "IN" I'd have to use a hash of conditions where the key is :name and the value is the array of names.
Is there a way to combine the two? |
Just blow the syntax out into the full syntax instead of the shorthand ... it'll be easier to read:
aNullableDouble = null;
if (double.TryParse(aString, out aDouble))
{
aNullableDouble = aDouble;
}
|
mysqldump has been reported to yeld that error for larger databases ([1](http://bugs.mysql.com/bug.php?id=26026), [2](http://bugs.mysql.com/bug.php?id=26114), [3](http://bugs.mysql.com/bug.php?id=27763)). Explanation and workaround from [MySQL Bugs](http://bugs.mysql.com/bug.php?id=26026):
> [3 Feb 2007 22:00] Serge... |
mysqldump has been reported to yeld that error for larger databases ([1](http://bugs.mysql.com/bug.php?id=26026), [2](http://bugs.mysql.com/bug.php?id=26114), [3](http://bugs.mysql.com/bug.php?id=27763)). Explanation and workaround from [MySQL Bugs](http://bugs.mysql.com/bug.php?id=26026):
> [3 Feb 2007 22:00] Serge... |
The PBS series Connections made the argument that the holes punched in tiles to control the patterns created on looms (circa 1700s??) were the first programming "language".
These were followed by player piano scrolls: Codes, on paper, which are read by, and control the operation of a machine. That's a programming ... |
I would directly assemble the floating point number using it's binary representation.
Read in the number one character after another and first find all digits. Do that in integer arithmetic. Also keep track of the decimal point and the exponent. This one will be important later.
Now you can assemble your floating... |
How do you port a virtual machine from VMWare to VirtualBox? |
|vmware|virtualbox| |
I've been using VMWare for a while and am very happy with it, but I would like to compare it with VirtualBox. Apparently the disk images are compatible, and I have successfully booted my Fedora based VM created by VMWare in VirtualBox... but the network is completely unavailable. How do you port a virtual machine fro... |
For storing passwords you could do a two step encryption routine, first with a hardcoded key in your script itself, and optionally a 2nd time with a key stored in a file (which is set using file permissons to have restricted access).
In a given situation you can then either use a key file (+ key from script), or if... |
Using the `Iterator` interface allows any class that implements its methods to act as iterators. The notion of an interface in Java is to have, in a way, a contractual obligation to provide certain functionalities in a class that `implements` the interface, to act in a way that is required by the interface. Since the c... |
Microsoft already has a very good [tutorial][1]
[1]: http://www.microsoft.com/globaldev/getwr/dotneti18n.mspx |
There is an MSDN article [here][1] which suggests that you just move the projects to a new directory.
However, as you mentioned, the list of projects is kept in the registry under this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\ProjectMRUList
Some people have automated clearing this r... |
There is an MSDN article [here][1] which suggests that you just move the projects to a new directory.
However, as you mentioned, the list of projects is kept in the registry under this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\ProjectMRUList
Some people have automated clearing this r... |
The easiest way is System.Net.WebClient.DownloadFile or DownloadString. |
Simple code for testing, dont use with Crypto
From Testing Computer Software, page 138
With is 32 bit maths, you dont need MOD 2^32
RNG=(69069*RNG + 69069) MOD 2^32
|
I've been using nUnit with 3.5. As long as you have a version that works with 2.0 you should be fine - same CLR and all that. :) |
Starting Windows development - advice please ? |
|windows| |
I've been a Unix-based web programmer for years (Perl and PHP). I'm also competent with C and C++ (and bash and that sort of sysadmin sort of stuff) in terms of the language itself. I've never had a problem learning a new language (I mucked around with Java a few years ago and whilst I could write it I just didn't li... |
For performance monitor - start it on the server (Win+r/perfmon). Select "Performance Logs and Alerts" and expand. Select "Alerts". Select "Action" & then "New Alert". Give the alert a name, click "Add" to add a counter (there are hundres of counters, for example CPU %), then give it dome limits.
Select the "Act... |
No limitations that I have found. |
I made a simple RMI service with two methods: lock and release. both methods take a key (my data model used UUIDs as pk so that was also the locking key).
RMI is a good solution for this because it's centralized. you can't do this with EJBs (specialially in a cluster as you don't know on which machine your call wil... |
True timeout on LWP::UserAgent request method |
|perl|lwp|timeout|signals| |
I am trying to implement a request to an unreliable server. The request is a nice to have, but not 100% required for my perl script to successfully complete. The problem is that the server will occasionally deadlock (we're trying to figure out why) and the request will never succeed. Since the server thinks it is li... |
@Infamous Cow -- you must be thinking of primary keys, not indexes.
@Xenph Yan --
Something others have not touched on is choosing what *kind* of index to create. Some databases don't really give you much of a choice, but some have a large variety of possible indexes. B-trees are the *default* but not always the... |
Sorry didn't see the requirement to neutralize the year.
select * from Employees
where DATEADD (year, DatePart(year, getdate()) - DatePart(year, Birthday), Birthday)
between convert(datetime, getdate(), 101)
and convert(datetime, DateAdd(day, 5, getdate()), 101)
This should... |
Creating accessible pages is something that is hard to think about if you have never done it. However, once you learn the basic concepts it is very easy to do in 95% of the cases. I will mostly be repeating what others have said, but:
1. Only use tables for tabular data
2. Make sure you use the semantic tools ava... |
I've always been a fan of Rocky Lhotka's approach in the [CSLA framework][1] (as mentioned by Charles). In general, whether it's driven by the setter or by calling an explicit Validate method, a collection of BrokenRule objects is maintained internally by the business object. The UI simply needs to check an IsValid m... |
I've always been a fan of Rocky Lhotka's approach in the [CSLA framework][1] (as mentioned by Charles). In general, whether it's driven by the setter or by calling an explicit Validate method, a collection of BrokenRule objects is maintained internally by the business object. The UI simply needs to check an IsValid m... |
You can use WMI to enumerate what Windows knows about a drive; get the [`Win32_DiskDrive`][1] instance from which you should be able to grab the the [`Win32_PhysicalMedia`][2] information for the physical media the drive uses; the [MediaType][2] property to get what media it uses (CD, CDRW, DVD, DVDRW, etc, etc).
... |
Asking them to write a **recursive algorithm** for a well known iterative solution (i.e. Fibonacci etc. -- we give them an iterative function, if needed) and then have them compute the run time for it.
Many times the recursive function involves a tree data structure. The number of times the person has failed to reco... |
Just look at the code, here you can see the iterators in the std::map in the GNU libstdc++
[http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a02142.html#l00312][1]
you'll see that all end rend cend ... are all implemented in constant time.
|
If you don't have .NET 3.5 and therefore the Reverse extension method you can implement your own. I'd guess it probably generates an intermediate list (when necessary) and iterates it in reverse, something like the following:
public static IEnumerable<T> Reverse<T>(IEnumerable<T> items)
{
IList<T> li... |
For std::set
begin: constant, end: constant,
rbegin: constant,
rend: constant,
For std::map
they are also constant (all of them)
if you have any doubt, just check [www.cplusplus.com][1]
[1]: http://www.cplusplus.com |
How do I display a substitute password character in a UILabel? |
|iphone| |
I have a need to display a UITableView containing a user's account credentials. For this, I'm using UILabels in UITableViewCells. When I display their password, I'd obviously like to just display a placeholder password character instead of their actual password, similar to a UITextField when it's set to secure text ent... |
Anonymous objects are faster than named objects. But calling more functions is more expensive, and to a degree which eclipses any savings you might get from using anonymous functions. Each function called adds to the call stack, which introduces a small but non-trivial amount of overhead.
But unless you're writing... |
.NET supports [nullable types][1], but by declaring them as such you have to treat them a bit differently (as, understandably, something which is normally a value type now is sort of reference-ish).
This also might not help much if you end up having to do too much converting between nullable doubles and regular doub... |
How can I tint a sprite to white in XNA? |
|xna|c#|shader|tint| |
I don't think this is possible just using the color setting in SpriteBatch, so I'm trying to work out a simple shader that would take every pixel and make it white, while respecting the alpha value of the pixel. |
|c#|xna|shader|tint| |
RIM's compiler (the one that builds the COD files) can be easily run from the command line. All you need to do is create a corresponding build step in IDEA.
Also, to make your life easier when editing the code, you may want to add the net\_rim\_api.jar (the one that comes with RIM JDE) to the JAR files used by your ... |
There's a few things that get installed on every computer I use for development:<br>
- [ExamDiff][1] is the best light-weight diff program I've found.
- [Tortoise SVN][2] is the best version control client
- [Perforce][3] is a way to make your life worse when your company inflicts it upon you.
[1]: http... |
If you cannot find a good converter, you could always compile the c# code and use the dissasembler in [Reflector](http://www.red-gate.com/products/reflector/) to see Visual Basic code. Some of the variable names will change. |
[The Pi-Calculus, A Theory of Mobile Processes][1] is a good place to begin.
[1]: http://books.google.com/books?id=WR828X_7488C&dq=pi-calculus&pg=PP1&ots=C2uWpHm7fN&sig=H_cJSbWkK6TzKTe3x89BtTDYSyw&hl=en&sa=X&oi=book_result&resnum=1&ct=result |
Ship early, ship often, constant refactoring.
What I mean is, don't let it stop you from shipping, but don't give up on fixing the problems either.
An inability to resolve wonkiness is a sign of problems in your code base. Spend more time refactoring than adding features. |
Perfectionists may answer "don't do it".
Business people may answer "do it".
I guess where the balance is is up to you. I would be swaying towards putting the feature in there if the bugs are non-critical. Most users don't see your software the same way you do. You're a craftsman/artist, which means your more ... |
Open the properties of the Setup Project, then click on the Prerequesites button. Then check the prerequisites to install.

Then you can define how the user gets the pre-reqs. |
Open the properties of the Setup Project, then click on the Prerequesites button. Then check the prerequisites to install.

Then you can define how the user gets the pre-reqs.
Here is a link to framework version information and an excerpt from S... |