instruction
stringlengths
0
30k
Besides another commercial product, like [Wowza Media Server][1], you could go with a CDN (Content Delivery Network), like [Limelight Networks][2] or [Voxel.net][3]. You might even be able to find a local hosting provider that would serve up live Flash video for you. (Live Flash video in a non-trivial thing to do, ...
Obvious question, but have you got Hudson set up to point to the same Maven repository as your command line build? You can check this from the Hudson admin gui - look in the Maven section of the Manage Hudson page. This should have a `MAVEN_HOME` environment variable listed. Look in the settings.xml file under: ...
How will the other site validate your username and password? Ideally your site shouldn't even be remembering the user's password to be able to pass it to another site (you store hashes of the password, not the password itself, and only use the actually password during validation). What if your site provided a tok...
To my mind, the simplest way is maintain a 1:1 between rails instances and DB shards.
System.Reflection.MethodBase.GetCurrentMethod().Name;
- [@@IDENTITY][1] returns the last identity value generated for any table in the current session, across all scopes. You need to be careful here, since it's across scopes. You could get a value from a trigger, instead of your current statement. - [SCOPE_IDENTITY][2] returns the last identity value generated for ...
In native code you can get a shot at walking the callstack by installing a [Vectored Exception handler][1]. VC++ implements C++ exceptions on top of SEH exceptions and a vectored exception handler is given first shot before any frame based handlers. However be really careful, problems introduced by vectored exception...
I think so. RESTful solutions are more and more sensible for the vast majority of use cases; the complexities of SOAP and other RPC technologies just aren't worth the effort anymore.
I think the only solution will be to create an asynchronous service that wraps a [standard connector](http://dev.mysql.com/downloads/connector/odbc/5.1.html). You'll need to understand the ODBC APIs though. Skizz
One good reason not to use a relational database would be when you have a massive data set and want to do massively parallel and distributed processing on the data. The Google web index would be a perfect example of such a case. Hadoop also has an implementation of the [Google File System][1] called the [Hadoop D...
You need to use the "allowScriptAccess" flash variable in the HTML. You probably want to use "sameDomain" as the type. Note that if you go cross-domain, you also need to host a special file on the server called 'crossdomain.xml' which enables such scripting (the flash player will check for this. More info at [http://kb...
Why not throw an exception if the operation wasn't successful? Personally, I tend to be of the opinion that if you need to return more than one value from a function, you should reconsider if you're doing things the right way or use an object.
Why not throw an exception if the operation wasn't successful? Personally, I tend to be of the opinion that if you need to return more than one value from a function, you should reconsider if you're doing things the right way or use an object. But more directly to the point, if you throw an exception, you're forcin...
If you can find a professional or some other super-enterprise version of Visual Studio 6.0 - it came with a copy of <a href="http://en.wikipedia.org/wiki/MSDE">MSDE</a> (Basically the predecessor to SQL Express). I believe MSDE 2000 is still available as a free download from Microsoft, but I don't know if you can migra...
With git, you can do practically anything offline, because everybody has their own repository. Making branches and merging between branches is really easy. Even if you don't have commit rights for a project, you can still have your own repository online, and publish "push requests" for your patches. Everybody who...
Replace your hyphens with this: &shy; It's called a "soft" hyphen.
Word-wrapping is part of CSS3 (read not yet fully supported) and you can find information on it at [http://www.css3.info/preview/word-wrap/][1]. [1]: http://www.css3.info/preview/word-wrap/
Word-wrapping is part of CSS3 (read not yet fully supported) and you can find information on it at [http://www.css3.info/preview/word-wrap/][1]. Another option is the [wbr tag, &amp;shy;, and &amp;#8203;][2] none of which are fully supported either. [1]: http://www.css3.info/preview/word-wrap/ [2]: http://www...
Some fun things: 1. Having a PHP and MySQL Application that works well with German and French, but now needs to support Russian and Chinese. I think I move this over to .net, as PHP's Unicode support is - in my opinion - not really good. Sure, juggling around with utf8_de/encode or the mbstring-functions is fun. Alm...
Is this what you're after? select * from master..syslogins
I think, most of the time, we developers forget this we all do is, after all, about bussiness. From that point of view a project is not a failure while the client is willing to pay for it. It all depends on the client, some clients have more patience and understand better the risks of software development, other jus...
Unless the goals were clearly stated in the beginning of the project, there are no clear lines between "success" and "failure." Often, a project would have varying degree of success/failure. For some, just getting some concepts in code would be a success, while other may measure success as recovering all investments...
SQL Query for Logins
|sql|
What is the SQL query to select all of the MSSQL Server's logins?
|sql|mssql|
|sql|
What is the SQL query to select all of the MSSQL Server's logins? Thanks, more then one of you had the answer I was looking for SELECT * FROM syslogins
The best quality control for gcc is the linux kernel. GCC is the compiler of choice for basically all major open source C/C++ programs. A released GCC, especially one like 4.3.X, which is in major linux distros, should be pretty good. GCC 4.3 also has better support for optimizations on newer cpus.
- [@@IDENTITY][1] returns the last identity value generated for any table in the current session, across all scopes. You need to be careful here, since it's across scopes. You could get a value from a trigger, instead of your current statement. - [SCOPE_IDENTITY][2] returns the last identity value generated for ...
Try this inside the Main method in an empty console program: MethodBase method = MethodBase.GetCurrentMethod(); Console.WriteLine(method.Name); Console Output: <code>Main</code>
Functions are first class citizens in F#. You can therefore pass them around just like you want to.
Functions are first class citizens in F#. You can therefore pass them around just like you want to. If you have a function like this: let myFunction f = f 1 2 3 and **f** is function then the return value of **myFunction** is **f** applied to 1,2 and 3.
EDIT: MethodBase is probably a better way to just get the method you're in (as opposed to the whole calling stack). I'd still be concerned about inlining however. You can use a StackTrace within the method: StackTrace st = new StackTrace(true); And the look at the frames: // The first frame will be ...
strip all html tags except links
|html|regex|actionscript-3|string|tags|
I am trying to write a regex to strip all HTML with the exception of links (the `<a href` and `</a>` tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and published into a SWF movie. The original "strip t...
|html|regex|string|actionscript-3|tags|
How much order do you need to impose on the threads? If you just need all of the work started in the loop to finish before the code continues, but you don't care about the order the work within the loop finishes, then calling Join is the answer. To add more detail to [Kevin Kenny's answer,][1] you should call Join *out...
Static constructors are guaranteed to be run only once per application domain, before any instances of a class are created or any static members are accessed. <http://msdn.microsoft.com/en-us/library/aa645612.aspx> The implementation shown is thread safe for the initial construction, that is, no locking or null test...
Static constructors are guaranteed to fire only once per App Domain so your approach should be OK. However, it is functionally no different from the more concise, inline version: private static readonly Singleton instance = new Singleton(); Thread safety is more of an issue when you are lazily initializing th...
I suspect these are related to the SQL Server Agent trying to login to a database that no longer exists. To clear it up you need to: 1. Go to SQL Server Management Studio 2. Disable the job called <database name>_job_deleteExpiredSessions If that works, then you should be all clear to delete it.
Using a static constructor actually *is* threadsafe. The static constructor is guaranteed to be executed only once. From the C# language specification <http://msdn.microsoft.com/en-us/library/aa645612(VS.71).aspx>: >The static constructor for a class executes at most once in a given application domain. The execu...
Some fun things: 1. Having a PHP and MySQL Application that works well with German and French, but now needs to support Russian and Chinese. I think I move this over to .net, as PHP's Unicode support is - in my opinion - not really good. Sure, juggling around with utf8_de/encode or the mbstring-functions is fun. Alm...
Some fun things: 1. Having a PHP and MySQL Application that works well with German and French, but now needs to support Russian and Chinese. I think I move this over to .net, as PHP's Unicode support is - in my opinion - not really good. Sure, juggling around with utf8_de/encode or the mbstring-functions is fun. Alm...
I don't know the answer to your specific question, but hopefully this information will point you in the right direction. The "native" format for WF workflows is ".xoml" files. These are basically identical to XAML files, and both are nothing more than generic persistence formats for a .NET object tree. If you can ...
you could change the title of the web page with each new message to alert the user. I did this for a browser chat client and most users thought it worked well enough.
you could change the title of the web page with each new message to alert the user. I did this for a browser chat client and most users thought it worked well enough. document.title = "[user] hello world";
Lightweight rich-text XML format?
|xml|standards|
I am writing a basic word processing application, and I am trying to settle on a native "internal" format, the one that my code parsers in order to render to the screen. I'd like this to be XML, so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever. However, when searching for exist...
I am writing a basic word processing application, and I am trying to settle on a native "internal" format, the one that my code parsers in order to render to the screen. I'd like this to be XML, so that I can, in the future, just write XSLT to convert it to ODF or XHTML or whatever. However, when searching for exist...
I am trying to write a regex to strip all HTML with the exception of links (the `<a href` and `</a>` tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and published into a SWF movie). The original "strip ...
I don't think there is a library that does this out of the box. If you want to implement your own, I would definitely go with the [Python Imaging Library][1] (PIL). This is [a Python Cookbook recipe][2] that uses PIL to add a _visible_ watermark to an image. If it's enough for your needs, you could use this to add a...
I think you should be able to get that from creating a [StackTrace][1]. [1]: http://msdn.microsoft.com/en-us/library/6zh7csxz(VS.80).aspx
I think you should be able to get that from creating a [StackTrace][1]. Or, as @[edg][2] and @[Lars Mæhlum][3] mention, MethodBase.[GetCurrentMethod][4]() [1]: http://msdn.microsoft.com/en-us/library/6zh7csxz(VS.80).aspx [2]: http://stackoverflow.com/questions/44153/can-you-use-reflection-to-find-the-name-of...
How can I install libgluezilla on Ubuntu 8.04?
|ubuntu|mono|
I want to use the Web Browser control within an mono application, but when I do get the error "libgluezilla not found. To have webbrowser support, you need libgluezilla installed." I can't find the package other than a SUSE rpm, how do I install the library?
I want to use the Web Browser control within an mono application, but when I do get the error "libgluezilla not found. To have webbrowser support, you need libgluezilla installed." Installing the Intrepid Deb causes any application that references the web browser control to crash on startup with : 'Thread (nil) may ha...
Yes definately. I actually do this in this function I use in my code framework to get the calling method: public static T CreateWrapper<T>(Exception innerException, params object[] parameterValues) where T : Exception, new() { if (parameterValues == null) { parameterValues = new object[0]; ...
@Bernard: That's a good question... I think the code's ok. From a practical standpoint, we use it in my company every day, and we run on a pretty wide array of boxes, everything from 2-8 cores. Of course, YMMV, etc, but it seems to be a reliable and low-overhead (because it doesn't make a context switch into sys...
String literals and escape characters in postgresql
|postgresql|
Attempting to insert an escape character into a table results in a warning and the string being truncated at the escape character. For example: create table EscapeTest (text varchar(50)); insert into EscapeTest (text) values ('This will be inserted \n This will not be'); Produces the warning: WA...
Partially. The text is inserted, but the warning is still generated. I found a discussion that indicated the text needed to be preceded with 'E', as such: insert into EscapeTest (text) values (E'This will be inserted \n This will not be'); This suppressed the warning, but still didn't insert the text. When...
An example of a lambda in Ruby is as follows: hello = lambda do puts('Hello') puts('I am inside a proc') end hello.call Will genereate the following output: Hello I am inside a proc
I have used both MSBuild and NAnt, and I much prefer MSBuild, mainly because it requires a lot less configuration by default. Although you can over-complicate things and load MSBuild down with a lot of configuration junk too, at its simplest, you can just point it at a solution/project file and have it go which, most o...
LIMIT n,1 doesn't work in MS SQL Server. I think it's just about the only major database that doesn't support that syntax. To be fair, it isn't part of the SQL standard, although it is so widely supported that it should be. In everything except SQL server LIMIT works great. For SQL server, I haven't been able to fi...
Here's a generic version of a sproc I recently wrote for Oracle that allows for dynamic paging/sorting - HTH -- p_LowerBound = first row # in the returned set; if second page of 10 rows, -- this would be 11 (-1 for unbounded/not set) -- p_UpperBound = last row # in the returned set; if s...
I'm not sure about any of the rest, but I know SQLite and MySQL don't have any "default" row ordering. In those two dialects, at least, the following snippet grabs the 15th entry from the_table, sorting by the date/time it was added: SELECT * FROM the_table ORDER BY added DESC LIMIT 1,15 (of course, you'd nee...
It also depends on **what** you're building. [MSBuild SDC Task library][1] has a couple of special tasks for example AD, BizTalk etc. > There are over 300 tasks included in > this library including tasks for: > creating websites, creating > application pools, creating > ActiveDirectory users, running FxCop, > c...
Seat [number]: [letters&numbers&characters] ([number] in chips) Your Regex should look something like this Seat (\d+): ([a-zA-Z0-9]+) \((\d+) in chips\) The brackets will let you capture the seat number, name and number of chips in groups.
Thanks guys, lot of good info, but Martin has given me a bit more detail on how to proceed. I'll give him the answer, as it seems like now we're off the front few pages answers will drop off.
[db4objects][1] might be the best choice [1]: http://www.db4o.com
I know a lot of people think short code equals elegant code but that isn't true. The example you propose is perfectly solved in code, as you have shown so, what do you need a preprocessor directive to? You don't want to "preprocess" your code, you want the compiler to insert some code for you in your properties. It'...
C# Preprocessor
|c#|
While the C# spec does include a pre-processor and basic directives (#define, #if, etc), the language does not have the same flexible pre-processor found in languages such as C/C++. I believe the lack of such a flexible pre-processor was a design decision made by Anders Hejlsberg (although, unfortunately, I can't find ...
|c#|preprocessor|
I found the following in an [Apple Forum][1]: > Xcode doesn't come with any symbolic breaks built in - but they're quick to add. Go to the breakpoints window and add: > -[NSException raise] [1]: http://lists.apple.com/archives/Cocoa-dev/2003/Nov/msg00166.html
Yes definately. I actually do this in this function I use in my code framework to get the calling method: public static T CreateWrapper<T>(Exception innerException, params object[] parameterValues) where T : Exception, new() { if (parameterValues == null) { parameterValues = new object[0]; }...
AFAIK, this **cannot** be done. The TextBox control is a funny control because it actually has a *lot* of behaviour that can't be modified due to the way it taps into the operating system. This is why many of the cool custom TextBoxes are written from scratch. I am afraid you may not be able to do what you wish to d...
You can do through a win32 call DllImport("user32")] private static extern bool HideCaret(IntPtr hWnd); public void HideCaret() { HideCaret(someTextBox.Handle); }
Yes, on the server side for sure. Client side? I don't know. One the server side, one would have to parse the file, read the header and/or look for audio frames. (I've ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there. It is possible.) [osflash....
Yes, on the server side for sure. Client side? I don't know. (I'm a serverside kind of guy.) On the server side, one would have to parse the file, read the header and/or look for audio frames. (I've ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there....
There is nothing I know of that can do this without you at least writing a little bit of code... You will need 2 separate library: - A CSV Parser Framework - An XML Serialization Framework The CSV parser I would recommend (unless you want to have a little bit of fun to write your own CSV Parser) is OpenCSV ...
Very roughly and from memory since I don't have code on this laptop: <pre> using (OleDBConnection conn = new OleDbConnection()) { conn.ConnectionString = "Whatever connection string"; using (OleDbCommand cmd = new OleDbCommand()) { cmd.Connection = conn; cmd.CommandText = "Select * from CoolTabl...
All editions of SQL Server 2000/2005/2008 support having multiple databases, each using their own collation sequence. You don't need the Enterprise version. When you have a database that uses a collation sequence that is different from default collation for the database server, you will need to take some extra pr...
Cool. I also found the documentation regarding the E: [http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS][1] > PostgreSQL also accepts "escape" string constants, which are an extension to the SQL standard. An escape string constant is specified by writing the letter E (u...
PHP variables are passed by value, but there is a way to pass them by reference. Therefor, the following code: $aVar = "test"; $aNewVar = $aVar; $aNewVar = "newTest"; print ($aNewVar . " " . $aVar); would output "newTest test", NOT "newTest newTest". If PHP where pass by re...
Yes, on the server side for sure. Client side? I don't know. (I'm a serverside kind of guy.) On the server side, one would have to parse the file, read the header and/or look for audio frames. (I've ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there....
If you need to maintain the name of the column (so as not to break client code), you will need to drop the column and add back a stored column with the same name. You can do this without downtime by making the changes (along the lines of SQLMenace's solution) in a single transaction. Here's some pseudo-code: <pre>...
Connecting private IPs
|ip|private-ips|
A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth. Is this true? How's this technique named? Thanks
After installing the DEB my app crashes... Is this because the deb is for the wrong Ubuntu, it appears to be correct for the version of Mono (everything is. 1.9.1)... <pre> Mono-INFO: Assembly Loader probing location: '/usr/lib/mono/gac/Mono.Mozilla/0.2.0.0__0738eb9f132ed756/Mono.Mozilla.dll'. Mono-INFO: Image ad...
Using a static constructor actually *is* threadsafe. The static constructor is guaranteed to be executed only once. From the C# language specification <http://msdn.microsoft.com/en-us/library/aa645612(VS.71).aspx>: >The static constructor for a class executes at most once in a given application domain. The execu...
I would recommend using background images. The other ways aren't nearly as good: No anti-aliasing and senseless markup. This is not the place to use JavaScript.
I disagree with [Yaakov Ellis' answer.][1] The Common Language Specification guarantees that "a type initializer shall run exactly once for any given type, unless explicitly called by user code." (Section 9.5.3.1.) So unless you have some whacky IL on the loose calling Singleton::.cctor directly (unlikely) your static ...