instruction
stringlengths
0
30k
Don't video encoding algorithms like MPEG compute the difference between each frame of a video so they can just encode the delta? You might look into how video encoding algorithms compute those frame differences. Look at this open source image search application [http://www.semanticmetadata.net/lire/][1]. It descr...
It would be useful to you to figure out which error code is returned. Is it 404 - Resource not found or 503 - Forbidden Access? There are a few more, but in any case, it would help you figure out the cause of the problem. If your client is running IE, ask him to disable friendly error messages in the advanced optio...
- If the new people focus on testing - If you can isolate independent features that don't create new dependencies - If you can orthogonalise some aspects of the project (especially non-coding tasks such as visual design/layout, database tuning/indexing, or server setup/network configuration) so that one person ...
While i haven't personally used VisualVM, I saw this [blog post][1] just today that might have some useful information for you. He talks about profiling a production app using it. [1]: http://blog.xebia.com/2008/09/15/loitering-objects-make-web-company-lose-money/
You might want to look at https://www.xcase.com/demo.php. It's not free, but it's quite a bit cheaper than PowerDesigner, as far as I can tell. I've used earlier versions, but lately I've had easy access to Visio, so have continued with that instead of investing in xCase.
Googling for "iis cpu limit" gives these hits: [http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/38fb0130-b14b-48d5-a0a2-05ca131cf4f2.mspx?mfr=true][1] "The CPU monitoring feature monitors and automatically shuts down worker processes that consume large amounts of CPU time. CPU monitori...
re: > Update: Clarification The above sizes, > are the memory being used as the > process is ran, not the executable. Okay, when you run a tiny C# Win Forms app, the smallest amount of RAM that is reserved for it is around 2 meg, maybe 4 meg. This is just a working set that it creates. It's not actively using ...
@Prestaul $('#active ~ img.a') would only select the _following_ siblings, and would include the non-consecutive siblings too. Docs: <http://docs.jquery.com/Selectors/siblings#prevsiblings>
something like the psuedo code below might work.. var isClicked = false; var clickCounter = 100; function fnTrackClick(){ if(isClicked){ clickCounter--; setTimeout(clickCounter * 100, fnTrackClick); } } <input type="button" value="blah" onmousedown=...
I would also like to throw in a suggestion to visit the [Refactoring][1] website by Martin Fowler. He literally wrote the book on this stuff. As far as introducing unit tests into the equation the best method I have found is to find a top level component and identify all the external dependencies it has on concrete ...
If the standard toolbar is visible the following will open any file in the solution (resharper is not necessary). Ctrl-D places you in the Find textbox. '>of f' will provide a dropdown with all files that start with 'f' with path information after the filename to distinguish name collisions. Complete the filename, ...
@@ROWCOUNT
If you can rewrite other procedure to be a simple function that returns a resultset, you can simply select count(*) from it.
As @Brian stated, you can just use Expression blend and create any WPF/Silverlight apps. Especially if you have some Flash background/more interested in the interaction design (UX) I would recommend you to buy expression blend than VS2008. You can write C# code in notepad and Blend will take care of the compilation.
use an out parameter
Well, depending on how the stored procedures work, @@ROWCOUNT returns the # of results for ANYthing that SP will do (including updates): http://msdn.microsoft.com/en-us/library/ms187316.aspx This will only work if the LAST thing you do in the sp is returning the rows to the client... Otherwise you're going to get t...
Well here's the solution I came up with: function randomize_array_1($array_to_randomize) { $new_array = array(); while (count($array_to_randomize) > 0) { $rand_num = rand(0, count($array_to_randomize)-1); $extracted = array_splice($array_to_randomize, $rand_num, 1); $new_array[] ...
I wonder if passing the "bad" HTML through [HTML Tidy][1] might help as a first pass? Might be worth a look, if you can get the document to be well formed, maybe you could load it as a regular XML file with DomDocument. [1]: http://www.w3.org/People/Raggett/tidy/
If you mean 3000+ developers wokring on the same codebase, i've got no clue. If you mean working on several hundred projects on different locations and you need to have a standard, I'd go for somethins popular with a massive online user support i.e not something obscure that gives you 10 hits on Google. Personally I...
We've split our code base into several sibling modules and wrote the Ant scripts so that one developer can work on one module at a time without bothering too much about what's happening in the other modules. - a top-level build script triggers all modules build scripts - external libraries are **not** stored in...
Add a linefeed ("\n") to the output: <textarea>Hello Bybye</textarea> Will have a newline in it.
There's a difference between compiling and targeting. Compiling the code with the (for example) C# 3.0 compiler will probably give you a boost on performance (very little one anyway) as some optimization for the generated IL code migh have been included. It also allows you to use some of the new features like automa...
StringBuilder is better for building up a string from many non-constant values. If you're building up a string from a lot of constant values, such as multiple lines of values in an HTML or XML document or other chunk of text, you can get away with just appending to the same string, because almost all compilers do "c...
Check their "hosts file". The location of this file is different for XP and vista in XP I believe it's `C:\windows\hosts` or `C:\windows\system32\hosts` Look for any suspicious domains.. Generally speaking, there should only be ~2 definitions (besides comments) in the files defining localhost and other local ip d...
If the existing programmers are totally incompetent, then adding competent programmers may help.
If the existing programmers are totally incompetent, then adding competent programmers may help. I can imagine a situation where you had a very modular system, and the existing programmer(s) hadn't even *started* on a very isolated module. In that case, assigning just that portion of the project to a new programmer...
Never become popular. While that will work, it's not real helpful. What you need infrastructure that can scale on very short. Something like Google Gears or Amazon's web services seems ideal for this, since even Slashdot's not going to overwhelm Google or Amazon. If you want your own server make sure your network...
If you want to see the actual code that gets executed when linking a .dll, take a look at %ProgramFiles%\Visual Studio 8\vc\crt\src\dllcrt0.c. From inspection, destructors will be called via `_cexit()` when the internal reference count maintained by the dll CRT hits zero. MSN
[Coder to Developer][1], by Mike Gunderloy. [1]: http://www.amazon.com/Coder-Developer-Strategies-Delivering-Software/dp/078214327X
Fetch unread messages, by user
|sql|database|mysql|
As a user, I never want applications (or tabs) to take focus unless I specifically requested it. I have gone to great lengths to prevent tabs in my browser (Firefox) from taking focus for this reason.
By removing any non-latin character you'll be intentionally breaking some internationalization support. Don't forget the poor guy who's name has a "â" in it.
I highly recommend the Erlang mode shipped with the standard Erlang distribution. I've put together a "works out of the box" Emacs configuration which includes: * Syntax highlighting & context-sensitive indentation * Dynamic compilation with on-the-fly error highlighting * Integrated Erlang shell * And more.... ...
Effective C++ and More Effective C++ by Scott Myers.
If you don't want to use exceptions, the cleanest way to do it is to have the function return the error/success code and take either a reference or pointer argument that gets filled in with the result. I would not call it an anti-pattern. It's a very well proven workable method that's often preferable to using exce...
[Here][1] is a good article on obtaining the IP address of your visitors. You could display this in addition to their comment if you wanted or include it as a label or field in your page so you can reference it later. [1]: http://javascript.about.com/library/blip.htm
Why would you go with Air? Use [GTK#](http://www.mono-project.com/GtkSharp), and you have a cross platform forms engine and you get to keep your C# code.
Rename it it. eg: old-log-16-09-08.log Then the SQL server can use a new empty one.
Are there any advantages compiling for the 3.5 .net framework instead of 2.0?
|.net|frameworks|
For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something.
For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edit: Of course there are more features in the 3.5 framework, but these are not the focus of this question.
|.net|frameworks|optimization|
|.net|frameworks|optimization|compiler-construction|
|.net|optimization|compiler-construction|frameworks|
For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edit: Of course there are more features in the 3.5 framework, but these are not the focus of this question. Edit2: There seem to be no advantages
Well, it really depends on your metrics and purpose: 1. If you have 250 columns and want to (indeed) select them all, use select * if you want to get home the same day :) 2. If your coding needs flexibility and the table in need is small, again, select * helps you code faster and maintain it easier. 3. If you w...
[This page][1] explains it. Use SaveToStream and a TMemoryStream instead of SaveToFile if you don't want temporary files. TImage.Picture has a LoadFromStream which loads the image from the stream into the TImage for display. [1]: http://www.devrace.com/en/fibplus/articles/2161.php
It seems like you may be looking at something called [Hierarchical Model](http://en.wikipedia.org/wiki/Hierarchical_model). Or maybe a simple list of (attr, value) pairs will do?
Awhile back I wrote a decent sized application to route connections from a farm of modems through to a TCP/IP network address. Initially I looked for an unencumbered (free) Serial IO library. I tried Sun's, IBM's and RxTx. They were fine for developing the application, and in initial testing, but in production the...
Yes, Sharepoint looks to client installs of Office applications and Active X in order to fully integrate.
This is the sort of problem that web services were designed to solve. Although no longer simple, the SOAP format allows you to serialize objects to an XML representation on a Java/C# application, transmit them across the wire and deserialize them in the corresponding Java/C# application (Java/C# may be replaced with v...
This is a restriction of the EL parser (generally either OGNL or jboss-el for Spring Web Flow). EL uses dot notation for parsing the navigation chain,causing the initial behavior you describe (attempting to find the "bus" bean).
If you're coming from Windows & Visual Studio, you might find Code::Blocks meets your expectations. That was my experience; I tried a few others first, but they all seemed to expect me to do a lengthy tutorial before I could start doing anything interesting - and with a dozen IDEs to try, that could take days. Wi...
C# utility to create a CA
|c#|certificate|openssl|authority|ca|
I'd like to create a utility in C# to allow someone to easily create a Certificate Authority (CA) in Windows. Any ideas/suggestions? I know I can use OpenSSL to do this. In the end, I'll want this utility to do more than just generate a CA. I'd also like to avoid requiring the installation of OpenSSL in order to r...
Another alternative is to use COM Interop to create an assembly in .NET that is callable from classic ASP. To create a COM Interop assembly from Visual Studio (e.g. Microsoft Visual C# 2005 Express Edition): - Create a new Class Library project - Open the project properties - Under Application select As...
First, parse the string into a naive datetime object. This is an instance of `datetime.datetime` with no attached timezone information. See documentation for `datetime.strptime` for information on parsing the date string. Use the [`pytz`](http://pytz.sourceforge.net/) module, which comes with a full list of time zon...
There are two questions here. First, never use h2xs. It's old outdated nastiness, though I suppose if you're actually trying to turn a header file into XS code, it might be useful (never done that myself). For creating a new module, use Module::Starter. It works great, and has some nice plugins for customizing th...
Encrypting using a known (private) reversible key would be the simplest method. I'm not all up on AS so I'm not sure what sorts of encryption providers there are. But you could include variables like game-length (encrypted, again) and a click count. All things like this *can* be reverse engineered so consider thr...
Encrypting using a known (private) reversible key would be the simplest method. I'm not all up on AS so I'm not sure what sorts of encryption providers there are. But you could include variables like game-length (encrypted, again) and a click count. All things like this *can* be reverse engineered so consider thr...
I'd look into Session State Partitioning. Good info here: [http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Balancing.aspx][1] [1]: http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Balancing.aspx
You have two syntax options: **Option 1** CREATE TABLE Table1 ( id int identity(1, 1) not null, LongIntColumn1 int, CurrencyColumn money ) CREATE TABLE Table2 ( id int identity(1, 1) not null, LongIntColumn2 int, CurrencyColumn2 money ) INSER...
How do I convert local time to UTC in Python?
|python|datetime|utc|
How do I convert a datetime string in local time to a string in UTC time? I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
*How do I convert local time to UTC in Python?
How do I convert a datetime string in local time to a string in UTC time? I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future. **Clarification**: For example, if I have "2008-09-17 14:02:00" in my local timezone (+10), I'd like to generate a string with ...
How do I convert local time to UTC in Python?
As your query is currently written, the WHERE clause will not give you any information that can be used to sort your results. I like [Brian's idea][1]; add a constant column and UNION the queries and you could even get everything in one result set. For example: SELECT 1 as rank, * FROM Items WHERE column LIKE ...
As your query is currently written, the WHERE clause will not give you any information that can be used to sort your results. I like [Brian's idea][1]; add a constant column and UNION the queries and you could even get everything in one result set. For example: SELECT 1 as rank, * FROM Items WHERE column LIKE ...
Ensure you are editing the correct configuration file for VIM. Especially if you are using windows, where the file could be named _vimrc instead of .vimrc as on other platforms. In vim type `:help vimrc` and check your path to the _vimrc/.vimrc file with `:echo $HOME` `:echo $VIM` Make sure you are on...
Please don't do this. Make the interaction nonmodal if at all possible. Especially in something like a commit, it's much nicer to be able to browse around your files while you're writing commit comments. OS X does have window groups, but I don't think they can (easily) span applications.
A 404 error means that the requested resource was not found. As pkaeding suggests, it is probably due to the servlet mapping not being correct (or not being present) in the web.xml file. Servlets must be specified in the web.xml file, and not only that, but they must be mapped to particular paths (an "url-mapping"). ...
Ruby's make system is called rake: <http://rake.rubyforge.org/> Looks quite promising. There's always Ant: <http://ant.apache.org>, which I personally find horrendous. It's the de-facto standard for Java development, however.
Whether or not the efficiency matters depends a lot on the size of your production datasets (and their rate of growth). If your datasets aren't going to be that large, and they aren't going to grow that quickly, there may not be much of a performance advantage to selecting individual columns. With larger datasets a...
check out [SCons](http://www.scons.org/). For example Doom 3 and Blender make uses of it.
Forth: : a 1 recurse ; a
Forth: : a 1 recurse ; a Inside the `gforth` interpreter: : a 1 recurse ; a *the terminal*:1: Return stack overflow : a 1 recurse ; a ^ Backtrace: On a Power Mac G4 at the Open Firmware prompt, this just hangs the machine. :)
Your example comes straight out of the API docs which are unfortunately poorly presented. Your annotation should be placed on some class, probably the one in which you will be creating the query to use the result set mapping. However, it actually doesn't matter where this annotation is placed. Your JPA provider will...
`sudo perl -MCPAN -e 'install Foo'`
Why not just pass the the whole path to the include method? include('/myapp/src/MyClass.php'); or include('../src/MyClass.php');
I think it's a good idea to keep your files separate. I normally use a folder structure like this: /myapp/src/ <- my classes /myapp/tests/ <- my tests for the classes /myapp/public/ <- document root In your case, for including the class in your test file, why not just pass the the ...
Should I use an initialization vector (IV) along with my encryption?
|encryption|cryptography|
Is it recommended that I use an [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector) to encrypt/decrypt my data? Will it make things more secure? Is it one of those things that need to be evaluated on a case by case basis? To put this into actual context, the Win32 Cryptography function, [Cryp...
I'm using Erlang in a few production systems personally as well at the office. For client side testing, documentation and development I use a MacBook Pro as the OS/platform and TextMate with the Erlang bundle as an editor. For sever side development and deployment we use RHEL 4.x/5.x in production and for editing I ...
The definition of the "ID" in the question isn't really clear: do you need to use it as a key for fast Vertex lookup? You could define a comparator for the `std::map` (see below for an example) Do you need to be able to differentiate between two Vertex objects with the same coordinates (but different in another fi...
I want to maintain a list of global messages that will be displayed to all users of a web app. I want each user to be able to mark these messages as read individually. I've created 2 tables; `messages (id, body)` and `messages_read (user_id, message_id)`. Can you provide an sql statement that selects the unread mess...
[Google hosts a handful of pre-compressed JavaScript library files][1] that you can include in your own site. Not only does Google provide the bandwidth for this, but based on most browser's file caching algorithms, if the user has already downloaded the file from Google for another site they won't have to do it again...
You would need a mapping provider for MySQL. That is an extra thing the Entity Framework needs to make the magic happen. [This blog][1] talks about other mapping providers besides the one Microsoft is supplying. I haven't found any mentionings of MySQL. [1]: http://blogs.msdn.com/adonet/
Use a mail in database (your Domino administrator can set that up for you but it's in the help file as well). In that database, you can create an agent that runs periodically to process all new documents. That agent will use the EmbeddedObjects property of the NotesRichTextItem class and the ExtractFile method of t...
In IE, go to the "Anvanced" section of "Internet Options" and uncheck "Show friendly HTTP errors". This should give you the *real* error.
My suggestion is that you store whatever you want to insert into a staging table, and once the procedure is over run the cross server insert. To my knowledge there is no way of ignoring the transaction you are in once you are within the SProc execution. In contrast, if you use .NET 2.0's System.Transaction namesp...
There are a number of ways this can be done, or at least helped. Search Google for "slashdot-proof" and you'll find a number of them: - Slashdot-proof your server with FreeCache - Boing Boing - Simple Thoughts Blog is now Slashdot Proof etc.
To convert from Decimal to Hex do... string hexValue = decValue.ToString("X"); To convert from Hex to Decimal do either... int decValue = int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); or int decValue = Convert.ToInt32(hexValue, 16);
Is it possible to base GroupTemplate (.NET) on anything but a fixed record count?
|c#|.net|listview|