instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I don't want to include relations in my edmx entity framework, I want to have the foreign key field as a normal property in my entity. </p>
<p>How can I do that?</p>
| <p>If you want plain foreign keys in your database then you're using the wrong one. As far as I know entity framework made sure all those obscure id's were thrown away and replaced with pointers to the entity you need. If you really want those foreign keys then you should look into a different database.</p>
| <p><a href="http://www.thedatafarm.com/blog/2007/09/11/EntityDataModelAssociationsWheresMyForeignKey.aspx" rel="nofollow noreferrer">http://www.thedatafarm.com/blog/2007/09/11/EntityDataModelAssociationsWheresMyForeignKey.aspx</a></p>
<p>I found the article describing the error in our ways...
basically we never suppos... | 33,065 |
<p>I learned Java in college, and then I was hired by a C# shop and have used that ever since. I spent my first week realizing that the two languages were almost identical, and the next two months figuring out the little differences. For the most part, was I noticing the things that Java had that C# doesn't, and thus w... | <p>Comparing and contrasting the languages between the two can be quite difficult, as in many ways it is the associated libraries that you use in association with the language that best showcases the various advantages of one of another.</p>
<p>So I'll try to list out as many things I can remember or that have already... | <p>Java:</p>
<ul>
<li>Enums in Java kick so much ass, its not even funny.</li>
<li>Java supports generic variance</li>
</ul>
<p>C#:</p>
<ul>
<li>C# is no longer limited to Windows (Mono).</li>
<li>The lack of the keyword internal in Java is rather disappointing.</li>
</ul>
| 12,269 |
<p>I'm creating a plugin, and am looking to use RSpec so I can build it using BDD. </p>
<p>Is there a recommended method of doing this?</p>
| <p>OK, I think I have a solution:</p>
<ul>
<li>Generate the plugin via script/generate plugin</li>
<li>change the Rakefile, and add</li>
</ul>
<p><code>
require 'spec/rake/spectask'</p>
<pre><code>desc 'Test the PLUGIN_NAME plugin.'
Spec::Rake::SpecTask.new(:spec) do |t|
t.libs << 'lib'
t.verbose = tru... | <p>For an example of an existing plugin that uses rspec, check out the <a href="http://github.com/technoweenie/restful-authentication/tree/master" rel="nofollow noreferrer">restful_authentication plugin</a>. Maybe it will help.</p>
| 10,788 |
<p>How do you control the column width in a gridview control in ASP.NET 2.0?</p>
| <p>You can use the HeaderStyle-Width, ItemStyle-Width or FooterStyle-Width properties. These can be applied to all the columns or per-column basis.</p>
<pre><code> <asp:GridView ID="GridView1" runat="server">
<HeaderStyle Width="10%" />
<RowStyle Width="10%" />
<FooterS... | <pre><code>Gridview.Columns[1].ItemStyle.Width = 100;
</code></pre>
<p>This will set the with in pixel.</p>
| 39,916 |
<p>If I understand correctly, <code>ClickOnce</code> only checks for prerequisites with the first install of an application through the setup.exe file that contains the prerequisite information. If the user opens the app in the future it will check for new versions, but it does not launch the setup.exe again, thus not ... | <p>Unfortunately, your users will have to re-run the setup.exe to check and install all the new prerequisites that you have added.</p>
<p>Applications deployed using ClickOnce only check for application updates (if enabled), not prerequisites as it's the bootstrapper's job to make sure all dependencies are installed b... | <p>HAdes is correct. However, as long as your app can <em>start</em> without the new prerequisite, you have the option of checking for it in code.</p>
<p>I had the exact same situation with Crystal Reports and ended up writing code to check if it was installed, download the installation files, and run it in the backg... | 10,713 |
<p>How can i add a line break to the text area in a html page?
i use VB.net for server side coding.</p>
| <p>If it's not vb you can use <code>&#013;&#010;</code> (ascii codes for cr,lf)</p>
| <p>I believe this will work:</p>
<pre><code>TextArea.Text = "Line 1" & vbCrLf & "Line 2"
</code></pre>
<p>System.Environment.NewLine could be used in place of vbCrLf if you wanted to be a little less VB6 about it.</p>
| 9,232 |
<p>I recently wrote a class for an assignment in which I had to store names in an ArrayList (in java). I initialized the ArrayList as an instance variable <code>private ArrayList<String> names</code>. Later when I checked my work against the solution, I noticed that they had initialized their ArrayList in the <co... | <p>In the words of the great Knuth "Premature optimization is the root of all evil". </p>
<p>Just worry that your program functions correctly and that it does not have bugs. This is far more important than an obscure optimization that will be hard to debug later on. </p>
<p>But to answer your question - if you initia... | <p>You have to avoid Lazy initialization. It leads to problems later.<br>
But if you have to do it because the initialization is too heavy you have to do it like this:</p>
<p>Static fields:</p>
<pre><code>// Lazy initialization holder class idiom for static fields
private static class FieldHolder {
static final Fi... | 37,306 |
<p>I would like to automatically generate PDF documents from <a href="https://en.wikipedia.org/wiki/WebObjects" rel="nofollow noreferrer">WebObjects</a> based on mulitpage forms. Assuming I have a class which can assemble the related forms (java/wod files) is there a good way to then parse the individual forms into a P... | <p>The canonical response when asked about PDFs from WebObjects has generally been <a href="http://www.reportmill.com/" rel="nofollow noreferrer">ReportMill</a>. It's a PDF document generating framework that works a lot like WebObjects, and includes its own graphical PDF builder tool similar to WebObjects Builder an... | <p>ScArcher2>></p>
<p>I have looked into different routes for creating PDFs on the fly including FOP and a few Java libraries. I think what I am really asking is if anyone has already done this in the WebObjects framework. My hope is that someone familiar with WebObjects might have done this already and have some insi... | 3,250 |
<p>As a Micro ISV I am coming to the stage in the development of a new desktop software application where beta testing it with an external group of users would be great.</p>
<p><em>I would prefer private invite only beta testing as opposed to public free for all beta testing.</em></p>
<p><strong>Are there websites/or... | <p>Usually, invite-only beta testing pretty much restricts you to existing or potential customers. If you have customers of this product (you don't because you say it's "new") or of other products from your company, invite them to test your product. They won't all say yes.</p>
<p>If you don't have customers, or you ... | <p>You might take the approach that GMail used during its initial launch -- for products with neworking effecs, an initial-seed rollout, followed by an referall-invite-based growth would allow you to scale up at your preferred growth rate. And, the test pool would have a greater likelihood of interactions.</p>
<p>How... | 28,930 |
<p>I have a view which is selecting rows from a table in a different database. I'd like to grant select access to the view, but not direct access to the base table. The view has a where clause restricting the number of rows.</p>
<p>Can I grant select to the view and not the base table, or do I need to switch to a st... | <p>As you state in one of your comments that the table in question is in a different database, then <a href="http://msdn.microsoft.com/en-us/library/ms188676.aspx" rel="noreferrer">ownership chaining</a> applies. I suspect there is a break in the chain somewhere - check that link for full details.</p>
| <p>Just have a materialized view then you don't have to worry about all other factors. This is only going to work if space and refresh time is not a big deal.. materialized views are pretty cool.</p>
| 48,097 |
<p>i am trying to do something with the PIL Image library in django, but i experience some problems.</p>
<p>I do like this:</p>
<p><code>
import Image
</code></p>
<p>And then I do like this</p>
<p><code>
images = map(Image.open, glob.glob(os.path.join(dirpath, '*.thumb.jpg')))
</code></p>
<p>But when i try to run ... | <p>The error above happens because your file is called Image.py and you're trying to import yourself. As Manual pointed out, you should import Image from the PIL module, but you'd also need to rename your file so it's <em>not</em> called Image.py.</p>
| <p>Your example works fine in my machine. I don't know why you're getting that error. PIL documentation say you have to import the library in this way:</p>
<pre><code>from PIL import Image
</code></pre>
<p>You should try that way. As I said, for me works in both ways.</p>
| 44,849 |
<p>In a destructor, is there a way to determine if an exception is currently being processed?</p>
| <p>You can use std::uncaught_exception(), but it might not do what you think it does: see <a href="http://www.gotw.ca/gotw/047.htm" rel="nofollow noreferrer" title="GoTW#47">GoTW#47</a> for more information.</p>
| <p>You can use the <a href="http://www.boost.org/doc/libs/1_31_0/libs/test/doc/index.html" rel="nofollow noreferrer">Boost Test Library</a>. Look here for a small example:</p>
<pre><code>struct my_exception1
{
explicit my_exception1( int res_code ) : m_res_code( res_code ) {}
int m_res_code;
};
st... | 15,427 |
<p>For some reason sql server 2008 is not allowing me to add columns to an existing table.</p>
<p>The table is empty btw.</p>
<p>Is there a setting that prevents modifying tables in sql 2008?</p>
| <p>If <code>today</code> is the current day of the week, then you can use something like:</p>
<pre><code>days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7
</code></pre>
<p>This assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract <code>days_since_friday</cod... | <p>If <code>today</code> is the current day of the week, then you can use something like:</p>
<pre><code>days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7
</code></pre>
<p>This assumes that Friday is represented by day number 6 of the week (that is, 1 represents Sunday). Then subtract <code>days_since_friday</cod... | 36,186 |
<pre><code>public class Test {
public static void main(String[] args) {
}
}
class Outer {
void aMethod() {
class MethodLocalInner {
void bMethod() {
System.out.println("Inside method-local bMethod");
}
}
}
}
</code></pre>
<p>Can someone tell me ... | <p>You can only instantiate <code>MethodLocalInner</code> within <code>aMethod</code>. So do </p>
<pre><code>void aMethod() {
class MethodLocalInner {
void bMethod() {
System.out.println("Inside method-local bMethod");
}
}
MethodLocalInner foo = new MethodLoc... | <p>You need to call new Outer().aMethod() inside your main method. You also need to add a reference to MethodLocalInner().bMethod() inside your aMethod(), like this:</p>
<pre><code>public class Test {
public static void main(String[] args) {
new Outer().aMethod();
}
}
void aMethod() {
class Metho... | 10,604 |
<p>I've only started playing with both ASP.Net MVC and the new-to-VS2008 Dynamic Data Website Templates. I note that they both use routing in their URL handling, and I'm given to understand that because of routing, ASP.Net MVC won't work under IIS6. However my DynamicData site works just fine on IIS6.</p>
<p>I've ha... | <p>ASP.NET MVC does indeed work under <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true" rel="nofollow noreferrer">IIS6</a> (and IIS5 for that matter) as long as you <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer20... | <p>ASP.Net MVC and Dynamic Data use the same routing engine contained in System.Web.Routing, so they both work under IIS6. The issue is with mapping requests to ASP.Net (as described by @Richard Szalay). MVC will work fine under IIS6 if a wildcard mapping is used, if the .mvc extension is mapped to ASP.Net, or if ano... | 20,341 |
<p>My application has no forms. It runs by calling Application.Run();</p>
| <p>Call </p>
<pre><code>System.Windows.Forms.Application.Exit();
</code></pre>
| <p>Just like the MSDN documentation for the <a href="http://msdn.microsoft.com/en-us/library/ms157900.aspx" rel="nofollow noreferrer">Application.Run()</a> suggests:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.exit.aspx" rel="nofollow noreferrer">Application.Exit()</a... | 21,839 |
<p>There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled. </p>
<p>Does anyone know of some short/simple ways to detect if JavaScript is disabled? My intention is to give a warning that the site is not... | <p>I assume you're trying to decide whether or not to deliver JavaScript-enhanced content. The best implementations degrade cleanly, so that the site will still operate without JavaScript. I also assume that you mean <a href="https://www.seguetech.com/client-server-side-code/" rel="nofollow noreferrer" title="'Client-... | <p>Might sound a strange solution, but you can give it a try :</p>
<pre><code><?php $jsEnabledVar = 0; ?>
<script type="text/javascript">
var jsenabled = 1;
if(jsenabled == 1)
{
<?php $jsEnabledVar = 1; ?>
}
</script>
<noscript>
var jsenabled = 0;
if(jsenabled == 0)
{
<?php... | 14,741 |
<p>Does anyone have any suggestions for creating meta tables in a database? These tables would be used to emulate tables in a database, using a database. This is for when you want to easily add structure (more fields) to a database on the fly without having to worry about all the technicalities involved. The only examp... | <p>What you are talking about is a flexible schema model often referred to as an Open Schema model or Entity-attribute-value model. Google those and you will gets lots of references and articles.</p>
<p>I would also suggest you not shy away from a design wherein you add columns. Too often I see people take an approach... | <p>Instead of using tables and fields to express a dynamic structure, you could always use a single field of XML data. Many mainstream RDBMS's permit indexing attributes/elements within the XML, so your queries may even be performant.</p>
| 47,546 |
<p>The task is to take a list of tables which is changeable.</p>
<p>Write a piece of PL/SQL that when executed outputs every tables rows into individual csv files.</p>
<p>So if 5 tables. You will get 5 CSV files with the relevant table data in it.</p>
<p>The CSV should be | delimited and have " around each value (fo... | <p>Yes, it is possible. Look at this <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:88212348059" rel="nofollow noreferrer">Ask Tom</a> question that shows how to do it for 1 table at a time. All you need to do is loop through your array of table names and call Tom's procedure for each.</p... | <p>Ther are several options.</p>
<ol>
<li>You can use UTL_FILE do dump preformatted text strings into files. Just make a cursor that outputs all data columns concatenated with delimiters.</li>
</ol>
<p>Something like this:</p>
<pre><code>DECLARE
TYPE IDCurTyp IS REF CURSOR;
fo UTL_FILE.FILE_TYPE;
va... | 41,606 |
<p>Are there any guidelines/best practices for deciding what type of data should be stored in the database?</p>
<p>For ex., is it ok to use database to store</p>
<ol>
<li>Application logs </li>
<li>Configuration details (like server IP addresses etc.)</li>
<li>System information (e.g., names of shell scripts, schedul... | <p>To answer this question we have to understand what database storage provides that isn't available in say, flat file storage.</p>
<ol>
<li>security - You can store stuff and be sure that updates, deletes and views would be controlled</li>
<li>audit - you can keep track of who made changes and when</li>
<li>distribut... | <p><strong>Focus on ease of use and maintenance.</strong> The only logs I store in a database are put there by triggers that error out because that's easiest. But for everything else, searching and parsing text logs is faster and easier. If your app crashes, looking at a text config file is easier than looking in the d... | 41,844 |
<p>I am having some issues with using the OrderBy extension method on a LINQ query when it is operating on an enum type. I have created a regular DataContext using visual studio by simply dragging and dropping everything onto the designer. I have then created seperate entity models, which are simply POCO's, and I have ... | <p>Can you specify the type <code>CampaignStatus</code> directly in your <code>DataContext</code> trough the designer? This way the value is automatically mapped to the <code>enum</code>.</p>
| <p>My DataContext has it's own entity class named Campaign, (living in a different namespace, of course). Also the status column is saved as a smallint in the database, and the LINQ Entity namespace has it's type listed as a short (System.Int16).</p>
<p>The orderby DOES work if I apply it in the query in my repository... | 49,528 |
<p>When writing an app that one wants to have compile on mac, linux and windows, what is the best way of managing the different libraries that will need to be included on the various operating systems. For example, using the glut opengl toolkit requires different includes on each operating system. </p>
| <p>Your question is actually two questions in one:</p>
<p>1) How do I write my C++ code to include the right include files on the right platform?</p>
<p>2) How do I write my Makefile to work on different platforms?</p>
<p>The C++ code question is already answered - find the platform-specific defines and use them to ... | <p>Several projects I've worked on use an autoconf-based configure script which builds a Makefile, hence the reason you can build all of them from source with a simple:</p>
<pre><code>./configure
make
make install
</code></pre>
| 14,195 |
<p>We have a service that runs methods used for data import/export at specified intervals. To test these methods we have a little application with a single button that, when clicked, instantiates the import/export class and invokes the desired method. Nothing fancy. I would like create a more robust test application... | <p>You could modify your service methods to raise events that report on status during the processing then simply handle the events in your code to update the status, that would be the fastest method.</p>
<p>Your production code could simply not do anything with the events</p>
| <p>Perhaps you can use a BackgroundWorker object to update your application with the Debug information from your service. The nice thing about BackgroundWorker is that it runs the code on a separate thread which leaves your form available for updates.</p>
<p>Using the BackgroundWorker will allow you to update your ap... | 25,598 |
<p>I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network.</p>
<p>After renaming the server, the Sharepoint sites have many errors and do not run.</p>
| <p>I had similar issue just yesterday when trying to test my own DependencyProperty creating class. I came across this question, and noticed there was no real solution to unregister dependency properties. So I did some digging using <a href="http://www.red-gate.com/products/reflector/" rel="noreferrer">Red Gate .NET Re... | <p>If we register name for a Label like this :</p>
<pre><code>Label myLabel = new Label();
this.RegisterName(myLabel.Name, myLabel);
</code></pre>
<p>We can easily unregister the name by using :</p>
<pre><code>this.UnregisterName(myLabel.Name);
</code></pre>
| 17,673 |
<p>This question relates to an ASP.NET website, originally developed in VS 2005 and now in VS 2008.</p>
<p>This website uses two unmanaged external DLLs which are not .NET and I do not have the source code to compile them and have to use them as is.</p>
<p>This website runs fine from within Visual Studio, locating an... | <p>Try putting the dlls in the \System32\Inetsrv directory. This is the working directory for IIS on Windows Server.</p>
<p>If this doesn't work try putting the dlls in the System32 directory and the dependency files in the Inetsrv directory.</p>
| <p>On Application_start use this:
(customise /bin/x64 and bin/dll/x64 folders as needed)</p>
<pre><code>String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH")
,";"
, System.Web.Hosting.HostingEnvironment.MapPath("~/bin/x64")
,";"
... | 44,825 |
<p>I am new to BIRT. </p>
<ol>
<li>I have a requirement to print a HEADING based on a database value. How do I do that?</li>
<li>How do I leave a Blank line upon break in one of the fields I am reporting?</li>
<li>In the footer, I need to say "Page X of Y" where Y is the total number of pages?</li>
</ol>
| <ol>
<li><p>After creating the data source, switch to the "Master Page" and drag the field in question into the header.</p></li>
<li><p>No idea.</p></li>
<li><p>There are a couple of computed fields (called "AutoText") available. One of them renders itself as the total number of pages.</p></li>
</ol>
| <p>As you are new to BIRT it would be good to start with the <a href="http://www.eclipse.org/birt/phoenix/tutorial/" rel="nofollow noreferrer">Tutorials</a>. Reading the <a href="http://wiki.eclipse.org/BIRT/FAQ" rel="nofollow noreferrer">FAQ</a>s is usually enlightening, too. Make sure to check out the <a href="http:/... | 43,511 |
<p>I'm looking for something like: </p>
<pre><code>svnserve stop
</code></pre>
| <p>The recommended way is to do it is by using the <code>kill</code> command which will allow subversion to shut down properly. I don't think there is any better way to do it.</p>
| <p>also ps aux | grep -e PID -e svnserve may be useful to show titles.</p>
| 43,150 |
<p>I have a web-based application that notifies users of activity on the site via email. Users can choose which kinds of notifcations they want to receive. So far there are about 10 different options (each one is a true/false).</p>
<p>I'm currently storing this in one varchar field as a 0 or 1 separated by commas. For... | <p>I would use two tables. One table would store the user data and the other the notifications that they subscribe to. The second table would look something like this:</p>
<pre><code>create table notifications (
user_id int,
notification_type int
);
</code></pre>
<p>I'd make a FK relationship between user_id ... | <p>I'd expect that letting the DB manage it by using Bool columns would be better. I seem to recall that some systems will pack bools to bits (null might mess that up). To avoid clutter, you might make it a separate table.</p>
<p>(I'm no DBA)</p>
<p><em>Edit: slaps head "I just suggested exactly what you are thing of... | 25,363 |
<p>What prompts my question is <a href="http://www.codinghorror.com/blog/archives/001172.html" rel="nofollow noreferrer">this post from Jeff Atwood</a>, and <a href="http://www.25hoursaday.com/weblog/2008/08/31/DevelopersUsingLibrariesIsNotASignOfWeakness.aspx" rel="nofollow noreferrer">this post</a> from Dare Obasanjo... | <p>Encryption should be third party most of the times, ...unless you're in the business of selling encryption systems.</p>
<p>Which is pretty much Mr. Atwood his point as I understood it, your core busines shouldn't be third party, so there's probably nothing that should <em>always</em> be third party...</p>
| <p>Don't forget that the time is a big issue for writing all things by your hand, it is not that you cannot do that but the problem comes from your customers or company they always want to find the fastest way to build their system. But if you have a non-profit project you can try building things by yourself. For e.g y... | 27,074 |
<p>I'm looking to use Java to parse an ongoing stream of event drive XML generated by a remote device. Here's a simplified sample of two events:</p>
<pre><code><?xml version="1.0"?>
<Event> DeviceEventMsg
<Param1>SomeParmValue</Param1>
</Event>
<?xml version="1.0"?>
<Event> D... | <p>Try to use <a href="http://en.wikipedia.org/wiki/StAX" rel="nofollow noreferrer">StAX</a> instead of SAX. StAX allows much more flexibility and it is a better solution for streaming XML. There are few implementations of StAX, I am very happy with the <a href="http://stax.codehaus.org/Download" rel="nofollow noreferr... | <p>If you print out the name for the start and end element System.out.println() you will get something like this:</p>
<blockquote>
<p>got startDocument got startElement
Event found characters found
characters got startElement Param1
found characters got endElement Param1
found characters got endElement Even... | 24,143 |
<p>I have a Crystal Report that looks like:</p>
<p><em>Date | Person | Ticket | Summary <br>
Date | Person | Ticket | Summary <br>
Date | Person | Ticket | Summary</em> </p>
<p>I would like it to look like: </p>
<p><em>Date <br>
Person | Ticket | Summary <br>
Person | Ticket | Summary <br><br>
Date <br>
Person | Ti... | <p>Reading a bit about the <a href="http://dev.mysql.com/doc/refman/5.0/en/enum.html" rel="noreferrer">MySQL enum</a>, I'm guessing the closest equivalent would be a simple check constraint</p>
<pre><code>CREATE TABLE sizes (
name VARCHAR2(10) CHECK( name IN ('small','medium','large') )
);
</code></pre>
<p>but that... | <p>At this link you can find an alternative solution/workaround for Oracle, inspired by C language enums: <a href="http://www.petefinnigan.com/weblog/archives/00001246.htm" rel="nofollow">http://www.petefinnigan.com/weblog/archives/00001246.htm</a></p>
<p>Shortly put, Pete suggests to define some integer constants and... | 24,896 |
<p>Will I have to pay again? I have about 9 months left before renewal but my current provider doesn't offer many options / control panels.</p>
<p>Update: thanks for everyone's help - I've finally completed this now.</p>
<p>I had to:</p>
<ul>
<li>Ask my old registrar to "Unlock" the domain</li>
<li>Ask my old regist... | <p>This is how it works
Lets say you have 9 more months for your current domain to expire
you transfer the domain to GoDaddy (or to any other decent Registrar)
you will be charged the price (little more or equal) to the price of booking a new domain
BUT, you will have the domain for 9 months + one year (or the no. of y... | <p>There is a domain transfer procedure. It's kind of complex, since it's intended to keep people from stealing domains by transferring them to another registrar (like happened to <a href="http://en.wikipedia.org/wiki/Sex.com" rel="nofollow noreferrer">sex.com</a> back in the 90's). GoDaddy does a good job of talking... | 9,907 |
<p>Since the keyboard is <strong>the</strong> interface we use to the computer, I've always thought touch typing should be something I should learn, but I've always been, well, lazy is the word. So, anyone recommend any good touch typing software?</p>
<p>It's easy enough to google, but I'ld like to hear recommendation... | <p><a href="http://en.wikipedia.org/wiki/Typing_of_the_Dead" rel="nofollow noreferrer">Typing of the Dead!</a></p>
<p>It's a good few years old so you may have to hunt around, but it's a lot of fun and as well as the main game there are numerous minigames to practice specific areas you may be weak on.</p>
<p><img src... | <p>I've been using <a href="http://www.typefastertypingtutor.com/" rel="nofollow noreferrer">TypeFaster</a>. It's not pretty, but one nice feature is that it can load lessons in different keyboard layouts, like Colemak (<a href="http://colemak.com/Learn" rel="nofollow noreferrer">layout files here</a>) or Dvorak.</p>
| 3,165 |
<p>Anyone got a ready made function that will take an XML string and return a correctly indented string?</p>
<p>eg</p>
<pre><code><XML><TAG1>A</TAG1><TAG2><Tag3></Tag3></TAG2></XML>
</code></pre>
<p>and will return nicely formatted String in return after inserting line... | <p>The RTL has <a href="http://docwiki.embarcadero.com/Libraries/XE5/en/Xml.XMLDoc.FormatXMLData" rel="noreferrer">FormatXMLData</a> in XMLDoc.pas that accepts and returns strings.</p>
| <p>The XML Document DOM object build into Delphi has a pretty formatting option. You just load your XML into it and save it back out, and if you have that option set then it makes it all pretty. </p>
<p>I'll look it up and update this answer.</p>
| 28,970 |
<p>My application is preparing a cover-sheet for submitting documents by fax. I identify the batch by printing a <a href="http://en.wikipedia.org/wiki/Code_39" rel="nofollow noreferrer">Code39</a> on it. </p>
<p>The incoming faxes are received as tif files and my small c# service is polling for new faxes and calling a... | <p><a href="http://sourceforge.net/projects/barbara/" rel="nofollow noreferrer">BarBara</a> is an open source barcode recognition library. It certainly isn't perfect, but I have gotten it to work (if I remember it needed some twiddling to get it to compile in VS2008) pretty well. </p>
| <p>I'm not sure there is anything available free or open source, but <a href="http://www.vintasoft.com/vsbarcode-dotnet-index.html" rel="nofollow noreferrer">VintaSoftBarcode.NET Library</a> is pretty cheap and did the job for me on a recent project.</p>
| 14,642 |
<p>I've got a Windows Forms application with two ListBox controls on the same form.
They both have their SelectionMode set to 'MultiExtended'. </p>
<p>When I change the selection of one the selection of the other changes.</p>
<p>Now I thought I'd done something stupid with my SelectedIndexChanged handlers so I remove... | <p>It isn't the <em>list</em> that stores the current position - it is the <code>CurrencyManager</code>. Any controls (with the same <code>BindingContext</code>) with the <em>same reference</em> as a <code>DataSource</code> will share a <code>CurrencyManager</code>. By using different list instances you get different <... | <p>I created a new win forms app with two list boxes on it. They behave as I would expect. Can you post the complete code? Here is my code. </p>
<pre><code>public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private class Thing
{
public String Letters { get; set; }
public Int32 Id { ge... | 36,235 |
<p>If you were writing a new application from scratch today, and wanted it to scale to all the cores you could throw at it tomorrow, what parallel programming model/system/language/library would you choose? Why?</p>
<p>I am particularly interested in answers along these axes:</p>
<ol>
<li>Programmer productivity / e... | <p>Multi-core programming may actually require more than one paradigm. Some current contenders are:</p>
<ol>
<li><a href="http://labs.google.com/papers/mapreduce.html" rel="noreferrer">MapReduce</a>. This works well where a problem can be easily decomposed into parallel chunks.</li>
<li><a href="http://www.haskell.org... | <p>I'd use Java - its portable so future processors wont be a problem. I'd also code my application with layers seperating interface / logic and data (more like 3 tier web app) with standard mutex routines as a library (less debugging of parallel code). Remember that web servers scale to many processors really well an... | 10,544 |
<p>Does anyone know of a good way to convert a 3D print file, like STL, to STEP - a useable file format for plastic injection molding companies? </p>
<p>I have tried to convert the files through a couple of programs without success. The most requested file is a STP or STEP file. If there’s no easy way to convert it,... | <blockquote>
<p>a good way to convert a 3D print file like STL to STEP a useable file format for plastic injection molding companies</p>
</blockquote>
<p>I don't know much about plastic injection molding companies, but I do manipulate a lot STEP, STL files and I do know that it is possible to achieve <em>"a good way... | <p>Converting mesh files to solid formats is a complex task.
While converting files from mesh to solid you should look for accuracy, number of patches, nurbs pattern, file size and many other variables that should be taken in consideration based on the use you will give for the solid file.
I have compiled some thoughts... | 833 |
<p>Is it possible to pass a function as a parameter in C#? I can do it using the Func or Action classes, but this forces me to declare the entire function signature at once. When I try to use Delegate, I get a compile error saying it can't convert a method group to a Delegate. </p>
<p>I'm working on <a href="http://ww... | <p>I think what you want is:</p>
<pre><code>static object InvokeMethod(Delegate method, params object[] args){
return method.DynamicInvoke(args);
}
static int Add(int a, int b){
return a + b;
}
static void Test(){
Console.WriteLine(InvokeMethod(new Func<int, int, int>(Add), 5, 4));
}
</code></pre>
... | <p>Something like this ought to work for you:</p>
<pre><code>delegate int MyDelegate(int a, int b);
public int Add(int a, int b) {
return a + b;
}
public void InvokeMethod(Delegate method, object[] param) {
Console.WriteLine(method.DynamicInvoke(param));
}
public Form1() {
InitializeComponent();
... | 49,825 |
<p>Are there any usable implementations of Smalltalk for the .NET runtime?</p>
| <p>There's a project to build Smalltalk on top of the DLR. Unsurprisingly, it's called <a href="http://www.codeplex.com/IronSmalltalk" rel="noreferrer">IronSmaltalk</a>.</p>
| <p>There is <a href="http://www.lesser-software.com/lswvst.htm" rel="nofollow">LSW Vision-Smalltalk</a>, which seems to be a private Smalltalk environment, they claim to support .NET:</p>
<p>"LSWVST has a .NET Integration which enables us to develop our .NET Tools. LSWVST includes now LSW DotNet-Lab a toolset for .NET... | 29,257 |
<p>What is the most efficient way to convert data from nested lists to an object array (which can be used i.e. as data for JTable)?</p>
<pre><code>List<List> table = new ArrayList<List>();
for (DATAROW rowData : entries) {
List<String> row = new ArrayList<String>();
for (String col : ... | <pre><code>//defined somewhere
List<List<String>> lists = ....
String[][] array = new String[lists.size()][];
String[] blankArray = new String[0];
for(int i=0; i < lists.size(); i++) {
array[i] = lists.get(i).toArray(blankArray);
}
</code></pre>
<p>I don't know anything about JTable, but converting... | <p>To convert a nested list to a two-dimensional object-array, you can use this code:</p>
<pre><code>public Object[][] ToObjectMatrix(List<List<String>> data) throws IllegalArgumentException {
if(data == null) {
throw new IllegalArgumentException("Passed data was null.");
}
Ob... | 48,602 |
<p>I'm working with C and through a socket I will be receiving a message with one space in it, I need to split the string into parts at the space. How would I go about doing this?</p>
| <p><a href="http://www.mkssoftware.com/docs/man3/strtok_r.3.asp" rel="noreferrer">strtok_r</a> is your friend.</p>
<p>Don't use plain <code>strtok()</code>, as it's NOT thread-safe.</p>
<p>Even on platforms where it is thread-safe (because the state is held in Thread-Local Storage), there is still the problem that th... | <p>This is usually done using the <a href="http://www.opengroup.org/onlinepubs/000095399/functions/strtok.html" rel="nofollow noreferrer">strtok</a>() library call. Be warned, however, that this function will modify the input string (it inserts '\0' NUL characters everywhere that the chosen delimiter was found) - so y... | 41,843 |
<p>Maybe this cannot be done, but please help or suggest how this can be achieved without writing something to disk.</p>
<p>Lets suppose there are two string values that I want to share between two independent applications.</p>
<p>You are welcome to provide code sample in any programming language.</p>
| <p>What you probably want to do is create a memory-mapped file. You can create a memory-mapped file that doesn't have any backing store on disk, but is instead backed by the system page file. Have a look at the documentation for <a href="http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx" rel="nofollow norefe... | <p>The recommended approach is to create a named memory mapping (<code>CreateFileMapping</code>, probably with <code>INVALID_HANDLE_VALUE</code> as first parameter since you don't need an actual file) and put your shared data in the mapping. You'll also need a named mutex to synchronize access to this data.</p>
<p>A l... | 42,104 |
<p>I'm on a Hardy Heron Ubuntu build, BTW.</p>
| <p>Try:</p>
<p>:set mouse=a</p>
<p>":help mouse" says</p>
<pre><code>Enable the use of the mouse. Only works for certain terminals
(xterm, MS-DOS, Win32 |win32-mouse|, qnx pterm, and Linux console
with gpm). For using the mouse in the GUI, see |gui-mouse|.
The mouse can be enabled for different modes:
n Norm... | <p>Hate to give this answer, because it isn't very helpful, but it works fine for me (scroll wheel in gvim on ubuntu hardy).
<p>
But maybe I can suggest some things that help debug the issue:
<p></p>
<ol>
<li>Confirm you are running "gvim" and trying to scroll the new window that comes up (i.e. you are not running vim... | 24,360 |
<p>It seems like Sql Reporting Services Server logs information in several places including web server logs and logging tables in the database. Where are all the locations SSRS logs to, and what type of errors are logged in each place?</p>
| <p>As far as I know SSRS logs to the Event Log, the filesystem and its own database.</p>
<p>The database is typically the most easily available one. You just login to the ReportServer database and execute </p>
<pre><code>select * from executionlog
</code></pre>
<p>This only logs the executions though. If you want ... | <p>For SSRS 2008 R2:
C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles</p>
| 18,167 |
<p>When using MYSQL C API to query results. The results are returned as a <code>MYSQL_ROW</code> type, which according to the MYSQL C API documentation, I can easily <code>printf("%s", row[0])</code>. But what if I want to transfer the contents of <code>row[0]</code> into a string or a char*?</p>
| <p>The %s format is only supposed to accept char* so from your description it looks like MYSQL_ROW is really a char** and taking row[0] will yield a char* anyway.</p>
<p>I don't see how using sprintf() (or the safer but non standard asprintf()) would be of any benefit but you may consider it if it makes you feel bette... | <p>You could use <a href="http://linux.die.net/man/3/sprintf" rel="nofollow noreferrer">sprintf()</a>, but you will still need to know the length of the string contained in row[0] so you can allocate enough memory.</p>
<p>Caveat: BCS correctly points out that your data will be truncated if row[0] contains extra nul by... | 34,698 |
<p>I assume SLA printing only works on Earth and upright.</p>
<p>But would fused-filament printer (e.g. Prusa Mk3) work in zero gravity? What about upside down or sideways? If not, could it be modified to work in other orientations? Have there been any demonstrations of it?</p>
| <p>I think it's safe to say that there's at least one model of 3D printer that works in microgravity -- since <a href="https://www.nasa.gov/mission_pages/station/research/news/3d-printing-in-space-long-duration-spaceflight-applications" rel="nofollow noreferrer">one was sent to the International Space Station a few mon... | <p>Lulzbot used to do this at trade shows -- printers on their side, printing all day long.</p>
<p>So long as it sticks to the bed, and sticks to the subsequent layers of the part, it works.</p>
<p>The determining factor is gravity -- if the part being printed has overhangs or unsupported areas, the extruded material w... | 1,812 |
<p>Here's what <a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members" rel="noreferrer">MSDN has to say under <em>When to Use Static Classes</em></a>:</p>
<blockquote>
<pre><code>static class CompanyInfo
{
public static string GetCompa... | <p>I wrote my thoughts of static classes in an earlier Stack Overflow answer:
<em><a href="https://stackoverflow.com/questions/205689/class-with-single-method-best-approach#206481">Class with single method -- best approach?</a></em></p>
<p>I used to love utility classes filled up with static methods. They made a great... | <p>Based on <a href="http://msdn.microsoft.com/en-us/library/79b3xss3(VS.80).aspx" rel="nofollow">MSDN</a>:</p>
<ol>
<li>You cannot create the instance for static classes</li>
<li>If the class declared as static, member variable should be static for that class</li>
<li>Sealed [Cannot be Inherited]</li>
<li>Cannot cont... | 29,874 |
<p>Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.</p>
| <p>As far as I know that is not possible. It is not an open source database, so writing drivers for it is really hard.</p>
| <p>This depends a lot on the version of Btrieve. I've been working with btrieve for a long time and have found that the best API for the old 6.15 version was in pascal. That having been said there was definately a C api around as well.</p>
<p>Pervasive have recently released a 6.15 ultimate patch. Using this and the C... | 10,564 |
<p>I have just acquired my first 3D printer, a BIQU B1. Overall I'm quite pleased with the printing results but I'm having minor defects on the Benchy test. I'm not sure what the problem is, but I guess it's related to the overhang and maybe vibrations.</p>
<p>My print settings are:</p>
<ul>
<li>Software: Ultimaker Cur... | <p>After two weeks of working on different settings in different slicers, I finally have a profile which has improved the quality of my printings. It still has some overhangs, which I'm sure will improve by increasing the cooling flow like 0scar already mentioned.</p>
<p>Here is the profile bundle (for Prusa Slicer): <... | <p>I agree with <a href="/a/15995">this answer</a>. There might be an obstruction in the cooling. I also have a B1, have you checked the included printed part that redirects the blower fans towards the part and made sure it's clear? Mine came with some warping that I had to file off.</p>
| 1,903 |
<p>Does anyone have any idea why the following code sample fails with an XmlException "Data at the root level is invalid. Line 1, position 1."</p>
<pre><code>var body = "<?xml version="1.0" encoding="utf-16"?><Report> ......"
XmlDocument bodyDoc = new XmlDocument();
bodyDoc.LoadXml(body);
</cod... | <h2>Background</h2>
<p>Although your question does have the encoding set as UTF-16, you don't have the string properly escaped so I wasn't sure if you did, in fact, accurately transpose the string into your question.</p>
<p>I ran into the same exception: </p>
<blockquote>
<p>System.Xml.XmlException: Data at the
... | <p>Simple line:</p>
<p><code>bodyDoc.LoadXml(new MemoryStream(Encoding.Unicode.GetBytes(body)));</code></p>
| 40,032 |
<p>I'm wondering if there's some kind of criteria that can be used to determine where a script or file should go.</p>
| <p>If you don't mind the possibility that anyone might be able to see the contents then put it inside the web path. Otherwise keep it outside.</p>
<p>Inside:
anything publicly available - images, javascript, css, static content. You'll be putting less strain on the server and will automatically be taking advantage of ... | <p>Its usually best to keep it outside but of course it all comes down to personal preference. I don't think there's any set rule pertaining to this</p>
| 38,740 |
<p>I'd like to attach a piece I printed out of PLA to a small titanium rod. I've previously used Superglue (cyanoacrylate) to glue PLA pieces to each other with great success, but the problem is that if you don't apply it perfectly cleanly, it leaves very noticeable stains on the PLA.</p>
<p>Can anyone recommend a goo... | <p>I've been a fan of epoxies for unusual adhesion problems. I found on <a href="https://rads.stackoverflow.com/amzn/click/B000FW6322" rel="nofollow noreferrer">Amazon a product with titanium</a> in the name, but there's a caution regarding polypropylene plastics. </p>
<p><a href="https://i.stack.imgur.com/DfKGn.jpg" ... | <p>A glue gun would IMO work very well, and you can use transparent (or almost transparent) glue sticks to minimize ugly looking stains.</p>
<p>Things glued together usually break before the glue (in my experience) and it's cheap, you can get one for $10 with some glue sticks. It's fun too, I glue everything since I b... | 812 |
<p>I'm working with large numbers that I can't have rounded off. Using Lua's standard math library, there seem to be no convenient way to preserve precision past some internal limit. I also see there are several libraries that can be loaded to work with big numbers:</p>
<ol>
<li><a href="http://oss.digirati.com.br/l... | <p>The <a href="http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lmapm" rel="noreferrer">lmapm library</a> by Luiz Figueiredo, one of the authors of the Lua language.</p>
| <p>There are several libraries for the problem, each one with your advantages
and disadvantages, the best choice depends on your requeriments. I would say
<a href="http://webserver2.tecgraf.puc-rio.br/%7Elhf/ftp/lua/#lbc" rel="nofollow noreferrer">lbc</a> is a good first pick if it
fulfills your requirements or any oth... | 36,756 |
<p>In Visual Studio, when you compile foo.idl, MIDL generates the proxy information in foo_p.c.</p>
<p>Unfortunately, for Win32 and x64 files, it uses the same filename. For Win32, the file starts with:</p>
<pre><code>#if !defined(_M_IA64) && !defined(_M_AMD64)
</code></pre>
<p>For x64, the file starts with:... | <p>You could modify the compiler settings for your IDL file to specify a different file name for the output proxy file according to the target platform. (Select Properties on the IDL file, then Configuration Properties / MIDL / Output).</p>
<ul>
<li>For Win32 builds, use <code>foo_p_w32.c</code></li>
<li>For x64 build... | <p>Here are the configuration changes we use to allow automated builds to work cleanly</p>
<p>Change</p>
<pre><code><Tool
Name="VCMIDLTool"
TypeLibraryName="$(ProjectName).tlb"
OutputDirectory="$(SolutionDir)$(PlatformName)"
HeaderFileName="$(ProjectName)_h.h"
DLLDataFileName="$(ProjectName)_dlldata.c"
/>
</cod... | 27,257 |
<p>I'm a .Net developer and would like to investigate building and running our framework on Mono. </p>
<p>If the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working.</p>
<p>What would be the best distr... | <p>I work for Novell, so I am going to recommend OpenSUSE as the distribution to use for Mono of course.</p>
<p>When you use OpenSUSE, not only you get Mono, but there are hundreds of open source libraries and .NET based applications that we have ported and make available through our update system.</p>
<p>Additionall... | <p>Like others have said, Novell has direct ties to Mono, but I wouldn't think the mono experience would vary a great deal amongst the bigger names (Suse, Ubuntu, Redhat...). </p>
<p>Are you more interested in getting something that's easy to get up and running or is there a plan to deploy this in production at some p... | 20,140 |
<p>I'm trying to use jQuery to get data from an ASP.NET web service (SharePoint Server 2007 lists.asmx), but any call to a web service will really help as a first step in that direction.</p>
| <p>I use this method as a wrapper so that I can send parameters. Also using the variables in the top of the method allows it to be minimized at a higher ratio and allows for some code reuse if making multiple similar calls.</p>
<pre><code>function InfoByDate(sDate, eDate){
var divToBeWorkedOn = "#AjaxPlaceHolder";... | <p>I quite often use ajaxpro along with jQuery. ajaxpro lets me call .NET functions from JavaScript and I use jQuery for the rest.</p>
| 28,524 |
<p>I am having a few problems with my BLTouch. I have calibrated it several times using different methods and get the nozzle being 1.3 mm lower than the BLTouch pin so a Z offset of -1.3 mm. This works fine for auto homing, bed levelling and using code <code>G1 Z0</code> to lower to where needed. However when... | <p>This answer is intended to be a generic answer for Z-offset determination. The question is not clear on how the Z-offset has been determined. It appears as if this distance is measured, while in reality this cannot be measured.</p>
<p>A touch (or a inductive or capacitive) probe uses a trigger point to determine th... | <p>You should be able to offset this with a <code>G54 Z-1.3</code> - <strong>if your setup accepts these gcodes</strong>. </p>
<p>If you do this, always add a <code>G53</code> to the very start and just before the <code>M30</code> to clear all offsets after job finish (or in the event of a cancel, at the start of the ... | 1,466 |
<p>After hosting an ASP.NET 2.0 web application on a windows 2000 server(IIS 5).
I was unable to browse the web site.</p>
<p>The following error message was displayed on the browser and three Event Log entries were added...</p>
<p><strong>Error Message on Browser</strong></p>
<blockquote>
<p>Server Application Una... | <p>I discovered that when the web site folder was copied to the server it inherited the security permissions of the parent folder which only had permission for the Administrator, Administrators & System accounts.</p>
<p>I added</p>
<ul>
<li>IUSER_MACHINENAME (Internet Guest Account)</li>
<li>ASPNET (ASP.NET Machi... | <p>This error means that your code has thrown an exception that has either crashed IIS, or forced it to shut down. Common exceptions that cause this are OutOfMemoryException and StackOverflowException.</p>
<p>You're getting a FileLoadException, but there could be an underlying OutOfMemoryException or similar that's ac... | 28,901 |
<p>How would make a news feed "friendly" database design, so that it wouldn't be extremely expensive to get all of the items (query) to put in the news feed? The only way I can think of would involve UNIONing nearly every table (representing groups, notes, friends, etc) and getting the dates and such, that just seems ... | <p>Firstly, consider doing a performance prototype to check your hunch that the union would be too expensive. You may be prematurely optimisizing something that is not an issue.</p>
<p>If it is a real issue, consider a table designed purely to hold the event feed data, that must be updated in parallel with the other t... | <p>It's hard to answer this question without a schema, but my hunch is that a UNION involving 10 or more properly indexed tables is nothing:<br>
A typical LAMP application like wordpress or PHPBB runs more than 10 queries per pageview without problems. So don't worry.</p>
| 39,621 |
<p>I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications' assemblies, but it's better if I compile these resources in one single assembly and have my applications reference it, right? </p>
<p>After the r... | <p>Check out the <a href="http://msdn.microsoft.com/en-us/library/aa970069(VS.85).aspx" rel="noreferrer">pack URI syntax</a>. You want something like this:</p>
<pre><code><ResourceDictionary Source="pack://application:,,,/YourAssembly;component/Subfolder/YourResourceFile.xaml"/>
</code></pre>
| <p>I know I will probably go to WPF hell but I like to keep it simple.</p>
<p>In my "external" WPF project named <em>MyCorp.Wpf.Dll</em> where I have a folder called assets with my resource dictionaries</p>
<pre><code>MyCorp.Wpf.Dll
|- Assets
|- TextStyles.xaml
|- Colours.axml
</code></pre>
<p>Let's ass... | 43,875 |
<p>I am developing an ASP.NET Ajax form, and decided to make most of the site in one page, because it isn't a very involved site (it's more of a form). In the codebehind, I have been making my code more organized by adding regions to it (inside are the click events of the controls, etc).</p>
<p>When I expand a region,... | <p>Try the "key chord": Ctrl+M, Ctrl+O, then use Ctrl+M, Ctrl+M to expand one at a time.</p>
<p>Although, I do think regions are evil, and you should do something about the fat code ;)</p>
| <p>VS does not expand all nested regions by default. It keeps the state of the nested regions. There's no option in VS to have all nested regions collapsed or expanded explicitly when expanding a region.</p>
<p>You could use Ctrl-M Ctrl-L to toggle all regions in the file to collapsed and then use Ctrl-M Ctrl-M to nav... | 15,873 |
<p>I'm seeing a very strange issue with a .NET webservice being consumed by Flex.</p>
<p>I have a very simple class with nothing other than properties with [XmlAttribute('xxx')] attributes.</p>
<pre><code>public class OrderAddress
{
public OrderAddress() {}
[XmlAttribute("firstName")]
public string First... | <p>After three days' struggling, finally I figured out this XML attribute was the cause of my problem. Slightly different from yours, my class has an array of objects in addition to the XML attribute. Flex was able to generate proxies, and even got attribute correctly (it was treated as a property), but it failed to de... | <p>Elements centric XML is more interoperable format in XML serialization.
This is the reason that the new WCF DataContract serializer serializes every property as elements instead of attribute. Attribute to me is descriptor to the element rather than data for the element.</p>
| 29,424 |
<p>This problem has several of us stumped in the office. We are all new to deploying ASP.NET apps to a web farm, and I am fresh out of ideas.</p>
<p>We have a web farm, and the application is copied on to all of them.
However, we are having a problem..</p>
<p>An exception is being thrown when trying to get settings f... | <p>This is the hierarchy for ASP.NET configuration. Maybe this could help understanding which settings overwrite each other.</p>
<h2>Server</h2>
<p>Machine.config: The Machine.config file contains the ASP.NET schema for all of the Web applications on the server. This file is at the top of the configuration merge hier... | <p>From what you tell in the comments, I suggest going with "Try and Error".</p>
<p>What happens, if you insert an erroneous entry by purpose? Does the application fail or doesn't that affect anything?</p>
<p>Try to copy the content and then delete and recreate that file from scratch.</p>
| 30,099 |
<p>Can anyone provide some real examples as to how best to keep script files for views, stored procedures and functions in a SVN (or other) repository.</p>
<p>Obviously one solution is to have the script files for all the different components in a directory or more somewhere and simply using TortoiseSVN or the like to... | <p>Sounds like you're not wanting to use Revision Control properly, to me.</p>
<blockquote>
<p>Obviously one solution is to have the
script files for all the different
components in a directory or more
somewhere and simply using TortoiseSVN
or the like to keep them in SVN</p>
</blockquote>
<p>This is what s... | <p>You can always try integrating SourceSafe with SQL Server. Here's a quick start : <a href="http://msdn.microsoft.com/en-us/library/ms181089(VS.80).aspx" rel="nofollow noreferrer">link</a> . To work with it you've got to have Managment Studio Developers Edition.</p>
| 7,433 |
<p>I have an object that implements IDisposable that is registered with the Windsor Container and I would like to dispose of it so it's Dispose method is called and next time Resolve is called it fetches a new instance.</p>
<p>Does </p>
<pre><code>container.Release(obj);
</code></pre>
<p>automatically call Dispose(... | <p>This is something I think people aren't really aware of when working with the Windsor container - especially the often <em><strong>surprising</strong></em> behavior that disposable transient components are held onto by the container for the lifetime of the kernel until it's disposed unless you release them yourself ... | <p>Alright, so I've been running tests and it seems like <code>Container.Release()</code> WILL implicitly cause an IDisposable's <code>Dispose()</code> method to execute only if the lifestyle is Transient (this is probably not exactly correct but point is that it wont' do a darn thing if the lifestyle is singleton).</p... | 11,076 |
<p>I encountered the following ddl in a pl/sql script this morning:</p>
<p>create index genuser.idx$$_0bdd0011
...</p>
<p>My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special significanc... | <p>Your initial thought seems to be correct. That would look to be an index name generated by a tool (but not assigned by Oracle because an index name wasn't specified). Dollar signs don't have any particular meaning other than being valid symbols that are rarely used by human developers and so are handy to reduce th... | <p>No special meaning or significance.</p>
<pre><code>SQL> create table t (col number)
2 /
Table created.
SQL> create index idx$$_0bdd0011 on t(col)
2 /
Index created.
</code></pre>
<p>Note: CREATE INDEX is a DDL statement which is usually executed in a SQL script, not in PL/SQL.</p>
| 18,223 |
<p>Why is it that <code>scanf()</code> needs the <code>l</code> in "<code>%lf</code>" when reading a <code>double</code>, when <code>printf()</code> can use "<code>%f</code>" regardless of whether its argument is a <code>double</code> or a <code>float</code>?</p>
<p>Example code:</p>
<pre><code>double d;
scanf("%lf",... | <p>Because C will promote floats to doubles for functions that take variable arguments. Pointers aren't promoted to anything, so you should be using <code>%lf</code>, <code>%lg</code> or <code>%le</code> (or <code>%la</code> in C99) to read in doubles.</p>
| <p>Using either a float or a double value in a C expression will result in a value that is a double anyway, so printf can't tell the difference. Whereas a pointer to a double has to be explicitly signalled to scanf as distinct from a pointer to float, because what the pointer points to is what matters.</p>
| 25,848 |
<p>The attached screenshot is from OS X/Firefox 3. Note that the center tab (an image) has a dotted line around it, apparently because it was the most-recently selected tab. Is there a way I can eliminate this dotted line in CSS or JavaScript? (Hmmm...the free image hosting service has reduced the size of the image. Bu... | <p>You'll want to add the following line to your css:</p>
<pre><code>a:active, a:focus { outline-style: none; -moz-outline-style:none; }
</code></pre>
<p>(Assuming your tabs are done using the a element, of course.)</p>
<p><em>[edit] On request from everyone else, for future viewers of this it should be noted that t... | <p>You can start by looking at the :focus and :active pseudo classes, although you probably <em>shouldn't</em> be completely removing any formatting from these cases, since they are an invaluable usability aid.</p>
| 21,280 |
<p>I wonder if there is a way to set the value of #define in run time.</p>
<p>I assume that there is a query for Oracle specific and Sql Server specific at the code below.</p>
<pre><code>#define oracle
// ...
#if oracle
// some code
#else
// some different code.
#endif
</code></pre>
| <p>Absolutely not, #defines are compiled out by the preprocessor before the compiler even sees it - so the token 'oracle' isn't even in your code, just '1' or '0'. Change the #define to a global variable or (better) a function that returns the correct value.</p>
| <p>No, the preprocessor runs before compile and can alter code at that time, that is its purpose, if you want to switch behavior based on something at runtime use a variable and normal conditional logic.</p>
| 34,290 |
<p>This is a problem we all have to consider at some point. </p>
<p>After many years and many approaches I tend to agree in general with the staterment:
"For any protected software used by more than a few hundred people, you can find a cracked version. So far, every protection scheme can be tampered with."
<a href="ht... | <p>I disagree xsl.</p>
<p>We protect our code, not because we want to protect our revenue - we accept that those who would use if without a license probably would never pay for it anyway.</p>
<p>Instead, we do it to protect the investment <strong>our</strong> customers have made in <strong>our</strong> software. We ... | <p>I have used .NET Reactor in the past with good results - <a href="http://www.eziriz.com/" rel="nofollow noreferrer">http://www.eziriz.com/</a></p>
<p>What I liked about this product is that it did not require you to obfuscate the code in order to have pretty good protection.</p>
| 44,685 |
<p>We are designing a Payroll Generation System for a client.</p>
<p>The organization we are targeting has a hierarchy as follows:
Company -> Cluster -> Business Unit (BU) -> Department -> Employee</p>
<p>The salary for an employee is made up of various salary components.
Each salary component has 3 rules associated ... | <p>I always try to shy away from putting business logic in the DB layer. It is more difficult to write, debug and maintain. In addition, the DB is generally the most expensive layer to scale. If you end up needing to beef up your system to support more users it is relatively cheap and easy to add new webservers to a... | <p>If you store the formulas as in for example JEP (for java) it's not much of a problem. Just keep the full formula as a string: i.e: "pay=((0.3 * Basic) + 800) and then parse it into a tree.</p>
<p>You can see some of jep documentation for info, and take the ideas from there. Shouldn't be 2 problematic to implement ... | 25,743 |
<p>The strongly typed <code>SearchViewData</code> has a field called Colors that in it's turn is a <code>ColorViewData</code>.
In my <code>/Colors.mvc/search</code> I populate this <code>viewData.Model.Colors</code> based on the given search criteria.
Then, based on several factors, I render one of a set of user contro... | <p>Probably an overload issues. You could call the RenderPartial(string, object, ViewDataDictionary) which makes all three parameters explicit.</p>
<p>One thing we're planning to change is if you call the overload RenderPartial(string, object), we'll pass the current ViewDataDictionary to the partial. We don't do that... | <p>Noticed the same thing, I fixed it with the following, though I'm not sure if it's the "right" solution:</p>
<pre><code><% Html.RenderPartial("xxx", new ViewDataDictionary(ViewData.Model.Colors)); %>
</code></pre>
| 28,878 |
<p>I have recently gained access to a Mac. I am wondering if anyone has any tips/advice for setting up <a href="http://www.mono-project.com/Main_Page" rel="noreferrer">Mono</a> on a mac for development and execution of ASP.NET? Most resources point to Linux implementations which tend to differ a lot from the way Mac's ... | <p>To launch the development ASP.NET server, just open a terminal window and run the "xsp2" command from the Mono installation.</p>
<p>The only thing that is missing from the Mono distribution on the Mac compared to Linux is the Apache module, that one you will have to compile yourself if you want to deploy your appli... | <p>Why use Mono on a Mac? Run Parallels, VMWare, or Boot Camp.</p>
| 13,372 |
<p>I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. </p>
<p>Is this possible, using C++ / MFC?</p>
| <p>Charlie hit on the answer with <code>WM_NCPAINT</code>. If you're using MFC, the code would look something like this:</p>
<pre><code>// in the message map
ON_WM_NCPAINT()
// ...
void CMainFrame::OnNcPaint()
{
// still want the menu to be drawn, so trigger default handler first
Default();
// get menu bar... | <p>In order to draw in the non-client area, you need to get the "window" DC (rather than "client" DC), and draw in the "window" DC.</p>
| 12,482 |
<p>Wanted to generate a UI diagram (with nice layout) depicting relationships amongst network components. Which is the best Java based API to do such layouts with minimum fuss and light codebase.</p>
| <p>If you're logging for a Java API that can do layouts (e.g. arrange boxes in a hierarchical fashion without overlap), check out <a href="http://www.jgraph.com/" rel="nofollow noreferrer">JGraph</a>.</p>
| <p>Any uml tool should do the work</p>
<p>Take a look at <a href="http://www.umlet.com/" rel="nofollow noreferrer">UMLet</a> or <a href="http://www.netbeans.org/" rel="nofollow noreferrer">NetBeans</a> as UML editors made in Java.</p>
<p>(BTW, Visio Is usually the standard tool for that job)</p>
| 31,105 |
<p>I'm trying to get a list of processes currently owned by the current user (<code>Environment.UserName</code>). Unfortunately, the <code>Process</code> class doesn't have any way of getting the UserName of the user owning a process.</p>
<p>How do you get the UserName of the user which is the owner of a process using... | <p>The CodeProject article <a href="http://www.codeproject.com/KB/cs/processownersid.aspx" rel="noreferrer">How To Get Process Owner ID and Current User SID</a> by <a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=856529" rel="noreferrer">Warlib</a> describes how to do this using both WMI and usin... | <p><strong>You'll need to add a reference to System.Management.dll for this to work.</strong></p>
<p>Here's what I ended up using. It works in .NET 3.5:</p>
<pre><code>using System.Linq;
using System.Management;
class Program
{
/// <summary>
/// Adapted from https://www.codeproject.com/Articles/14828/... | 38,514 |
<p>I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statements.</p>
<p>Here are two possible ways of doing it. Which one is the standard/best way of doing it?</p>
<p>First way:</p>
<pre><code>IF EXISTS (SELECT 1
FROM INFORMATION_SCHEMA.TABLE... | <p>For queries like this it is always best to use an <code>INFORMATION_SCHEMA</code> view. These views are (mostly) standard across many different databases and rarely change from version to version.</p>
<p>To check if a table exists use:</p>
<pre><code>IF (EXISTS (SELECT *
FROM INFORMATION_SCHEMA.... | <p>consider in one database you have a table t1. you want to run script on other Database like - if t1 exist then do nothing else create t1.
To do this open visual studio and do the following:</p>
<p>Right click on t1, then Script table as, then DROP and Create To, then New Query Editor </p>
<p>you will find your de... | 20,240 |
<p>When I am printing objects that have a lot of surface area on the first layer parts of that layer will rise up causing there to be gaps in the first layer. Here are two pictures. The first one was printing with a raft and the second one was without a raft.<a href="https://i.stack.imgur.com/yLnZA.jpg" rel="noreferrer... | <p>You got a few things happening. First that temp seems low. I am printing PLA at 215.. but there are a lot of factors. Start with a simple calibration thin wall test. Which is just a wall, no body. </p>
<p>From there your bed could be closer. Maybe. I don't think that's really the issue. Slower speed and heat will m... | <p>I am having the same issue. I saw one similar post describe this as "baconing" and said it comes from over extrusion. Looking at the filament coming out I could imagine that if there is too much filament for the given travel speed, then it would buckle up. I tried decreasing the extrusion percentage. The Makerbot ... | 537 |
<p>I need some SQL to update a record in a database if it exists and insert it when it does not, looking around there looks to be several solutions for this, but I don't know what are the correct/ accepted ways to do this.</p>
<p>I would ideally like it to work on both Firebird 2 and MySQL 5 as the update will need to... | <p>You should either use something like this:</p>
<pre><code>BEGIN TRANSACTION
IF EXISTS (SELECT * FROM the_table WHERE pk = 'whatever')
UPDATE the_table SET data = 'stuff' WHERE pk = 'whatever'
ELSE
INSERT INTO the_table (pk, data) VALUES ('whatever', 'stuff')
COMMIT
</code></pre>
<p>Or this, but send them s... | <p>REPLACE works exactly like INSERT, except that if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the new row is inserted.</p>
<p>Syntax : </p>
<p>REPLACE [LOW_PRIORITY | DELAYED]
[INTO] tbl_name [(col_name,...)]</p>
<pre><code>{ VALU... | 44,681 |
<p>I am implementing an asynchronous command pattern for the "client" class in a client/server application. I have done some socket coding in the past and I like the new Async pattern that they used in the Socket / SocketAsyncEventArgs classes.</p>
<p>My async method looks like this: <code>public bool ExecuteAsync(Com... | <p>throwing an exception from the dispatch point may or may not be useful</p>
<p>calling the callback passing an exception argument requires the completion callback to do 2 distinct things</p>
<p>a second callback for exception reporting might make sense instead</p>
| <p>Handling exceptions in one spot is a lot easier. I'd use the following distinction: for exceptions that should be handled, throw them in the callback. It makes it simpler to use the class. For exceptions that should not be caught (e.g., ArgumentException) throw in the ExecuteAsync. We want unhandled exceptions to bl... | 38,096 |
<p>I have a 200+ case statement in Classic ASP which is getting out of control. It sets 5 variables, based on which case is selected. Address, Phone, Name etc. Just sets the variables and nothing else in each case.</p>
<p>Databases or files are not an option for this application.</p>
<p>Coming from the Perl world I w... | <p>Brian, the classic ASP equivalent of a Perl hash is the <a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_scr_ildk.mspx?mfr=true" rel="nofollow noreferrer">Scripting.Dictionary</a> object.</p>
| <p>This should be done with a database, but since you said that is not an option, nothing you will write will be any less complex than a switch statement, since it's all required to live in your code (according to your terms of no db and no files).</p>
<p>I mean, you could use an Excel Spreadsheet if the idea of a <st... | 7,279 |
<p>What is the difference between the following class methods?</p>
<p>Is it that one is static and the other is not?</p>
<pre><code>class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test = Test()
a_test.method_one()
a_test.method_two()
</co... | <p>In Python, there is a distinction between <em>bound</em> and <em>unbound</em> methods. </p>
<p>Basically, a call to a member function (like <code>method_one</code>), a bound function</p>
<pre><code>a_test.method_one()
</code></pre>
<p>is translated to</p>
<pre><code>Test.method_one(a_test)
</code></pre>
<p>i.e.... | <p>The definition of <code>method_two</code> is invalid. When you call <code>method_two</code>, you'll get <code>TypeError: method_two() takes 0 positional arguments but 1 was given</code> from the interpreter. </p>
<p>An instance method is a bounded function when you call it like <code>a_test.method_two()</code>. It ... | 13,948 |
<p>Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.</p>
| <ul>
<li>Because it's bloated</li>
<li>Because JSON is natively understandable by the JavaScript</li>
<li>Because XML isn't fast to manipulate with JavaScript.</li>
</ul>
| <p>It could be done. Just remember that SOAP is not the fastest way to exchange information as there is a big overhead (big XMLs have to be sent back and forth) - that's probably why you don't see it used that often</p>
| 15,459 |
<p>Please help me with a sanity check. Assuming a many-to-many relationship:</p>
<p><a href="http://www.codingthewheel.com/pics/many_to_many.gif" rel="nofollow noreferrer">Post, PostTagAssoc, Tag http://www.codingthewheel.com/pics/many_to_many.gif</a></p>
<p>What's the most succinct way (using LINQ to SQL) to get a r... | <pre><code> from pta in db.PostTagAssoc
group pta by pta.PostID into t
select new {PostID = t.Key, TagCount=t.Count()}
</code></pre>
| <p>This will also show those posts with 0 tags, and is a bit clearer in my opinion.</p>
<pre><code>from p in db.Post
select new {PostID = p.ID, TagCount = t.PostTagAssoc.Count}
</code></pre>
| 29,284 |
<p>How do I set the executable icon for my C++ application in visual studio 2008?</p>
| <p>First go to Resource View (from menu: View --> Other Window --> Resource View). Then in Resource View navigate through resources, if any. If there is already a resource of Icon type, added by Visual Studio, then open and edit it. Otherwise right-click and select Add Resource, and then add a new icon.</p>
<p>Use the... | <p><strong>If you're using .NET</strong>, in the solutions explorer right click your program and select properties. Under the resource section select Icon and manifest, then browse to the location of your icon.</p>
| 41,487 |
<p>Here's the scenario - a client uploads a Sybase dump file to (gzipped) to our local FTP server. We have an automated process which picks these up and then moves them to different server within the network where the database server resides. Unfortunately, this transfer is over a WAN, which for large files takes a lon... | <p>There are a few things you can do from the command line. The first, on the sending side, is to generate md5sum's of the files.</p>
<pre><code>$ md5sum *.dmp
2bddf3cd8b04010183dd3295ce7594ff pubs_1.dmp
7510e0250c8d68bae3e0e794c211e60b pubs_2.dmp
091fe54fa5fd81d8c109cc7835d37f4a pubs_3.dmp
</code></pre>
<p>On th... | <p>There is no way to really verify the integrity of the dump file without loading it in some way by a backup server. The client should know whether the dump is successful or not via the backup log or output during the dump.</p>
<p>But to solve your problem you should use to SFTP or SCP, all transfers are done in bina... | 36,739 |
<p>I am trying to do something I've done a million times and it's not working, can anyone tell me why?</p>
<p>I have a table for people who sent in resumes, and it has their email address in it...</p>
<p>I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all ... | <p>We had a very similar problem recently where the subquery was returning null values sometimes. Then, the in statement treats null in a weird way, I think always matching the value, so if you change your query to:</p>
<pre><code>select j.email
from jobseeker j
where j.email not in (select email from aspnet_Members... | <p>You could use <code>exists</code> instead of <code>in</code> like this:</p>
<pre><code>Select J.Email
From Jobseeker j
Where not exists (Select * From aspnetMembership a where j.email = a.email)
</code></pre>
<p>You should get better performance and avoid the 'weird' behaviour (which I suspect is to do with null v... | 8,145 |
<p>Is there any real practical difference between "java -server" and "java -client"? </p>
<p>All I can find on Sun's site is a vague </p>
<blockquote>
<p>"-server starts slower but should run faster". </p>
</blockquote>
<p>What are the real differences? (Using JDK 1.6.0_07 currently.)</p>
| <p>This is really linked to <em>HotSpot</em> and the default <em>option values</em> (<a href="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html" rel="noreferrer">Java HotSpot VM Options</a>) which differ between client and server configuration.</p>
<p>From <a href="http://www.oracle.com/techn... | <p>When doing a migration from 1.4 to 1.7("1.7.0_55") version.The thing that we observed here is, there is no such differences in default values assigned to heapsize|permsize|ThreadStackSize parameters in client & server mode. </p>
<p>By the way, (<a href="http://www.oracle.com/technetwork/java/ergo5-140223.html" ... | 24,196 |
<p>Is http/1.0 able to handle deflated and gzip content?
I've finished to implement deflate and gzip in my minimalist web server and I don't really know if browsers with http/1.0 are capable to handle deflate and gzip compressed content.</p>
| <p>Well really it's down to the browser; not the protocol (HTTP 1.0 does allow for compression quite happily)</p>
<p>You should be examining the <a href="http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#Accept-Encoding" rel="noreferrer">Accept-Encoding</a> header, which will either be gzip, deflate. If t... | <p>Check out <a href="http://www.computec.ch/projekte/browserrecon/scan/accept-encoding.fdb" rel="nofollow noreferrer">this rather extensive list</a>. (short answer appears to be : Yes they do).</p>
| 29,636 |
<p>I currently have a DetailsView in ASP.NET that gets data from the database based on an ID passed through a QueryString. What I've been trying to do now is to then use that same ID in a new cookie that is created when a user clicks either a ButtonField or a HyperLinkField.</p>
<p>What I have in the .aspx is this:</p... | <p>Use the CommandName and the CommandArgument parameters of the Button class. Specifying a CommandName will expose the ItemCommand event. From there you can check for the CommandName, easily grab the CommandArgument (the ID of your row or item) then push whatever data your need into your cookie that way.</p>
<p>More ... | <p>I noticed you're putting the key in the grid itself (DataKeyNames="ArtID"). You have access to that in your event handler -- the event args will get you the current index for indexing into the datakeys on the grid.</p>
<p>Make sense?</p>
| 21,009 |
<p>The subject doesn't say much cause it is not easy to question in one line.
I have to execute a few programs which I read from the registry. I have to read from a field where somebody saves the whole paths and arguments.<br>
I've been using System.Diagnostics.ProcessStartInfo setting the name of the program and its a... | <p>I have tackled this the same way as the poster above, using cmd.exe with process start info.</p>
<pre><code>Process myProcess = New Process;
myProcess.StartInfo.FileName = "cmd.exe";
myProcess.StartInfo.Arguments = "/C " + cmd;
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myProcess.StartInfo.CreateN... | <p>There are several, in fact.</p>
<ol>
<li>You can call cmd.exe with /C [your command line] as the arguments. This causes cmd.exe to process your command, and then quit.</li>
<li>You could write the command to a batch file and launch that.</li>
</ol>
<p>And of course there's the approach you're taking now, namely pa... | 27,112 |
<p>I understand the differences between optimistic and pessimistic locking. Now, could someone explain to me when I would use either one in general?</p>
<p>And does the answer to this question change depending on whether or not I'm using a stored procedure to perform the query?</p>
<p>But just to check, optimistic mea... | <p><a href="http://en.wikipedia.org/wiki/Optimistic_locking" rel="noreferrer">Optimistic Locking</a> is a strategy where you read a record, take note of a version number (other methods to do this involve dates, timestamps or checksums/hashes) and check that the version hasn't changed before you write the record back. ... | <blockquote>
<p><strong>Optimistic locking and Pessimistic locking are two models for locking data in a database.</strong></p>
</blockquote>
<p><strong>Optimistic locking</strong> : where a record is locked only when changes are committed to the database.</p>
<p><strong>Pessimistic locking</strong> : where a record is ... | 15,725 |
<p>I want to add a calendar control to a page that already includes Prototype and Scriptaculous. Not happy with any of the Prototype ones I could find, I'm considring using the YUI Calendar widget. </p>
<p>I this likely to cause any problems?</p>
| <p>We have worked hard to make sure that YUI is safe to use with any other library. We namespace everything, as HermanD says, under only one required global (YAHOO) and one optional one (YAHOO_config). We don't modify native objects. And even though Protoype does modify native prototypes, we code defensively so that... | <p>By default everything in YUI is within the YAHOO namespace, so as long as you sensibly apply namespaces to anything you use from YUI, I would have thought you should be ok.</p>
<p>See: <a href="http://developer.yahoo.com/yui/yahoo/" rel="nofollow noreferrer">http://developer.yahoo.com/yui/yahoo/</a></p>
| 49,419 |
<p>I've seen several questions about dyes in regards to food-safety, with no conclusive answers, as well as anecdotes on the RepRap wiki about how the mechanical properties of dyed PLA tend to vary by color. The general unsatisfactory answer is that dyes and additives used are proprietary secrets of filament manufactur... | <p>I spoke with a chemist tonight. He said to start with the SDS (or MSDS) for the filament, which is required to be available for most materials. It should list the pigments and additives if they are not recognized as safe. If they are safe, non-toxic, not flammable, non-reactive, they might not be disclosed on... | <p>I fear your supposition about <em>secret</em> --> <em>open secret</em> is too optimistic. Manufacturers are very unlikely to reveal their components, or the mix ratio, used to create a given color. </p>
<p>Consider the Coca-cola formula. It's been a secret for over a hundred years, despite a number of competin... | 1,366 |
<p>I am trying to audit the action that the user performed that resulted in changes to corresponding tables. For example if a user were to transfer money between 2 accounts this would generate the following sequence of events:</p>
<ol>
<li>Insert transfer amount into Transfer table</li>
<li>Subtract transfer amount fr... | <p>Seems like the relationship between parentAuditRecord and transferauditrecord and balance auditrecord shouldn't be one to many. When I read what you typed I'm seeing it as a table per subclass usage of that audit hierarchy which is a one-to-one relationship.</p>
<p><a href="http://www.hibernate.org/hib_docs/referen... | <p>At the design level, it seems like a insert only db design would work marvels here.</p>
<p>If you want to keep it the way it is right now (which I'm sure you do), you could look into Hibernate listeners/interceptors/events (well defined in the doc: <a href="http://www.hibernate.org/hib_docs/v3/reference/en-US/html_... | 35,704 |
<p>I'd like to establish an ssh tunnel over ssh to my mysql server.</p>
<p>Ideally I'd return a mysqli db pointer just like I was connecting directly.</p>
<p>I'm on a shared host that doesn't have the <a href="http://ca.php.net/ssh2" rel="noreferrer">SSH2</a> libraries but I might be able to get them installed locall... | <p>I would use the <a href="http://www.harding.motd.ca/autossh/" rel="noreferrer">autossh</a> tool to create a persistent ssh tunnel to your mysql database. Then all you have to do in your PHP code is point it to localhost.</p>
<p>You can test this (without automatic restart) by doing:</p>
<pre><code>ssh -L 3306:loca... | <p>I think your best bet is to find a different hosting provider; I suggest a VPS solution (Virtual Private Server) which gives you full control over your web host. THat way, if you don't like the default configuration, you can upgrade it yourself.</p>
| 39,885 |
<p>How to change overview rule <strong>background</strong> color in Eclipse 3.4.0.I20080617-2000 (vertical bar on right of editing window with some annotations) ? </p>
<p>General > Editors > Text Editors > Annotations allows only to change colors of marks itself not background of whole bar.</p>
<p>It looks like my we... | <p>I also faced the problem of not being able to see the colors in the annotations ruler, so I've made a small plugin which enables setting the background color for the ruler. You can D/L it
from here: <a href="https://github.com/chookapp/AnnotationsRulerBackground" rel="nofollow">https://github.com/chookapp/Annotation... | <p>It seams to work for me.
The only thing to do is to "restart" Eclipse after your change.
The overview ruler and the editor will display the selected color</p>
| 25,039 |
<p>Is there a function the .NET framework that can evaluate a numeric expression contained in a string and return the result? F.e.:</p>
<pre><code>string mystring = "3*(2+4)";
int result = EvaluateExpression(mystring);
Console.Writeln(result); // Outputs 18
</code></pre>
<p>Is there a standard framework function that... | <p>If you want to evaluate a string expression use the below code snippet.</p>
<pre><code>using System.Data;
DataTable dt = new DataTable();
var v = dt.Compute("3 * (2+4)","");
</code></pre>
| <p>Short answer: I don't think so. C# .Net is compiled (to bytecode) and can't evaluate strings at runtime, as far as I know. JScript .Net can, however; but I would still advise you to code a parser and stack-based evaluator yourself.</p>
| 43,267 |
<p>The MS source server technology uses an initialization file named srcsrv.ini. One of the values identifies the source server location(s), e.g.,</p>
<pre><code>MYSERVER=\\machine\foobar
</code></pre>
<p>The docs leave much unanswered about this value. To start with, I haven't been able to find the significance of t... | <p>For anyone looking into this in the future, I received the following information from MS:</p>
<blockquote>
<p>The name on the left side is the logical name of a version
control server. The name is also used in the source-indexed symbol files
(pdb). For example, a symbol file may contain this string value:<b... | <p>The way the debugger retrieves your source is by srcsrv using some command line utility. The utility program itself and the command line used varies depending on which type of repository hosts your code. One of the issues preventing retrieval is that when that command line program is invoked it fails.
To find out wh... | 37,320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.