instruction
stringlengths
0
30k
It all depends on what you want to do with the data, but in general I would want to store all data and also make sure that the semantics interpreted by the MUA are preserved in the db, so for example: - All headers that are parsed should have their own column - A column should contain the whole headers - The attachm...
You are looking for something like the following ALTER TABLE dbo.doc_exz ADD CONSTRAINT col_b_def UNIQUE column_b [MSDN Docs][1] [1]: http://msdn.microsoft.com/en-us/library/ms190273.aspx
You mighta also want to consider using a variant data type for your arguments list and then figure out what's what type using the TypeOf statement, and then call the appropriate functions when you figure out what's what...
In the management studio diagram choose the table, right click to add new column if desired, right-click on the column and choose "Check Constraints", there you can add one.
I've come across that <a href="http://developer.yahoo.com/javascript/howto-proxy.html">YDN server side proxy script</a> before. It says it's built to work with Yahoo's Search APIs. Will it work with any domain, if you simply trim the Yahoo API code out? Or do you need to replace it with the domain you want it to...
You could always use an actual table that is garrenteed to be unique. It's a kludge, but it's an option. This will not work inside a stored proc though. if exists (select * from sys.tables where name = 'tmp_TableName') drop table tmp_TableName go select * into tmp_TableName from MyTable ...
Best PHP image processing library?
How do I use PDB files
|debugging|crash|pdb|
I have heard using PDB files can help diagnose where a crash occurred. My _basic_ understanding is that you give Visual studio the source file, the pdb file and the crash information (from Dr Watson?) Can someone please explain how it all works / what is involved? (Thank you!)
Short answer: No I have not yet found one. Your options include using less complicated controls and know what html the standard controls emit. Thing like h:panelGrid render as a table. There is nothing stopping you writing your own rendering family which produces more standards compliment html, but this would be a big...
First, i suggest you to use the `object` html tag which is standardized, `embed` is not. Then you could simply hide your embeded audio using CSS instead of this `hidden` param. Even better, you should hide it using CSS through JavaScript, because if you do it this way, people who don't have JavaScript enabled but...
Well, if you listed your error codes, it might help. Off the top of my head, do you have something in Particles.h to make sure that the file is only included once? There are two methods of doing this. The first is to use #pragma once, but I think that might be Microsoft specific. The second is to use a #define. Exa...
Not sure what type of processing you're doing, but for very large XML, I've always been a fan of event-based processing. Maybe it's my Java background, but I really do like SAX. You need to do your own state management, but once you get past that, it's a very efficient method of parsing XML. http://saxdotnet.sourcef...
Some that I remember: * Keep its usage to a minimum, only use it when T-SQL proved too complex. * Avoid pointers/cursors at all costs because a for loop is so easily abusable in CLR context. * Only use the SQL-Server native data types unless totally necessary. Can't remember where I've found the information, bu...
I have not tried the Entity Framework, but I definitely would recommend NHibernate over Linq to SQL; The biggest reason I can give is just the control. Linq to SQL likes to have a lot more control over everything, loading the object and maintaining all kinds of tracking information about the object. If you serialize/...
With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators. Is there any downside to this other than expo...
|javascript|deployment|webapplications|browsers|
|javascript|deployment|webapplications|browser|
|javascript|deployment|web-applications|browser|
What to use for login ID?
|authentication|webapplications|account|
We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers. We want to move to a single namespace. But that brings the problem ...
|web-applications|authentication|account|
Best practices for managing and deploying large javascript apps
|javascript|deployment|webapplications|
What are some standard practices for managing a medium-large javascript app? My concerns are both speed for browser download and ease and maintainability of development. Our JS is roughly "namespaced" eg: var Client = { var1: '', var2: '', accounts: { /* 100's of funct...
|javascript|bestpractices|deployment|webapplications|
|javascript|deployment|web-applications|
RSS feeds from Gallery2
|php|webapp|webapplications|
There is [Phusion Passenger][1], a robust Apache module that can run [Rack][2] applications with minimum configuration. It's becoming appealing to shared hosts, and turning any program into a Rack application is ridiculously easy: > A Rack application is an Ruby **object** > (not a class) that responds to `call`. ...
How can I detect when an Exception's been thrown globally in Java?
|java|exception|
How can I detect when an Exception has been thrown anywhere in my application? I'm try to auto-magically send myself an email whenever an exception is thrown anywhere in my Java Desktop Application. I figure this way I can be more proactive. I know I could just explicitly log and notify myself whenever an except...
Domain Driven Design by Eric Evans
[Managing Gigabytes][1] is an instant classic for thinking about the heavy lifting of information. [1]: http://www.amazon.com/Managing-Gigabytes-Compressing-Multimedia-Information/dp/1558605703
Glassfish on Linux is an excellent choice.
I wrote a guide to <a href="http://jmcpherson.org/editing.html">efficient editing with Vim</a> a while back. You may find it helpful. I'd step back for a minute and ask yourself "why do I want to learn this editor? What makes me think it'll be faster or better than my current text editor?" Then learn those featur...
referring to the global scope
I think [smoofra][1] is on the right track here; you're looking to register a global hotkey with X so that you can intercept keypresses and take appropriate action. [Xlib][2] is probably what you want, and [XGrabKey][3] is the function, i think. It's not easy to learn, I'm afraid; I did locate this example that see...
Extracted fromt he SQL Server documentation: >**Maximum server memory (in MB)** > > Specifies the maximum amount of memory > SQL Server can allocate when it starts > and while it runs. This configuration > option can be set to a specific value > if you know there are multiple > applications running at the same...
If language choice is open, a Flash file created with Haxe might have a place. Haxe is free, and a full, dynamic programming language. Then there's the related Neko, a virtual machine (like Java's, Ruby's, Parrot...) to run on Mac, Windows and Linux. Being in some ways a new improved form of Flash, naturally i...
Have you upgraded to Subversion 1.5? It includes automated merge tracking. This may address your issue. It sounds like you're already familiar with the tool itself and it's free. So, if you upgrade your current solution to 1.5 you'll have almost no learning curve and zero cost - plus you won't have to go through th...
I take your point, svcutil is definetly the more advanced way of adding and updating service references. Its just a fair bit more manual work when "right click, update reference" is so close to just working in a single step. I guess we could create some batch files or something to just output the reference code. Eve...
CSS does not (yet) employ variables, which is understandable for its age and it being a declarative language. Here are two major approaches to achieve more dynamic style handling: * Server-side variables in inline css Example (using PHP): > `<style> .myclass{color:<?php echo $color; ?>;} </style>` ...
This is a translation of Mike's Ruby version, into Common Lisp: (defun perms (x y original-string) (loop with all = (list "") with current-array = (list "") for iteration from 1 to y do (loop with next-array = nil for string in current-array ...
|php|image-manipulation|
for resizing images and creating thumbnails, preferably works on most shared hosts
for resizing images and creating thumbnails, preferably works on most shared hosts. clarification: i'm looking for a PHP class/wrapper that's easy to use, so I don't have to run GD or imagemagik functions directly.
for resizing images and creating thumbnails, preferably works on most shared hosts. clarification: i'm looking for a PHP class/wrapper (eg. phpthumb, asido), so I don't have to run GD or imagemagik functions directly.
Best PHP thumbnailer/resizer class?
preferably works on most shared hosts. clarification: i'm looking for a PHP class/wrapper (eg. phpThumb, asido), so I don't have to run GD or imagemagik functions directly. I'm specifically looking for resizing and framing functions.
'foo bar "lorem ipsum" baz'.match(/"[^"]*"|\w+/g); the bounding quotes get included though
Remove border from IFrame
|html|internet-explorer-6|iframe|noborder|
How do I remove the border from an IFrame embedded in my web app? An example of the IFrame is: <IFRAME src="myURL" width=300" height="300">Browser not compatible. </IFRAME> I would like the transition from the content on my page to the contents of the IFrame to be seemless, assuming the background colors are ...
In Java, does return trump finally?
|java|return|finally|
If I have a try/catch block with returns inside it, will the finally block be called? For example: try { something(); return success; } catch (Exception e) { return failure; } finally { System.out.println "i don't know if this wi...
I also found you can do this via, the database diagrams. By right clicking the table and selecting Indexes/Keys... Click the 'Add' button, and change the columns to the column(s) you wish make unique. Change Is Unique to Yes. Click close and save the diagram, and it will add it to the table.
is there a way to write macros with a variable argument list in visual C++?
|c++|macros|variables|arguments|
As far as I know, in gcc you can write something like: #define DBGPRINT(fmt...) printf(fmt); Is there a way to do that in VC++?
Another, BSD-safe, way to do it, with arrays (why not?) #!/bin/bash ARRAY=( `ls -td */` ) ELEMENTS=${#ARRAY[@]} COUNTER=4 while [ $COUNTER -lt $ELEMENTS ]; do echo ${ARRAY[${COUNTER}]} let COUNTER=COUNTER+1 done
Is it ok to have multiple threads writing the same values to the same variables?
|multithreading|
I understand about race conditions and how with multiple threads accessing the same variable, updates made by one can be ignored and overwritten by others, but what if each thread is writing the same value (not different values) to the same variable; can even this cause problems? Could this code: GlobalVar.property ...
Activestate Perl has been considered the defacto windows perl for quite a while. While it has a lot of flaws and a lot of us use something else, it remains very popular. If you were building perl code to be executed on a windows machine (other than your own), I would consider writing it with an eye towards a default (o...
What about a web site or a web page's structure would cause a visitor to return to the top of the previous page, instead of to the point in the page where the link resides?
|html|browser|weird|
I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the previous page, not at the link. This is very annoying if I'm clicking on links in a search results page or a list of "10 Best Foo Bar...
I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the previous page, not at the link. This is very annoying if I'm clicking on links in a search results page or a list of "10 Best Foo Bar...
Finding the Variable Name passed to a Function in C#
|c#|
Let me use the following example to explain my question: public string ExampleFunction(string Variable) { return something; } string WhatIsMyName = "Hello World"'; string Hello = ExampleFunction(WhatIsMyName); When I pass the variable "WhatIsMyName" to the example function, I want to...
Eliminate duplicate lines from a file #sort -u filename > filename.new List all lines that do not match a condition #grep -v ajsk filename These are not necessarily Bash specific (but hey neither is `ls -thor` :) ) Some other useful cmds: prtdiag, psrinfo, prtconf - more info [here][1] and [he...
[Java Technology Insider][1] is what I found when I went looking for a Java equivalent of .NET Rocks! The interviewer is an enthusiastic amateur, and the guests are usually good. [1]: http://www.javaworld.com/podcasts/jtech/
Can an fdopen() cause a memory leak?
|file-io|memory-leaks|stream|
I use fdopen to associate a stream with an open file. When I close() the file, is the stream automatically disassociated as well, and all stream memory returned to the OS, or do I need to be aware of the fdopen'd file and close it in a specific manner? -Adam
Try unison if the task is recurring. http://www.cis.upenn.edu/~bcpierce/unison/
[Subversion][1] handles binary files really well, is pretty fast, and scriptable. [VisualSVN][2] and [TortoiseSVN][3] make dealing with Subversion very easy too. You could set up a folder that's checked out from Subversion with all your binary files (that all developers can push and update to) then just type "svn u...
Having the thread set a flag (or signal an event) before it exits is a race condition. The thread has not necessarily returned to the OS yet, and may still be executing. For example, consider a program that loads a dynamic library (pseudocode): lib = loadLibrary("someLibrary"); fun = getFunction("someFu...
`od -a $file` is useful to explore those types of question on Linux (similar to dumphex in the above).
pwd can be used to find the current working directory, and dirname to find the directory of a particular file (command that was run, is $0, so dirname $0 should give you the directory of the current script). However, dirname gives precisely the directory portion of the filename, which more likely then not is going t...
I have been using the free controls in various small internal projects for work for several years. I started following his blog just as he started as MicroISV, from a mention on a MicroISV blog. So I have been through many improvments he has made. The controls he makes are rock solid (at least in my usage of them) and ...
I agree with creating multiple thread dumps and viewing them though this: [Thread Dump Analyzer][1] [1]: http://today.java.net/pub/n/TDA1.1
Also you can take a look at [Google Charts CPAN module](http://search.cpan.org/perldoc?Google::Chart) use Google::Chart; my $chart = Google::Chart->new( type => "Bar", data => [ 1, 2, 3, 4, 5 ] ); print $chart->as_uri, "\n"; # or simply print $chart, "\n" ...
Another vi command that'll do: `:%s/.$//`
Another vi command that'll do: `:%s/.$//` This removes the last character of each line in the file. The drawback to this search and replace command is that it doesn't care what the last character is, so be careful not to call it twice.
Presumably you use SSL to protect users from man-in-the-middle or other attacks, yes? SSLv2 is useless for this. Disable it -- the number of users who use a browser without SSLv3 or TLS support is vanishingly small, and it's easier to make them somebody else's problem than explain why somebody in Nigeria is using their...
Life cycle of custom controls does not match up perfectly with page life cycle events of same name.
> The only thing that I'm suspicious on is that the server has two Database engines: SERVER and server\sqlexpress I think this is the source of the problem. Which one do you intend to connect to? You need to specify the "instance" you are connecting to. Assuming you intend to connect to the SERVER instance, you...
After a couple hours fighting with the [Gallery2](http://gallery.menalto.com/) [RSS module](http://codex.gallery2.org/Gallery2:Modules:rss) and getting only the message, "no feeds have yet been defined", I gave up. Based on [a Google search for "no feeds have yet been defined"](http://www.google.com/search?q=%22no+fee...
After a couple hours fighting with the [Gallery2](http://gallery.menalto.com/) [RSS module](http://codex.gallery2.org/Gallery2:Modules:rss) and getting only the message, "no feeds have yet been defined", I gave up. Based on [a Google search for "no feeds have yet been defined"](http://www.google.com/search?q=%22no+fee...
|php|web-applications|
JRuby / Rack deployment
|ruby|rack|deployment|webdeploymentproject|webdevelopment|
I know this is pretty exotic, but I want to deploy a Ruby web application (not Rails, but Rack based, so it plugs into most Ruby servers just fine) using JRuby. Google and friends give me a few success stories, but mostly rails related and if not, no details on the deployment are provided. The framework I'm using is Ra...