instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I made a test print for a small gear (~ 1.5 inches in diameter) a few months ago, with a hole through the center. On the first try, the filament (ABS) fused to the print bed, meaning that I had to spend ten minutes scraping off material to loosen it. One solution to this is to use painter's tape spread across the pr... | <p>This can highly depend on the slicer you are using. Some software such as Makerware and Slic3r allow you to adjust the settings for the first raft/part layers. I might suggest adjusting this "Z0" point to about 1/4-1/2 of your layer height. Essentially the first layer (or two) will not adhere as well.</p>
<p>This i... | <p>My very first thought was you didn't re-calibrate your Z0 after adding the blue tape. It sounds like the print head was too close to the print bed to begin with, and adding the blue tape just made it that much worse. </p>
| 104 |
<p>What is best practises for communicating events from a usercontrol to parent control/page i want to do something similar to this:</p>
<pre><code>MyPage.aspx:
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceholder" runat="server">
<uc1:MyUserControl ID="MyUserControl1" runat="server"
... | <p>You would want to create an event on the control that is subscribed to in the parent. See <a href="http://www.odetocode.com/code/94.aspx" rel="noreferrer">OdeToCode</a> for an example.</p>
<p>Here is the article for longevity sake:</p>
<p>Some user controls are entirely self contained, for example, a user control ... | <p>I found the same solution on OdeToCode that @lordscarlet linked to in his accepted solution. The problem was that I needed a solution in VB rather than C#. It didn't translate perfectly. Specifically, checking if the event handler is null in OnBubbleClick didn't work in VB because the compiler thought I was tryin... | 11,838 |
<p>I've got an unusual situation: I'm using a Linux system in an embedded situation (Intel box, currently using a 2.6.20 kernel.) which has to communicate with an embedded system that has a partially broken TCP implementation. As near as I can tell right now they expect each message from us to come in a separate Ethern... | <p>IIUC, setting the TCP_NODELAY option should flush all packets (i.e. tcp.c implements setting of NODELAY with a call to tcp_push_pending_frames). So if you set the socket option after each send call, you should get what you want.</p>
| <p>Maybe you could try putting the tcp stack into low-latency mode:</p>
<pre><code>echo 1 > /proc/sys/net/ipv4/tcp_low_latency
</code></pre>
<p>That should favor emitting packets as quickly as possible over combining data. Read the man on tcp(7) for more information.</p>
| 32,326 |
<p>I recently watched <a href="http://www.youtube.com/watch?v=hp1Y9bhail8" rel="nofollow noreferrer">this youtube tutorial</a> on the Null Object design pattern. Even though there were some errors in it: such as the NullCar that doesn't do anything creates an infinite loop, the concept was well explained. My question i... | <p>As far as I've understood it the idea is that the null object's value is as close to "nothing" as possible. That unfortunately means you have to define it yourself. As an example I personally use "" when I can't pass a null String, null object number for me is -1 (mostly because by default most database sequences st... | <p>What should be the integration point of Null design pattern in code ? I think that DAO objects are the fisrt level client for this design pattern as they lookup an entity in database and return it simply.</p>
<p>The nullability check of these objects pollute the code in service layer or command layer where they are... | 41,188 |
<p>I have a scenario when I start 3..10 threads with ThreadPool.
Each thread does its job and returns to the ThreadPool.
What are possible options to be notified in main thread when all background threads have finished?</p>
<p>Currently I'm using a homegrown method with incrementing a variable for each of created thre... | <p>Decrementing a variable (between threads) is a little bit risky unless done with <code>Interlocked.Decrement</code>, but that approach should be fine if you have the last thread (i.e. when it gets to zero) raise an event. Note that it would have to be in a "finally" block to avoid losing it in the case of exceptions... | <p>Marc's solution is best if you just want to know when all the jobs are finished, and don't need finer info than that (as seems to be your case).</p>
<p>If you wanted some thread to spawn jobs, and some other thread to to receive the notifications, you could use WaitHandle. The code is much longer.</p>
<pre><code> ... | 46,778 |
<p>What is a good method of writing reports using PHP and SQL Server? Is there a third party vendor that supports SQL Server?</p>
| <p>SQL Server comes with <a href="http://www.microsoft.com/sql/reporting/" rel="nofollow noreferrer">Reporting Services</a> out of the box as of version 2005. If you are using SQL Server 2000, Reporting Services 2000 is available as a free download. Reporting Services is web based, so you can drive it off a URL refer... | <p>Check this one out: <a href="http://sourceforge.net/projects/phpreportgen/" rel="nofollow">http://sourceforge.net/projects/phpreportgen/</a></p>
<p>You'll have to use SVN to get the code, but it works really well and can operate with virtually any data source.</p>
| 41,970 |
<p>A cancer CT picture is stored inside a unsigned short array (1-dimensional).</p>
<p>I have the location information of the cancer region inside the picture, but the coordinates (x,y) are in superpixel (128x128 unsigned short). My task is to highlight this region. </p>
<p>I already solved this one by converting su... | <p>This is difficult to answer, since it's rather vague.</p>
<p>If you only mean "how do I access a pixel at (x,y) given this definition of an image", the answer shouldn't be very surprising:</p>
<pre><code>typedef struct
{
unsigned short data[128 * 128]; // This was broken in the question.
} spix;
void spix_se... | <p>This is difficult to answer, since it's rather vague.</p>
<p>If you only mean "how do I access a pixel at (x,y) given this definition of an image", the answer shouldn't be very surprising:</p>
<pre><code>typedef struct
{
unsigned short data[128 * 128]; // This was broken in the question.
} spix;
void spix_se... | 40,524 |
<p>I have an OpenGL/GLUT program running on my linux machine that views a 3D model from various angles and can take screenshots, and everything is controlled from the keyboard. I want to write a script that moves around the model in a particular way, taking screenshots at every step. It seems there should be a simple... | <p>Take the GLUT source-code and make it remote controllable. One way to do this is to remove the function that polls the keyboard and let it poll a socket instead. Link the program with the existing program with the new library.</p>
<p>Afterwards you can establish a connection to the now remote-controllable program a... | <p>You can inject events into an X11 window. I think <a href="http://manpages.ubuntu.com/manpages/hardy/man1/xnee.html" rel="nofollow noreferrer">xnee</a> will do that for you. I think that "inspect" (using a feature of Tk?) used to do this as well.</p>
| 23,828 |
<p>I am using System.IO.Directory.GetCurrentDirectory() to get the current directory in my web service, but that does not give me the current directory. How do I get the current directory in a web service?</p>
<p>Thanks
Stuart </p>
| <p>In a webservice, you are running in a http context. So,</p>
<pre><code>HttpContext.Current.Server.MapPath("~/")
</code></pre>
<p>will give you the answer.</p>
| <p>HttpContext.Current.Server.MapPath("..") [observe two(..) dots instead of (.)] gives physical directory of Virtual Directory of the site!</p>
| 29,224 |
<p>I have some update or something that tries to run every night, and ends up leaving the SQL Server service stopped. When the machine restarts, the service restarts properly. How do I go about diagnosing and fixing what is breaking my SQL Server service? I'm running SQL 2005 on Vista Business.</p>
| <p>We've had this issue with SQL Server 2005 on our dev server. What was happening in our scenario was that the user account under which automatic updates were running wasn't a local machine admin. Automatic updates were in the queue, the machine tried to apply them to SQL 2005, was able to shut down the service but ne... | <p>Check the event log and the sql server error log. They should provide you with hints or the actual error so you can fix it. </p>
| 33,673 |
<p>As per the title. For those who don't know, it's basically Ada for .Net.</p>
| <p>According to [wikipedia](<a href="http://en.wikipedia.org/wiki/A_Sharp_(.NET))" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/A_Sharp_(.NET))</a>, A#.Net has been folded into "GNAT for .Net" for future releases</p>
<blockquote>
<p><a href="http://www.adacore.com/home/" rel="nofollow noreferrer">AdaCore</... | <p>The 2010 .Net. version is supposed to work with MVS 2008.</p>
| 17,316 |
<p>I have two Java classes: B, which extends another class A, as follows :</p>
<pre><code>class A {
public void myMethod() { /* ... */ }
}
class B extends A {
public void myMethod() { /* Another code */ }
}
</code></pre>
<p>I would like to call the <code>A.myMethod()</code> from <code>B.myMethod()</code>. I ... | <p>The keyword you're looking for is <code>super</code>. See <a href="http://java.sun.com/docs/books/tutorial/java/IandI/super.html" rel="noreferrer">this guide</a>, for instance.</p>
| <p>If u r using these methods for initialization then use constructors of class A and pass super keyword inside the constructor of class B.</p>
<p>Or if you want to call a method of super class from the subclass method then you have to use super keyword inside the subclass method like :
super.myMethod();</p>
| 33,762 |
<p>Is there any source on the web where I could find date and time formats used in individual countries in the World? I was checking languages listed in Control panel in Windows, but there are some countries missing (for example countries in Africa etc.).</p>
<p>I found some locale tables on the web, but these usualy ... | <p>The <a href="http://unicode.org/cldr/" rel="noreferrer">Common Locale Data Repository</a> is an excellent resource for locale data. From the website you can download an xml version of the database, which includes datetime formats, number formats, and lots of other locale specific data.</p>
| <p>This webpage shows how to use date and time based on culture settings:<br />
<a href="http://msdn.microsoft.com/en-us/library/5hh873ya.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/5hh873ya.aspx</a></p>
<p>I'm assuming you're programming something so this would probably help you create a d... | 19,076 |
<p>If I have the following code:</p>
<pre><code>MyType<int> anInstance = new MyType<int>();
Type type = anInstance.GetType();
</code></pre>
<p>How can I find out which type argument(s) "anInstance" was instantiated with, by looking at the type variable? Is it possible?</p>
| <p>Use <a href="http://msdn.microsoft.com/en-us/library/system.type.getgenericarguments.aspx" rel="noreferrer">Type.GetGenericArguments</a>. For example:</p>
<pre><code>using System;
using System.Collections.Generic;
public class Test
{
static void Main()
{
var dict = new Dictionary<string, int>... | <p>Use Type.GetGenericArguments(). For example:</p>
<pre><code>using System;
using System.Reflection;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
MyType<int> anInstance = new MyType<int>();
Type type = anInstance.GetType();
foreach (Type t in t... | 37,517 |
<p>I'm trying to bind a list of custom objects to a WPF Image like this:</p>
<pre><code><Image>
<Image.Source>
<BitmapImage UriSource="{Binding Path=ImagePath}" />
</Image.Source>
</Image>
</code></pre>
<p>But it doesn't work. This is the error I'm getting:</p>
<p><em>"P... | <p>WPF has built-in converters for certain types. If you bind the Image's <code>Source</code> property to a <code>string</code> or <code>Uri</code> value, under the hood WPF will use an <a href="https://msdn.microsoft.com/en-us/library/system.windows.media.imagesourceconverter(v=vs.110).aspx" rel="noreferrer">ImageSour... | <p>You need to have an implementation of <a href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx" rel="nofollow noreferrer">IValueConverter</a> interface that converts the uri into an image. Your Convert implementation of IValueConverter will look something like this:</p>
<pre><code>... | 4,091 |
<p>Say you have an application divided into 3-tiers: GUI, business logic, and data access. In your business logic layer you have described your business objects: getters, setters, accessors, and so on... you get the idea. The interface to the business logic layer guarantees safe usage of the business logic, so all the ... | <p>If I understand the question correctly, you've created a domain model and you would like to write an object-relational mapper to map between records in your database and your domain objects. However, you're concerned about polluting your domain model with the 'plumbing' code that would be necessary to read and write... | <p>I always create a separate assembly that contains: </p>
<ul>
<li>A lot of small Interfaces (think ICreateRepository, IReadRepository, IReadListRepsitory.. the list goes on and most of them relies heavily on generics) </li>
<li>A lot of concrete Interfaces, like an IPersonRepository, that inherits from IReadReposi... | 3,065 |
<h2>Background</h2>
<p>My task is to, in SharePoint, show an image of a process map which should be clickable. Think of an imagemap in html. Some areas take you to other process map images and other brings up a pop-up window.</p>
<p>"Connected" to each process map is a set of documents. These documents are stored in ... | <p>My thoughts are that you create a web part that displays your image map and outputs(provider) the appropriate criteria to a another web part that consumes it and displays the files in a document library.</p>
<p>You can achieve this by creating your own custom webpart that displays a document library based on a CAML... | <p>My thoughts are that you create a web part that displays your image map and outputs(provider) the appropriate criteria to a another web part that consumes it and displays the files in a document library.</p>
<p>You can achieve this by creating your own custom webpart that displays a document library based on a CAML... | 33,840 |
<p>For a governmental agency, we build a release management system developped in PHP and Oracle. The data for this application is stored in database tables and is processed with PL/SQL packages and procedures.</p>
<p>The release management process is extensively based on metadata coming from Subversion repositories. ... | <p>If your using Oracle's Java JVM, you could try to use <a href="http://svnkit.com/" rel="nofollow noreferrer">SVNKit</a> to communicate with the SVN server nativly from Java, instead of shelling out to the operating system to execute commands.</p>
| <p>I'm also looking for an API to integerate Subversion and Oracle. I need to be able to pull Oracle PL/SQL objects (procedures, packages) into Subversion and then once changes are made to objects it should be applied to those objects in Oracle database.</p>
| 16,960 |
<p>I'm working on a project that contains Thomas Brothers Map page and grid numbers. Is there a way to programatically convert from this map page to a latitude & longitude?</p>
<p>An Example would be for the intersection of the US101 & I405 freeways.</p>
<p>ThomasBrothers: 561-3G (page-grid)</p>
| <p>Not that I know of, but I don't have a lot of experience with Thomas bros maps. Are you talking about printed version of the maps or is there a link somewhere to an online map? </p>
<p>If you just need a few lat/longs, then you can look up the locations that correspond to the grid and get the lats and longs manua... | <p>I've also got ThomasBros. pages that I would like to convert to lat/long for lookup against Google Maps API. They also provided something called TBXY ... not sure what this is -- perhaps some notation for GPS/lat/long?</p>
<pre><code><Area>"El Cajon"</Area>
<ThomasBrothers>"1297 5E"</ThomasBrot... | 30,701 |
<p>I Have a problem where I occasionally (i.e. not always) see the below error popup from the Debug Flash Player after launching my app:</p>
<pre><code>Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://example.com/myApp.swf cannot load data from localhost:4499.
at org.mydo... | <p>I too struggled with this for a couple of hours. The solution is to listen for SecurityErrorEvent.SECURITY_ERROR. Apparently the SecurityError is only raised if there isn't such an event handler.</p>
| <p>This may not be the issue but you're catching SecurityError and its throwing securityError. Maybe try lowercasing the s.</p>
| 37,784 |
<p>Why doesn't the code below work? The idea is that the page checks to see if the dropdown variable has changes since you last refreshed the page.</p>
<pre><code> <logic:equal name="Result" value = "-1">
<bean:define id="JOININGDATE" name="smlMoverDetailForm" property="empFDJoiningDate"
type="jav... | <p>You have realized, that your bean:define - at least in your question stated here - is flawed?</p>
<pre><code>toScope="sess
</code></pre>
<p>is most likely not what you want - it doesn't even terminate the tag. But this may be formatting in StackOverflow... Also, the missing quotes have been mentioned in other answ... | <pre><code><logic:equal name= DropDownValue value = NewDropDownValue>
</code></pre>
<p>I'm not sure if this is your problem (describe <em>how</em> it doesn't work please), but the above is not valid xml: it needs quotes around the attribute values.</p>
| 26,025 |
<p>I recently discovered Powershell and through that <a href="http://code.google.com/p/psake/" rel="nofollow noreferrer">PSake</a>. If you are using it and you've extended it or created tasks for it, please share!</p>
| <p>As Marc points out, you're probably using a reference to the OBJC object that is un-initialised outside the objective-c scope.</p>
<p>Here's a working sample of C code calling an ObjC object's method:</p>
<pre><code>#import <Cocoa/Cocoa.h>
id refToSelf;
@interface SomeClass: NSObject
@end
@implementation ... | <p>There's a simple way to do this:</p>
<pre><code>@implementation
// Define a object
ClassName *thisClass;
</code></pre>
<p>and then init with self</p>
<pre><code>thisClass = self;
</code></pre>
<p>You can use any var and methods in C-Method</p>
| 39,202 |
<p>I've created a VB 2008 program to track work requests. It all works perfectly on a VISTA box, but I am having an issue with the program on an XP environment with adding new records.</p>
<p>Basically I've got 2 tabs: TAB 1 holds a datagridview with limited info and a calendar. Selecting dates on the calendar chan... | <p>This is definitely an environmental issue. To solve the problem I would need to know which browsers you are using on each machine and some of the settings on each. </p>
<p>It <strong>sounds</strong> like the XP machine is refreshing the page after a timeout period and therefore munging the new record. I have see... | <p>If the code is exactly the same I wonder if it is an environment issue e.g. something like different international options or version of framework? </p>
| 16,239 |
<p>I am getting the below error and call stack at the same time everyday after several hours of application use. Can anyone shed some light on what is happening?</p>
<pre><code>System.InvalidOperationException: BufferedGraphicsContext cannot be disposed of because a buffer operation is currently in progress.
at Syste... | <p>There is a very long MSDN forums discussion of this error <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=200483&SiteID=1" rel="nofollow noreferrer">here</a>. In most cases the error is apparently associated with either:</p>
<ol>
<li>An underlying OutOfMemory problem, which manifests as the Buffe... | <p>a shot in the dark - are you painting from multiple threads? If you are doing painting related work, do it on the GUI thread or synchronize your code carefully.</p>
| 8,216 |
<p>I have the following situation:</p>
<pre><code>
class A
{
public:
A(int whichFoo);
int foo1();
int foo2();
int foo3();
int callFoo(); // cals one of the foo's depending on the value of whichFoo
};
</code></pre>
<p>In my current implementation I save the value of <code>whichFoo</code> in a data ... | <p>How sure are you that calling a member function via a pointer is slower than just calling it directly? Can you measure the difference?</p>
<p>In general, you should not rely on your intuition when making performance evaluations. Sit down with your compiler and a timing function, and actually <em>measure</em> the di... | <p>Sounds like you should make <code>callFoo</code> a pure virtual function and create some subclasses of <code>A</code>.</p>
<p>Unless you really need the speed, have done extensive profiling and instrumenting, and determined that the calls to <code>callFoo</code> are really the bottleneck. Have you?</p>
| 13,823 |
<p>I'm preparing to teach someone to program. When I learned the course material, I used turtle graphics for the first few exercises. In reading introductory textbooks, I have not found one that uses the technique. Did others find this approach helpful? If not, what is a better way to learn to program?</p>
| <p>In the late 80s, before I was programming in C, I was programming in <a href="http://en.wikipedia.org/wiki/Applesoft_BASIC" rel="noreferrer">Applesoft BASIC</a> and <a href="http://en.wikipedia.org/wiki/Logo_(programming_language)" rel="noreferrer">Logo</a>. As a child I thought the <a href="http://en.wikipedia.org/... | <p>I learned to program in BASIC by writing simple programs drawing faces (I mean circles and squares) on the screen. Somehow the whole turtle programming was never my thing, although a few of my friends learned that way. Later on I moved to Pascal, then to Delphi, Java and C++/C#.
In my opinion the trick is to "wow" y... | 45,032 |
<p>I've never forked a project before so I'm a little stumped as to how to proceed. I have a project that I use on my own that I release as a BSD licensed project (Project A). At work I want to use that code but with modifications specific to our company (Project B) but I want to be able to still update with features t... | <p>See the section in previously mentioned <a href="http://svnbook.red-bean.com/en/1.1/ch07s05.html" rel="nofollow noreferrer">The Subversion Book discussing "vendor branches"</a>. This dicusses how to deal with an external subproject so you can both merge in changes when the external project is updated and merge in yo... | <p>Unless Work is willing release those modifications back to the original project, I would start a brand new SVN project there (Project B). Then, as you progress to your next release of the BSD licensed project (Project A), you can make change sets from the last release, and then apply them back to Project B.</p>
<p>... | 41,550 |
<p>I've been working on porting some of my Processing code over to regular Java in NetBeans. So far so well, most everything works great, except for when I go to use non-grayscale colors. </p>
<p>I have a script that draws a spiral pattern, and should vary the colors in the spiral based on a modulus check. The script ... | <p>Have you considered adding debugging statements (System.out.println) and looking at the Java Console?</p>
<p>There may be a massive amount of output and definitive slowdown, but you can at least see what happens when nothing seems to happen.</p>
<p>What I do think is a logic error is the filling if statement; ever... | <p>To see whats happening here add</p>
<pre><code>stroke(255);
</code></pre>
<p>at the beginning of the draw. You'll see all the wanted circles draw, but without color. As the previous poster mentioned: you're using a non gray color only every 11th, 13th and 17th iteration.</p>
<p>I think that your color values are ... | 19,975 |
<p>I need to respond to the events of minimizing / maximizing Eclipse window. How do I do that?</p>
| <p>The only purpose of the extra braces is to provide scope-limit. The <code>List<PExp> copy</code> will only exist within those braces, and will have no scope outside of them.</p>
<p>If this is generated code, I assume the code-generator does this so it can insert some code (such as this) without having to worr... | <p>I think they just define an unnamed level of scope.</p>
| 29,835 |
<p>According to the documentation, the <a href="http://msdn.microsoft.com/en-us/library/zy06z30k.aspx" rel="noreferrer"><code>decimal.Round</code></a> method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algori... | <p>Probably because it's a better algorithm. Over the course of many roundings performed, you will average out that all .5's end up rounding equally up and down. This gives better estimations of actual results if you are for instance, adding a bunch of rounded numbers. I would say that even though it isn't what some... | <p>Use another overload of Round function like this:</p>
<pre><code>decimal.Round(2.5m, 0,MidpointRounding.AwayFromZero)
</code></pre>
<p>It will output <strong>3</strong>. And if you use</p>
<pre><code>decimal.Round(2.5m, 0,MidpointRounding.ToEven)
</code></pre>
<p>you will get banker's rounding.</p>
| 40,168 |
<pre><code>private const int THE_ANSWER = 42;
</code></pre>
<p>or</p>
<pre><code>private const int theAnswer = 42;
</code></pre>
<p>Personally I think with modern IDEs we should go with camelCase as ALL_CAPS looks strange. What do you think?</p>
| <p>The recommended naming and capitalization convention is to use <a href="https://en.wikipedia.org/wiki/Camel_case" rel="noreferrer"><strong>P</strong>ascal<strong>C</strong>asing</a> for constants (Microsoft has a tool named <a href="https://github.com/StyleCop" rel="noreferrer">StyleCop</a> that documents all the pr... | <p>The ALL_CAPS is taken from the C and C++ way of working I believe. This article <a href="http://blogs.msdn.com/sourceanalysis/archive/2008/05/25/a-difference-of-style.aspx" rel="noreferrer">here</a> explains how the style differences came about.</p>
<p>In the new IDE's such as Visual Studio it is easy to identify t... | 30,020 |
<p>In your opinion, what are the best options for adding video to a website assuming it would be rendered as FLV. What are the key considerations?</p>
<p>Would you use a 3rd party service (youtube.com, vimeo.com, etc.) or host yourself? Why?
If you used a service, which one? If you hosted yourself is it as simple a... | <p>I guess the question boils down to whether you need to be in complete control of the video, and whether you have money to throw at the project. If you host on youtube etc you are subject to their terms of service and need to work within the constraints of their branding.</p>
<p>When I have needed complete control o... | <p>If you are going to use a 3rd party site, use vimeo - it's a great user experience and great video quality.</p>
| 14,024 |
<p>I'm developing an application that is targeting the .NET 3.5 Framework. The application's setup installs the .NET <strong>2.0</strong> runtime on the target machine. So far I haven't had any issues with doing this, but I'm wondering what problems I'm going to have down the line. Do I <em>need</em> to be installing t... | <p>This is a tough question to answer, because ultimately it depends on what .NET 3.5 features you are using. If you are using some of the new libraries, such as LINQ, then yes, you'll need to install the 3.5 runtimes. However, if you are just using some of the new syntatic sugars introduced in 3.5, you may not. The... | <p>If you're referencing 3.5 specific libaries such as System.Core or System.Xml.Linq then you'll need to ship 3.5.</p>
| 16,969 |
<p>I would like to generate a report file from a view&template in django.
Preferred file formats would be OpenOffice/ODF or PDF.</p>
<p>What is the best way to do this?</p>
<p>I do want to reuse the page layout defined in the template, possibly by redefining some blocks in a derived template.</p>
<p>Ideally, the... | <p><a href="http://www.htmltopdf.org/" rel="nofollow noreferrer">pisa/xhtml2pdf</a> should get you covered for PDF. It even includes an example Django project.</p>
| <p><a href="http://www.htmltopdf.org/" rel="nofollow noreferrer">pisa/xhtml2pdf</a> should get you covered for PDF. It even includes an example Django project.</p>
| 27,787 |
<p>When you have an array like this:</p>
<pre><code>int foo[3][2][2];
</code></pre>
<p>and you make:</p>
<pre><code>int *bar = &foo[0][0][0];
</code></pre>
<p>Is this the way it works?</p>
<pre><code>*bar == foo[0][0][0];
*(bar+1) == foo[0][0][1];
*(bar+2) == foo[0][1][0];
*(bar+3) == foo[0][1][1];
*(bar+4) ==... | <p>Yes, that's called <a href="http://en.wikipedia.org/wiki/Row-major_order" rel="nofollow noreferrer">row major ordering</a>, and is what C is using.</p>
| <p>On most systems, yes.</p>
| 45,150 |
<p>I need to programmatically enable READ COMMITTED SNAPSHOT in SQL Server. How can I do that?</p>
| <p>I recommend switching to <code>single-user</code> mode first. That ensures you're the only connection. Otherwise, the query might be suspended.</p>
<p>From: <a href="http://msdn.microsoft.com/en-us/library/ms175095.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms175095.aspx</a></p>
<blockquote>
... | <pre><code>ALTER DATABASE [dbname] SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK AFTER 20 SECONDS
</code></pre>
| 32,862 |
<p>I have a slight problem reading data from file. I want to be able to read wstring's, aswell as a chunk of raw data of arbitrary size (size is in bytes). </p>
<pre><code>std::wfstream stream(file.c_str());
std::wstring comType;
stream >> comType;
int comSize;
stream >> comSize;
char *comData = new cha... | <p>the problem with the stream.read is that it uses wchar_t as "character unit" with wfstream. If you use fstream it uses char as "character unit".</p>
<p>This would work if you want to read wide characters:</p>
<pre><code>wchar_t *comData = new wchar_t[comSize];
stream.read(comData, comSize);
</code></pre>
<p>Also ... | <pre><code># ifdef UNICODE
# define tfstream wfstream
# else
# define tfstream fstream
# endif
tfstream fs( _T("filename.bin"), tfstream::binary );
byte buffer[1023];
fs.read( buffer, sizeof(buffer) )
</code></pre>
<p>I think, the _T("filename.bin") and tfstream are the UI expression; the buffer and the read(... | 19,571 |
<p>does it matter at all what order the <code><link></code> or <code><script></code> or <code><meta></code> tags are in in the <code><head></head></code>?</p>
<p>(daft question but one of those things i've never given any thought to until now.)</p>
| <p><strong>Optimization</strong></p>
<p>According to the folks over at Yahoo! you should <a href="http://developer.yahoo.com/performance/rules.html#css_top" rel="nofollow noreferrer">put CSS at the top</a> and <a href="http://developer.yahoo.com/performance/rules.html#js_bottom" rel="nofollow noreferrer">scripts at th... | <p>Nope, it doesn't matter, except for CSS linking or inclusion, because of CSS inheritance and the fact that it overwrite what was already styled (sorry for my english, i think my sentence is not really clear :-/).</p>
| 23,174 |
<p>Why is it wrong to use <code>std::auto_ptr<></code> with standard containers?</p>
| <p>The C++ Standard says that an STL element must be "copy-constructible" and "assignable." In other words, an element must be able to be assigned or copied and the two elements are logically independent. <code>std::auto_ptr</code> does not fulfill this requirement.</p>
<p>Take for example this code:</p>
<pre><code>... | <p><em>C++03 Standard (ISO-IEC 14882-2003)</em> says in clause 20.4.5 paragraph 3:</p>
<blockquote>
<p>[...]
[<strong>Note: [...]
auto_ptr does not meet the CopyConstructible and Assignable requirements for Standard Library
container elements and thus instantiating a Standard Library container
with an auto_p... | 13,669 |
<p>Given a database field named "widget_ids", containing data like "67/797/124/" or "45/", where the numbers are slash separated widget_ids... how would you make an update statement with SQL that would say:
"if the widget_ids of the row with id X contains the text "somenumber/" do nothing, otherwise append "somenumber/... | <p>Updates are kind of like if-thens themselves, and there is also if-then support of some sort in most SQL implementations. A simple solution might be:</p>
<pre><code>update <tablename>
set widget_id = widget_id + "somenumber/"
where row_id = X
and widget_id not like "%/somenumber/%"
and widget_id n... | <p>First, get rid of the symbol-separated list. Use another table, with one widget id per row.</p>
<pre><code>CREATE TABLE ThingieWidgets (
thingie_id INT REFERENCES Thingies,
widget_id INT REFERENCES Widgets,
PRIMARY KEY(thingie_id, widget_id)
);
</code></pre>
<p>Fill the table with values from the slash-sepa... | 18,298 |
<p>Since the TFS is too big for our project, we want to use subversion and Trac. The hosting environment is Windows 2003 and IIS.</p>
<p>There are some options:</p>
<ol>
<li>Run tracd</li>
<li>Run Apache with mod_python</li>
<li>Run tracd with <a href="http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html" rel="no... | <p>You are asking two questions, how do I run it and what would I suggest.</p>
<ol>
<li>I run it with Apache.</li>
<li>I suggest doing it that way (no surprise).</li>
</ol>
<p>I feel that running with a web server gives you more flexibility and
running with Apache gives you more portability.</p>
<p>On the other hand... | <p>We run Apache listening on port 443 (https) for Trac and Svn (WebDAV), and IIS listening on port 80 (http) for public web pages. Setting up Apache for Trac and Svn was very easy and well documented.</p>
| 43,958 |
<p>Is there a way to validate on the client side browser whether the size of a file being uploaded from a JSP page is over a set size limit without forcing the user to upload the entire file only to find out it was too large?</p>
<p>I would like to stay away from any proprietary controls or techniques like Flash or Ac... | <p>This isn't a perfect solution, but if you check the Content-Length HTTP header with <code>request.getHeader("Content-Length")</code> then you can choose to not transfer the entire file.</p>
<p>By way of explanation, an extremely large file will not be transferred all at once. You'd have to actually open a stream r... | <p>With JSP or PHP you won't be able to restrict the file size because your page won't get the request until the upload has already happened. At that point you can decide not to save the file but that might be too late.</p>
<p>There are some Java solutions out there, e.g. <a href="http://www.javaatwork.com/java-upload... | 19,117 |
<p>I keep hearing people complaining that C++ doesn't have garbage collection. I also hear that the C++ Standards Committee is looking at adding it to the language. I'm afraid I just don't see the point to it... using RAII with smart pointers eliminates the need for it, right?</p>
<p>My only experience with garbage co... | <h2>I keep hearing people complaining that C++ doesn't have garbage collection.</h2>
<p>I am so sorry for them. Seriously.</p>
<p>C++ has RAII, and I always complain to find no RAII (or a castrated RAII) in Garbage Collected languages.</p>
<h2>What advantages could garbage collection offer an experienced C++ developer?... | <p>I, too, have doubts that C++ commitee is adding a full-fledged garbage collection to the standard.</p>
<p>But I would say that the main reason for adding/having garbage collection in modern language is that there are too few good reasons <strong>against</strong> garbage collection. Since eighties there were several... | 28,292 |
<p>Which other restrictions are there on names (beside the obvious uniqueness within a scope)?</p>
<p>Where are those defined?</p>
| <p>From the <a href="https://www.ecma-international.org/publications/standards/Ecma-335.htm" rel="nofollow noreferrer">PDF of ECMA-335</a>, Partition II, section 22:</p>
<blockquote>
<p>Metadata preserves name strings, as created by a compiler or code generator, unchanged. Essentially, it treats
each string as an opaq... | <p>Looking in the Partition II Metadata docs, it states that an identifier is either an ID or an SQSTRING</p>
<p>An ID is described as</p>
<blockquote>
<p>a contiguous string of characters
which starts with either an alphabetic
character or one of “_ ”, “$”, “@” or
“?” and is followed by any number of
alpha... | 22,571 |
<p>I am using a route like this one:</p>
<pre><code>routes.MapRoute("Invoice-New-NewCustomer",
"Invoice/New/Customer/New/{*name}",
new { controller = "Customer", action = "NewInvoice" },
new { name = @"[^\.]*" });
</code></pre>
<p>There is an action which handles this route:</p>
<pre><code>public ActionR... | <p>Ok, I confirmed that this is <em>now</em> a known issue in ASP.NET Routing, unfortunately. The problem is that deep in the bowels of routing, we use Uri.EscapeString when escaping routing parameters for the Uri. However, that method does not escape the "#" character.</p>
<p>Note that the # character (aka Octothorpe... | <p>URL Encoding! Change the link so that it encodes special characters.</p>
<pre><code>Server.URLencode(strURL)
</code></pre>
<p>C# will become "c%23".</p>
| 48,856 |
<p>I've seen two different implementation of memento on .NET.</p>
<p>One is pretty straightforward - The object creates another instance of itself.</p>
<p>The other is serializing the object using BinaryFormatter and MemoryStream.</p>
<p>Which is the preferred method? Can anyone point out advantages/disadvantages o... | <p>I think that the choice of how to create/store the memento depends on how long you want the memento to persist and whether you need to communicate that memento across appdomains. If the memento exists only for a short time and is only used by the same thread, then a cloned object is reasonable. If the memento need... | <p>if you are going to persist the memento, use the serialization method</p>
<p>otherwise, a cloned object is fine</p>
| 36,090 |
<p>In the following code, used to get a list of products in a particular line, the command only returns results when I hard code (concatenate) <code>productLine</code> into the SQL. The parameter substitution never happens.</p>
<pre><code> + "lineName = '@productLine' "
+... | <pre><code> + "lineName = ?productLine "
+ "and isVisible = 1 ";
MySqlDataAdapter adap = new MySqlDataAdapter(sql, msc);
adap.SelectCommand.Parameters.Add("?productLine", productLine);
</code></pre>
<ol>
<li>Remove the apostrophes (').</li>
<li>Change @ to ?, which is the ... | <p>like he said</p>
<pre><code>+ "lineName = '@productLine' "
</code></pre>
<p>should be</p>
<pre><code>+ "lineName = @productLine "
</code></pre>
| 31,187 |
<p>I am rendering a rails partial and I want to alternate the background color when it renders the partial. I know that is not super clear so here is an example of what I want to do:</p>
Row One grey Background
Row Two yellow background
Row Three grey Background
Row Four yellow background
<ul>
<li>sorry st... | <p>You could use the Cycle helper. Something like this:</p>
<pre><code><tr class="<%= cycle("even", "odd") %>">
<td><%= row.name %></td>
</tr>
</code></pre>
<p>Or in your case use bgcolor instead, although i would recomend using css classes.</p>
<p>You can cycle through more tha... | <p>Another idea, you can use javascript to change the element's style based on (total number of TD's % 2). </p>
<p>That way all your visual stuff are contained in html/css/javascript layer. Then again, this technique does not work if javascript is disabled.</p>
| 32,652 |
<p>I'd like to find a way to determine how long each function in PHP, and each file in PHP is taking to run. I've got an old legacy PHP application that I'm trying to find the "rough spots" in and so I'd like to locate which routines and pages are taking a very long time to load, objectively. </p>
<p>Are there any pr... | <p>I have actually done some optimisation work last week. XDebug is indeed the way to go.</p>
<p>Just enable it as an extension (for some reason it wouldn't work with ze_extension on my windows machine) , setup your php.ini with xdebug.profiler_enable_trigger=On and call your normal urls with XDEBUG_PROFILE=1 as eithe... | <p>The easiest solution is to use Zend Profiler, you don't need Zend Platform to use is, you can run it directly from your browser, it's quite accurate and has the most features you need and it's integrated in the Zend Studio</p>
| 16,180 |
<p>Is there an easy way to marshal a PHP associative array to and from XML? For example, I have the following array:</p>
<pre><code>$items = array("1", "2",
array(
"item3.1" => "3.1",
"item3.2" => "3.2"
"isawesome" => true
)
);
</code></pre>
<p>How would I turn it into somethi... | <p><a href="http://php.net/simplexml" rel="noreferrer">SimpleXML</a> works great for your use.</p>
| <p>Following class uses simplexml to achieve the same, you just need to loop through the array and call addchild of ximplexml.</p>
<p><a href="http://snipplr.com/view.php?codeview&id=3491" rel="nofollow noreferrer">http://snipplr.com/view.php?codeview&id=3491</a></p>
| 12,458 |
<p>Ok, here's the breakdown of my project: I have a web project with a "Scripts" subfolder. That folder contains a few javascript files and a copy of JSMin.exe along with a batch file that runs the JSMin.exe on a few of the files. I tried to set up a post build step of 'call "$(ProjectDir)Scripts\jsmin.bat"'. When ... | <p>If you have something in your custom build step that returns an error code, you can add:</p>
<pre><code>exit 0
</code></pre>
<p>as the last line of your build step. This will stop the build from failing.</p>
| <p>Somehow, and I'm not familiar with the specifics of how .bat files exit, but either JSMin or the batch file execution is exiting with a non-zero return code.</p>
<p>Have you tried running the scripts directly (i.e. not through JSMin.bat) as part of the post-build?</p>
<p>Edit: Looks Hallgrim has it.</p>
| 12,273 |
<p>EDIT TO IMPROVE CLARITY</p>
<p>Scrum suggests that you split your development into a number of sprints. Each sprint being a fixed duration. At the end of each sprint you ask the client if you should release the software. If they say yes, you perform a <strong>Release Sprint</strong>, during which you do all the tas... | <p>We're using a <a href="http://www.agilemanagement.net/Articles/Weblog/KanbaninAction.html" rel="nofollow noreferrer">kanban</a> board with scrum. Each product item is represented by a post-it note on the whiteboard. Its really obvious during the daily standups where everyone is with each of their tasks, and we can s... | <p>Your goal should be to get to a point where you don't need a release sprint to deploy to production:) But with that said, what are you doing in your release sprint? There are still tasks to be done, but they are even more predictable than developing code. I've never seen a difference in how the burndown/planning ... | 15,491 |
<p>So I have logical entities (person, country, etc.), GUI elements / controls, data and navigation controllers / managers, then things like quad-trees and timers, and I always struggle with cleanly separating these things into logical namespaces.</p>
<p>I usually have something like this:</p>
<ul>
<li>Leviathan.GUI.... | <p>Try to avoid the "and other stuff" or "misc." categories, If you are putting things in these categories you are failing to really organize them at all.</p>
| <p>I follow the Java / python ideal that namespaces should follow the directory structure.</p>
| 14,985 |
<p>I am connecting to a MySQL database with PHP and the CodeIgniter Framework. I want to store my passwords encrypted in the database and would like to know the best way to do this.</p>
| <p>From a high level overview - don't encrypt, hash. And if you can, use BCrypt. <a href="http://www.securityfocus.com/blogs/262" rel="nofollow noreferrer">Here's a long article explaining why BCrypt</a> and why hashing. </p>
| <p>hmm, I hash, more than once based on whatever math springs to mind at the time of writing the storing and validation of passwords</p>
<p>From here on I'll probably go with OpenID as much as possible wherever I have an actual choice tho, so i don't have to do any password storage at all. That way I can leave passwor... | 27,080 |
<p>How do I find the location of my <code>site-packages</code> directory?</p>
| <p>There are two types of site-packages directories, <em>global</em> and <em>per user</em>.</p>
<ol>
<li><p><strong>Global</strong> site-packages ("<a href="https://stackoverflow.com/questions/9387928/whats-the-difference-between-dist-packages-and-site-packages">dist-packages</a>") directories are listed in <... | <p>I had to do something slightly different for a project I was working on: find the <em>relative</em> site-packages directory relative to the base install prefix. If the site-packages folder was in <code>/usr/lib/python2.7/site-packages</code>, I wanted the <code>/lib/python2.7/site-packages</code> part. I have, in ... | 14,881 |
<p>We currently have a web application loading a Spring application context which instantiates a stack of business objects, DAO objects and Hibernate. We would like to share this stack with another web application, to avoid having multiple instances of the same objects.</p>
<p>We have looked into several approaches; e... | <p>Are the web applications deployed on the same server?</p>
<p>I can't speak for Spring, but it is straightforward to move your business logic in to the EJB tier using Session Beans.</p>
<p>The application organization is straight forward. The Logic goes in to Session Beans, and these Session Beans are bundled withi... | <p>Take a look at <a href="http://www.jboss.org/jbosscache/" rel="nofollow noreferrer">JBossCache</a>. It allows you to easily share/replicate maps of data between mulitple JVM instances (same box or different). It is easy to use and has lots of wire level protocol options (TCP, UDP Multicast, etc.).</p>
| 33,648 |
<p>I have a legacy web site in ColdFusion MX 2004. I'm re-writing it in .Net, so I don't want to pay $600+ for an upgrade to the latest version of ColdFusion, nor do I want to go through the (very large) site fixing version incompatibilities.</p>
<p>I often have to track down and fix bugs in the site.</p>
<p>A sourc... | <p>There's no such thing as ColdFusion MX 2004, neither in name nor release year (CFMX 6.1 was released in 2003, and CFMX 7 was released in 2005).</p>
<p><strong><a href="http://www.fusion-reactor.com/fd/" rel="nofollow noreferrer">FusionDebug</a></strong> supports all versions of CFMX from 6.1 onwards.</p>
<p>You ma... | <p>BlueDragon.Net is interesting, but I installed it and found out that it does not do source-level debugging.</p>
| 13,326 |
<p>How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something.</p>
| <p>In general, polling is less efficient than being notified when something happens. Additionally, if you're checking whether something is reading from a disk, you will probably be accessing said disk yourself, possibly influencing what you're trying to observe.</p>
<p>Since 10.5, OSX includes something called the Fil... | <p>You could run the terminal command iostat periodically. You'd have to parse the results into a form you could digest.</p>
<p>If you know enough about various UNIX command line tools, I'd suggest iostat piping the output to awk or sed to extract just the information you want.</p>
| 9,032 |
<p>Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin, for example - and I'm not interested in those.</p>
<p>Some provide useful enhancements, but in a specific niche. I'm not interested in those.</p>
<p>Some are great, but cost money. I'm not interested in those.</p>... | <p>Findbugs saved me doing something silly twice today.</p>
<p><a href="http://findbugs.sourceforge.net/" rel="noreferrer">http://findbugs.sourceforge.net/</a></p>
<p>Eclipse update site is: <a href="http://findbugs.cs.umd.edu/eclipse/" rel="noreferrer">http://findbugs.cs.umd.edu/eclipse/</a></p>
| <p><a href="http://fast-code.sourceforge.net/" rel="nofollow noreferrer">Fast Code eclipse plugin</a> can be of help a little.</p>
| 11,026 |
<p>We have redesigned the structure to a website which has several business units. Now I want to redirect (301) to the new page.</p>
<p>IE: <br />
was www.example.com/abc <br />
now www.example.com/default.aspx?article=abc <br /></p>
<p>I have tried to use Global.asax to do this, and it works properly when I debug th... | <p>Well, if the port indicates you are using the built-in web server (the one that comes with VS), this probably works because that <em>always</em> routes requests through the ASP.NET framework.</p>
<p>Requests ending with /abc will not automatically route through the ASP.NET framework because IIS may not "know" you w... | <p>Have you made sure the web.config files are the same for each website (assuming :1234 is different to :80)</p>
<p>Also, have you tried localhost:80?</p>
| 14,813 |
<p>my company is small with only one full time tester, and mostly we're doing web apps.
so i'm glad that we have tester as i think i would probably be bias or lazy when debugging my own code...</p>
<p>and our tester is actually located in another country, so usually we communicate via IM or email only. usually i try t... | <p>Sounds like you are already doing two important things:</p>
<ol>
<li>Do you best to find your own defects.
(Although doesn't sound like you are working with any automated unit tests, which could help in this area)</li>
<li>Valuing the feedback that you get from testing.</li>
</ol>
<p>Two additional things I would ... | <p>Wouldnt it be better to NOT aid the tester in some cases? Are you going to be present to aid all the users when they run your program?</p>
| 46,721 |
<p>I need to add a <code>xml:lang</code> attribute on the root xml node in the outbound document from BizTalk.</p>
<p>This is a fixed value, so it may be set in the schema or something.</p>
<p>This is what I want to get out:</p>
<pre><code><Catalog xml:lang="NB-NO">
...
</Catalog>
</code></pre>
<p>I've ... | <p>Try to add the xml namespace declaration to the schema </p>
<pre><code>xmlns:xml="http://www.w3.org/XML/1998/namespace"
</code></pre>
<p>Beware that this addition will be removed when the schema file is recreated.</p>
| <p>Instead of</p>
<pre><code><xs:attribute name="xml:lang" />
</code></pre>
<p>try</p>
<pre><code><xs:attribute ref="xml:lang" />
</code></pre>
<p>instead. At least PhpStorm stopped complaining about it.</p>
| 22,553 |
<p>I need to find the smallest power of two that's greater or equal to a given value. So far, I have this:</p>
<pre><code>int value = 3221; // 3221 is just an example, could be any number
int result = 1;
while (result < value) result <<= 1;
</code></pre>
<p>It works fine, but feels kind of naive. Is there a... | <p>Here's my favorite. Other than the initial check for whether it's invalid (<0, which you could skip if you knew you'd only have >=0 numbers passed in), it has no loops or conditionals, and thus will outperform most other methods. This is similar to erickson's answer, but I think that my decrementing x at the be... | <p>This works and is really fast (on my 2.66 GHz Intel Core 2 Duo 64-bit processor).</p>
<pre><code>#include <iostream>
int main(void) {
int testinput,counter;
std::cin >> testinput;
while (testinput > 1) {
testinput = testinput >> 1;
counter++;
}
int finalnum =... | 47,644 |
<p>We're trying to tune an application that accepts messages via TCP and also uses TCP for some of its internal messaging. While load testing, we noticed that response time degrades significantly (and then stops altogether) as more simultaneous requests are made to the system. During this time, we see a lot of TCP c... | <p>A TCP connection is specified by the tuple (source IP, source port, destination IP, destination port).</p>
<p>The reason why there is a TIME_WAIT state following session shutdown is because there may still be live packets out in the network on their way to you (or from you which may solicit a response of some sort)... | <p>TIME_WAIT might not be the culprit. </p>
<pre><code>int listen(int sockfd, int backlog);
</code></pre>
<p>According to Unix Network Programming Volume1, backlog is defined to be the sum of completed connection queue and incomplete connection queue.</p>
<p>Let's say the backlog is 5. If you have 3 completed connec... | 43,739 |
<p>I'm calling a non-.NET dll from my project using P/Invoke, meaning that the .dll must always be present in the .exe's directory. </p>
<p>Is there any way to tell Visual Studio of this dependency, so that it will automatically copy the .dll to the output directory when compiling, and will automatically include the .... | <p>You can copy/link this file(s) to the project, and in properties windows set "Build Action" to "None" and "Copy to Output Directory" to "Copy if newer" or "Copy always".</p>
<p>Or you can use a "Pre-Build Events" & "Post-Build Events" where you can specify any batch scripts.</p>
<p>I prefere the second option,... | <p>I think one problem with just adding a .DLL to the project is that you may need different versions of a DLL for debug and release builds. You'd think you can add both debug and release versions of the DLL to the file, and based on configurations, exclude the inappropriate one, but I couldn't find a way to do that. ... | 15,364 |
<p>I have string which is base64 encoded. How can I search this string to check if this string contains specific sub string which is not encoded? I don't want to decode that string and then search it. </p>
<p>Can I just encode that specific sub string, and search the encoded string by using the encoded sub string?</p>... | <p>The best way is probably to just to decode the string. However, if really necessary, it is possible to do this on the fly instead of a full decode followed by a search. You'll have to implement your one search and just decode only that part that you are currently inspecting. This is most likely only useful if you ha... | <p>You can't just search for an encoded substring. Your search string will be encoded differently depending on where in the original string it appears. I think you will need to decode the entire string and then search for your substring.</p>
| 45,178 |
<p>I'm starting to look into the whole world of RJS and Prototype/jQuery in Rails and am a little bit confused. There seems to be no clear line of where to use one or the other.</p>
<p>Say I wanted one of the "Active, Hot, Week" tabs like the ones here on SO. When pressing one of them, I want to remove a CSS class (li... | <p>If you want to give users that ability to link to the generated page directly, then definitly go for a static page. Using AJAX breaks the back button unless you use something like <a href="http://code.google.com/p/reallysimplehistory/" rel="nofollow noreferrer">Really Simple History</a> (<a href="http://code.google.... | <p>If you want to give users that ability to link to the generated page directly, then definitly go for a static page. Using AJAX breaks the back button unless you use something like <a href="http://code.google.com/p/reallysimplehistory/" rel="nofollow noreferrer">Really Simple History</a> (<a href="http://code.google.... | 27,824 |
<p>I've got a service that has a very slow memory leak. If I analyze the .NET CLR Loading counters, I see that the <em>Current Classes Loaded</em> counter is constantly increasing and matches <em>Total Classes Loaded</em> counter at all times. This gives me the impression that the memory leak is related to resources ... | <p>I believe that the issue was actually caused by a series of un-disposed FileSystemWatcher instances that were nested way down inside the RemoteTaskRunner MBRO. I'm still not sure I have resolved the memory leak entirely, but I can definitely tell a difference.</p>
<p>It seems like this isn't the first time FileSys... | <p>EDIT: After reading some of the other posts, these should be taken into consideration after a better profiler is used and after the appDomain issue is sorted out. </p>
<p>You may want to add performance counters into your service so at least the objects you create can be tracked. That will help you determine if the... | 44,732 |
<p>I have a job interview tomorrow for a .NET shop. For the past few years I have been developing in languages other than .NET and figure it is probably a good idea to brush up on what is cool and new in the world of .NET. I've been reading about LINQ and WPF but these are more technologies than trends. What else sh... | <p>This is completely language agnostic so you may want to skip over it, but I've based a lot of my practice and preparation for job interviews around <a href="http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html" rel="nofollow noreferrer">Steve Yegge's getting a job at google post</a>.</p>
<p>I use a l... | <p>If you're doing web development, ASP.NET MVC and Silverlight (née WPF/e) come to mind as relatively recent trends.</p>
| 3,590 |
<p>I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. </p>
<p>How do I resize the iframes to fit the height of the iframes' content?</p>
<p>I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitle... | <p>We had this type of problem, but slightly in reverse to your situation - we were providing the iframed content to sites on other domains, so the <a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="noreferrer">same origin policy</a> was also an issue. After many hours spent trawling google, we eventually f... | <p>This is slightly tricky as you have to know when the iframe page has loaded, which is difficuly when you're not in control of its content. Its possible to add an onload handler to the iframe, but I've tried this in the past and it has vastly different behaviour across browsers (not guess who's the most annoying...).... | 18,483 |
<p>Does anyone know of a short cut to place my name and the date where the cursor is i.e.</p>
<pre><code> //021208 DarkAxi0m
</code></pre>
<p>so i don't keep check what the date is when i'm adding comments. </p>
<p>Im using Delphi7, with CnPack And GExperts Installed.
I think it should be able to be done with one of... | <p>I use GExperts to do this, like so:</p>
<p>in the</p>
<p>GExperts\Configuration </p>
<p>Select the Editor Experts tab.</p>
<p>In the list of experts, select </p>
<p>Insert Date\Time</p>
<p>Click on the configuration, insert the desired text:</p>
<p>'//' ddmmyy 'DarkAxi0m: '
//021208 DarkAxi0m:</p>
<p>After, ... | <p>Never mind found one in CnPack/Soure Templates
Added the template</p>
<pre><code> //%Date% DarkAxi0m
</code></pre>
<p>Note: i should look in the menus more closely</p>
| 44,052 |
<p>I have a login screen that I force to be ssl, so like this:
<a href="https://www.foobar.com/login" rel="noreferrer">https://www.foobar.com/login</a>
then after they login, they get moved to the homepage:
<a href="https://www.foobar.com/dashbaord" rel="noreferrer">https://www.foobar.com/dashbaord</a></p>
<p>However,... | <p>I figured this out. Cake was switching the session.cookie_secure ini value on-the-fly while under SSL connections automatically, So the cookie being created was a secure cookie, which the second page wouldn't recognize.</p>
<p>Solution, comment out /cake/lib/session.php line 420 ish:</p>
<blockquote>
<p>ini_set(... | <p>Has your homepage got any flash on it that makes a subsequent request to your server? Or any Ajax loading of content?</p>
<p>Have you checked headers being sent from the server? In IE you can use Fiddler or in Firefox use the Live Headers addon. Check for any new cookies being set or the CAKEPHP cookie having a dif... | 39,764 |
<p>Having not done ASP.NET since v1.1, and now blitzing through the Wrox Pro ASP.NET v3.5 book, what other resources are available to get me developing enterprise ASP.NET apps the fastest?</p>
<p>I've been developing in DotNet since Beta and have been doing Winform & middle-layer architecture/design/dev for 3.5 ye... | <p>I'd start with the <a href="http://quickstarts.asp.net/QuickStartv20/default.aspx" rel="nofollow noreferrer">QuickStart tutorials</a>. That'll get you into the code, get you some exposure to the programming, architecture, controls, data access, and so on. You can also watch videos of how to accomplish various tasks ... | <p>Take a look to the <a href="http://www.asp.net/dynamicdata/" rel="nofollow noreferrer">ASP.NET Dynamic Data</a> Scaffolding Framework (included in the .NET Framework 3.5 SP1), it allows you to build really quickly data driven web applications. <a href="http://www.asp.net/learn/3.5-SP1/" rel="nofollow noreferrer">H... | 31,635 |
<p>It's really quite annoying as they are not part of the project.</p>
| <p>The Visual Studio Web Deployment addin lets you exclude folders and more.
<a href="http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx" rel="nofollow noreferrer">VS2005</a>
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en" rel="nofollow nore... | <p>The Visual Studio Web Deployment addin lets you exclude folders and more.
<a href="http://msdn.microsoft.com/en-us/asp.net/aa336619.aspx" rel="nofollow noreferrer">VS2005</a>
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&displaylang=en" rel="nofollow nore... | 7,308 |
<p>I'm building a website in ASP.Net, using MVC, and need to list a set of results. Both of the following work as I want them to but I'm wondering which is faster, cleaner and/or better - or if another option entirely would be more appropriate?</p>
<p>Note: <code>ViewData.Model</code> is of type <code>IEnumerable<T... | <p><code>foreach</code> is definitely faster, if you don't specifically screw up something. <code>Repeater</code> is cleaner of course, and more neatly separates UI and logic. Sometimes you need more conditions (other than different look even and odd rows) to render your stuff properly which makes <code>foreach</code> ... | <p>Here's <a href="http://www.codeplex.com/MVCContrib/Wiki/View.aspx?title=Grid&referringTitle=Documentation" rel="nofollow noreferrer">another option</a>. I have not used this myself, but looks interesting.</p>
| 45,210 |
<p>How do I go about performing AES encryption on a GUID?</p>
<p>On the clients computer we will store a GUID and their public key, and our internal servers will have the private key and their guid.</p>
<p>Is this all the necessary inputs to generate the AES encryption?</p>
| <p><a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">AES</a> is a symmetric encryption algorithm (encrypt and decrypt key is the same). If you are talking about public and private keys, you want an <a href="http://en.wikipedia.org/wiki/Public-key_cryptography" rel="nofollow n... | <p>Here's a quick encrypt/decrypt of string data using AES (Rijndael):</p>
<pre><code>private static readonly byte[] rgbKey = Encoding.UTF8.GetBytes("Ni=9OE=$i+62eprIuDr@ewOu5I9r34Ro"); // change to your own secure key
private static readonly byte[] rgbIv = Encoding.UTF8.GetBytes("to$eO_e!maI*o3ut"); // change to you... | 33,248 |
<p>A while back I asked the following question here on Stack Overflow, <em><a href="https://stackoverflow.com/questions/93455">Assembly Names and Versions</a></em>.</p>
<p>Now I have come to realize I can't sign my assembly with a strong name as one of the 3rd party dependencies is not a strongly named assembly a... | <p>One option might be to use <a href="http://research.microsoft.com/~mbarnett/ILMerge.aspx" rel="nofollow noreferrer">ILMerge</a> to sign the third-party assembly though that would be a bit of a pain to update if the third party deployed updates to their assembly very regularly.</p>
| <p>If you cannot ask the third party for a signed assembly (or in many cases the project has been abandoned) you will need to sign the assembly yourself. Many of the examples online including the answer from Lloyd sometimes cause problems during a round-trip.</p>
<p>ILMerge comes with it's own risks and may not be pos... | 30,171 |
<p>Suppose I have a class module <code>clsMyClass</code> with an object as a member variable. Listed below are two complete implementations of this very simple class.</p>
<p>Implementation 1:</p>
<pre><code>Dim oObj As New clsObject
</code></pre>
<p>Implementation 2:</p>
<pre><code>Dim oObj As clsObject
Private S... | <p>In implementation 1 the clsObject will not get instantiated until it is used. If it is never used, then the clsObject.Class_Initialize event will never fire. </p>
<p>In implementation 2, the clsObject instance will be created at the same time that the clsMyClass is instantiated. The clsObject.Class_Initialize wi... | <p>If in implementation 1 the declaration is inside the class and not a sub, yes the scope is the same for both examples.</p>
| 11,186 |
<p>I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?</p>
| <p>Use <code>$_SERVER['REQUEST_METHOD']</code> to determine whether your page was accessed via a GET or POST request.</p>
<p>If it was accessed via post then check for any variables in <code>$_POST</code> to process.</p>
| <pre><code>!empty($_POST)
</code></pre>
<p>I'm pretty sure you can access a page via GET and POST, so this would be the safest way IMO</p>
| 31,081 |
<p>We have been working on a complex database and client interface for the last 18 months. We are regularly adding new functionnalities to this application, and it is now used by tens of users on a daily basis in all our offices, including sites and overseas. This is just to tell you it is a REAL application with a REA... | <blockquote>
<p>Could we consider that having none or few stored procedures / triggers in a database is a good indication of its normalization level and/or its code maintenance cost?</p>
</blockquote>
<p>No you cannot. </p>
<p>Normalization and stored procedures are completely separate from each other. </p>
<p>My ... | <p>If you have seven different apps all talking to the users database, wouldn't it make more sense having a stored proc called "createUser" rather than seven different applications building that INSERT statement on their own?</p>
<p>And now, a new app, has to add users to this database, but it has a new requirement, a... | 28,394 |
<p>There is a lot of conversation about commenting code, but how about commenting on check-ins?</p>
<p>I found this blog post:
<a href="http://redbitbluebit.com/subversion-check-in-comment-great-practices/" rel="nofollow noreferrer">http://redbitbluebit.com/subversion-check-in-comment-great-practices/</a></p>
<p>As t... | <p>Every feature has a ticket/issue/bugreport/task/whatever-you-call-it, and the ticket number is always referenced in the check-in comment. This gives context.</p>
| <p><strong>Edit: Given that this is by far my most downvoted answer, I think it's worth emphasizing what's hidden in the last paragraph: I'm a sole proprietor. I have 100% ownership of these projects and do not work with other developers. In a shop with more than one developer, everything I'm saying in this answer ... | 41,644 |
<p>Why won't this work? I'm trying to make an instance of a class delete itself.</p>
<pre><code>>>> class A():
def kill(self):
del self
>>> a = A()
>>> a.kill()
>>> a
<__main__.A instance at 0x01F23170>
</code></pre>
| <p>'self' is only a reference to the object. 'del self' is deleting the 'self' reference from the local namespace of the kill function, instead of the actual object.</p>
<p>To see this for yourself, look at what happens when these two functions are executed:</p>
<pre><code>>>> class A():
... def kill_a(s... | <p>I'm curious as to why you would want to do such a thing. Chances are, you should just let garbage collection do its job. In python, garbage collection is pretty deterministic. So you don't really have to worry as much about just leaving objects laying around in memory like you would in other languages (not to say... | 37,454 |
<p>The following code returns data from a spreadsheet into a grid perfectly</p>
<pre><code>[
string excelConnectString = "Provider = Microsoft.Jet.OLEDB.4.0;" +
"Data Source = " + excelFileName + ";" +
"Extended Properties = Excel 8.0;";
OleDbConnection objConn = new OleDbConne... | <p>If you don't want to do <strong>Group by</strong> then DataTable class has a method called <strong>Compute</strong> that executes few SQL functions. <br/>
The following functions are supported : <strong>COUNT, SUM, MIN, MAX, AVG, STDEV, VAR</strong>. <br /></p>
<pre><code>string salary = empTable.Compute("SUM( Sa... | <p>In your example, does <code>SUM</code> represent a potential column name or a SQL funciton?</p>
<p>Are you trying to get your query so that you're able to reference <code>Column A, B, C, D, etc...</code> from the Excel sheet as <code>ColumnA, ColumnB, ColumnC, ColumnD, etc...</code> in your SQL query?</p>
<p>I sup... | 25,451 |
<p>I'm using the following code to have a non-JS navigation:</p>
<pre><code><ol id="navigation">
<li id="home"><a href="#"><img src="./images/nav/home-hover.png" alt="Home" /></li>
...
</ol>
</code></pre>
<p>And the CSS:</p>
<pre><code>#navigation a {
display: block;
... | <p>IE doesn't repaint anchors unless any rule on <code><a></code> itself changes. Add anything for <code>a:hover</code>, e.g.:</p>
<pre><code> #navigation a:hover {border:0} /* no-op */
</code></pre>
<p>BTW: unfortunately popular screen readers don't read things with <code>display:none</code>, so your menu ends... | <p>You can also use the background on the anchor tag to be your image holder.</p>
<p>HTML:</p>
<pre><code><ol>
<li><a href="#"></a></li>
</ol>
</code></pre>
<p>CSS:</p>
<pre><code>li a{
background:url("link.jpg");
display:block;
width:100px;
height:50px;
}
li a:hover{
bac... | 42,695 |
<p>The Objective Caml language will only produce stack traces if you ask for them just right - what are the requirements for both bytecode and native code?</p>
| <p>Compile with -g and set environment variable OCAMLRUNPARAM=b</p>
| <p>As noted in other answers, you need to compile your project with debugging info and run it with the <code>OCAMLRUNPARAM=b</code> environment variable.</p>
<p>A convenient way to have Ocamlbuild compile an entire project with debugging info but without editing the <code>_tags</code> file is to specify a special debug... | 17,585 |
<p>I have the following .aspx page, and I want to view it in web browsers such as IE or Google Chrome by opening it directly in those browsers:</p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD X... | <p>Remove or comment out the</p>
<p><<code>%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %></code></p>
<p>line as a browser doesn't know what to do with it. This is normally interpreted by iis and not sent to the browser.</p>
| <p>It won't actually work properly unless it is "served" by a web server of some sort. </p>
<p>If you are using Visual Studio, fire up the debugger, which by default will open IE, then grab the url from the location bar, and paste that into the browsers you want to check. Elsewise, mount the web site in IIS, and brow... | 39,111 |
<p>I am having a doubt in page_init, page preinit, load.
I need to know when we use this also where we need to call our objects in different stages of our life cycle.</p>
<p>Please let me know how they will process for each events raised</p>
| <p>Page events happen first before user control events. So the pages PageInit event fires, then the all user controls PageInit events fire. The pages PageLoad event fires, then all user controls PageLoad events fire. etc...</p>
<p>Sometimes developers will put initialization of private objects in their user controls P... | <p>You will probably find yourself using OnInit and Load. Differences is mostly in viewstate deserialisation event, which happens after OnInit, so you cannot read values from controls in OnInit.
Also, in OnInit you can (must) dynamically add new controls to page.<br>
All other things, like filling grids and reading fro... | 22,454 |
<p>It took me forever to reduce the problem to this. I cannot express the amount of frustration I'm experiencing, and if I did, it would not be suitable for any website. Ever. Here is the HTML code that is causing me epic pain:</p>
<pre><code><div style="padding: 5px; background: #EEE">
This text is invis... | <p>You’ve been bitten by <a href="http://www.positioniseverything.net/explorer/peekaboo.html" rel="nofollow noreferrer">Peek-a-boo</a>.</p>
<p>From that link, your options are:</p>
<ol>
<li>Keep the clearing div from touching the float, or avoid using a background on div#floatholder. Not exactly ideal.</li>
<li>Give ... | <p>Looks like classic hasLayout problem. Add a width to your outer-most div or try any of the other methods described <a href="http://www.satzansatz.de/cssd/onhavinglayout.html" rel="nofollow noreferrer">here</a>.</p>
| 46,746 |
<p>Newbie question.</p>
<p>I have a NSMutableArray that holds multiple objects (objects that stores Bezier paths and related variables e.g. path colour etc.) These are properly released whenever the relevant <code>-dealloc</code> method is called. Each object is instantiated with <code>+alloc/-init</code> and added to... | <p>You don't need to keep a reference to the object you're working with. When you add an operation to the undo stack (see NSUndoManager <code>registerUndoWithTarget:</code>) it will retain the argument for you. For instance, if you add an object using addObject:(id)obj in your code, you would register it with NSUndoMan... | <p>Maintain a separate list of potential redo actions; move an item from the active list to this one. Only release them once they are "unreachable" (the user performs some other action that invalidates the redo list). You then still have a reference to these items that can be cleaned up if they are never put back on ... | 48,366 |
<p>I´m working on a project, in Visual Studio 2008, which DLL currently surpasses 20 MB. Is there a way to profile that DLL, searching the main contributors to this size? </p>
<p>I suspect that breaking it in smaller projects inside the solution would help, but I'm looking for a faster solution (although not better, I... | <p>Yowser! Have you perchance got some huge resx files (or other embedded content) that are getting embedded in the dll? Perhaps treat those as external content? I'd start by looking at the files in the project tree... that 20Mb has to come from somewhere obvious - large graphics, etc.</p>
| <p>Microsoft.SharePoint.dll is 9Mb. Even for a complex product like SharePoint, DLLs are separated into separate projects.</p>
<p>If you have a large project and that nothing is coming from the resources, might I suggest splitting your project into different assemblies?</p>
<p>I saw the exact error you had but on a V... | 45,668 |
<p>I added a custom boot screen to marlin by adding <code>_Bootscreen.h</code> to the project root folder and it works fine. The problem is that the custom screen shows quickly and disappear then the marlin boot screen is then displayed for a longer time.
I want to remove the marlin boot screen.</p>
<p>I dug around in... | <p>So after some search:</p>
<ol>
<li><p>You can't (at least should not) remove the marlin bootscreen according to this issue <a href="https://github.com/MarlinFirmware/Marlin/issues/8186" rel="nofollow noreferrer">SHOW_CUSTOM_BOOTSCREEN hides Marlin logo</a>, quote:</p>
<blockquote>
<p>We wanted an additional logo... | <p>So after some search:</p>
<ol>
<li><p>You can't (at least should not) remove the marlin bootscreen according to this issue <a href="https://github.com/MarlinFirmware/Marlin/issues/8186" rel="nofollow noreferrer">SHOW_CUSTOM_BOOTSCREEN hides Marlin logo</a>, quote:</p>
<blockquote>
<p>We wanted an additional logo... | 777 |
<p>I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server?</p>
<p><strong>Edit on question:</strong></p>
<p>The query is failing silently with no errors messages logged, and does not occur inside of a... | <p>I suppose you have three options.</p>
<ol>
<li><p>Set user permissions so that user x can only read from the database.</p></li>
<li><p>Set the database into single user mode so only one connection can access it</p>
<p>sp_dboption 'myDataBaseName', single, true</p></li>
<li><p>Set the database to readonly</p>
<p>s... | <p>I never was able to solve the problem, however what I wound up doing was switching to MySQL and using a transactional level query here. This was not the main or even a primary reason to switch. I had been having problems with MSSQL and it allowed me to have our CMS and various other tools all running on the same dat... | 2,701 |
<p>I haven't been to enough of these "live" events to really determine which, if any, are worth the time / money. Which ones do you attend and why?</p>
| <p>For conventions, if you're still in university, and can make it to Montreal, Canada, the <a href="http://www.cusec.net/" rel="nofollow noreferrer">Canadian Undergraduate Software Engineering Conference</a> (CUSEC) has been extremely enjoyable. See the <a href="http://2009.cusec.net/" rel="nofollow noreferrer">2009<... | <p>I used to belong to my local Linux User Group which I co-founded but I treated it more as a social event than anything else but obviously a social event full of geeks is still a great way to get a great debate going :)</p>
<p>Conventions and the like I've not got much out of other than being pestered by businesses ... | 4,604 |
<p>I got a new MKS 1.4 controller board and it came with A4988 driver chips. But I can't figure out which way they install. I found something saying to match the printing on the back of the chip to that on the board. But I don't see anything that matches. Suggestions?</p>
<p><a href="https://i.stack.imgur.com/dQer... | <p>From <a href="https://www.pololu.com/product/1182" rel="nofollow noreferrer">A4988 Stepper Motor Driver Carrier</a>, the rear of the breakout board, is identical to yours:</p>
<p><a href="https://i.stack.imgur.com/8xpCF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8xpCF.jpg" alt="A4988 Breakou... | <p>The below image was taken from <a href="https://www.aliexpress.com/store/product/3D-printer-control-board-motherboard-MKS-Gen-V1-1-RepRap-Ramps1-4-compatible/1047297_2030818114.html" rel="nofollow noreferrer">their AliExpress shop page</a>.</p>
<p>Unfortunately, I don't manage to find the datasheet or schematic to ... | 496 |
<p>I want yo use the EXSLT - DYN:EVALUATE in a style sheet. I have added the names pace but I don't know where the .xsl file I need to import is. I don't believe I have XALAN installed to point the import to. How would I install this? Once installed and I point it to the .xsl will it pick up the function and apply it? ... | <p>Xalan has the EXSL dyn:evaluate function built-in, you don't need to import anything in order to use it. You just need to declare the namespace. I'll give a small example:</p>
<p><em>input.xml</em>:</p>
<pre><code><root>
<foo>I am foo</foo>
<bar>I am bar</bar>
</root>
</... | <p>How would you call this from a JSP page? The JSP serves up the XML and currently attaches the style sheet to the XML page and servers the result.</p>
| 28,527 |
<p>How to pass parameters to [WebMethod] in Asp.Net(C#) ? Can some one please explain the same with the help of an example?</p>
| <p>After you add the web reference you must create an instance of the class that contains the webmethod, then you pass parameters the exact same way as any other method.</p>
| <p>See <a href="http://johnwsaundersiii.spaces.live.com/blog/cns!600A2BE4A82EA0A6!790.entry" rel="nofollow noreferrer">How to Consume a Web Service</a>. Even though it's from the point of view of a WCF service and Service Reference, it largely applies to legacy ASMX web references.</p>
| 46,324 |
<p>How do I take an efficient simple random sample in SQL? The database in question is running MySQL; my table is at least 200,000 rows, and I want a simple random sample of about 10,000.</p>
<p>The "obvious" answer is to:</p>
<pre><code>SELECT * FROM table ORDER BY RAND() LIMIT 10000
</code></pre>
<p>For lar... | <p>There's a very interesting discussion of this type of issue here: <a href="http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/" rel="noreferrer"><a href="http://www.titov.net/2005/09/21/do-not-use-order-by-rand-or-how-to-get-random-rows-from-table/" rel="noreferrer">http://... | <p>Maybe you could do</p>
<pre><code>SELECT * FROM table LIMIT 10000 OFFSET FLOOR(RAND() * 190000)
</code></pre>
| 30,988 |
<p>I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is easy to use? </p>
<p>I'm looking for so... | <p>A command line solution is good. If your database is an internal application, not to be redistributed, I can recommend <a href="http://www.gnupg.org" rel="noreferrer">Gnu Privacy Guard</a>. This command-line based tool will allow you to do anything that you need to with regard to the OpenPGP standard.</p>
<p>Within... | <p>I would look for a command line encrypter / decrypter and just call the exe from within your Access application, with the right parameters.</p>
<p>There is no PGP encrypter / decrypter in VBA that I know of.</p>
| 16,830 |
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/57530/any-tool-to-migrate-repo-from-vault-to-subversion">Any tool to migrate repo from Vault to Subversion?</a> </p>
</blockquote>
<p>I'm currently reviewing the benefits of moving from SVN to a SourceGear Vaul... | <p>Having used both 'in anger' I'd choose Subversion (with TortoiseSVN) over Vault every day.</p>
<p><a href="http://blog.mrlacey.co.uk/2008/03/subversion-vs-vault.html" rel="nofollow noreferrer">When I went from Subversion to Vault this is what I noticed</a>:</p>
<ul>
<li>Can't do a get latest of everything I haven'... | <blockquote>
<p>Forums are difficult to trawl but give many clues to get the best out of all the trials and errors that people have been through.</p>
</blockquote>
<p>Makers comments can be biased and unsure whether they just try to offer their workaround only.</p>
| 22,031 |
<p>I want to write C/C++ programs that take input from a MIDI device. </p>
<p>The MIDI device connects to my PC using a USB connector. </p>
<p>I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port.</p>
<p>I'm happy manipulating the MIDI data o... | <p><a href="http://portmedia.sourceforge.net/portmidi/" rel="noreferrer">PortMidi</a> is another open source cross-platform MIDI I/O library worth checking out. On the other hand, if you are working on a sysex type of app, then direct Win32 works easily enough.</p>
<p>Just came across another open source cross-platfo... | <p>Check out the open source project <a href="http://lmms.sourceforge.net/" rel="nofollow noreferrer">LMMS</a>. It's a music studio for Linux that includes the ability to use MIDI keyboards with software instruments. If you dig around in <a href="http://lmms.sourceforge.net/wiki/index.php?title=Accessing_SVN" rel="nofo... | 2,541 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.