instruction
stringlengths
0
30k
On that hardware, a .NET application should be able to serve about 200-400 requests per second. If you have only a few hundred users, I doubt you are seeing even 2 requests per second, so I think you have a lot of capacity on that box, even with SQL server running. Without know all of the details, I would say **no**...
type works similar to cat. type file1 file2 > file3
type works similar to cat. type file1 file2 > file3 Edit: Greg, can you explain what you mean by file headers? (I would just comment but I don't have enough karma yet)
rsync -avlzp /path/to/folder name@remote.server:/path/to/remote/folder
check out scp or rsync man scp man rsync scp file1 file2 dir3 user@remotehost:path
Use rsync so that you can continue if the connection gets broken. And if something changes you can copy them much faster too! Rsync works with SSH so your copy operation is secure.
scp -r <directory> <username>@<targethost>:<targetdir>
Well, quick answer would to take a look at the 'scp' manpage, or perhaps rsync - depending exactly on what you need to copy. If you had to, you could even do tar-over-ssh: tar cvf - | ssh server tar xf -
Log in to one machine > $ scp -r /path/to/top/directory user@server:/path/to/copy
As non-root user ideally: scp -r src $host:$path If you already some of the content on $host consider using rsync with ssh as a tunnel. /Allan
Any reason why you must have a mock here... If not, I would go for a fake class.. Much Simpler and I know how to get it to do this :) I don't know if mock frameworks provide this kind of custom behavior.
Referencing internal resources that are 100% subject to change isn't serviceable - better to just copy it.
I can think of a couple of good web application testing suites that should get the job done - one free/open source and one commercial: 1. [Selenium][1] (open source/cross platform) 2. [TestComplete][2] (commercial/Windows-based) Both will let you create test suites by verifying database records based on intera...
Is there a way to make text unselectable on an html page?
|javascript|html|css|
I'm building an html UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers. I might be able to solve this with a javascript trick (I'd like to see those answers, too) -- but I'm r...
There are two ways I usually do this, both use ssh: scp -r sourcedir/ user@dest.com:/dest/dir/ or, the more robust and faster (in terms of transfer speed) method: rsync -auv -e ssh --progress sourcedir/ user@dest.com:/dest/dir/ Read the man pages for each command if you want more details about how t...
This is a list of books that are recommended by the folks over in #C++ EFNet: http://rafb.net/efnet_cpp/books/
One objection to object databases is that it creates a tight coupling between the data and your code. For certain apps this may be OK, but not for others. One nice thing that a relational database gives you is the possibility to put many views on your data. [Ted Neward][1] explains this and a lot more about OODBMS...
I have seen some of the work done by Laurent... wait for his book ![Sams Silverlight 2 Unleashed][1] [Sams Silverlight 2 Unleashed][2] [1]: http://galasoft.ch/blogs-all/2008090101.png [2]: http://geekswithblogs.net/lbugnion/archive/2008/09/01/sams-silverlight-2-unleashed-was-teach-yourself-silverlight-i...
The closest I can think of is doing something similar with [VEDekstop][1] from Shunra.. [Simulating High Latency and Low Bandwidth in Testing of Database Applications][2] *Shunra VE Desktop Standard is a Windows-based client software solution that simulates a wide area network link so that you can test applicati...
Where to put master page's code in an MVC application?
|asp.net-mvc|design|mvc|
I'm using a few (2 or 3) master pages in my ASP.NET MVC application and they must each display bits of information from the database. Such as a list of sponsors, current fundings status etc. So my question was, where should I put these master-page database calling code? Normally, these should goes into its own co...
|asp.net|asp.net-mvc|design|mvc|
I use a `tests/` directory, and then import the main application modules using relative imports. So in MyApp/tests/foo.py, there might be: from .. import foo to import the `MyApp.foo` module.
It's the classic space versus performance tradeoff. In MS SQL 2005, Varchar (or NVarchar for lanuagues requiring two bytes per character ie Chinese) are variable length. If you add to the row after it has been written to the hard disk it will locate the data in a non-contigious location to the original row and lead ...
I will start, I like how setting default values on function parameters that aren't supplied is much easier: function MyMethod($VarICareAbout, $VarIDontCareAbout = 'yippie') { }
Some good .NET-specific help for doing progress bars can be found in Dino Esposito's MSDN Magazine articles from last July and August: [**Context-Sensitive Feedback with AJAX (July '07)**][1] [**Canceling Server Tasks with ASP.NET AJAX (August '07)**][2] [1]: http://msdn.microsoft.com/en-us/magazine/cc16...
With a Client/Sever setup, you're allowed to require that whoever installs the server install it as an admin. That should solve most of your problems. Again- that's the server. The clients might be another story.
I'm a very satisfied user [msysgit][1] for Windows. It contains a recent copy of git as well as a GUI, a shell and a history browser in a single install package. No need for a server component and if you _do_ decide to host it somewhere you can sign the repo before uploading. [1]: http://code.google.com/p/msysgit/
I'm a very satisfied user [msysgit][1] for Windows. It contains a recent copy of git as well as a GUI, a shell and a history browser in a single install package. No need for a server component and if you _do_ decide to host it somewhere your repository is signed and cannot be modified by the hoster without you seein...
At my company, we use a custom inhouse updater for our applications. It's embedded as as a resource in the main application executable and when the application needs to update, the updater is extracted, written to disk and launched to do the update. The updater can download a .msi and launch it or it can download a zip...
Most examples I've seen use a variant of the Command-Pattern for this. Every user-action that's undoable get's it's own command instance with all the information to execute the action and roll it back. You can then maintain a list of all the commands that have been executed and you can roll them back one by one.
For horizontal: <style> body { text-align:left; } .MainBlockElement { text-align:center; margin: 0 auto; } </style> You need the text-align:left in the body to fix a bug with IE's rendering.
I've used reflection to get current method information for exceptions, logging, etc. string src = MethodInfo.GetCurrentMethod().ToString(); string msg = "Big Mistake"; Exception newEx = new Exception(msg, ex); newEx.Source = src; instead of ...
Just been reading about the command pattern in my agile development book - maybe that's got potential? You can have every command implement the command interface (which has an Execute() method). If you want undo, you can add an Undo method. more info [here][1] [1]: http://en.wikipedia.org/wiki/Command_pat...
type works similar to cat. type file1 file2 > file3 Edit: Greg, can you explain what you mean by file headers? (I would just comment but I don't have enough karma yet) Edit2: The file headers are printed to stderr, so the redirect to the output file works like cat, at least in Windows XP.
The `git commit` command will open up the editor specified in the `EDITOR` environment variable so you can enter a commit comment. On a Linux or BSD system, this should be vi by default, although any editor should work. Just enter your comments and save the file.
The `-m` option to commit lets you enter a commit message on the command line: git commit -m "my first commit"
If possible how can one embed PostGreSQL?
|database|postgresql|embedded|
If it's possible, I'm interested in being able to embed a PostGreSQL database, similar to [sqllite][1]. I've read that it's [not possible][2]. I'm no database expert though, so I want to hear from you. Essentially I want PostGreSQL without all the configuration and installation. If it's possible, tell me how. ...
The text file that is being opened is a summary of the current commit operation. The git commit drops you into this file so the you can add a commit message at the top of the file. Once you've added your message just save and exit from this file. There is also a "-m msg" switch on this command that allows you to add...
The way I usually see things done with smaller images such as buttons it that only a certain portion of the image is shown. Then many states of the picture will make up a larger picture which gets shifted around behind the visible port. I'll delete this when someone has code.
Here's some good information about image opacity and transparency with CSS: [http://www.w3schools.com/css/css_image_transparency.asp][1] So to make an image with opacity 50%, you'd do this: <img src="image.png" style="opacity: 0.5; filter: alpha(opacity=50)" /> The **opacity:** part is how Firefox does it,...
[Chris Hecker][2] has a nice set of articles on his website which were originally published in Game Developer Magazine. They start with 2D physics and progress to 3D. [Physically Based Modeling][1] by David Baraff is also good, but is a bit heavier on the math. [1]: http://www.cs.cmu.edu/~baraff/sigcourse/ ...
I usually try to ship products with all available sets of localized resources. Upon a user's first launch of the product, the UI is presented in the localization most closely matching the OS on their machine. Once within the app, the user has the option of switching the UI to one of the other available localizations. ...
Changing ofs = *pChar >> 4; pszHex[0] = pHex[ofs]; pszHex[1] = pHex[*pChar-(ofs*16)]; to int upper = *pChar >> 4; int lower = *pChar & 0x0f; pszHex[0] = pHex[upper]; pszHex[1] = pHex[lower]; results in roughly 5% speedup.
Changing ofs = *pChar >> 4; pszHex[0] = pHex[ofs]; pszHex[1] = pHex[*pChar-(ofs*16)]; to int upper = *pChar >> 4; int lower = *pChar & 0x0f; pszHex[0] = pHex[upper]; pszHex[1] = pHex[lower]; results in roughly 5% speedup. Writing the result two...
What Safari-specific pure CSS hacks are out there?
|css|safari|
I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet.
Going Ruby: Straight to IronRuby?
|ruby|ironruby|
I just started to learn Ruby and as a .Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first. What do you think? Will I be missing anything? -- rauchy
Programatically change the text of a TextLayer in After Effects
|javascript|after-effects|
I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition. Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer object.
If you're using [ExtUtils::MakeMaker](http://search.cpan.org/perldoc?ExtUtils::MakeMaker) or [Module::Build](http://search.cpan.org/perldoc?Module::Build), then you can run all your tests automatically by entering the command "make test" or "Build test", which will execute any *.t files in your project's t/ subfolder. ...
+1 for Subversion, for those not familiar with it I would recommend the [SVN Book](http://svnbook.red-bean.com/).
You might want to refer to the [Paint.NET code][1] for their undo - they've got a really nice undo system. It's probably a bit simpler than what you'll need, but it might give you some ideas and guidelines. -Adam [1]: http://www.getpaint.net/download.html
What is a good design when trying to build objects from a list of key value pairs?
|c#|
So if I have a method of parsing a text file and returning a **list** _of a_ **list** _of_ **key value pairs**, and want to create objects from the kvps returned (each list of kvps represents a different object), what would be the best method? The first method that pops into mind is pretty simple, just keep a list o...
So if I have a method of parsing a text file and returning a **list** _of a_ **list** _of_ **key value pairs**, and want to create objects from the kvps returned (each list of kvps represents a different object), what would be the best method? The first method that pops into mind is pretty simple, just keep a list o...
Here's one, I like how setting default values on function parameters that aren't supplied is much easier: function MyMethod($VarICareAbout, $VarIDontCareAbout = 'yippie') { }
a) Retrieve it and try to parse it. If you can parse it, it's valid. b) Test if it's an HTML document (server sent `text/html`) MIME-type. If so, run it through an HTML parser and look for `<link>` elements with RSS feed relations.
Are you doing this in a specific language, or do you just want details about the RSS specification? In general, look for the XML prolog: <?xml version="1.0" encoding="UTF-8"?> followed by an &lt;rss&gt; element, but you might want to validate it as XML, fully validate it against a DTD, or verify that - for...
The `__dict__` attribute of an instance class contains all the class's members: >>> class Foo(object): ... bar = 'hello' ... baz = 'world' ... >>> dict((k, v) for k, v in Foo.__dict__.iteritems() if not k.startswith('__')) {'foo': 'world', 'bar': 'hello'}
The `dir` builtin will give you all the object's attributes, including special methods like `__str__`, `__dict__` and a whole bunch of others which you probably don't want. But you can do something like: >>> class Foo(object): ... bar = 'hello' ... baz = 'world' ... >>> f = Foo() ...
The `dir` builtin will give you all the object's attributes, including special methods like `__str__`, `__dict__` and a whole bunch of others which you probably don't want. But you can do something like: >>> class Foo(object): ... bar = 'hello' ... baz = 'world' ... >>> f = Foo() ...
**To Truncate the log file:** - Backup the database - Detach the database, either by using Enterprise Manager or by executing : *Sp_DetachDB [DBName]* - Delete the transaction log file. (or rename the file, just in case) - Re-attach the database again using: *Sp_AttachDB [DBName]* - When the database i...
PostgreSQL is intended to run as a stand-alone server; it's probably possible to embed it if you hack at it hard and long enough, but it would be much easier to just run it as intended in a separate process.
You cannot embed it, nor should you try. For embedding you should use [sqlite][1] as you mentioned or [firebird rdbms][2]. [1]: http://www.sqlite.org/ [2]: http://www.firebirdsql.org/
Safari plugin development is non-trivial. The interface is written in Objective-C, and most of it is not even part of WebKit (so you can't see the source), but there's machinery to inspect and patch the object hierarchy of a running application. It requires understanding of Cocoa and Objective-C, but no lower. Here'...
If the data you send to the browser becomes mangled (moji-bake) you will get trash characters. Also, if you specify the wrong character set in your META headers, your browser will render the page incorrectly, causing moji-bake again, sometimes in random places on the page. When handling CJK character sets, you must ...
Asynchronous Mysql connector for C++ or C
|c++|mysql|asynchronous|asio|boost|
Does there exist any asynchronous connectors to Mysql that can be used in C or C++? I'm looking for something that can be plugged into a [reactor pattern][1] written in [Boost.Asio][2]. [1]: http://en.wikipedia.org/wiki/Reactor_pattern "reactor pattern" [2]: http://www.boost.org/doc/libs/release/libs/asio/ind...
|c++|mysql|boost|asynchronous|asio|
Does there exist any asynchronous connectors to Mysql that can be used in C or C++? I'm looking for something that can be plugged into a [reactor pattern][1] written in [Boost.Asio][2]. [Edit:] Running a synchronous connector in threads is not an option. [1]: http://en.wikipedia.org/wiki/Reactor_pattern "reacto...
Is Wiki Content Portable?
|wiki|
I'm thinking of starting a wiki, probably on a low cost LAMP hosting account. I'd like the option of exporting my content later in case I want to run it on IIS/ASP.NET down the line. I know in the weblog world, there's an open standard called BlogML which will let you export your blog content to an XML based format on ...
I'm not familiar specifically with CakePHP, but this kind of thing seems to happen anywhere with fixtures. There is no built in way in rails at least for this to happen, and I imagine not in cakePHP or anywhere else either because the whole idea of a fixture, is that it is **fixed** There are 2 'decent' workaroun...
I don't like either one. What happens when someone is both a member and an employee?
[Sphinx][1] is one of the best solutions [1]: http://www.sphinxsearch.com
[Sphinx][1] is one of the best solutions. It's written in C++ and has amazing performance. [1]: http://www.sphinxsearch.com
ruby idioms for using command-line options
|ruby|idioms|
I'm trying to pick up ruby by porting a medium-sized (non-OO) perl program. One of my personal idioms is to set options like this: use Getopt::Std; our $opt_v; # be verbose getopts('v'); # and later ... $opt_v && print "something interesting\n"; In perl, I kind of grit my teeth and let $o...
In C++, use `std::numeric_limits<type>::is_signed`. #include <limits> std::numeric_limits<int>::is_signed - returns true std::numeric_limits<unsigned int>::is_signed - returns false See <http://msdn.microsoft.com/en-us/library/85084kd6(VS.80).aspx>.
To add to John's post, there is also built in unit testing, built in refactoring, code analysis, and the web designer for html\javascript is vastly improved. I can't think of any reason why you wouldn't upgrade.
If what you want is a simple macro, this should do the trick: #define is_type_signed(my_type) (((my_type)-1) < 0)
as Marius already pointed, you can have public static variables in functions. I usually use them to create functions that are executed only once, or to cache some complex calculation results. Here's the example of my old "singleton" approach: var singleton = function(){ if (typeof arguments.ca...
It has been a while, but I seem to remember having trouble with the slight differences in how default namespaces were handled between .Net and Java web services. Double check the generated c# proxy class and any namespaces declared within (especially the defaults xmlns=""), against what the Java service is expecting...
Doesn't this mask indicate the events you're willing to receive? In this case, you'll probably want to receive notification that the user has clicked or double-clicked an item in the GtkTreeView, and you'll want to register callbacks to handle these events.
For c++, there is boost::is_unsigned&lt;T>. I'm curious why you need it though, there are few good reasons IMHO.
Have you looked into querying INFORMATION_SCHEMA.Tables? As in SELECT ic.Table_Name, ic.Column_Name, ic.data_Type, isnull(Character_Maximum_Length,'') Max, ic.Numeric_precision as Precision, ic.numeric_scale as Scale, ic.Character_Maximum_Length as VarCharSize, ic.is_nullable as Nulls, ic.ordinal...