instruction stringlengths 0 30k ⌀ |
|---|
What platform?
On Mac OS X I have installed [msmtp][1] and created a post-commit script under hooks in the repository. A .msmtprc file needs to be setup for the svn (or www) user.
REPOS="`echo $1 | sed 's/\/{root of repository}//g'` "
REV="$2"
MSG=`/usr/local/bin/svn log -v -r HEAD https://localhost$REPOS`
/usr/local/bin/msmtp {list of recipents} <<EOF
Subject: SVN-Commit $REPOS#$REV
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit
$MSG
EOF
Make {root of repository} and {list of recipents} specific for your needs. Note I have used UTF8 because we have some special characters here in sweden (åäö)
[1]: http://msmtp.sourceforge.net/ |
|python|sql|optimization|olap|aggregate| |
I need a real DBA's opinion here, my SQL aggregate query is conspicuously slow.
Using Postgres 8.3 I've built a table with 350,000 rows (responses to a survey):
CREATE TABLE tuples (id integer primary key, a integer, b integer, c integer, d integer);
\copy tuples from 'responses.csv' delimiter as ','
On my Macbook Pro it takes about 200 ms to execute this query:
SELECT count(id), avg(a),avg(b),avg(c), avg(d) FROM tuples;
I assumed that databases were really darn good at simple queries like this, but obviously I'm missing something...
I wrote some tests in Java and Python for context and they crush SQL (except for pure python):
java 1.5 threads ~ 7 ms
java 1.5 ~ 10 ms
python 2.5 numpy ~ 18 ms
python 2.5 ~ 370 ms
Even sqlite3 is competitive with Postgres despite it assumping all columns are strings (for contrast: even using just switching to numeric columns instead of integers in Postgres results in 10x slowdown)
Tunings i've tried without success include (blindly following some web advice):
increased the shared memory available to Postgres to 256MB
increased the working memory to 2MB
disabled connection and statement logging
used a stored procedure via CREATE FUNCTION ... LANGUAGE SQL
So my question is, is my experience here normal, and this is what I can expect when using a SQL database? I can understand that ACID must come with costs, but this is kind of crazy in my opinion. I'm not asking for realtime game speed, but since Java can process millions of doubles in under 20 ms, I feel a bit jealous.
Is there a better way to do simple OLAP on the cheap (both in terms of money and server complexity)? I've looked into Mondrian and Pig + Hadoop but not super excited about maintaining yet another server application and not sure if they would even help.
|
I need a real DBA's opinion. Postgres 8.3 takes 200 ms to execute this query on my Macbook Pro while Java and Python perform the same calculation in under 20 ms (350,000 rows):
SELECT count(id), avg(a), avg(b), avg(c), avg(d) FROM tuples;
Is this normal behaviour when using a SQL database?
The schema (the table holds responses to a survey):
CREATE TABLE tuples (id integer primary key, a integer, b integer, c integer, d integer);
\copy tuples from '350,000 responses.csv' delimiter as ','
I wrote some tests in Java and Python for context and they crush SQL (except for pure python):
java 1.5 threads ~ 7 ms
java 1.5 ~ 10 ms
python 2.5 numpy ~ 18 ms
python 2.5 ~ 370 ms
Even sqlite3 is competitive with Postgres despite it assumping all columns are strings (for contrast: even using just switching to numeric columns instead of integers in Postgres results in 10x slowdown)
Tunings i've tried without success include (blindly following some web advice):
increased the shared memory available to Postgres to 256MB
increased the working memory to 2MB
disabled connection and statement logging
used a stored procedure via CREATE FUNCTION ... LANGUAGE SQL
So my question is, is my experience here normal, and this is what I can expect when using a SQL database? I can understand that ACID must come with costs, but this is kind of crazy in my opinion. I'm not asking for realtime game speed, but since Java can process millions of doubles in under 20 ms, I feel a bit jealous.
Is there a better way to do simple OLAP on the cheap (both in terms of money and server complexity)? I've looked into Mondrian and Pig + Hadoop but not super excited about maintaining yet another server application and not sure if they would even help.
|
I create a the [stackoverflow tag feeds pipe](http://pipes.yahoo.com/pipes/pipe.info?_id=uP22vN923RG_c71O1ZzWFw). You can list your tags of choice into the text box and it will combine them into a single feed with all the unique posts. It escapes `'#'` and `'+'` characters for you.
Alternatively, you can use the pipe's rss feed by appending your html-encoded tags separated by `'+'`s:
http://pipes.yahoo.com/pipes/pipe.run?_id=uP22vN923RG_c71O1ZzWFw&_render=rss&tags=.net+c%23+powershell
[Thanks to everyone for suggesting [Yahoo Pipes](http://pipes.yahoo.com/pipes/)! Had heard of it before, but never tried it until now :-] |
I create a the [stackoverflow tag feeds pipe](http://pipes.yahoo.com/pipes/pipe.info?_id=uP22vN923RG_c71O1ZzWFw). You can list your tags of choice into the text box and it will combine them into a single feed with all the unique posts. It escapes `'#'` and `'+'` characters for you.
Alternatively, you can use the pipe's rss feed by appending your html-encoded tags separated by `'+'`s:
http://pipes.yahoo.com/pipes/pipe.run?_id=uP22vN923RG_c71O1ZzWFw&_render=rss&tags=.net+c%23+powershell
Unfortunatley, though, this seems to strip out the content of the posts. The content is visible in the debug view, but the output only contains the post title.
[Thanks to everyone for suggesting [Yahoo Pipes](http://pipes.yahoo.com/pipes/)! Had heard of it before, but never tried it until now :-] |
The best thing I could recommend is the [Internet Explorer Developer Toolbar][1] which allow you to view changes in the DOM.
[1]: http://www.microsoft.com/downloads/details.aspx?FamilyId=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en |
I'm guessing your question is about arranging the system so you don't have to work as:
1. Select all the top level comments
2. Select all comments whose parents were found in the step prior
3. Select all comments whose parents were found in the step prior
4. ... repeat until no comments found
I would suggest desiging the db table with a thread key which would be string of all the parents of that post. You'd have to limit your discussion to a certain depth, but your sql statements would be straight selects and order by the thread key, giving you back threaded comments. Less taxing on your DB and Webserver.
A thread key would be something like it's current post id joined onto it's parent's thread key with a delimiter.
How does that sound? |
How do I Send Email from the Command Line? |
|email|command-line| |
I would like to quickly send email from the command line. I realize there are probably a number of different ways to do this.
I'm looking for a simple way to do this from a linux terminal (likely a bash shell but anything should do) and an alternative way to do this on Windows. I want to be able to whip up an email right on the command line or have the flexibility to pipe the message into the command line program. How would you go about doing this? If you have small scripts that would be fine as well.
Thanks in advance. |
Detect DOM modification in Internet Explorer BHO |
|internet-explorer|internet-explorer-7|bho| |
Use aspnet_setreg.exe http://support.microsoft.com/kb/329290 |
How would I allow a user to stream video to a web application for storage? |
|java|flash|web-applications|applet| |
I'd like to add some functionality to a site that would allow users to record video using their webcam and easily store it online. I don't even know if this is possible right now, but I think flash has access to local webcams running through the browser.
Do you have any suggestions or resources to get me started on this? I'm primarily a java developer so If I could do it in an applet that would be great, but It may be easier to accomplish this using flash or some other technology.
This would mean streaming the video back to the webserver and storing it there.
Uploading a file is easy enough, but I'd rather the user not have to deal with that if it's possible.
Just to be clear. I'm not talking about uploading a video. I'm talking about allowing the user to click "record" in a web application and having the video streamed to the server and stored when the user clicks "stop".
|
Linq to SQL - Accessing System Databases/Tables? |
|c#|sql-server|linq|linq-to-sql| |
Right now I have an SSIS package that runs every morning and gives me a report on the number of packages that failed or succeeded from the day before. The information for these packages is contained partly within the <code>sysjobs</code> table (a system table) within the <code>msdb</code> database (a system database) in SQL Server 2005.
When trying to move the package to a C# executable (mostly to gain better formatting over the email that gets sent out), I wasn't able to find a way to create a dbml file that allowed me to access these tables through Linq. I tried to look for any properties that would make these tables visible, but I haven't had much luck.
Does anyone know if this is possible with Linq to SQL? |
You must synchronize, but on certain architectures there are efficient ways to do it.
Best is to use subroutines (perhaps masked behind macros) so that you can conditionally replace implementations with platform-specific ones.
The Linux kernel already has some of this code. |
Encrypting appSettings in web.config |
|encryption|security|settings| |
I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.
I know the .Net framework will not allow a web.config file to be served, however I still think its bad practice to leave this sort of information in plain text.
Everything I have read so far requires me to use a command line switch or to store values in the registry of the server. I have access to neither of these as the host is online and I have only FTP and Control Panel (helm) access.
Can anyone recommend any good, free encryption DLL's or methods which I can use? I'd rather not develop my own! |
|security|encryption|settings| |
MS SQL FTI - searching on "n*" returns numbers |
|sql-server| |
This seems like odd behaviour from SQL's full-text-index.
FTI stores number in its index with an "NN" prefix, so "123" is saved as "NN123".
Now when a user searches for words beginning with N (i.e. contains "n*" ) they also get all numbers.
So:
select [TextField]
from [MyTable]
where contains([TextField], '"n*"')
Returns:
<pre>
MyTable.TextField
--------------------------------------------------<span style="color:#777777;">
This text contains the word <b style="color:red;">n</b>avigator
This text is <b style="color:red;">n</b>ice
This text only has 123, and shouldn't be returned</span>
</pre>
Is there a good way to exclude that last row? Is there a consistent workaround for this? |
|sql-server|full-text-search| |
This seems like odd behaviour from SQL's full-text-index.
FTI stores number in its index with an "NN" prefix, so "123" is saved as "NN123".
Now when a user searches for words beginning with N (i.e. contains "n*" ) they also get all numbers.
So:
select [TextField]
from [MyTable]
where contains([TextField], '"n*"')
Returns:
<pre>
MyTable.TextField
--------------------------------------------------<span style="color:#777777;">
This text contains the word <b style="color:red;">n</b>avigator
This text is <b style="color:red;">n</b>ice
This text only has 123, and shouldn't be returned</span>
</pre>
Is there a good way to exclude that last row? Is there a consistent workaround for this?
----------
Those extra "" are needed to make the wildcard token work:
select [TextField] from [MyTable] where contains([TextField], 'n*')
Would search for literal n* - and there aren't any.
--return rows with the word text
select [TextField] from [MyTable] where contains([TextField], 'text')
--return rows with the word tex*
select [TextField] from [MyTable] where contains([TextField], 'tex*')
--return rows with words that begin tex...
select [TextField] from [MyTable] where contains([TextField], '"tex*"')
|
You don't know where the string literals are stored. It may even be read-only memory, so your code should read:
const char* c = "string";
And a *new* char array should be *delete*d just like any other dynamically allocated memory area. |
Try [Laconica](http://laconi.ca/): An open source Twitter-like system you could run on your own servers. |
They're not the same. Your first example is a constant string, so it's definitely not allocated from the heap. Your second example is a runtime memory allocation of 6 characters, and that comes from the stack. You don't want to delete your first example, but you need to **delete []** your second example. |
>I assume when I do char* = "string" its the same thing as char* = new char[6].
No. What the first one does is create a constant. Modifying it is undefined behaviour. But to answer your question; no, you don't have to destroy them. And just a note, always use `std::string` whenever possible. |
There is a (large) example written in Perl included in the Subversion source (it can be [viewed here](http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/commit-email.pl.in)). |
You could use this perl command.
Perl -lne 's/[,|"]//; print' file.txt > newfile.txt
You may need to play around with it a bit, but it should do the trick. |
take a look at the syslockinfo and syslocks system tables
you can also run the sp_lock proc |
aargh, just being an idiot:
SELECT name, lockscheme(name)
FROM sysobjects
WHERE type="U"
ORDER BY name |
It's been a <i>long</i> time since I've done any GBA programming, but as I recall, the DS supports most (if not all) of the stuff that GBA supports. [This](http://www.coranac.com/tonc/text/gfx.htm) link has a section on how to do alpha blending for GBA (section 13.2). I don't know if there's a DS-specific way of doing it, but this should work for you. |
I don't think there is. I've tried to solve this problem at my job. Hiding the select control was the best we could come up with (being a corporate shop with a captive audience, user experience doesn't usually factor into the PM's decisions).
From what I could gather online when looking for a solution, there's just no good solution to this. I like the FogBugz solution (the same thing done by a lot of high-profile sites, like Facebook), and this is actually what I use in my own projects. |
Here's the PHP way:
$stripped = str_replace(array(',', '"'), '', $value);
[Link to W3Schools page](http://w3schools.com/php/func_string_str_replace.asp) |
a) Must look the same
b) As standards-compliant as possible, but not so anal that it blocks finishing work
In a situation where you have perpetual access to the code, I don't think standards-compliance is all that important, since you can always make changes to the code if something breaks. If you don't have perpetual access (ie, you sign off on the code and it becomes someone else's responsibility), it's probably best to be as standards-compliant as possible to minimize maintenance headaches later... even if you never have to deal with the code again, your reputation persists and can be transmitted to other potential clients, and many teams like to blame the previous developer(s) for problems that come up. |
Have a look at Subversion Notify
<http://sourceforge.net/projects/svn-notify/>
<http://www.subversionnotify.com/>
It can do emailing on commit and also much more! |
Have a look at Subversion Notify (Windows only)
<http://sourceforge.net/projects/svn-notify/>
<http://www.subversionnotify.com/>
It can do emailing on commit and also much more! |
I think validation is a good litmus test of whether you've done things properly, so if there are only a few minor problems, why not fix them and ensure your site will at least be understood correctly by browsers in the future (even if they do render things differently for other reasons)?
OTOH, for most projects, validation seems like a huge headache and if you can get things working across browsers, it's not worth spending an extra day/week+ on just validation. |
You could run the third party functions in a separate process and close the process when you are done using the library. |
First, you have to provide the entrypoints for `malloc()` and `free()` and friends. Because this code is compiled already (right?) you can't depend on `#define` to redirect.
Then you can implement these in the obvious way and log that they came from a certain module by linking those routines to those modules.
The fastest way involves *no logging at all.* If the amount of memory they use is bounded, why not pre-allocate all the "heap" they'll ever need and write an allocator out of that? Then when it's done, free the entire "heap" and you're done! You could extend this idea to multiple heaps if it's more complex that that.
If you really do need to "log" and not make your own allocator, here's some ideas. One, use a hash table with pointers and internal chaining. Another would be to allocate extra space in front of every block and put your own structure there containing, say, an index into your "log table," then keep a free-list of log table entries (as a stack so getting a free one or putting a free one back is O(1)). This takes more memory but should be fast.
Is it practical? I think it is, so long as the speed-hit is acceptable. |
How to click on an AutoCompleteExtender with Watin |
|watin|autocompleteextender| |
For my acceptance testing I'm writing text into the auto complete extender and I need to click on the populated list.
In order to populate the list I have to use AppendText instead of TypeText, otherwise the textbox looses focus before the list is populated.
Now my problem is when I try to click on the populated list. I've tried searching the UL element and clicking on it; but it's not firing the click event on the list.
Then I tried to search the list by tagname and value:
Element element = Browser.Element(Find.By("tagname", "li") && Find.ByValue("lookupString"));
but it's not finding it, has anyone been able to do what I'm trying to do? |
There are a number of known incompatibilities between TinyMCE and WebKit (the rendering engine used by Chrome). If you're using TinyMCE 2.x, you might want to try the [Safari plug-in to TinyMCE](http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari); Safari also uses WebKit. I gather also that [TinyMCE 3.x has better support for Safari/WebKit](http://wiki.moxiecode.com/index.php/TinyMCE:Compatiblity) than TinyMCE 2.x, so you might want to try upgrading to the latest 3.x version.
HTH
Alastair |
Since you're worried about memory leaks and talking about malloc/free, I assume you're in C. I'm also assuming based on your question that you do not have access to the source code of the third party library.
The only thing I can think of is to examine memory consumption of your app before & after the call, log error messages if they're different and convince the third party vendor to fix any leaks you find. |
The <?xml...?> processing instruction must be the very first thing in the XML content (see [XML comment][1] and [processing instructions][2]). The following should work:
<?xml version='1.0' encoding='UTF-8'?>
<!-- Queries used: ... -->
<dataset>
...
</dataset>
[1]: http://www.w3.org/TR/REC-xml/#sec-comments
[2]: http://www.w3.org/TR/REC-xml/#sec-pi |
I am writing a BHO for ie7, and I need to detect DOM modification (i.e. via AJAX).
So far I couldn't find any feasible solutions. |
I am writing a BHO for ie7, and I need to detect DOM modification (i.e. via AJAX).
So far I couldn't find any feasible solution. |
|internet-explorer|internet-explorer-7|bho|c++| |
Detect DOM modification in Internet Explorer |
|c++|internet-explorer|internet-explorer-7|bho| |
I am writing a Browser Helper Object for ie7, and I need to detect DOM modification (i.e. via AJAX).
So far I couldn't find any feasible solution. |
If you are looking to inject code into processes (which is what Input Managers are most commonly used for), the Windows equivalents are:
- <code>[AppInit_DLLs][1]</code> to automatically load your DLL into new processes,
- <code>[CreateRemoteThread][2]</code> to start a new thread in a particular existing process, and
- <code>[SetWindowsHookEx][3]</code> to allow the capture of window events (keyboard, mouse, window creating, drawing, etc).
All of these methods require a DLL which will be injected into the remote process. C would be the best language to write such a DLL in as such a DLL needs to be quite light weight as to not bog the system down. RPC methods such as named pipes can be used to communicate to a master process should this be required.
Googling for these three APIs will turn up general sample code for these methods.
[1]: http://support.microsoft.com/kb/197571
[2]: http://msdn.microsoft.com/en-us/library/ms682437(VS.85).aspx
[3]: http://msdn.microsoft.com/en-us/library/ms644990.aspx |
$ echo "This is the text of the email" | mail -s "This is the subject" manpages@rtfm.com
Alternatively:
$ cat | mail -s "A few lines off the top of my head" me@here.com
This is where my
multiline
message would go
^D
^D - means press control-D
|
$ echo "This is the email body" | mail -s "This is the subject" me@email.com
Alternatively:
$ cat | mail -s "A few lines off the top of my head" me@here.com
This is where my
multiline
message would go
^D
^D - means press control-D
|
Tools to help a small shop score higher on the "Joel Test" |
|joeltest|dailybuilds|sourcecontrol|bugtracking| |
Questions #1 through #4 on the [Joel Test][1] in my opinion are all about the development tools being used and the support system in place for developers:
1. Do you use source control?
2. Can you make a build in one step?
3. Do you make daily builds?
4. Do you have a bug database?
I'm just curious what free/cheap (but good) tools exist for the small development shops that don't have large bank accounts to use to achieve a positive answer on these questions.
For source control I know Subversion is a great solution, and if you are a one man shop you could even use SourceGear's [Vault][2].
I use NAnt for my larger projects, but have yet to set up a script to build my installers as well as running the obfusication tools all as a single step. Any other suggestions?
If you can answer yes to the building in a single step, I think creating daily builds would be easy, but what tools would you recommend for automating those daily builds?
For a one or two man team, it's already been discussed on SO that you can use FogBugz On Demand, but what other bug tracking solutions exist for small teams?
[1]: http://www.joelonsoftware.com/articles/fog0000000043.html
[2]: http://www.sourcegear.com/vault/index.html |
**What are all the different ways of finding primes?** |
|language-agnostic|prime|primes| |
Alright, so maybe I shouldn't have shrunk this question sooo much... I have seen the post on [the most efficient way to find the first 10000 primes](http://stackoverflow.com/questions/622/most-efficient-code-for-the-first-10000-prime-numbers). I'm looking for **all possible ways**. The goal is to have a one stop shop for primality tests. Any and all tests people know for finding prime numbers are welcome.
And so:
- **What are all the different ways of finding primes?** |
|language-agnostic|primes| |
Batch file to "Script" a Database |
|sql-server|script|batch-file| |
Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database? I can do this via the wizard, but would like to streamline the creation of this file for source control purposes.
I would like to avoid the use of 3rd party tools - just limiting myself to the tools that come with SQL Server. |
|sql-server|scripting|batch-file| |
Automated script to zip IIS logs? |
|iis|batch-file|script|logging|zip| |
I'd like to write a script/batch that will bunch up my daily IIS logs and zip them up by month.
ex080801.log which is in the format of ex*yymmdd*.log
ex080801.log - ex080831.log gets zipped up and the log files deleted.
The reason we do this is because on a heavy site a log file for one day could be 500mb to 1gb so we zip them up which compresses them by 98% and dump the real log file. We use webtrend to analyze the log files and it is capable of reading into a zip file.
Does anyone have any ideas on how to script this or would be willing to share some code?
|
|iis|batch-file|scripting|zip|logging| |
Any recommendations for lightweight .net Win Forms HTML renderer controls? |
|winforms|.net|control|user-interface| |
Trying to avoid the .net WebBrowser control (I don't need to navigate to a url, print rendered html or any of the other inbuilt goodies). Wrapping the IE dll seems a bit heavyweight.
I simply require something that can dusplay basic html marked up text - an html equivalent of [RichTextBox][1] in effect.
[1]: http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx |
|.net|winforms|user-interface|control| |
Trying to avoid the .net WebBrowser control (I don't need to navigate to a url, print rendered html or any of the other inbuilt goodies). Wrapping the IE dll seems a bit heavyweight.
I simply require something that can display basic html marked up text - an html equivalent of [RichTextBox][1] in effect. Anyone have any experiences / recommendations / war stories?
[1]: http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx |
I had a similar problem and used the following code:
System.Diagnostics.Process[] procs = System.Diagnostics.Process.GetProcesses();
for (int i = 0; i < procs.Length; i++)
{
if(procs[i].ProcessName == "EXCEL")
{
procs[i].Kill();
}
}
This worked pretty well, but I would really think about working with Office on a server. |
You can, from 1.6, use JMX to do all sorts of interesting things including finding held locks. You can't get the actual object, but you do get the class and identity hash value (which is not unique).
[There's an example in one of my weblogs.][1]
[1]: http://www.jroller.com/tackline/entry/detecting_invokeandwait_abuse |
Or, the layer above Laconica called [Identi.ca][1] There's a good talk with the founder of Identi.ca about such usage over at [IT Conversations][2].
[1]: http://identi.ca/
[2]: http://itc.conversationsnetwork.org/shows/detail3791.html |
You can use SELECT * FROM INFORMATION_SCHEMA.COLUMNS but I suspect you created the destination database from a script of the source database so it is very likely that they columns will be the same.
Some comparisons might bring something up though.
These sorts of errors sometimes come from trying to insert too much data into varchar columns too. |
new is always an allocation whereas defining a string inline actually embeds the data in the program itself and cannot be changed (some compilers allow this by a smart trick, don't bother).
Some compilers type inline strings so that you cannot modify the buffer.
char* const sz1 = "string"; // embedded string, immutable buffer
char* sz2 = new char[10]; // allocated string, should be deleted
|
No. When you say:
const char* c = "Hello World!";
You are assigning c to a "pre-existing" string constant which is NOT the same as:
char* c = new char[6];
Only in the latter case are you allocating memory on the heap. So you'd call delete when you're done. |
C# doesn't support duck typing. You have 2 choices: interfaces and inheritance, otherwise you can't access similar properties of different types of objects. |
Josh Bloch has publicised this recently. It is consistent in that InputStream.read is not guaranteed to read as many bytes as it could. However, it is utterly pointless as an API method. InputStream should probably also have readFully. |
The method I've always used is below. It is a pain and a bit ugly, but I haven't found a better one. You have to pass the class type through on construction, as when Generics are compiled class information is lost.
public class Test<E> {
private Class<E> clazz;
public Test(Class<E> clazz) {
this.clazz = clazz;
}
public boolean sameClassAs(Object o) {
return this.clazz.isInstance(o);
}
} |
You could give [this][1] a go.
[1]: http://mime-types.rubyforge.org/ |
I'd think about putting in place some sort of general archiving functionality. How you implement that depends on your specific retrieval needs.
For example if you wish just to retrieve emails sent to a particular customer for a certain month then stocking them in an appropriate heirachy on the File System (zip them up if necessary) should be simple to do. You might want to record a list of sent emails in a database table with a *pointer* to the appropriate directory but a naming convention for your directories and files might be sufficient
You might not need to access very old emails very infrequently so you might archive these to DVD for example if online storage is a problem
If you're wanting to often search the actual content of emails then your going to have to put the content in a DB table or use an indexer like Lucerne to examine the files stocked on disk |
I think this is an area in which you should strive to use the [Robustness principle][1] as far as is practical (which is good advice for any area of coding). Just because something works today doesn't mean it will work tomorrow: if you're relying on a particular HTML/CSS hack or even if you've just been a little lax in emitting strictly valid code, the next iteration of browsers could well break. Doing it once the right way minimises this problem (though does not entirely mitigate it).
There is a certain element of pragmatism to take here, though. I'd certainly do all I could for a client's site to be valid, but I would be willing to take more risks in my own space.
[1]: http://en.wikipedia.org/wiki/Postel%27s_law |
I love TextMate on OSX.
There is a kind of TextMate clone for Windows called simply "E" ([e-texteditor.com][1]). Its author promised that there will be a Linux version soon. Even if you already picked your favourite, TextMate (or E) is worth a look, simply because it is different.
I would say that there are mainly four different families of text editors:
* classic menubar-based editors like WinEdit, Gedit or BBEdit
* Emacs and its brethren XEmacs, Aquamacs etc.
* VI / Vim / Cream and the like
* TextMate and E
You can differenciate between these families by their different paradigms of usage:
* Classic editors rely mainly on a menubar and some Ctrl-key shortcuts.
* Emacs-style editing uses highly sophisticated keyboard commands like C-x-s and even whole words to evoke commands.
* VI is modebased and is operated by single-key commands or whole words.
* TextMate is based on Snippets and classic shortcuts.
Emacs and TextMate are also easily extensible by user-created scripts in Lisp (Emacs) or any other command-line-language (TextMate). (Classic editors and VI are also extendable, but the effort is usually considerably bigger)
I would recommend that everyone tried at least one good example of each of these families (if possible) and find out what suits them best.
[1]: http://www.e-texteditor.com |
You could also group the characters by language. Load each language table as needed, and when you need to switch languages, unload the previous language table and load the new one. |
I know this isn't answering your whole question, but it is worth considering that by using completely valid html you can be sure that your website should work properly in **future** web browsers that haven't been released yet. |
I would recommend [Companion JS](http://www.my-debugbar.com/wiki/CompanionJS/HomePage).
This is the free version of [Debug Bar](http://www.my-debugbar.com/wiki/Doc/HomePage) but I find it easier to use and have the features I need. Great to test little JavaScript snippets in IE the same way I do with Firebug in Firefox. |
As far as I know there are only two options, the better of which is the mentioned usage of an iframe. The other one is hiding all selects when the overlay is shown, leading to an even weirder user experience. |
I think it's only "tech" guys that really care for "100% standard compliance". My usual page consumers (= users) don't care if there's no alt-attribute for a "menu border element".
I usually just make sure that I don't see any obvious errors (all tags closed, all lower case, attributes in quotes, ...), but if it looks good on IE and FF, that's all I care for. I don't really care if I use a non-standard attribute in any HTML tag, so that the page doesn't validate against an DTD - as long as I get the visual results that I intended to get. |