instruction
stringlengths
0
30k
The minimum of testing shows that this should do it: grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt - -E use extended regexp - -v Show lines that do **not** match - ^ starts with - .* anything - \* an asterisk - [0-9A-Fa-f] hexadecimal digit - {2} exactly two of the previous HTH, Motti.
Disable (Politely) a website when the sql server is offline
|asp.net|sql|maintenance|
I work at a college and have been developing an ASP.NET site with many, many reports about students, attendance stats... The basis for the data is a ms sql server db which is the back end to our student management system. This has a regular maintenance period on thursday mornings for an unknow length of time (dependent...
I like 50 for fixed rate pc games. I can't really tell the difference between 50 and 60 (and if you are making a game that can/cares you should probably be at 100).
I like 50 for fixed rate pc games. I can't really tell the difference between 50 and 60 (and if you are making a game that can/cares you should probably be at 100). you'll notice the question is 'fixed-rate game logic' and not 'draw loop'. For clarity, the code will look something like: while(1) { ...
Is there a reason why ms-access was added as a tag here? It seems to me that the question has nothing but the most trivial relevance to Access, since once you're working with .NET, Access is completely out of the picture. -- <br> David W. Fenton<br> [David Fenton Associates][1] [1]: http://dfenton.com/DFA/
ASP.Net with it's code behind is *almost* MVC - but not - the one big thing that makes it not is that the codebehinds are tied directly to the aspx's - which is a big component of MVC. If you are thinking of the codebehinds as the controller - the should be completely decoupled from the view. The new .NET MVC rounds ...
Best way to convert a decimal value to a currency string for display in HTML.
|asp.net|localization|currency|browser|
I wanting to show prices for my products in my online store. I'm currently doing: <span class="ourprice"> <%=GetPrice().ToString("C")%> </span> Where GetPrice() returns a decimal. This is rendering fine in most browsers, e.g. £12.00 (The server is in the UK), but some browsers (Mozilla) show t...
I wanting to show prices for my products in my online store. I'm currently doing: <span class="ourprice"> <%=GetPrice().ToString("C")%> </span> Where GetPrice() returns a decimal. I think the correct HTML for an output of "£12.00" is "&pound;12.00", so although this is rendering fine in mo...
App Domains are great for application stability. By having your application consist of a central process, which then spawns out "features" in separate appdomains, you can can prevent a global crash should one of them misbehave.
Agda 2: Functional, dependently typed. data Nat = zero | suc (m::Nat) add (m::Nat) (n::Nat) :: Nat = case m of (zero ) -> n (suc p) -> suc (add p n) mul (m::Nat) (n::Nat)::Nat = case m of (zero ) -> zero (suc p) -> add n (mul p n) ...
Agda 2: Functional, dependently typed. data Nat = zero | suc (m::Nat) add (m::Nat) (n::Nat) :: Nat = case m of (zero ) -> n (suc p) -> suc (add p n) mul (m::Nat) (n::Nat)::Nat = case m of (zero ) -> zero (suc p) -> add n (mul p n) ...
If you create an application that allows 3rd-party plug-ins, you can load those plug-ins in a separate AppDomain so that your main application is safe from unknown code.
If you create an application that allows 3rd-party plug-ins, you can load those plug-ins in a separate AppDomain so that your main application is safe from unknown code. ASP.NET also uses separate AppDomains for each web application within a single worker process.
Using SQL Server 2005's XQuery select all nodes with a specific attribute value, or with that attribute missing.
|sql-server|xpath|xquery|axes|
Using SQL Server 2005's XQuery implementation I need to select all nodes in an XML document, just once each and keeping their original structure, but only if they are missing a particular attribute, or that attribute has a specific value (passed in by parameter). The query also has to work on the whole XML document (d...
## Update: giving a much more thorough example. The first two solutions offered were right along the lines of what I was trying to say *not* to do. I can't know location, it needs to be able to look at the whole document tree. So a solution along these lines, with /Books/ specified as the context will not work: ...
Interfacing with telephony systems from *nix
|c++|unix|tapi|cisco|
Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it. I want to monitor the phone system for lo...
|c++|unix|cisco|tapi|
Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it. I want to monitor the phone system for lo...
If you are using the .NET Framework 3.0 or above, I would use WCF. Using WCF, you can use different bindings depeneding on the trade-off between performance/interop/etc. that you need. If performance isn't critical and you need interop with other Web Service technologies, you will want to use the WS-HTTP binding. F...
If you have your own web server (and don't want to use TiddlySpot), try [this code][1] to enable saving to your own server. [1]: http://tiddlywiki.bidix.info/#HowToUpload
I create a design etc., and then I look at it and try and remove (agressively) everything that doesn't seem to be needed. If it turns out I need it later when I am polishing the design I add it back in. I do this over several iterations, refining as I go along.
It depends on the lifestyle of the component you specified when you added it to the container. You would use Release() If the lifestyle is Pooled. This puts the component back in the pool for the next retrieval (the object is not destroyed, so disposing would be bad) if the lifestyle is transient, a new object i...
There is a plugin to use TinyMCE with rails, lots of information on the [rails wiki][1]. [1]: http://wiki.rubyonrails.org/rails/pages/HowToUseTinyMCE
How can I convert types in C++ ?
|c++|types|oop|
I'm using two different libraries in my project, and both of them supply a basic rectangle struct. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author of either of the...
I'm using two different libraries in my project, and both of them supply a basic rectangle struct. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author of either of the...
|c++|oop|types|
I'm using two different libraries in my project, and both of them supply a basic rectangle struct. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author of either of the...
The minimum of testing shows that this should do it: grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt - -E use extended regexp - -v Show lines that do **not** match - ^ starts with - .* anything - \* an asterisk - [0-9A-Fa-f] hexadecimal digit - {2} exactly two of the previous - $ end of line ...
The minimum of testing shows that this should do it: grep -Ev "^\$.*\*[0-9A-Fa-f]{2}$" a.txt | grep -v ADVER - -E use extended regexp - -v Show lines that do **not** match - ^ starts with - .* anything - \\* an asterisk - [0-9A-Fa-f] hexadecimal digit - {2} exactly two of the previous ...
It depends if you're talking about just the DB engine or the product as a whole. SQL Server 2000 didn't have anything like Analysis services and Reporting services. As for the DB engine - if you use it for a simple application, I don't think you should bother. Also, I think the SQL Express edition introduced in 2005 be...
I've used [dhtmlxGrid](http://www.dhtmlx.com/docs/products/dhtmlxGrid/index.shtml) in the past. Among other things it supports drag-and-drop rows/columns, client-side sorting (string, integer, date, custom) and multi-browser support.
I've used [dhtmlxGrid](http://www.dhtmlx.com/docs/products/dhtmlxGrid/index.shtml) in the past. Among other things it supports drag-and-drop rows/columns, client-side sorting (string, integer, date, custom) and multi-browser support. Response to comment: No, not found anything better - just moved on from that proje...
Why do we need other JVM languages
|jvm|vm|compatibility|
I see [here](http://www.is-research.de/info/vmlanguages/index.html) that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So: What is the advantage in having other languages for the JVM? What is required (in high l...
|jvm|compatibility|vm|
I see [here](http://www.is-research.de/info/vmlanguages/index.html) that there are a load of languages aside from Java that run on the JVM. I'm a bit confused about the whole concept of other languages running in the JVM. So: What is the advantage in having other languages for the JVM? What is required (in high l...
How to load a python module into a fresh interactive shell in Komodo?
|python|shell|interpreter|interactive|komodo|
When using PyWin I can easily load a python file into a fresh interactive shell and I find this quite handy for prototyping and other exploratory tasks. I would like to use Komodo as my python editor, but I haven't found a replacement for PyWin's ability to restart the shell and reload the current module. How can ...
**I strongly dislike any style that places the if's test and body on the same line.** This is because sharing the line makes it impossible to set a breakpoint on the if's body in many debuggers because breakpoints are typically line number based.
Are you thinking of [Park Place][1]? [1]: http://code.whytheluckystiff.net/parkplace/
map[ key ] - let stl sort it out. That's communicating your intention most effectively.
map[ key ] - let stl sort it out. That's communicating your intention most effectively. Yeah, fair enough. If you do a find and then an insert you're performing 2 x O(log N) when you get a miss as the find only lets you know if you need to insert not where the insert should go (lower_bound might help you there...
How can I open a google chrome control in C#
|c#|
I know there is a way to add a IE control, how do you add a chrome control...? Is it even possible right now?
|c#|
I know there is a way to add a IE control, how do you add a chrome control...? Is it even possible right now? I'm need this because of the fast javascript VM found in chrome.
`std::list<int>` is slightly nicer, IMO. Note that this would not require an extra copy of the data in the list, as it's only pointers being copied. It depends entirely on your consumers. If you can expect them to be C++ developers, give them one of the `std` container classes, I say. The only other thing that ...
NHibernate, auditing and computed column values
|c#|.net|nhibernate|
How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties? E.g. every table contains audit columns like CreatedBy, CreatedDate, UpdatedBy, UpdatedDate. But I dont want to add these poperties to the domain classes. I want to k...
|asp.net|browser|localization|currency|
I wanting to show prices for my products in my online store. I'm currently doing: <span class="ourprice"> <%=GetPrice().ToString("C")%> </span> Where GetPrice() returns a decimal. So this currently returns a value e.g. "£12.00" I think the correct HTML for an output of "£12.00" is "`&pound;...
'Looser' typing in C# by casting down the inheritance tree
|c#|inheritance|data-structures|bittorrent|
The question I want to ask is thus: Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available? Now, the example of why I think it can be used for good. I recently implem...
|c#|data-structures|inheritance|bittorrent|
The question I want to ask is thus: Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available? Now, the example of why I think it can be used for good. I recently implem...
It depends on the lifestyle of the component you specified when you added it to the container. You would use Release() If the lifestyle is Pooled. This puts the component back in the pool for the next retrieval (the object is not destroyed, so disposing would be bad) if the lifestyle is transient, a new object i...
This allows you to create a scope block anywhere. It's not that useful on it's own, but can make logic simpler: switch( value ) { case const1: int i = GetValueSomeHow(); //do something return i.ToString(); case const2: int i = Ge...
Perhaps the following SQL is clumsy, but it seems to work correctly in Access. SELECT a.account, a.time, a.value FROM tablename AS a INNER JOIN [ SELECT account, Max(time) AS MaxOftime FROM tablename GROUP BY account ...
It tells you how many milliseconds late the callback is called.
From everything I can find it looks like [Corin][1] is right. Here is the code that I used to accomplish the original goal. I am not usually a Managed C++ programmer, so any editing would be appreciated. CustomMessageBox.h: using namespace System::Windows::Forms; /// <summary> /// A message ...
I dont't know if that helps, but if you can use MIDI for anything, you should check out [JFuge](http://www.jfugue.org/).
I don't mean becoming an _ALT.NETters_ just in a way of letting them know that the stuff are out there but in a way that they can understand it and feel that it can help them.
I don't mean becoming an _ALT.NETter_ just in a way of letting them know that the stuff are out there but in a way that they can understand it and feel that it can help them.
How do I use INotifyPropertyChanged to update an array binding?
|wpf|
Let's say I have a class: class Foo { public string Bar { get { ... } } public string this[int index] { get { ... } } } I can bind to these two properties using "{Binding Path=Bar}" and "{Binding Path=[x]}". Fine. Now let's say I w...
Personally I would say one of the biggest advantages I have found is the product responds quicker i.e. opens faster, compiles and runs projects faster. In my mind why wouldn't you upgrade for this benefit alone. Because of the environment that I work in I am restricted to .NET 2.0 so have not been able to take adva...
InlineShape is treated as a letter. Hence, the same technique. ThisDocument.Range(15).InlineShapes.AddPicture "1.gif"
A basic JavaScript object is an associative array, so it can easily be used to store key/value pairs. So using [JSON][1], you could create an object for each string to be localized like this: var localizedStrings={ confirmMessage:{ "en/US":"Are you sure?", "fr/FR":"Est-ce que v...
A basic JavaScript object is an associative array, so it can easily be used to store key/value pairs. So using [JSON][1], you could create an object for each string to be localized like this: var localizedStrings={ confirmMessage:{ 'en/US':'Are you sure?', 'fr/FR':'Est-ce que v...
I started out with RadRails then moved to Aptana when they took it over, wasn't too bad. Got a macbook and have been using Textmate, never going back.
The two most commonly used licenses that allow what you want are the [BSD License][1] and [MIT License][2]. (see also the full [list of licenses][3] considered Open Source by the OSI). [1]: http://www.opensource.org/licenses/bsd-license.php [2]: http://www.opensource.org/licenses/mit-license.php [3]: htt...
I think you can get that information using [JDepend][1] [1]: http://www.clarkware.com/software/JDepend.html
The [GNU Lesser General Public Licence][1] is also corporate-friendly and quite often used in libraries. It allows for _usage_ of a certain library but modifications to it should be made public. [1]:http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_Licence
As a possible alternative to the BSD license you can also use the [Ms-PL](http://www.opensource.org/licenses/ms-pl.html) license (Microsoft public license). Pretty much the same but (arguably) better worded. Additionally, It's got “Microsoft” in its name, which screams “corprate-friendly” like nothing else does. ;-)
Textmate on osx
if you include the active_support gem (comes with rails) it adds the method from_xml to the Hash object. You can then call Hash.from_xml(xml_content) and it'll return a hash that you can use to access the data. I don't know of an easy way to map an xml to an object, but you could create a wrapper class that delegat...
Is it possible to use nHibernate with Paradox database?
|database|nhibernate|paradox|
Is it possible to configure nHibernate to connect to Paradox database (*.db files)?
For debugging, I usually just create an element (in the case below: `<div id="error"></div>`) on the page and write the XmlHttpRequest to it: error: function (XMLHttpRequest, textStatus, errorThrown) { $("#error").html(XMLHttpRequest.status + "\n<hr />" + XMLHttpRequest.responseText); } Then you...
For debugging, I usually just create an element (in the case below: `<div id="error"></div>`) on the page and write the XmlHttpRequest to it: error: function (XMLHttpRequest, textStatus, errorThrown) { $("#error").html(XMLHttpRequest.status + "\n<hr />" + XMLHttpRequest.responseText); } Then you...
The question I want to ask is thus: Is casting down the inheritance tree (ie. towards a more specialiased class) from inside an abstract class excusable, or even a good thing, or is it always a poor choice with better options available? Now, the example of why I think it can be used for good. I recently implem...
.aspx doesn't fulfill the MVC pattern because the aspx page (the 'view') is called before the code behind (the 'controller'). This means that the controller has a 'hard dependency' on the view, which is very much against MVC principles. One of the core benefits of MVC is that it allows you to test your controller...
shell script is a language designed to manipulate files and processes. While it's great for that, it's not a general purpose language, so always try to glue logic from existing utilities rather than recreating new logic in shell script. Other than that general principle I've collected some [common shell script mi...