instruction
stringlengths
0
30k
Can I detect and handle MySQL Warnings with PHP?
|mysql|warning|warnings|php|error-handling|
I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropriately. ...
|php|mysql|error-handling|warning|
|php|mysql|error-handling|warnings|
Is it possible to automatically make check-outs from any VCS?
|cvs|svn|version|version-control|vcs|
Let's take a web development environment, where developers checkout a project onto their local machines, work on it, and check in changes to development. These changes are further tested on development and moved live on a regular schedule (eg weekly, monthly, etc.). Is it possible to have an auto-moveup of the latest t...
|svn|version-control|cvs|version|
|svn|version-control|cvs|versions|
How to implement a file download in asp.net
|asp.net|.net2.0|
What is the best way to implement, from a web page a download action using asp.net 2.0? Log files for a action are created in a directory called [Application Root]/Logs. I have the full path and want to provide a button, that when clicked will download the log file from the IIS server to the users local pc.
|asp.net|download|
When I'm creating a user for my web application, an SMTP email is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out sometimes and the new user simply won't receive the email with the password. Alright, so I'll display a message indicating that the mail...
|.net|asp.net|email|smtp|
When I'm creating a user for my web application, an SMTP email is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Alright, so I'll display a message indicating that the mail did not g...
When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password. Alright, so I'll display a message indic...
Indexed Views in OLTPs?
|sql-server|database|view|indexed|materialized|
I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them in our OLAP applications. They have the really cool feature of being able to usurp an execution plan and remap it to the indexed view w/out having to change existing code. IE. Let's say I had a SPROC that was a really expensive jo...
Why not just use two different membership providers (Windows and Forms, instead of using LogonUserIdentify specifically)? In the code example you posted, you could use the same method in the Membership namespace for any provider. You can change which provider is the default in the Web.config file. I agree that using co...
It depends, if they are not going to do much more, then I would probably leave them as is - IMHO factoring out stuff is likely to be more complex, in this case.
DBI rocks! but for a proper fully-featured ORM that is fast go for DBIx::Class all the time.
Try the [seed-fu][1] plugin, which is quite a simple plugin that allows you to seed data (and change that seed data in the future), will also let you seed environment specific data and data for all environments. [1]: http://www.intridea.com/2008/4/20/seed-fu-simple-seed-data-for-rails
I *highly recommend* starting with [Simon Cozens' Beginning Perl book](http://www.perl.org/books/beginning-perl/). And also, reading the [Perl documentation](http://perldoc.perl.org/index-language.html).
You don't mention what language you want to use. For C++, use the Feature Pack.
One approach is the so called bag-of-words model. As you guessed, first you count how many times words appear in the text (usually called document in the NLP-lingo). Then you throw out the so called stop words, such as "the", "a", "or" and so on. You're left with words and word counts. Do this for a while and you...
You can do a server-side HTTP Request, it looks something like this in C#: HttpWebRequest req = (HttpWebRequest)WebRequest.Create("/ASPSession.ASP?SessionVar=" + SessionVarName); req.Headers.Add("Cookie: " + SessionCookieName + "=" + SessionCookieValue); HttpWebResponse resp = (HttpWebResponse)re...
C and C++ have different rules about names of symbols. Symbols are how the linker knows that the call to function "openBankAccount" in one object file produced by the compiler is a reference to that function you called "openBankAccount" in another object file produced from a different source file by the same (or compat...
> When should we use it? When you are linking C libaries into C++ object files > What is happening at the > compiler/linker level that requires us > to use it? C and C++ use different schemes for symbol naming. This tells the linker to use C's scheme when linking in the given library. > How in terms o...
What is wrong with [DataTable.Copy][1]? [1]: http://msdn.microsoft.com/en-us/library/system.data.datatable.copy.aspx
Be sure to check out [http://www.cocoalab.com/?q=becomeanxcoder][1]. It goes from the very fundamentals of programming to learning Cocoa, Xcode and more. [1]: http://www.cocoalab.com/?q=becomeanxcoder "Becoming an Xcoder"
Remove C++-STL/Boost debug symbols
|c++|debugging|symbols|stl|link-performance|
I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons: 1. Linking gets very slow for big programs 2. Debugging jumps into stl/boost code, which is annoying For 1. incremental linking would be a big improvement, but AFAIK ld does not support incremental linking. There is ...
Remove C++-STL/Boost debug symbols (... or do not create them)
Linux/Gcc/LD - Toolchain. I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons: 1. Linking gets very slow for big programs 2. Debugging jumps into stl/boost code, which is annoying For 1. incremental linking would be a big improvement, but AFAIK ld does not support i...
|c++|stl|debugging|symbols|link-performance|
Linux/Gcc/LD - Toolchain. I would like to remove STL/Boost debug symbols from libraries and executable, for two reasons: 1. Linking gets very slow for big programs 2. Debugging jumps into stl/boost code, which is annoying For 1. incremental linking would be a big improvement, but AFAIK ld does not support i...
I guess I could potentially rename the file temporarily to match whatever I decide to put in the schema.ini or potentially modify the schema.ini on the fly and put the correct filename in there, but I'd love to do know if there was a better way.
Problem accessing the content of a div when that content came from an Ajax call
|javascript|prototype|dom|
|javascript|dom|prototype|
Here's a very simple Prototype example. All it does is, on window load, an ajax call which sticks some html into a div. <html> <head> <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script> <script type="text/javascript"> Event.ob...
Here's a very simple Prototype example. All it does is, on window load, an ajax call which sticks some html into a div. <html> <head> <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script> <script type="text/javascript"> Event.ob...
Add the 'n' flag to avoid the substitution. This is described as [an official tip][1]. [1]: http://vimdoc.sourceforge.net/htmldoc/tips.html#count-items
Just write your commands one after the other, put it in a file and run this file with promp> bash file and you have your first automation. Then learn about bash variables, loops and control structures.
There is a plugin that does just this, http://blog.labnotes.org/2007/12/11/json_request-handling-json-request-in-rails-20/ And from what I understand this functionality is already in Rails. But go see that blog post, there are code examples and explanations.
What is GNU Screen?
|gnu-screen|
What is GNU Screen?
This is a rather simple question and to me smells awefully like a homework assignment. You can obviously see the common bits in the code and I'm pretty sure you can make an attempt at it yourself by putting such things into a super-class.
Yes, my preferred way of doing this would be via PHP. You'd have to set up a script which would load up the file and send it to the user browser. This script would also be able to log the download somewhere (e.g. your database). For example - in very rough pseudo-code: download.php $file = $_GET['file']; ...
If you don't have JTAG, the LEDs suggested by the others are a great idea - although you do tend to end up in a test/rebuild cycle to try to track down the issue. If you've got more time, and spare hardware pins, and memory to spare, you could always bit-bash a low speed serial interface. I've found that pretty usef...
I have used Oracle emmbedded java for two problems: 1) To do a PLSQL procedure which bulks the results of a query in a text file and send it over FTP. This file was very large and i use Java to Zip it. 2) In a client-server aplication with direct connection with the DB, to send the user's password for the applica...
I have used Oracle emmbedded java for two problems: 1) To do a PLSQL procedure which bulks the results of a query in a text file and send it over FTP. This file was very large and i use Java to Zip it. 2) In a client-server aplication with direct connection with the DB, to compare the user sent password to the ap...
The `extern "C" {}` construct instructs the compiler not to perform mangling on names declared within the braces. Normally, the C++ compiler "enhances" function names so that they encode type information about arguments and the return value; this is called the *mangled name*. The `extern "C"` construct prevents the man...
TCP is a "reliable" protocol, which means the data will be received at the other end if there are no socket errors. I have seen numerous efforts at second-guessing TCP with a higher level application confirmation, but IMHO this is usually a waste of time and bandwidth. Typically the problem you describe is handled ...
You might want to have a look at this: http://www.codeproject.com/KB/cs/rssframework.aspx
Buy a book, open XCode, and *write*. Seriously, writing is *the best way* to learn Cocoa. In addition, I recommend [Cocoa Programming for Mac OS X](http://www.amazon.com/Cocoa-Programming-Mac-OS-2nd/dp/0321213149)!
You should test as little as possible! meaning, you should write just enough unit tests to reveal intent. This often gets glossed over. Unit testing costs you. If you make changes and you have to change tests you will be less agile. Keep unit tests short and sweet. Then they have a lot of value. Too often...
If you're on .NET 3.5 you now got built-in support for syndication feeds (RSS and ATOM). Check out this [MSDN Magazine Article for a good introduction][1]. If you really want to parse the string using regex (and parsing XML is not what regex was intended for), the easiest way to get the content is to use the WebClie...
How can I import a raw RSS feed in C#?
|import|xml|rss|c#|
Does anyone know an easy way to import a raw, XML RSS feed into C#? Am looking for an easy way to get the XML as a string so I can parse it with a Regex. Thanks, -Greg
> thetalkingwalnut asks: >> What are some good ways to convince the skeptical developers on the team of the value of Unit Testing? Everyone here is going to pile on lots of reasons out of the blue why unit testing is good. However, I find that often the best way to convince someone of something is to *listen* to th...
Have you tried: Russel and Norvig's Artificial Intelligence: A Modern Approach. I realise that this is heavy on theory, but it also contains useful code samples that can be used to help your learning.
Have you tried: Russel and Norvig's Artificial Intelligence: A Modern Approach. I realise that this is heavy on theory, but it also contains useful code samples that can be used to help your learning. You can also check out: <http://www.kanungo.com/software/software.html> for a c-implementation of a HMM
I don't have the syntax to do this gracefully with an LKM offhand, but this article provides a good overview of what you'd need to do: http://www.linuxjournal.com/article/4378 You could also just patch the sys_open function. It starts on line 1084 of file/open.c as of linux-2.6.26. You might also see if you can...
If I am searching for something in a directory, but I am not sure of the file, then I just grep the files in the directory by: find . -exec grep whatIWantToFind {} \;
I'm currently using FFmpeg version SVN-r12665 for this, with no problems (the console version, without any wrapper library). There are some caveats to using console applications from non-console .NET environments, but it's all fairly straightforward. Using the libavcodec DLL directly is much more cumbersome.
Can I implement a web user authentication system in python without POST?
|python|authentication|cgi|
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with POST? Just out of curiosity. Cheers!
I think the [Red Gate Dependency Tracker mentioned by rpetrich][1] is a decent solution, it works well and Red Gate has 30 day trial (ideally long enough for you do do your forensics). I would also consider isolating the system and running the **SQL Profiler which will show you all the SQL action on the tables**. Th...
Your first step should be to download the latest TFS Installation Guide (TFSInstall.chm) from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=FF12844F-398C-4FE9-8B0D-9E84181D9923&displaylang=en You should use TFS 2008 SP1, since it is the latest release and includes many new features and performance i...
My approach has always been to use StringBuilder when concatenating 4 or more strings OR When i don't know how may concatenations are to take place. [Good performance related article on it here][1] [1]: http://www.heikniemi.net/hc/archives/000124.html
I don't know Slackware very well, I last used it over ten years ago. However, any mainstream Linux distribution should have either the 'ifconfig' program, or the 'ip' program or both. You will need to have root privilges, so either become root (e.g with su) or use the 'sudo' program if you know how. Let's do it with 'i...
Response.AddHeader("Content-Disposition", "attachment;filename=" & FileName & ";")
You can add a style directly to the select element: <code>&lt;select name="foo" style="width: 200px"&gt;</code> So this select item will be 200 pixels wide. Alternatively you can apply a class or id to the element and reference it in a stylesheet
Go to Tools > Options > Text Editor > All Languages > General The option on that page is "Apply Cut or Copy commands to blank lines when there is no selection"
Like so many architecture and design questions, the answer is "it depends". In my experience, the strength of asynchronous messaging has been in the loose coupling it brings to a design. The coupling can be in: - Time - Requests can be handled asynchronously, helping overall scalability. - Space - As you poi...
Whenever your highscore system is based on the fact that the Flash application sends unencrpyted/unsigned highscore data via the network, that can be intercepted and manipulated/replayed. The answer follows from that: encrypt (decently!) or cryptographically sign highscore data. This, at least, makes it harder for peop...
[This question][1] covers making sure a webpage is not cached. It seems you have to set several properties to ensure a web page is not cached across all browsers. [1]: http://stackoverflow.com/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers
Yes and no: yes, the RSA keys embedded into certificates and privkeys are just numbers. You can extract them from the certificate and use them to build keys in other formats. This is commonly done to convert between different certificate formats. PGP has some support for X.509 for S/MIME, but no ability to use X.50...
Put your domain objects and interfaces in a seperate "domain" assembly. This assembly should never reference anything but the core .net assemblies. This way you get a clean seperation from your domain/service model and your implementation.
Put your domain objects and interfaces in a seperate "domain" assembly. This assembly should never reference anything but the core .net assemblies. This way you get a clean seperation from your domain/service model and your implementation. _Edit:_ <http://jeffreypalermo.com/blog/the-onion-architecture-par...
web page cache setexpires
|caching|
Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
|caching|
Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user that previously used that mach...
Each VS project builds a single EXE or DLL. The solution is just a collection of related projects. So VS project:Eclipse project::VS solution:Eclipse workspace.
Where do Interfaces "physically live"
|architecture|.net|
I like the idea of having Interfaces and Implementation separate. But how separate? Are the Interface definitions in a separate .Net assembly? Do you have a single project that defines all Interfaces for a solution? Otherwise are there issues with circular dependencies of Interfaces?
Where should interfaces "physically live"?
|.net|architecture|
Your problem could be caused by the browser remembering data entered into form fields. You can turn this off like this: <input autocomplete="off">