instruction stringlengths 0 30k ⌀ |
|---|
The general practice that I've experienced is that if it's something like a config file or just a really small amount of data then you could probably get away with just having an XML file on the server with your SWF files.
If you want the data to be more dynamic or you anticipate changing it quite often I would defi... |
I can't seem to figure out a good way to do this, but it seems like it should be simple. I have an element that I want to append a div to. Then I have another element that I want to clone and shove into that intermediate div. Here's what I was hoping to do:
$("#somediv > ul").after("<div id='xxx'></div>").app... |
|javascript|jquery|css-selectors| |
HttpContext.IsCustomErrorEnabled is a cool feature.I've found it useful more than once. Here is a [short post][1] about it.
[1]: http://weblogs.asp.net/leftslipper/archive/2008/07/13/httpcontext-iscustomerrorenabled-one-of-asp-net-s-hidden-gems.aspx |
What about [google charts][1]?
[1]: http://code.google.com/apis/chart/ |
If you are using Java 6 you can just use the [open method of java.awt.Desktop][1] to launch the file using the default application for the current platform.
[1]: http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#open(java.io.File) |
Pls recommend a good platform (environment / language /reuseable component) for data visualization |
|datavisualization| |
I have lots and lots of data in various structures. Are there any better platforms other than Excel charts which can help me.
thanks |
What is a good platform (environment/language/reuseable component) for data visualization? |
|data-visualization| |
Profiling visualization tools? |
|performance| |
I need to display profiling information pulled from a deeply embedded CPU, presenting it in a way which other developers on my team will be able to act upon. The profiling data is a snapshot of a cycle counter at the entry and exit of every function, so we have a call graph annotated with sub-microsecond timing accurac... |
|asp.net|linq|linq-to-sql|validation|data-binding| |
In my application I have `TextBox` in a `FormView` bound to a `LinqDataSource` like so:
<asp:TextBox ID="MyTextBox" runat="server"
Text='<%# Bind("MyValue") %>' AutoPostBack="True"
ontextchanged="MyTextBox_TextChanged" />
protected void MyTextBox_TextChanged(object se... |
[The Ruby Way][1] by Hal Fulton
![The Ruby Way cover][2]
[1]: http://rubyhacker.com/
[2]: http://rubyhacker.com/trw2cover.gif |
Also, remember that many backup strategies are busted in some way, and we don't find out until it's time to restore after a hardware failure. This is a bad time to find that out!
When you work out your backup strategy, [test][1] that you can actually restore from it. Do this periodically.
[1]: http://www.ta... |
Can you try the windbg command "!sysptes" to get System PTE Information? I'm not sure if you can do this with live kernel debug, you may have to get a memory dump. |
## Perl 6 version
rx{
^
$month := (\d{1,2})
{ $^month <= 12 or fail }
<[\/]>
$day := (\d{1,2})
{
given( +$^month ){
when any(qw'1 3 5 7 8 10 12') {
$day <= 31 or fail
}
when any(qw'4 6 9 11') {
$day <= 3... |
SQL Server does not have any form of resource governor yet. There is a SET option called QUERY_GOVERNOR_COST_LIMIT but it's not quite what you're looking for. And it prevents queries from executing based on the cost rather than controlling resources. For now, the only way is to make sure you disable parallelism or set ... |
SQL Server does not have any form of resource governor yet. There is a SET option called QUERY_GOVERNOR_COST_LIMIT but it's not quite what you're looking for. And it prevents queries from executing based on the cost rather than controlling resources. |
You may want to look at [this "PowerToy" from Microsoft][1]:
> **Open Command Window Here**
>
> This PowerToy adds an "Open Command
> Window Here" context menu option on
> file system folders, giving you a
> quick way to open a command window
> (cmd.exe) pointing at the selected
> folder.
[1]: http://... |
The easiest way to check your workstation is to download the [VMware Processor Check for 64-Bit Compatibility][1] tool from the VMware website.
You can't run a 64-bit VM session on a 32-bit processor. However, you can run a 64-bit VM session if you have a 64-bit processor but have installed a 32-bit host OS and y... |
Upload a file to SharePoint through the built-in web services |
|sharepoint|wss| |
What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes? |
What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes?
**Following the two initial answers...**
* We definitely need to use the Web Service layer as we will be making these calls from remote client applications.
* The... |
What is the best way to upload a file to a Document Library on a SharePoint server through the built-in web services that version WSS 3.0 exposes?
**Following the two initial answers...**
* We definitely need to use the Web Service layer as we will be making these calls from remote client applications.
* The... |
MSDN gives extensive answer:
[Getting the System Version][1]
[1]: http://msdn.microsoft.com/en-us/library/ms724429%28VS.85%29.aspx |
I some cases, asserts are disabled when building for release. You may not have control over this (otherwise, you could build with asserts on), so it might be a good idea to do it like this.
I usually throw an exception in the if-statement to take over the role of the assert in case they are disabled
assert(... |
I some cases, asserts are disabled when building for release. You may not have control over this (otherwise, you could build with asserts on), so it might be a good idea to do it like this.
The problem with "correcting" the input values is that the caller will not get what they expect, and this can lead to problems ... |
Don't re-invent the wheel. There are a number of open source cross-domain SSO packages such as JOSSO, OpenSSO, CAS, Shibboleth and others. If you're using Microsoft Technology throughout (IIS, AD), you can use microsoft federation (ADFS) instead. |
Eclipse and Netbeans have text editors among a whole lot of other stuff. I don't think you would want to wait 10 seconds for your text editor to become ready :/...If you are going to spend some serious time coding then spend some time and learn to use vim (emacs too but, I recommend vim) |
C++/Java Performance for Neural Networks? |
|java|c++|performance|neural-network| |
I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++. I know that with 'just in time' compiler techniques Java can do very well, but somehow I just don't buy it. Does anyone have any experience th... |
I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++. I know that with 'just in time' compiler techniques Java can do very well, but somehow I just don't buy it. Does anyone have any experience th... |
[LiquiBase](http://www.liquibase.org) is an interesting open source library for handling database refactorings (upgrades). I have not used it, but will definitely give it a try on my next project where I need to upgrade a db schema. |
How do I get the unix find command to print out the file size with the file name? |
|unix|command-line|solaris| |
If I issue the find command as follows:
$find . -name *.ear
It prints out:
./dir1/dir2/earFile1.ear
./dir1/dir2/earFile2.ear
./dir1/dir3/earFile1.ear
What I want to 'print' to the command line is the name and the size:
./dir1/dir2/earFile1.ear 5000 KB
./dir1/dir2/earFile2.ear... |
If your XML file is so large that updating it is a performance bottleneck, you should consider moving away from XML to a more efficient disk format (or a real database).
If, however, you just *feel* like it might be a problem, remember the rules of optimization:
1. Don't do it
2. (experts only) Don't do it, ... |
My development machine is backed up using Retrospect and Acronis. These are nightly backups that run when I'm asleep - one to an external drive and one to a network drive.
All my source code is in SVN repositories, I keep all my repositories under a single directory so I have a scheduled task running a script that s... |
I'll second the valgrind as an external tool for memory leaks.
But, for most of the problems I've had to solve I've always used internally built tools. Sometimes the external tools have too much overhead or are too complicated to set up.
Why use already written code when you can write your own :)
I joke, but ... |
Using mock objects doesnt mean you're not doing state based testing. |
lint (very similar open-source tool called [split][1])
[1]: http://splint.org/ |
lint (very similar open-source tool called [splint][1])
[1]: http://splint.org/ |
I have always used [Zabbix][1] especially for critical web sites. It uses MySql for the database and it has a PHP frontend. Of course it is open source and it is very flexible. It uses servers to stick data in the database and agents collect the data and send it to the servers. It is very scalable with this respect... |
How do prepared statements work? |
|php|sql|pdo| |
I'm writing some DB routines and I'm using prepared statements. My environment is PDO with PHP5.
I understand prepared statements primarily provide a performance benefit, as well as some auxiliary bonuses such as not having to manually SQL-escape input data.
My question is about the performance part.
I have t... |
Personally, I've been using Dmacro for years (<ftp://ftp.sgi.com/other/dmacro/dmacro.tar.gz>).
Here's a review of it that also mentions some alternatives: <http://linuxgazette.net/issue39/marsden.html> |
You said that "this will not compile because it throws an error" but never said what that error is.
A shared variable is static, so there is only a single copy of it in memory that is accessible to all instances. You can only modify a static readonly (Shared ReadOnly) from a static (Shared) constructor (New()) so yo... |
If you want to find out if two files contain the same set of lines, but in a different order, you can use a regular hash function on each line individually, then combine them with a function where ordering doesn't matter, like addition. |
The suggestion of "Drop and recreate the table" is probably not a good one because that goofs up your foreign keys.
You ARE using foreign keys, right? |
Your NFS server disappeared.
Ideally your best bet is if the NFS server comes back.
If not, the "umount -f" should have done the trick.
It doesn't ALWAYS work, but it often will.
If you happen to know what processes are USING the NFS filesystem,
you could try killing those processes and then maybe an unmount... |
Java supports any string that can be expressed in Unicode (subject to some ridiculously long maximum length), and file names are just another kind of string.
Of course, this means that you can try and refer to a file using a name that isn't supported by the underlying Operating System. If you do this, you'll get som... |
Java supports any string that can be expressed in Unicode (subject to some ridiculously long maximum length, Integer.MAX_VALUE), and file names are just another kind of string.
Of course, this means that you can try and refer to a file using a name that isn't supported by the underlying Operating System. If you do t... |
It's been a while since I ran linux, but try looking for the x64 version. There are also x64 to x86 compatibility libraries available that should make 32 bit programs work for most situations.
The [ubuntu forums](http://ubuntuforums.org/) are a much better place for this question, however. |
This might be what you want:
cmd /K "cd C:\Windows\" |
Changing the font in Aquamacs? |
|macos|emacs|lisp|aquamacs| |
I've recently had a need to do a bit of lisp editing and I found the nifty Ready Lisp package for OS X, which is great, except Aquamacs automatically uses a proportional font (which is idiotic, IMHO) and I want to change it to a monospace font. However, I'm not really much of an EMACS user, and the preferences menu in ... |
Use the /K switch. For example
<pre>
cmd /K "cd /d c:\WINDOWS\"
</pre>
Will create a cmd window at the C:\Windows directory |
Not familiar with ASP, but in .net, couldn't you just do something along the lines of
protected void MyTextBox_TextChanged(object sender, EventArgs e)
{
Decimal d = null;
TextBox tb = sender as TextBox;
if(!Decimal.TryParse(tb.Text, out d))
{
... |
Create a shortcut and edit the "Start In" property of the shortcut to the directory you want the cmd.exe to start in. |
If you have Vista or Server 2008, right-click on the directory icon in Explorer while holding the Shift key, and then click the "Open Command Window Here" context menu option. For XP, use the PowerToy mentioned by dF to get the same function. |
The problem does happen on Unix, although it's usually not as bad.
The Low-framgmentation heap helped us, but my co-workers swear by [Smart Heap](http://www.microquill.com/)
(it's been used cross platform in a couple of our products for years). Unfortunately due to other circumstances we couldn't use Smart Heap thi... |
I think you should override the Updating event of the LinqDataSource on your page. Do your check for invalid strings (use a TryParse method or something), and then continue with the base class update. |
I think you should handle the Updating event of the LinqDataSource on your page. Do your check for invalid strings (use a TryParse method or something), and then continue with the base class update.
(Edit: My intuition lines up with what's recommended [here](http://msdn.microsoft.com/en-us/library/system.web.ui.we... |
The usual approach is to use option two with email:
Store user name, password hash and email address into the database.
Users can either input their password or reset it, in the latter case a random password is generated, a new hash is created for the user and the password is sent to him via email.
Edit: If th... |
SQLiteManager (the Firefox Plugin mentioned by Vinko) also works well as a standalone app, with XULRunner. |
Apart from the apparent diff of having to declare the value at the time of a definition for a const vs readonly only being assignable till the ctor exits. There is a subtle difference.
Consider a class defined in AssemblyA.
public class Const_V_Readonly
{
public const int I_CONST_VALUE = 2;
... |
Apart from the apparent diff of
- having to declare the value at the time of a definition for a const vs readonly only being assignable till the ctor exits.
- 'const's are implicitly static. You use a ClassName.ConstantName notation to access them.
There is a subtle difference. Consider a class defin... |
Apart from the apparent diff of
- having to declare the value at the time of a definition for a const VS readonly values can be computed dynamically but need to be assigned before the ctor exits.. after that it is frozen.
- 'const's are implicitly static. You use a ClassName.ConstantName notation to access the... |
results = results.Where(x =>
(string.IsNullOrEmpty(ddlFileName.SelectedItem.Text) || x.FileName.Contains(ddlFileName.SelectedValue))
&& (!chkFileName.Checked || string.IsNullOrEmpty(x.FileName))
&& ...); |
Well, I would try and figure out what application is using Access. Not knowing what is running is a real issue, especially when it is having unhandled exceptions!
As far as just disabling?
Try:
Right click 'My Computer'
left click 'Properties'
left click 'Advanced' tab
left click 'Error Reporting' (near... |
From <http://www.codeproject.com/KB/exception/UnhandledExceptionClass.aspx>:
> If you also want to disable the Windows “Send Error Report” dialog on your computer, right-click on the “My Computer” icon, select “Properties”, switch to the “Advanced” tab, and click on the “Error Reporting” button. In the Options dialo... |
From [the documentation][1]:
> A prepared statement is a server-side
> object that can be used to optimize
> performance. When the PREPARE
> statement is executed, the specified
> statement is parsed, rewritten, and
> planned. When an EXECUTE command is
> subsequently issued, the prepared
> statement need on... |
From [the documentation][1]:
> A prepared statement is a server-side
> object that can be used to optimize
> performance. When the PREPARE
> statement is executed, the specifie
> statement is parsed, rewritten, and
> planned. When an EXECUTE command is
> subsequently issued, the prepared
> statement need onl... |
- CTRL-SHIFT-g : finds usages of the method or field under the cursor, absolutely necessary for understanding code
- CTRL-F6 : navigate between the list of open editor windows, if you just type it once and let go you toggle back to the previous editor window, doing this successively is a nice way to jump back and ... |
Assuming the destination array has enough space, Array.Copy() will work. You might also try using a List<T> and it's .AddRange() method. |
You can also sort a dictionary by value and control the sort order:
import operator
d = {'b' : 'this is 3', 'a': 'this is 2' , 'c' : 'this is 1'}
for key, value in sorted(d.iteritems(), key=operator.itemgetter(1), reverse=True):
print key, " ", value
Output:
b this is 3
... |
Merging two arrays in .Net |
|c#|.net-2.0|.net| |
Is there a built in function in .Net 2.0 that will take two arrays and merge them into one array? The arrays are both of the same type. I'm getting these arrays from a widely used function within my code base and can't modify the function to return the data in a different format.
I'm looking to avoid writing my own ... |
|c#|.net|.net-2.0|arrays| |
As Vinko said, the full details are way beyond the scope of a forum post. The differences/similarities boil down to this:
They are both a runtime environment "sandbox" that include a "just-in-time" compiler to translate program instructions in an intermediate language (MSIL or ByteCode) to native machine code and pr... |
Don't store the credit card numbers, store a hash instead. When you need to verify if a new number matches a stored number, take a hash of the new number and compare it to the stored hash. If they match, the number is (in theory) the same.
Alternatively, you could encrypt the data by getting the user who enters th... |
select column_name, count(column_name)
from table
group by column_name
having count (column_name) > 1; |
Easiest way to add a Header and Footer to a Printing.PrintDocument (.Net 2.0)? |
|.net|vb.net|printing|printdocument|header| |
What's the easiest way to add a header and footer to a .Net PrintDocument object, either pragmatically or at design-time?
Specifically I'm trying to print a 3rd party grid control (Infragistics GridEx v4.3), which takes a PrintDocument object and draws itself into it.
The resulting page just contains the grid and... |
If the lines are fairly long, you could just keep a list of the hashes of each line -- sort those and compare with previous outputs.
If you don't need a 100% fool-proof solution, you could store the hash of each line in a Bloom filter (look it up on Wikipedia) and compare the Bloom filters at the end of processing. ... |
if you don't need the dict functionality, and only need to return tuples in the order you've inserted them, wouldn't a queue work better? |
it depends how complex your project files are:
you definitly need a gcc environment like cygwin.
- for small projects or single file compile you can use a custom build tool (rules-file)
- for large projects/solutions I'm auto-generating an autotools configure/makefile from the vcproj/sln-file and compile this ... |
Enum.Parse() is your friend here
MyEnum GetEnumValue(string enumString) {
return (MyEnum)Enum.Parse(typeof(MyEnum),enumString);
}
Obviously you'd also need some error-checking on the string you're getting from you're config file in which case you might want to return a default.
|
Listing/walking directories in Python is very easy, so I would recommend trying to "roll your own" using one of the simple tree controls (such as TreeCtrl or CustomTreeCtrl). It should really be quite easy to call the directory listing code when some directory is expanded and return the result.
|
Some control-flow tricks, `finally` around a `return` statement:
int getCount() {
try { return 1; }
finally { System.out.println("Bye!"); }
}
The rules for [definite assignment][1] will check that a final variable is always assigned through a simple control-flow analysis:
final int ... |