instruction stringlengths 0 30k ⌀ |
|---|
I don't know about C# specifically, but in perl it would be:<br>
s/<br>
\\\*\\\*(.*?)\\\*\\\*/<br>
\< bold\>$1\<\/bold\>/g<br>
s/<br>
\\\*(.\*?)\\\*/<br>
\< em\>$1\<\/em\>/g<br>
|
I was helping a friend set up [the solution mentioned by Ricardo][1] yesterday. We hacked it a bit by loading the YAML file with something similar to this (going from memory here):
require 'ostruct'
require 'yaml'
require 'erb'
#config = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/config.y... |
There's a paper that purports to have an algorithm for this: "Critical path in an activity network with time constraints". Sadly, I couldn't find a link to a free copy. Short of that, I can only second the idea of modifying [Dijkstra's](http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) or [A*](http://en.wikipedia.or... |
There's a paper that purports to have an algorithm for this: "Critical path in an activity network with time constraints". Sadly, I couldn't find a link to a free copy. Short of that, I can only second the idea of modifying [Dijkstra's](http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) or [A\*](http://en.wikipedia.o... |
OK, everyone who has used generics in .net must have run into this at one point or another.
Yes, intuitively it should work. No, in the current version of the C# compiler it doesn't.
Eric Lippert has a really good explanation of this issue (it's in eleven parts or something and will bend you mind in places, b... |
OK, everyone who has used generics in .net must have run into this at one point or another.
Yes, intuitively it should work. No, in the current version of the C# compiler it doesn't.
Eric Lippert has a really good explanation of this issue (it's in eleven parts or something and will bend you mind in places, b... |
In 99% of cases, writing a CMS is simply busy work for re-inventing the wheel. There are so many open-source CMSs out there that I can almost guarantee you can find one that will suit your needs.
That said, if you're still determined to write your own, I would only write exactly as much functionality as you need. Wr... |
You might also want to have a look at the cost of storing the cache data, in terms of your effort and CPU cost, against how what the cache will buy you.
If you find that 80% of your forum views are looking at the first page of threads, then you could decide to cache that page only. That would mean both cache reads ... |
use the SDK Command Prompt and navigate the active folder to the folder containing the below source code... then compile the code using
' vbc.exe watermark.vb /t:exe /out:watermark.exe '
this will create an exe in the folder.. the exe accepts two parameters:
ex.
watermark.exe "c:\source folder" "c:\destinatio... |
use the SDK Command Prompt and navigate the active folder to the folder containing the below source code... then compile the code using
<pre><code>
vbc.exe watermark.vb /t:exe /out:watermark.exe
</code></pre>
this will create an exe in the folder.. the exe accepts two parameters:
ex.
<pre><code>
watermark.ex... |
here is my full article: [http://forums.asp.net/p/1323176/2634923.aspx][1]
use the SDK Command Prompt and navigate the active folder to the folder containing the below source code... then compile the code using
<pre><code>
vbc.exe watermark.vb /t:exe /out:watermark.exe
</code></pre>
this will create an exe i... |
The SGI STL has an extension called [`select1st`](http://www.sgi.com/tech/stl/select1st.html). Too bad it's not in standard STL! |
One thing you can do is to create client classes corresponding to the web service data contracts with any additional functionality that you want and set the web service reference to reuse existing types. Then there is no reason to create an additional wrapper class to bind to. |
How to access the current Subversion build number? |
|svn| |
How can you automatically import the latest build/revision number in subversion?
The goal would be to have that number visible on your webpage footer like SO does. |
The only way is to have each project in a completely separate repository. Items within the same repository will always exhibit the behavior you mentioned in your question.
[From Here](http://svnbook.red-bean.com/en/1.0/ch02s03.html)
>>>>Unlike those of many other version control systems, Subversion's revision nu... |
I use a custom xml configuration file, where a different config file is used for each environment (dev/qa/prod). The config files are templates that are dynamically instantiated with things like host/port configurations for services - this makes multi environments and failover very easy as it can be handled by the temp... |
I use a custom xml configuration file, where a different config file is used for each environment (dev/qa/prod). The config files are templates that are dynamically instantiated with things like host/port configurations for services - this makes multi environments and failover very easy as it can be handled by the temp... |
Class Naming Conventions / Layout |
|oop|naming-conventions| |
Does anyone have a good article or good advice for class naming for n-tier web applications? I'm used to the layout that LLBLGen gives when it generates objects based on a database structure, which might generate the following class files for a given "User" table in the database:
/EntityClasses/UserEntity.vb
... |
You have to create a separate repository for each project. This is in general a good idea anyways so no downside there :) |
Technical issues aside, just get SVN and start using it. You will see the immediate benefits (looking at code history, diff-debugging to see what change introduced the bug that was not present last week), and you will never want to look back.
I, personally, do not like my source control integrated in the IDE. I use ... |
Because checking for overflow takes time. Each primitive mathematical operation, which normally translates into a single assembly instruction would have to include a check for overflow, resulting in multiple assembly instructions, potentially resulting in a program that is several times slower. |
MySQL just officially released the alpha of "MySQL Workbech for linux":
See the announcement here:
<a href="http://dev.mysql.com/workbench/?p=153">MySQL Workbench 5.1 Alpha for Linux available</a>. |
It's hard to say how a certain JVM implements instance of, but in most cases, Objects are comparable to structs and classes are as well and every object struct has a pointer to the the class struct it is an instance of. So actually instanceof for
if (o instanceof java.lang.String)
might be as fast as the foll... |
You're an expert in c if you can answer all the questions tagged "c" on stackoverflow.com without blinking. |
Everyone is an expert at a job fair |
How do I get the Click Once Publish version to match the AssemblyInfo.cs File Version. |
|visual-studio|versioning| |
Every time I publish the Application in Click Once I get get it to update the revision number by one. Is there any way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting looks at the Assembly Version). |
|visual-studio|versioning|clickonce| |
A set only contains unique items. If there are duplicates, than it is no longer a set. |
A set only contains unique items. If there are duplicates, then it is no longer a set. |
ReportViewer displaying black background in Print Layout mode |
|visual-studio|reporting-services|reportviewer| |
In my ReportViewer control, when I click on Print Layout, the background turns black on the report. This must be a bug. Is there a workaround? |
For starters, check out [flydom](http://flydom.socianet.com/) and it's variants, they will help termendously. Could you possibly give more context? If this is not in the onload and just pasted in the page, just wrapping the whole thing in $(function () { /* code */ }) will probably clean up everything you are having pr... |
There's a paper that purports to have an algorithm for this: "Critical path in an activity network with time constraints". Sadly, I couldn't find a link to a free copy. Short of that, I can only second the idea of modifying <a href="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" title="Wikipedia entry for the alg... |
There's a paper that purports to have an algorithm for this: "Critical path in an activity network with time constraints". Sadly, I couldn't find a link to a free copy. Short of that, I can only second the idea of modifying http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm or http://en.wikipedia.org/wiki/A*
UPDATE... |
Please note that games for windows live is now free:
[http://www.engadget.com/2008/07/22/games-for-windows-live-now-free/][1]
Since using the Live APIs is your only option on xbox and zune, it makes it a pretty compelling option since your only issue was the cost on windows :-) Especially considering the fact tha... |
Please note that games for windows live is now free:
[http://www.engadget.com/2008/07/22/games-for-windows-live-now-free/][1]
Since using the Live APIs is your only option on xbox and zune, it makes it a pretty compelling option since your only issue was the cost on windows :-) Especially considering the fact tha... |
Perhaps you could try [Lidgren][1]
[1]: http://www.ziggyware.com/readarticle.php?article_id=168 |
Integrating gyro and accelerometer readings |
|kalman-filter|signal-processing|robotics| |
I have read a number of papers on Kalman filters, but there seem to be few good publically accessible worked examples of getting from mathematical paper to actual working code.
I have a system containing a three-axis accelerometer and a single gyro measuring rotation around one of the accelerometer axes. The system ... |
Seems that the array is the real data, and the single-string stuff is a convenience. That's fine, but I'd say look out for things like serialization and memberwise cloning, which will get and set both writeable properties.
I think I would;
- keep the array as a property
- provide a `GetJoinedString(string seper... |
You might find useful the MS AJAX [Calendar][1] control extender, you can get the date just by
`document.getElementById('<%= DateTextBox.ClientID%>').value;`
*DateTextBox* is an *asp:TextBox* control that will be extended with the AJAX calendar.
[1]: http://www.asp.net/ajax/ajaxcontroltoolkit/samples/Cal... |
I agree with others that you're probably thinking about this the wrong way. With that out of the way, this may work for you if you are only accessing static members:
public class A {
public static class Foo extends package1.Foo {}
}
public class B {
public static class Foo extends pa... |
If you are using the Settings.settings file, it's saving to the config file. By calling YourNamespace.Properties.Settings.Save() after updating your settings, they will be saved to the config files.
However, I have no idea what you mean by "multiple sets of settings." If the settings are user settings, each user w... |
I make limited use of stored procedures, and it works well. I am the lead dev for one of my companies clients, working on their e-comm website. The client has a stock system, we implemented a set of stored procedures on their system and built an API to communicate with it. This allowed us to abstract their database and... |
Here's a video that will show you, step-by-step, how to export data to Excel. It's a great solution for 'one-off' problems where you need to export to Excel:
[Ad-Hoc Reporting][1]
[1]: http://www.sqlservervideos.com/tips-n-tricks/adhoc-reporting |
In a library? Try [libextractor][1] if your software is GPL.
[1]: http://gnunet.org/libextractor/ |
Why does Rails cache views when hosted on VM and codebase on Samba share |
|ruby-on-rails|caching| |
I have the following setup:
- Code on my local machine (OS X) shared as a Samba share
- A Ubuntu VM running within Parallels, mounts the share
Running Rails (either via Mongrel, WEBrick or passenger) in development mode, if I make changes to my views they don't update without me having to kick the server. I'... |
You need to create repositories inside your "Projects" folder, and when you do the initial checkout, checkout "???/projects/repo1"... this will keep the working copies separate on your machine, and you will check in/out completely separately of each other. |
wget or curl can both recursively follow links and mirror an entire site, so that might be a good bet. You won't be able to use truly interactive parts of the site, like search engines, or anything that modifies the data, thoguh.
Is it possible at all to create dummy backend services that can run from the sales fol... |
LINQ requires framework 3/3.5, because it use a lot of extensions of 3/3.5 (Extension method, lambda expression Func<> delegate etc).Then it doesn' t work with 2.0 version.
If you develop a project using linq on your local pc, simply make a standard deploy (e.g. copy dll, aspx etc) to server production and it will w... |
You're not going to be able to handle things like AJAX requests without burning a webserver to the CD, which I understand you have already said is impossible.
[wget][1] will download the site for you (use the -r parameter for "recursive"), but any dynamic content like reports and so on of course will not work proper... |
If you're purely a listener and do *no* other JMS calls other than connection setup, then the "onException() handler" answer is correct.
If you do any JMS calls in your code, just using onException() callback isn't sufficient. Problems are relayed from the JMS provider to the app *either* via an exception on a JMS ... |
LINQ runs on .NET CLR 2.0 runtime, but to be able to compile and use your LINQ code you need .NET 3.5 (C# 3.0 compiler), since .NET 3.5 adds some LINQ-related assemblies to the framework. |
Good alternative to GenuineChannels for .net remoting |
|.net|remoting|genuinechannels| |
We have been using GenuineChannels in our product for the last 4 years. GenuineChannels now appears to have become unsupported and the main developer guy Dmitri has I think joined Microsoft. I have the source as part of the product but not the networking / .net knowledge to support it.
Has anyone found a good altern... |
One possible solution is to have it listen on a port using the socket functions. You can check that the socket is still listening with a simple script. Even a monitoring service like pingdom could monitor its status. If it dies, the socket is no longer listening.
Plenty of solutions.. Good luck.
|
One thing to be careful of with either of these methods is that not all enumerations can be rolled-back, for instance all implementations of System.Data.IDataReader can only run through once.
In these cases you don't really have a cost in a `foreach` loop, so long as you account for the fact that it might not even l... |
Just use File->open to open the copy of the VM. It will probably ask you if you want to change the VM's unique ID. If you plan to run both the original and the clone at the same time, and it's not a Windows OS that needs activation, you should say yes. |
just copy the folder cp -R folder newfolder (in your docs folder) Open the folder in Vmware and say you copied it Have a look on weblog.jamisburk.org, august 15
as there may be issues with networking
Justin |
Add the parameter to the parent report and set the sub report parameter value from the parent report (in the actual report definition). This is what I've read. Let me know if it works for you. |
`document.location.href` will give you the current URL, which you can then manipulate using JavaScript's string functions. |
There's a tool called IlMerge that can accomplish this: http://research.microsoft.com/~mbarnett/ILMerge.aspx
Then you can just make a build event similar to the following.
Set Path="C:\Program Files\Microsoft\ILMerge"
ilmerge /out:$(ProjectDir)\Deploy\LevelEditor.exe $(ProjectDir)\bin\Release\release.exe $(Proje... |
There's a tool called IlMerge that can accomplish this: http://research.microsoft.com/~mbarnett/ILMerge.aspx
Then you can just make a build event similar to the following.
Set Path="C:\Program Files\Microsoft\ILMerge"
ilmerge /out:$(ProjectDir)\Deploy\LevelEditor.exe $(ProjectDir)\bin\Release\release.exe $(Pro... |
You need to be able to identify bottlenecks and test improvements.
To identify bottlenecks, you need to use your system's reporting tools. Some examples:
- MySQL has a slow query log.
- Linux provides stats like load average, iostat, vmstat, netstat, etc.
- Apache has the access log and the server-status... |
You have three tables right?
People, Groups, and GroupAdministrators
when you add to both sides you get
People (with an id of p1)
Groups (with an id of g1)
and in GroupAdministrators you have two columns and a table that has
(p1,g1)
(p1,g1)
and your unit test code looks like the following.
... |
If you're asking for all birthdays in a given _month_, then you should supply the _month_, not a _date_:
SELECT c.name
FROM cust c
WHERE datepart(m,c.birthdate) = @SuppliedMonth
|
As to convincing your boss you might try arguments from Cory Doctorow from [this essay book][1].
He has some very good points·
[1]: http://craphound.com/content/ |
As to convincing your boss you might try arguments from Cory Doctorow from [this essay book][1].
He has some very good points.
I think the best argument is that you will be spending much programmer resources on writing features that your users will dislike. Noone wants their player to say: 'you can't listen to t... |
How can I immediately play a sound when another sound ends using XNA/XACT? |
|c#|audio|xna|xact| |
This question borders between the world of the audio designer and the programmer. While this question might have to be partially answered by that domain of an audio designer, it is sure a problem for the programmer. In our project, we want to loop a sound (background music) while the game timer is greater than one minu... |
The reason you can't stop DRM no matter what is as follows: imagine a bank vault. There has to be a way in to get the money out. If there is a way in, that means someone could get in that way, therefore it is not impenetrable. If the vault is impenetrable, that means no one can get in -- meaning no one can get the ... |
I have developed one myself, [LoginBuzz][1]. It is primarily Danish and I have first translated many parts of it the last week, but it should be fully functional.
It supports simple registration, attribute exchange and PAPE. I have also implemented CardSpace support and text messaging (only available in Denmark at t... |
|signal-processing|robotics|kalman-filter| |
I have read a number of papers on Kalman filters, but there seem to be few good publically accessible worked examples of getting from mathematical paper to actual working code.
I have a system containing a three-axis accelerometer and a single gyro measuring rotation around one of the accelerometer axes. The system ... |
http://pkgconfig.freedesktop.org/wiki/
pkg-config is a helper tool used when compiling applications and libraries.
Depending on your OS, you might be able to get a binary distribution (try apt-get on Ubuntu, for example), otherwise you can get the source from their web site.
|
pkg-config is used for when you are compiling applcations and libraries. It's really used for inserting the right command line arguments.
It comes installed on most new releases of linux, but is pretty common if it's not there initially so it shouldn't be too hard to find.
Here's how to install it on ubuntu:
... |
Well, I think that as soon you get enough experience in both languages this becomes a non-issue (just with similar natural languages, like Italian and Spanish). If you usually program in one language and switch to the other only occasionally, then unfortunately you are doomed to write Common Lisp in Scheme or vice vers... |
After spending a couple hours fooling around with this problem. Brian is totally right. The current version of VS does not allow changing the TabControl's template, but it can be done using Blend, and there is a margin on the template. The main drawback of doing this is that the XAML file will no longer be previewable ... |
At the application layer (using a Berkeley socket style API) you just watch the clock, and read or write data at the rate you want to limit at.
If you only read 10kbps on average, but the source is sending more than that, then eventually all the buffers between it and you will fill up. TCP/IP allows for this, and th... |
This isn't the exact answer to your question, but you could use [**Locate32**][1] instead of the Windows search facility. It has a whole suite of command-line options plus has the huge benefit of being an indexed search, which means the results will display instantaneously. It's a tool I can't be without on Windows.
... |
## Use [Locate32][1]
This isn't the exact answer to your question, but you could use [**Locate32**][1] instead of the Windows search facility. It has a whole suite of command-line options plus has the huge benefit of being an indexed search, which means the results will display instantaneously. It's a tool I can't b... |
## Use [Locate32][1]
This isn't the exact answer to your question, but you could use [**Locate32**][1] instead of the Windows search facility. It has a whole suite of command-line options plus has the huge benefit of being an indexed search, which means the results will display instantaneously. It's a tool I can't b... |
'Best' questions are not really valid. The world is filled with combination and variations. You should start with the question that you have to answer: What problem are you trying to solve. After you answer that you look at the tools that work best with the issue. |
My understanding of why errors would not be raised by default at runtime boils down to the legacy of desiring to create programming languages with ACID-like behavior. Specifically, the tenet that anything that you code it to do (or don't code), it will do (or not do). If you didn't code some error handler, then the m... |
One pragmatic tip: you can search easily for the static_cast keyword in your source code if you plan to tidy up the project. |
Secure-Wave and click once applications |
|click-once|secure-wave| |
I have users who are using "secure-wave" security. Evidently it is some sort of white-listing application monitor.
With my click-once application, the name of the folders that are used are runtime generated, so the administrators are not able to properly whitelist the application and its files.
Any suggestions... |