instruction
stringlengths
0
30k
I know that it's possible to replace the browse button, which is generated in html, when you use input tag with type="file". I'm not sure what is the best way, so if someone has experience with this please contribute.
This isn't technically possible for security purposes, so the user cannot be misled. However, there are a couple of workarounds - take a look at http://www.quirksmode.org/dom/inputfile.html for one example. For the record, this question has already been asked [here][1] (where I gave the same answer). [1]: ...
What is Cloud computing.
|cloud|
Could anybody explain in plain words how Cloud computing works. I have read the wikipedia article, but still not sure that I understand how Cloud is actually works.
What is Cloud computing?
Could anybody explain in plain words how Cloud computing works? I have read the [Wikipedia article][1], but still not sure that I understand how cloud actually works. [1]: http://en.wikipedia.org/wiki/Cloud_computing
[ZedGraph][1]. 'Nuff said. [1]: http://zedgraph.org/
This one's quite nice: [zed graph](http://zedgraph.org)
That got me going in the right direction. Adding the files to the deployment config didn't help, but disabling deployment did work. For future reference, Visit [this blog post][1] and scroll down to the section "Managing Test Runs" for details of creating a test configuration and how to disable the deployment ...
I believe the return codes adds to code noise. For example, I always hated the look of COM/ATL code due to return codes. There had to be an HRESULT check for every line of code. I consider the error return code is one of the bad decisions made by architects of COM. It makes it difficult to do logical grouping of the co...
Usually these things don't have a clear-cut answer. I would suggest that A,B, and C are the result of a function of the size of your space and the amount of stuff you are differentiating.
From Preview 5 to RTM, there will be less and less breaking changes. So if the concern is how much churn your project will face, it shouldn't be as bad as it was with earlier releases. If the concern is support, we do ship the source code and you're allowed to modify (but not redistribute) the source for your own ne...
Whats the best way to get total # of records in a mysql table with php?
|php|mysql|
Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing $result = mysql_query("SELECT id FROM table"); $total = mysql_num_rows($result) I was told this was not very efficient or fast, if you have a lot of records in the table.
Is there an "anonymous" generic tag in C#, like '?' in Java?
|c#|generics|syntax|
In Java, one can declare a variable parameterised by an "unknown" generic type, which looks like this: Foo<?> x; Is there an equivalent construct to this question-mark, in C#?
If you need a script to have the PID of the program, you can still get it after a fork. When you fork, save the PID of the child in the parent process. When you exit the parent process, either output the PID to STD{OUT,ERR} or simply have a `return pid;` statement at the end of `main()`. A calling script can then ge...
Seems you will have to use [MapFileGenerator.java][1] mentioned in the article referred ;-) Please find more info on BeanInfo in Java Tutorial on [https://java.sun.com/docs/books/tutorial/javabeans/introspection/index.html][2] [1]: http://www.frijters.net/MapFileGenerator.java [2]: https://java.sun.com/doc...
That always depends on your data-set. I for one had surprisingly good results by using the CRC32 of the string. Works very good with a wide range of different input sets. Lots of good CRC32 implementations are easy to find on the net. **Edit:** Almost forgot: This page has a nice hash-function shootout with p...
I assume that you have set an event handler that catches unhandled domain exceptions and thread exceptions. In that delegate you probably call the trace listener to log the exception. Simply issue an extra call to set the exception context. [STAThread] private static void Main() { // Add the e...
I also have a hard drive with a bunch of VSS projects that I want to move to SVN projects. Couldn't you just use [Vss2Svn][1]? It sounds like this will convert VSS projects to SVN, but I have not tried it and have not heard anything about it. Has anyone tried this to move from VSS to SVN? Or is it better to do it...
doesn't matter what you select in an exists clause. most people do select *, then sql server automatically picks the best index
I would strongly recommend Hibernate for the following reasons: - The most widely used and respected open source persistence layer in the Java world; huge active community and lots of use in high volume mission critical applications. - You don't tie yourself to J2EE or a specific vendor at all should you wish t...
map and multimap class templates store pairs of keys and values.
std::pair comes in handy for a couple of the other container classes in the STL. For example: std::map<> std::multimap<> Both store std::pairs of keys and values. When using the map and multimap, you often access the elements using a pointer to a pair.
Where can I see what Color properties in .NET like "BalnchedAlmond" look like?
|.net|colors|
I'm in the middle of writing code in .Net to draw something in my app and I need to pick a color to use. But what does the color "Chartreuse" look like? Isn't there a nice bitmap that shows what each of the system colors look like somewhere? Thanks!
Where can I see what Color properties in .NET like "BlanchedAlmond" look like?
Does your zip library have a parameter to treat the stream as either text or binary? It sounds like it's treating it as text and is changing the line-end delimiter (some apps do this to try and make sure it matches the target platform). If you can tell it to treat the data as binary it might help.
I tend to stick things like that in hidden fields just do a little <asp:label runat=server id=lblThingID visible=false />
For me it would depend on how sloppy my POC was. If it is something I would be ashamed to pass onto another developer, I would rewrite it. Otherwise, just go with what you got.
Try this [site][1]. [1]: http://www.blizzardskies.com/bz/colorchart.html
Try this [site][1]. This site is nice because it shows how the color will look as foreground and background color. [1]: http://www.blizzardskies.com/bz/colorchart.html
I always use style.display = "block" and style.display = "none"
Be sure you understand the idea behind a CI build. CI stands for Continuous Integration and CI builds are really intended to be throw-away builds that are performed when a developer checks code in to the source control system (or at some specified interval) to ensure that the newest changes do not break the code base (...
The Pragmatic series has two of the best books I have read to help get your head around version control. They have versions for [SVN][1] and [CVS][2]. I really like their chapters on tags and branches. [1]: http://www.amazon.com/Pragmatic-Version-Control-Subversion-Starter/dp/0977616657/ref=pd_bbs_sr_1?ie=UTF8&s...
Quick answer: matlab -wait -nosplash -nodesktop -r waitHello In Matlab 7.1 (the version I have) there is an undocumented command line option -wait in matlab.bat. If it doesn't work for your version, you could probably add it in. Here's what I found. The command at the bottom that finally launches matlab is (l...
Some differences (that are more substantial than syntactical) that suitably catch me out sometimes: - VB.NET does not have anonymous delegates - Unsafe code blocks aren't in VB.NET
True true, You are right of course.. But there is a whole new generation of programmers being born into this world that will never touch unmanaged code, and I do believe language definitions will re-invent itself over and over again. Memory leaks in WPF are in this way different than say C/Cpp. Or course to my ma...
In a scenario where I have multiple file assemblies (i.e. 1 exe and 5 dlls) I will use a different file version for each, but the same assembly version for all of them, allowing you to know which exe each of the dlls go with.
How about this: [Spawning the next generation of hackers](http://vodpod.com/watch/914464-inspirational-oscon-keynote) by Nat Torkington.
Run Profiler and filter for queries that take more than a certain number of reads. For the application I worked on, any non-reporting query that took more than 5000 reads deserved a second look. Your app may have a different threshold, but the idea is the same.
HTTP has many advantages over FTP: - it is available in more places (think workplaces which block anything other than HTTP/S) - it works nicely with proxies (FTP requires extra settings for the proxy - like making sure that it allows the CONNECT method) - it provides built-in compression (with GZIP) which al...
Well that (the manager bit) I can certainly understand, and sympathize with. But whatever Microsoft calls it, I don't think a "new" definition is appropriate. It's complicated, because we don't live in a 100% managed world (even though Microsoft likes to pretend that we do, Microsoft itself does not live in such a w...
I've used JCS (http://jakarta.apache.org/jcs/) and it seems solid and easy to use programatically.
Boost has an [boost::hash][1] library which can provides some basic hash functions for most common types. [1]: http://www.boost.org/doc/libs/1_36_0/doc/html/hash.html
I've found Hibernate to be fairly well documented, and well supported by the various caching technologies. I've also used it quite a bit more than the others in non-JPA contexts, so perhaps I'm a bit biased towards it because of that. The few little toy projects that I've tried with TopLink Essentials worked out pr...
The solution is simple. It's actually well documented, but not too easy to find. (I had to dig around--it didn't come up when I tried a few different Google searches.) See [http://docs.djangoproject.com/en/dev/ref/templates/api/#configuring-the-template-system-in-standalone-mode][1]. The following code works: ...
From some old code of mine: /* magic numbers from http://www.isthe.com/chongo/tech/comp/fnv/ */ static const size_t InitialFNV = 2166136261U; static const size_t FNVMultiple = 16777619; /* Fowler / Noll / Vo (FNV) Hash */ size_t myhash(const string &s) { size_t hash = Init...
use `date.getFullYear()`
use `date.getFullYear()`. This is (as correctly pointed out elsewhere) is a Y2K thing. Netscape (written before 2000) originally returned, for example `98` from `getYear()`. Rather than return to `00`, it instead returned `100` for the year 2000. Then other browsers came along and did it differently, and everyone wa...
Other than NIO (RTMP) channels, LCDS include also the "data management" features. Using this feature, you basically implement, in an ActionScript class, a CRUD-like interface defined by LCDS, and you get: * automatic progressive list loading (large lists/datagrids loads while scrolling) * automatic crud managem...
How do I connect to a database and loop over a recordset in C#?
|database|connection|
What's the simplest way to connect and query a database for a set of records in C#?
|c#|database|connection|
Try enabling [Interop logging][1]. Also, if you have access to the code of the native dll you are using, check this out: [http://msdn.microsoft.com/en-us/netframework/bb630228.aspx][2] [1]: http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx [2]: http://msdn.microsoft.com/en-us/netframework/bb630...
> 1) does it make sense to do a GUI in winforms but the expensive stuff in native, unmanaged C/C++ ? Most likely not. Unless you're communicating with a lot of other native C dlls or so on, C# is likely to be between 5% slower to 5% _faster_ than C++ (std::string really kills you if you're using it) > 2) any reco...
[Cmrepair](http://www.cmstory.com/_cm/CMrepair.zip) is an excellent freeware utility to repair corrupted .DBF files.
As a rule, if you have to ask this question, it is a bad idea.
I don't like using underscores as prefixes for any identifiers, because C and C++ both reserve certain underscore prefixes for use by the implementation. I think using "self.variable" is ugly. In general, I use unadorned identifiers (that is, no prefixes nor suffixes) for instance variables. If your class is so ...
If you are in the .NET environment then the solution is [Tarantino][1]. It handles all of this (including which sql scripts to install) in a NANT build. [1]: http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/08/04/manage-sql-databases.aspx
Personally, I follow the Cocoa naming conventions, using camel-casing for functions and variables, and capitalized camel-casing for object names (without the leading NS of course). I find type prefixing makes code more opaque to anyone who didn't write it (since everyone invariably uses different prefixes), and in a...
I'd focus on the shared memory locks first (the mutexes and semaphores) as they are most likely to cause issues. Look at which state is being protected by locks and then determine which state is under the protection of several locks. This will give you a sense of potential conflicts. Look at situations where code that ...
Refactor the existing code into the solution.
PostgreSQL syntax : DROP TABLE ObjectState; CREATE TABLE ObjectState ( object_id integer not null,--foreign key event_time timestamp NOT NULL, state varchar(10) NOT NULL, --Other fields CONSTRAINT pk_ObjectState PRIMARY KEY (object_id,event_time) ); ...
What are you wanting to represent it as? Arc seconds? Then 60 min in every degree, 60 seconds in every minute. You would then have to keep E and N by yourself. This is not how it's done generally though. The easiest representation I've seen to work with is a point plotted on the globe on a grid system that h...
Join doesn't do it for me. I hate having to de-tangle the data on the client side. All those nulls from left-joining. Here's a set-based solution that doesn't use Joins. INSERT INTO @LocalCollection (theKey) SELECT id FROM Table1 WHERE ... SELECT * FROM Table1 WHERE id in (...
std::for_each might be a better candidate for this. 1) After being copied in the same function object is used on each element and after all elements are processed a copy of the potentially updated function object is returned to the user. 2) It would improve the readability of the call in my opinion as well. Th...
If its a simple id will choose to pass it in querystring, that way you do not need to do postbacks and page is more accessible for users and search engines.
Just a guess: the handler specified in IIS7's %windir%\system32\inetsrv\config\applicationhost.config which is handling your request is not allowing the POST verb to get through at all, and it is evaluating that rule before determining whether the URL doesn't exist.
I have used and would highly recommend [pyglet][1], which provides 2D sprite graphics, hooks into OpenGL effects, audio support, file asset management, and excellent text layout and display support (not something you always find in a 2D game library). The API is sane, well-documented, and easy to get started with, and ...
You are unlikely to run into a stack overflow with unthreaded compiled C unless you do something particularly egregious like have runaway recursion or a cosmic memory leak. However, your simulator probably has a threading package which will impose stack size limits. When you start a new thread it will allocate a chun...
Browsers don't really like you to mess around with file inputs, but it's possible to do this. I've seen a couple of techniques, but the simplest is to absolutely position the file input over whatever you want to use as a button, and set its opacity to zero or near-zero. This means that when the user clicks on the image...
If you don't mind using javascript you can set the opasity of the file-input to 0, place your styled control on top via z-index and send clickevents from your button to the file-input. See here for the technique: http://www.quirksmode.org/dom/inputfile.html
>> In a similar vein, is .NET a language or a framework, and what exactly does "framework" mean here? << .NET is Microsoft's current enterprise software platform. It consists of: • A single universal interface for accessing Windows functionality: o The .NET Framework Class Library (FCL). o The FCL pro...
You can use a Flash uploader like [SWFupload][1] to do this, as well. [1]: http://swfupload.org/
I don't think you are alone in being confused about what .Net is. There are already other answers that should have you covered but I'll throw out this tidbit of info for others. To see what .Net "really" is simply go to c:\Windows\Microsoft.Net\Framework In there you'll see folders that are specfic to the versio...
That sounds like a privacy setting issue to me. Either increase your security settings in IE (which you won't be able to convince your users to do), or take another approach.
When you use SELECT 1, you clearly show (to whoever is reading your code later) that you are **testing** whether the record exists. Even if there is no performance gain (which is to be discussed), there is gain in code readability and maintainability.
I use Hibernate. It's very mature and works very nicely. I personally haven't used any of the others, but I do know that Hibernate is one of the most fully featured JPA providers out there. Also because so many people are using it, just about every problem I've had with it, I can quickly find an solution with a littl...
It's a bit of a workaround solution, but you can create a scheduled task that runs as your user account, and have it run regularly, maybe once every minute. Yes, you'll have to wait for it to run then. This task can then look for some data files to process, and do the real work only if they are there.
Take a look at the [Maven dependency plugin][1], specifically, the [dependency:copy-dependencies goal][2]. Take a look at [the example][3] under the heading **The dependency:copy-dependencies mojo**. Set the **outputDirectory** configuration property to ${basedir}/target/lib (I believe, you'll have to test). Hope ...
I agree with the compacity of the wsitch solution but IMO you're **hijacking the switch** here. The purpose of the switch is to have **different** handling depending on the value. If you had to explain your algo in pseudo-code, you'd use an if because, semantically, that's what it is: **if whatever_error do this...
I agree with the compacity of the switch solution but IMO you're **hijacking the switch** here. The purpose of the switch is to have **different** handling depending on the value. If you had to explain your algo in pseudo-code, you'd use an if because, semantically, that's what it is: **if whatever_error do this...
Disclaimer: work for product I am recommending [Atalasoft][1] has a .NET library that can read PDF and write TIFF -- we are a partner of FOXIT, so the PDF rendering is very good. [1]: http://www.atalasoft.com
BTW, different browsers might return different results, so it's better to skip this function altogether and and use getFullYear() always.
You can install [GnuWin32][1] and use *nix commands natively on windows. I install this before I install anything else on a minty fresh copy of windows. :) [1]: http://gnuwin32.sourceforge.net/
As you already kind of hinted at, the answer is, "It Depends" Starting over is good because you can help trim out the stuff that was added while you were initially working out the kinks but isn't really needed. It also gives you a chance to give more consideration to how you want the architecture to be -- without...
[rsync][1]. All the time. The biggest benefit to rsync is that it trades increased CPU time for decreased transfer bandwidth, as CPUs are super fast nowadays, and even disk-copy is relatively slow, this is a good thing. [1]: http://samba.anu.edu.au/rsync/
run sp_who, find the spid with the database name you require, kill the spid.
Once every while this happens to me as well. It seems like a bug or something, as when I replicate the scenario the exception is caught and shown as usual.
robocopy. It's in Vista, and is also part of the Windows Resource Kit. It has a strange command line interface, but it's very powerful & good for this kind of thing. Still, I find myself wondering whether source control would be a better choice for you.
What is the Liskov Substitution Principal?
|liskov-substitution-principle|oop|
What is the Liskov Substitution Principle?