instruction
stringlengths
0
30k
Reuse of SQL stored procedures across applications
|sql|architecture|stored-procedures|code-reuse|
I'm curious about people's approaches to using stored procedures in a database that is accessed by many applications. Specifically, do you tend to keep different sets of stored procedures for each application, do you try to use a shared set, or do you do a mix? On the one hand, reuse of SPs allows for fewer changes ...
How to get all file attributes including author, title, mp3 tags, etc, in one sweep
|c#|.net|
I would like to write all attributes of my files in folder to a csv file.
I would like to write all attributes of my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. This can also be a script.
|c#|.net|perl|vb|
I would like to write all meta data of my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#) This can also be a script (vb, perl) Update: by looking at libextractor (thank you) I can see this can b...
|c#|.net|perl|vb|file-system|
I would like to write all meta data (including advanced summary properties) for my files in a windows folder to a csv file. Is there a way to collect all the attributes? I see mp3 files have a different set of attributes compared to jpg files. (c#) This can also be a script (vb, perl) Update: by looking at libe...
Last I checked, [SharpDevelop][1] has one and it is open source too. [1]: http://www.icsharpcode.net/OpenSource/SD/
I would imagine automatically stubbing out test functions would be more of a function (of scripts for the framework or) the development environment in question. Supposedly CodeGear's C++Builder applications will quickly generate test code for user functions.
[SharpDevelop][1] has a built-in translator between C# and VB.NET. Is not perfect thought (e.g. the optional values in VB.NET doesn't have an equivalent in C#, so the signature of the converter method must be edited), but you can save some time, as you are making all operations inside an IDE and not a webpage (copy C# ...
Many years ago, I made the quickest progress in this area using Visual Basic. I assume it's still dead easy to pick up and the code/run/debug cycle is insanely productive and you'll learn a lotta useful stuff fast. Tons of documentation, and all the other goodies you want...
require 'sha1' srand seed = "--#{rand(10000)}--#{Time.now}--" Digest::SHA1.hexdigest(seed)[0,8]
You might be in Full recovery model mode - if you are doing regular backups you can change this to simple and it will reduce the size of the log after the backup. Here is [some more info][1]. [1]: http://support.microsoft.com/kb/873235
It just lets you use a reserved word as a variable name. Not recommended IMHO (except in cases like you have).
*Never* ask "Are you sure?". Just allow unlimited, reliable undo/redo.
You can just use the Universal Expression Language itself. You need an implementation (but there are a few to choose from). After that, you need to implement three classes: ELResolver, FunctionMapper and VariableMapper. This blog post describes how to do it: [Java: using EL outside J2EE][1]. [1]: http://illeg...
If portability is an issue, you may want to check out [STLport][1]. [1]: http://www.stlport.org/
It simply allows you to use reserved words as variable names. I wanted a var called `event` the other day. I was going to go with `_event` instead, but my colleague reminded me that I could just call it `@event` instead.
If you do not have hight security constraints (so nobody will access you data a way you don't want to) and you have a good documentation or well trained coders (so they don't need the interpreter / compiler to tell them what to do), then no, it's useless. For most medium size projects, duck typing is all you need.
MSDN has a pretty good writeup here: <http://msdn.microsoft.com/en-us/library/s7ee2dwt(VS.71).aspx> You should take a look at the data-reader for simple select-statements. Sample from the MSDN page: SqlCommand myCMD = new SqlCommand("SELECT CategoryID, CategoryName FROM Categories;" + ...
MSDN has a pretty good writeup here: <http://msdn.microsoft.com/en-us/library/s7ee2dwt(VS.71).aspx> You should take a look at the data-reader for simple select-statements. Sample from the MSDN page: SqlCommand myCMD = new SqlCommand("SELECT CategoryID, CategoryName FROM Categories;" + ...
There's already a lot about how to not leak, but if you need a tool to help you track leaks take a look at: - [BoundsChecker][1] under VS - MMGR C/C++ lib from FluidStudio [http://www.paulnettle.com/pub/FluidStudios/MemoryManagers/Fluid_Studios_Memory_Manager.zip][2] (its overrides the allocation methods and ...
I would definitely agree with your suggestion of writing a small script to produce your SQL with a query for every column. In fact your script could have already been finished in the time you've spent thinking about this magical query (that you would use only one time and then throw away, so what's the use in making...
I'd recommend using [Dev C++][1]. It's a small and lightweight IDE that uses the mingw ports as the backend, meaning you'll be compiling the the defacto C/C++ compiler, [gcc][2] [1]: http://www.bloodshed.net/devcpp.html [2]: http://gcc.gnu.org/
You could effectively fake a multi-color scatter plot by using a line plot with white lines and colored [shape markers][1] at the points you want to display. [1]: http://code.google.com/apis/chart/#shape_markers2
This may not be "elegant", but you could setup a scheduled task that executes a batch script. The script would essentially "touch" the web.config (or some other file that causes a re-compile) for you. Otherwise, is your application cache not set to expire after N minutes?
G++ is the GNU C++ compiler. Most *nix distros should have the package available.
Exceptions are a somewhat costly effect, if for example you have a user that provides an invalid password, it is typically a better idea to pass back a failure flag, or some other indicator that it is invalid. This is due to the way that exceptions are handled, true bad input, and unique critical stop items should b...
If you are trying to join across tables linked by ForeignKeys or ManyToManyField relationships then you can use the double underscore syntax. For example if you have the following models: class Foo(models.Model): name = models.CharField(max_length=255) class FizzBuzz(models.Model): bleh ...
If you are trying to join across tables linked by ForeignKeys or ManyToManyField relationships then you can use the double underscore syntax. For example if you have the following models: class Foo(models.Model): name = models.CharField(max_length=255) class FizzBuzz(models.Model): bleh ...
|xslt|
I had data in XML that had line feeds, spaces, and tabs that I wanted to preserve (so I couldn't use &lt;p&gt;) but I also wanted the lines to wrap when the side of the screen was reached (so I couldn't use &lt;pre&gt;).
I had data in XML that had line feeds, spaces, and tabs that I wanted to preserve in the output HTML (so I couldn't use &lt;p&gt;) but I also wanted the lines to wrap when the side of the screen was reached (so I couldn't use &lt;pre&gt;).
See [System.Web.Routing][1] Routing is a different from rewriting. Implementing this technique does require minor changes to your pages (namely, any code accessing querystring parameters will need to be modified), but it allows you to generate links based on the routes you define. It's used by ASP.NET MVC, but can b...
**new modifier** Usage of the "new" modifier in C# is not exactly hidden but it's not often seen. The new modifier comes in handy when you need to "hide" base class members and not always override them. This means when you cast the derived class as the base class then the "hidden" method becomes visible and is calle...
As far as I know there is no possible way for a server side script to detect that. It simply does not get sent to the server. It must be done client-side (i.e. With Javascript) and then sent to the server.
I have used three of the methods outlined above. When I first used threading in c++ I used *static member functions*, then *friend functions* and finally the *BOOST libraries*. Currently I prefer BOOST. Over the past several years I've become quite the BOOST bigot. BOOST is to C++ as CPAN is to Perl. :)
Sequence Diagram Reverse Engineering
|reverse|engineering|uml|sequence|diagram|
I'm looking for a tool that will reverse engineer into a sequence diagram BUT also provides the ability to filter out calls to certain libraries. For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which clutter up the diagram to the point it is unusable. An...
|java|hibernate|web-applications|jdbc|
I'm writing a report view of an audit trail, and I need display this in a .jsp. What's the "best" way to get the data from the database to the screen? We're using Spring for dependency injection, Data Access Objects, and Hibernate. I can use hibernate or straight jdbc for this report. If I load all the records i...
Part of the problem is that so many fractions aren't actually easily construed as fractions. E.g. 0.33 isn't 1/3, it's 33/100. But if you remember your elementary school training, then there is a process of converting decimal values into fractions, however it's unlikely to give you what you want since most of the time ...
Part of the problem is that so many fractions aren't actually easily construed as fractions. E.g. 0.33 isn't 1/3, it's 33/100. But if you remember your elementary school training, then there is a process of converting decimal values into fractions, however it's unlikely to give you what you want since most of the time ...
Sometimes the best way to learn is to just dig in to a framework. Sure, you could use someones wrapper API around something, but if there is something wrong w/ hibernate, then you wouldn't know what's happening. And to answer "how do i know what i should know prior to hibernate", you don't, that's why you are learni...
What is a variable's linkage and storage specifier?
|c++|c|
When someone talks about a variables storage class specifier, what are they talking about? They also often talk about variable linkage in the same context, what is that?
After reviewing the suggestions, I wound up using [HtmlUnit][1]. With HtmlUnit, I was able to customize the Java code to open each HTML file in the folder, navigate to the TABLE tag, query each column content and extract the data I needed to create a CSV file. [1]: http://htmlunit.sourceforge.net/ "HtmlUnit...
http://roundup.sourceforge.net/
Can I add new methods to the String class in Java?
|java|string|
I'd like to add a method AddDefaultNamespace() to the String class in Java so that I can type "myString".AddDefaultNamespace() instead of DEFAULTNAMESPACE + "myString", to obtain something like "MyDefaultNameSpace.myString". I don't want to add another derived class either (PrefixedString for example). Maybe the app...
[Tapestry](http://tapestry.apache.org) is a Java web app framework with an emphasis on easily creating reusable components.
[Tapestry](http://tapestry.apache.org) is a Java web app framework with an emphasis on easily creating reusable components. I have used sitemesh, and it is good for wrapping a set of pages in standard headers and footers, but Tapestry is better for creating components which are used on many pages, possibly many time...
Deadlock in ThreadPool
|ruby|multithreading|deadlock|thread-pool|
I couldn't find a decent ThreadPool implementation for Ruby, so I wrote mine (based partly on code from here: http://snippets.dzone.com/posts/show/3276 , but changed to wait/signal and other implementation for ThreadPool shutdown. However after some time of running (having 100 threads and handling about 1300 tasks), it...
MSDN has a pretty good writeup here: <http://msdn.microsoft.com/en-us/library/s7ee2dwt(VS.71).aspx> You should take a look at the data-reader for simple select-statements. Sample from the [MSDN][1] page: private static void ReadOrderData(string connectionString) { string queryString = ...
Detecting Web.Config Authentication Mode
|c#|asp.net|authentication|web-config|
Say I have the following web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <authentication mode="Windows"></authentication> </system.web> </configuration> Using ASP.NET C#, how can I detect the Mode value of the Authentication tag?
JEdit has a plugin called "XQuery" which provides querying functionality for XML documents. Not quite the command line, but it works!
Directly no, in large part because you cannot simply set the event to null. Indirectly, you could make the actual event private and create a property around it that tracks all of the delegates being added/subtracted to it. Take the following: ArrayList delegates = new ArrayList(); private event ...
That sure is weird. Do you have any timer controls on the form? If you do, try disabling it in the OnClose.
How about: i = 20 "%x" % i
Personally I work on a Java app, but I couldn't get by without perl for some supporting scripts. I've got scripts to quickly flip what db I'm pointing at, scripts to run build scripts, scripts to scrape data & compare stuff. Sure I *could* do all that with java, or maybe shell scripts (I've got some of those to...
Perfectly legal. The object will exist on the stack during the function call, just like any other local variable as well.
Problem with Java 1.6 and Desktop.open()
|java|windows|desktop|
I've been using Destop.open() to launch a .pdf viewer on Windows machines, both Vista and XP, and most of them work just fine. However, on one XP machine the call does not work, simply returning without throwing any exceptions, and the viewer does not launch. On that machine the file association is properly set up as...
There is a possibility that the message box that asks if you want to save changes is being displayed behind the form. I believe that this message box is modal so you must click yes or no before you can do anything with the form which is why you can't close it.
Do you mean it uses http basic-auth before allowing proxying, and does it then allow 'connect'. Then you should be able to tunnel over it using http-tunnel or proxytunnel
I do this by querying the system tables directly. Look into the syscolumns and sysobjects tables. You can also join across linked servers too select t1.name as tname,c1.name as cname from adventureworks.dbo.syscolumns c1 join adventureworks.dbo.sysobjects t1 on c1.id = t1.id where t1.type = 'U' order by t1.n...
It looked lke it would work, but it did not compile with g++ with the Wall option, here is what I get: <pre> michael@hardy-lenovo:~/Desktop$ g++ -Wall a.cpp a.cpp: In function ‘int main()’:michael@hardy-lenovo:~/Desktop$ g++ -Wall a.cpp a.cpp: In function ‘int main()’: a.cpp:8: warning: taking address of temporary...
Classes are for styles you may use multiple times on a page, IDs are unique identifiers that define special cases for elements. The standards say that IDs should only be used once in a page. So you should use classes for when you want to use a style on more than one element in a page, and an ID when you just want to us...
How is it possible to run a traceroute-like program without needing root privileges?
|traceroute|raw|sockets|nonadmin|
I have seen another program provide traceroute functionality within it but without needing root (superuser) privileges? I've always assumed that raw sockets need to be root, but is there some other way? (I think somebody mentioned "supertrace" or "tracepath"?) Thanks for your responses :)
|sockets|raw|traceroute|nonadmin|
I have seen another program provide traceroute functionality within it but without needing root (superuser) privileges? I've always assumed that raw sockets need to be root, but is there some other way? (I think somebody mentioned "supertrace" or "tracepath"?) Thanks!
You can always use the C++ compiler from the Gnu Compiler Collection (GCC). It is available for almost any Unix system on earth, BSDs, Mac OS, Linux, and Windows (via Cygwin or mingw). A number of IDEs are supporting the GCC C++ compiler, e.g. KDevelop under Linux/KDE, or Dev-CPP as mentioned in other posts.
For the total uploaded there doesn't seem to be a way to handle that, but there's something similar to what you want for download. Once readyState is 3, you can periodically query responseText to get all the content downloaded so far as a String (this doesn't work in IE), up until all of it is available at which point ...
Because they're things that will happen normally. Exceptions are not control flow mechanisms. Users often get passwords wrong, it's not an exceptional case. Exceptions should be a truly rare thing, UserHasDiedAtKeyboard type situations.
You need to be able to make a business case for switching, not just that "it's faster". If a site built on technology B costs 20% more in developer time for maintenance over a set period (say, 3 years), it would likely be cheaper to add another webserver to the system running technology A to bridge the performance gap...
Most C++ developers ignore the power of template metaprogramming. Check out [Loki Libary][1]. It implements several advanced tools like typelist, functor, singleton, smart pointer, object factory, visitor and multimethods using template metaprogramming extensively (from [wikipedia][2]). For most part you could consid...
<a href="http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/aa9f90e8-534d-4e74-b656-99187eb3f281/"> I found a link in the MSDN that describes this error.</a> To summarize, a naming conflict can happen between the file name of a page (TimeLogTab.aspx) and the class in the code behind (public class TimeLogTa...
ctrl-k, ctrl-k, (position to new location) ctrl-y Add a ctrl-a if you're not starting at the beginning of the line. And the 2nd ctrl-k is to grab the newline character. It can be removed if you just want the text.
[Shoes][1] for Ruby is cross platform, very easy, and is a brief introduction to building a window and handling events that happen in it. fun too :) [1]: http://www.shoooes.net
I've used [SIFT][1] to re-detect te same object in different images. It is really powerfull but rather complex, and miht be overkill. If the images are supposed to be pretty similar some simple parameters based on the difference between the two images can tell you quite a bit. Some pointers: - Normalize the images...
I was thinking exactly the same thing recently. [Qt](http://trolltech.com/products/qt) seems like a good cross platform GUI framework, and Python seems like a good language to work in. So [PyQt](http://wiki.python.org/moin/PyQt) is my (uneducated) suggestion. It does include a drag and drop GUI design tool.
Seeing as you already have knowledge of Java you should check out the Swing API [here][1], it provides a pretty powerful set of packages that can be used to create complex GUI's. Moreover, its cross platform, there's tons of documentation and it can be used with the Netbeans IDE. [1]: http://java.sun.com/docs/bo...
Have you tried running Profiler? This will allow you to view all of the running queries on the server. This may give you some insight into what is creating items in tempdb.
How can I detect if caps lock is toggled in Swing?
|java|swing|
I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on. Is this possible? And if so I'd like to have it detected before the client types their first letter.