instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>we are writing tests for a COM library written in VB 6.0.The problem we are facing is that, we are unable to access events declared in VB( withevents). We get exception, "object does not support set of events". How can we overcome this problem?</p>
| <p>Your mocking framework is the problem here. The mock object returned by this call:</p>
<pre><code>repository.DynamicMock<PersonLib.DatabaseCommand>();
</code></pre>
<p>implements the <code>DatabaseCommand</code> class's interface, but does not mock its events. Therefore, when you pass an instance of this moc... | <p>For example, we have a class in VB 6.0 called DatabaseCommand.</p>
<pre><code>Option Explicit
Public Event SavedSuccessfully()
Public Sub Execute(ByVal vAge As Integer, ByVal vName As String, ByVal vAddress As String)
RaiseEvent SavedSuccessfully
End Sub
</code></pre>
<p>Now, personclass</p>
<pre><code>Pr... | 35,889 |
<p><strong>EDIT: I missed a crucial point: .NET 2.0</strong></p>
<p>Consider the case where I have a list of unsorted items, for the sake of simplicity of a type like this:</p>
<pre><code>class TestClass
{
DateTime SomeTime;
decimal SomePrice;
// constructor
}
</code></pre>
<p>I need to create a report-... | <p>[edit] Since you are using .NET 2.0 with C# 3.0, you can use <a href="http://www.albahari.com/nutshell/linqbridge.aspx" rel="nofollow noreferrer">LINQBridge</a> to enable this.</p>
<p>LINQ; something like:</p>
<pre><code> var groups = from row in testList
group row by row.SomeTime;
... | <p>Your desired output feels like you want to make a data structure that represents your summary data. You want to pair a date with a list of TestClass objects, then have a collection of those. You could use a HashSet or a Dictionary for the collection.</p>
<p>For the summary, pair data structure can implement ToStr... | 26,051 |
<p>Is there any open source or free .net ui toolkit containing at least one of the following controls:</p>
<ol start="2">
<li>gantt chart (ms project like)</li>
<li>calendar (google calendar like or ms outlook 2003, 2007 like)</li>
<li>scheduler (outlook 2007 like)</li>
</ol>
<p>Thanks</p>
| <p>Here is a free gantt chart from CodeProject. <a href="http://www.codeproject.com/KB/vb/Gantt_Chart.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/vb/Gantt_Chart.aspx</a> </p>
| <p>Here is a list of open source charting libraries:</p>
<p><a href="http://csharp-source.net/open-source/charting-and-reporting" rel="nofollow noreferrer">http://csharp-source.net/open-source/charting-and-reporting</a></p>
| 18,597 |
<p>I was reading about output buffering in JavaScript <strong><a href="http://www.webreference.com/programming/javascript/jkm3/4.html" rel="nofollow noreferrer">here</a>,</strong> and was trying to get my head around the script the author says was the fastest at printing 1 to 1,000,000 to a web page. (Scroll down to th... | <h2>What makes this script so efficient compared to other approaches?</h2>
<p>There are several optimizations that the author is making to this algorithm. Each of these requires a fairly deep understanding of how the are underlying mechanisms utilized (e.g. Javascript, CPU, registers, cache, video card, etc.). I think... | <p>One way to think about it is to consider that a single call to document.write() is very expensive. However, building an array and joining that array into a string is not. So reducing the number of calls to document.write() effectively reduces the overall computational time needed to write the numbers.</p>
<p>Buff... | 16,636 |
<p>Im trying to access a web service from a remote computer. I managed to access the web service from the browser. But Im getting HTTP 403 when I try to call the web service from the application.</p>
<p>Any idea why?</p>
| <p>A <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4" rel="noreferrer">403</a> response indicates that the host or software you're connecting with isn't allowed to access the web service. Reasons for this might be:</p>
<ul>
<li>The remote host you are is being blocked by a firewall</li>
<li>Y... | <p>The Web server thinks that the HTTP data stream sent by the client was correct, but access to the resource identified by the URL is forbidden for some reason.Check the firewall settings.This should help you :-)</p>
| 48,389 |
<p>I am using asp.net mvc for an application. I've taken some guidance from Rob Conery's series on the MVC storefront. I am using a very similar data access pattern to the one that he used in the storefront.</p>
<p>However, I have added a small difference to the pattern. Each class I have created in my model has a ... | <p>In your SaveOrder method you are always creating a new ORDER object. You need to change this so that if order.IsNew is false, it retrieves the existing one from the DB and updates it instead.</p>
<pre><code>public void SaveOrder(Order order)
{
ORDER dbOrder;
if (order.IsNew)
{
dbOrder = new ORD... | <p>I think you have the problem that your entity is detached from your context.</p>
<p>You should try to attach your entity back to your context if you want to update. The downside of LINQtoSQL is that for the re-attachment you'll need the original state of the object when it was detached...</p>
<p>Another solution i... | 39,145 |
<p>I'm trying to find a way of finding out who is downloading what image from an image gallery. Users can download using a button beside the thumbnail or right click and use the "save link as" Is it possible to relate a user session or ID to a "save link as" action from all browsers using either PHP or JavaScript.</p>
| <p>Yes, my preferred way of doing this would be via PHP. You'd have to set up a script which would load up the file and send it to the user browser. This script would also be able to log the download somewhere (e.g. your database).</p>
<p>For example - in very rough pseudo-code:</p>
<p>download.php</p>
<pre><code>$f... | <p>You need a gateway script, like ImageDownload.php?picture=me.jpg, or something like that.</p>
<p>That page whould return the image bytes, as well as logging that the image is downloaded.</p>
| 9,603 |
<p>I recently purchased a BIGTREETECH SKR mini E3 V1.2 and need to adjust some of the settings in configuration h to accommodate for my custom built 3d printer. In the past I've used the RAMPS 1.4 board and adjusted the firmware in the arduino IDE. What is the best way/recommended way to do this for the mini E3 V1.2.</... | <h1>Basics</h1>
<p>Firmware can be distributed in 2 ways:</p>
<ul>
<li>As a compiled file (for example as .hex).</li>
<li>As an uncompiled repository (as in a preconfigured marlin distribution) that needs to be compiled at the users' side.</li>
</ul>
<h1>compiled file</h1>
<p>Compiled files <strong>can't</strong> be al... | <h1>Basics</h1>
<p>Firmware can be distributed in 2 ways:</p>
<ul>
<li>As a compiled file (for example as .hex).</li>
<li>As an uncompiled repository (as in a preconfigured marlin distribution) that needs to be compiled at the users' side.</li>
</ul>
<h1>compiled file</h1>
<p>Compiled files <strong>can't</strong> be al... | 1,645 |
<p>When I worked on the <a href="http://framework.zend.com/manual/en/zend.db.html" rel="noreferrer">Zend Framework's database component</a>, we tried to abstract the functionality of the <code>LIMIT</code> clause supported by MySQL, PostgreSQL, and SQLite. That is, creating a query could be done this way:</p>
<pre><c... | <pre><code>SELECT TOP n *
FROM tablename
WHERE key NOT IN (
SELECT TOP x key
FROM tablename
ORDER BY key
DESC
);
</code></pre>
| <p>I would try to implement this in my ORM as it is pretty simple there. If it really needs to be in SQL Server then I would look at the code generated by linq to sql for the following linq to sql statement and go from there. The MSFT engineer who implemented that code was part of the SQL team for many years and knew ... | 26,633 |
<ul>
<li>How can I convert a <code>str</code> to <code>float</code>?
<pre><code>"545.2222" → 545.2222
</code></pre>
</li>
<li>How can I convert a <code>str</code> to <code>int</code>?
<pre><code>"31" → 31
</code></pre>
</li>
</ul>
<hr />
<p><sub>For the reverse, see <a href="https://stacko... | <pre><code>>>> a = "545.2222"
>>> float(a)
545.22220000000004
>>> int(float(a))
545
</code></pre>
| <p>Here's another interpretation of your question (hint: it's vague). It's possible you're looking for something like this:</p>
<pre><code>def parseIntOrFloat( aString ):
return eval( aString )
</code></pre>
<p>It works like this...</p>
<pre><code>>>> parseIntOrFloat("545.2222")
545.22220000000004
>&... | 49,780 |
<p>I'm working on a page using jQuery's <a href="http://docs.jquery.com/UI/Accordion" rel="nofollow noreferrer">accordion UI element</a>. I modeled my HTML on that example, except that inside the <code><li></code> elements, I have some unordered lists of links. Like this:</p>
<pre><code> $(document).ready(functi... | <p>By default, the accordian widget sets all the links to headers. To change it, you need to specify a selector with the <code>headers</code> option. So, your code would look like this:</p>
<pre><code>$(".ui-accordion-container").accordion(
{ active: "a.default", ..., header: "a.accordion-label" }
);
</code></pre>... | <p>As my answer to your other question says:</p>
<pre><code> navigation: true
</code></pre>
<p>Should be set in your option list.</p>
| 43,058 |
<p>I interested in knowing what fields people actual capture and use when logging within their applications when using loggers like log4net. </p>
<p>This can range from debugging to testing to production and can be for thick client apps but I am thinking more about semantics of web apps (i.e. asp.net).</p>
<p>Also, i... | <p>In order to create an "interaction stack" for the request we assign a sessionid(guid) to the user in a cookie when they first access the application. Then we order by sessionid/datetime to see what the order of events was.</p>
<p>Another thing we always log is the data(minus sensitive data like ssn) the user was a... | <p>Log everything that is an <strong>Error</strong>.</p>
<p>Log as <strong>Warnings</strong> events that are handled but should be recorded.</p>
<p>Beyond that, it's up to you how much detail you want to Log as <strong>Info</strong>. You could Log as Info every entry/exit point to methods. Personally I think that is ... | 28,214 |
<p>I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.</p>
<p>I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?</p>
<p>EDIT: The a... | <p>You can use the <a href="http://docs.jquery.com/Traversing/filter#expr" rel="noreferrer"><code>filter</code></a> function to apply more complicated regex matching.</p>
<p>Here's an example which would just match the first three divs:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" ... | <p>If you just want to select elements that contain given string then you can use following selector:</p>
<p><code>$(':contains("search string")')</code></p>
| 23,087 |
<p>How do I compare two images & recognize the pattern in an image irrespective of its size and pattern size, and using .Net C#? Also, which algorithms are used for doing so from Image Processing?</p>
| <p>See <a href="http://en.wikipedia.org/wiki/Scale-invariant_feature_transform" rel="noreferrer">Scale-invariant feature transform</a>, <a href="http://en.wikipedia.org/wiki/Template_matching" rel="noreferrer">template matching</a>, and <a href="http://en.wikipedia.org/wiki/Hough_transform" rel="noreferrer">Hough trans... | <p><a href="http://en.wikipedia.org/wiki/Scale-invariant_feature_transform" rel="nofollow noreferrer">Scale-invariant feature transform (SIFT)</a> might be what you're looking for. It's not simple to understand or implement, however.</p>
| 39,113 |
<p>I have 4 different named instances of SQL Server 2005 on a single server (for testing purposes). There is no default instance on the server.</p>
<p>Because I will eventually need to allow communication to these instances across the firewall, I have set the ports of each instance statically listening on all IPs for ... | <blockquote>
<p>The first thing to do would be to try
adding the prefix np: or tcp: (for
either Named Pipes or TCP/IP) before
the name of the server. For tcp/ip,
you can also try adding the port
number (,1433) after the name of the
server. If this is not the default
instance, you must add the name of th... | <p>Try enabling TCP/IP communication to the SQL server instances. If you are eventually going to be traversing a firewall, you'll probably want to use TCP/IP instead of named pipes anyway. </p>
| 34,283 |
<p>My Java application is saving stuff in 'user.home' but on windows this does not seem to be the correct path to save application information (as a friend told me). An other option is using the preferences api but it's not possible to set up the hsqldb location using the preferences api. Also, I want all files to be a... | <p>On my WinXP Pro SP3 system, user.home points to <code>C:\Documents and settings\<username></code>
Lot of applications just store their data there (instead of this path + Application data, but some others go down to there), creating a directory in Unix style, ie. dot + application name (examples: .antexplorer, ... | <p>The problem is not Wiindows but the standard java setup.</p>
<p>Long Discussion
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4787931>Here</p>
<p>I would advise picking this up on a '-D MYLOC=%USERPROFILE%' property on the command line.</p>
<p>Note that you will only get a "USERPROFILE" if the user did a de... | 43,203 |
<p>This should hopefully be a simple one.</p>
<p>I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class.</p>
<p>How should this extension method look?</p>
<p>My first intuitive thought is something like this:</p>
<pre><code>namespace System.Web.Mvc
{
public static class ViewPageExt... | <p>I don't have VS installed on my current machine, but I think the syntax would be:</p>
<pre><code>namespace System.Web.Mvc
{
public static class ViewPageExtensions
{
public static string GetDefaultPageTitle<T>(this ViewPage<T> v)
{
return "";
}
}
}
</code><... | <p>If you want the extension to only be available for the specified type
you simply just need to specify the actual type you will be handling</p>
<p>something like...</p>
<pre><code>public static string GetDefaultPageTitle(this ViewPage<YourSpecificType> v)
{
...
}
</code></pre>
<p>Note intellisense will the... | 9,430 |
<p>Graphics and audio editing and processing software often contain functions called "High-Pass Filter" and "Low-Pass Filter". Exactly what do these do, and what are the algorithms for implementing them?</p>
| <p>Wikipedia:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/High-pass_filter" rel="noreferrer">High-pass filter</a></li>
<li><a href="http://en.wikipedia.org/wiki/Low-pass_filter" rel="noreferrer">Low-pass filter</a></li>
<li><a href="http://en.wikipedia.org/wiki/Band-pass_filter" rel="noreferrer">Band-pass filte... | <p>They are generally Electrical circuits that tend to pass parts of analog signals. High pass tends to transmit more of the high frequency parts and low pass tends to pass more of the low frequency parts.</p>
<p>They can be simulated in software. A walking average can act as a low pass filter for instance and the dif... | 5,604 |
<p>Two questions:</p>
<ol>
<li>Can someone point me to unbiased data that compares .NET performance to VB 6 performance? I have searched but it is surprisingly difficult to find.</li>
<li>What is the best way to compare .NET performance to VB 6 performance as an app behaves at a customer's site?</li>
</ol>
<p>We have... | <p>The first thing I need to mention is that .Net code <em>never</em> runs in a VM. While it's true .Net programs are compiled to IL that is somewhat analogous to Java's ByteCode, the important difference is that the IL is also in turn compiled to fully native code before the app starts, rather than interpreted by a V... | <p>The performance versus the VB6 app is probably due more to application design than c# versus VB6. I would guestimate that 9.5/10 times the C# app would be faster if designed properly. .Net does not run inside of a VM. The CLR JIT compiles a .Net app to machine level code, making it pretty darn fast. The reason is... | 29,085 |
<p>For our school project, we are tasked to define a design document describing the architecture of a PHP application.</p>
<p>We are free te decide what to include in the document.</p>
<p>Our professor suggested, lots of (UML) diagrams. </p>
<p>He also asked us to consider class diagrams, but with care, as PHP is no... | <p>IMHO it's pretty difficult to describe the architecture of any application without knowing what the application is supposed to do. All applications (PHP or otherwise) of any complexity look different. </p>
<p>Secondly, PHP5 gives you classes/objects and the usual plethora of OO gubbings - so to describe it as 'not ... | <p>OO is first and foremost a design methodoligy.</p>
<p>As such it is possable to come up with an OO design which can be implmented
in procedural langauges. I have seen this done for both C and COBOL projects.
And it has convinced me that nearly all the advantages of OO are to do with design and NOT language implment... | 40,963 |
<p>We are using NHibernate to manage our persistence in a complex modular windows forms application - but one thought keeps bothering me. We currently open a session on launch and open all objects through that session. I am worried that all loaded objects get loaded into the NHibernate session cache, so that they cant ... | <p>Ayende and company usually recommend using a session per "conversation". This usually makes the session lifetime last for very short operations, so it behaves more like a web app.</p>
<p>For your tree case, you can use Bruno's solution #2 just fine. The objects can be lazily mapped. Then, every time you need to acc... | <p>I can see a couple of alternatives:</p>
<ol>
<li>Eager-load the object tree (which, from what I can gather from the <a href="http://nhforge.org/doc/nh/en/#collections-lazy" rel="nofollow noreferrer">documentation</a> is the default)</li>
<li>Detach the objects, intercept the "click" event, and load the data from th... | 44,906 |
<p>I have a simple web form that has a several fields and a gridview on it. I also have a save and cancel button. </p>
<p>I would like a way to undo what was done to the data on the form when the user presses cancel. This is simple enough with the fields however since changes to the gridview happen in real time agains... | <p>Keep all the data in a session object and write that to the database when you are ready. If you abstract your data layer you can use the ObjectDataSource that interacts with the session objects.</p>
<p>I'm currently using this method on a checkout system for an e-commerce site. I store the data in custom objects ... | <p>One way would be to store changes to a table in another table together with a timestamp and a identifier for that application instance. If you want to undo changes since a specific time you just traverse the list backwards until that date for that identifier.</p>
| 19,377 |
<p>I'm thinking of learning the <code>ASP.NET MVC</code> framework for an upcoming project. Can I use the advanced routing to create long URLs based on the sitemap hierarchy?</p>
<p>Example navigation path:</p>
<p><strong>Home > Shop > Products > Household > Kitchen > Cookware > Cooksets > Nonstick</strong></p>
<p>... | <p>Zack, if I understand right you want unlimited depth of the subcategories. No biggie, since MVC Preview 3 (I think 3 or 4) this has been solved.</p>
<p>Just define a route like</p>
<p>"{controller}/{action}/{*categoryPath}"</p>
<p>for an url such as :</p>
<p><a href="http://example.com/shop/products/household/ki... | <p>The MVC routing lets you define pretty much any structure you want, you just need to define what each of the pieces mean semantically. You can have bits that are "hard-coded", like "shop/products", and then define the rest as variable, "{category}/{subcategory}/{speciality}", etc.</p>
<p>You can also define several... | 3,571 |
<p>I'd like to ask a question then follow it up with my own answer, but also see what answers other people have.</p>
<p>We have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while the other thread will sequentially read fileB. There is no lock... | <p>The problem seems to be in Windows I/O scheduling policy. According to what I found <a href="http://engr.smu.edu/~kocan/7343/fall05/slides/chapter11.ppt" rel="noreferrer" title="I/O management and disk scheduling">here</a> there are many ways for an O.S. to schedule disk requests. While Linux and others can choose b... | <p>I would create some kind of in memory thread safe lock. Each thread could wait on the lock until it was free. When the lock becomes free, take the lock and read the file for a defined length of time or a defined amount of data, then release the lock for any other waiting threads.</p>
| 3,061 |
<p>I've got in my webservice a simple <code>public boolean isAlive()</code> service.
I defined it in my WSDL :</p>
<pre><code><wsdl:types>
<xsd:element name="isAliveResponse" type="xsd:boolean">
</xsd:element>
</wsdl:types>
<wsdl:message name="isAliveResponse">
<wsdl:part e... | <p>As said in my edit the problem was the missing wsdl:input. By adding </p>
<pre><code><wsdl:input message="ns:isAliveRequest" />
</code></pre>
<p>and </p>
<pre><code><wsdl:message name="isAliveRequest"></wsdl:message>
</code></pre>
<p>then my original problem is solved... conclusion, I should ha... | <p>I'm not sure if this is your problem but the following line seems to have no closing tag:</p>
<pre><code><wsdl:types>
<xsd:element name="isAliveResponse" type="xsd:boolean">
</wsdl:types>
</code></pre>
<p>It should be like this:</p>
<pre><code><wsdl:types>
<xsd:element name="isA... | 40,991 |
<p>I am using the basic-auth twitter API (<a href="https://groups.google.com/d/topic/twitter-development-talk/wD-isa6Q0qk/discussion" rel="noreferrer">no longer available</a>) to integrate twitter with my blog's commenting system. The problem with this and many other web APIs out there is that they require the user's ... | <blockquote>
<ol>
<li>Generate a random key on the server (I'm using php).</li>
<li>Save the key in a session and also output the key in a javascript variable.</li>
<li>On form submit, use Triple DES in javascript with the key to encrypt the password.</li>
</ol>
</blockquote>
<p>This avoids sending the passw... | <blockquote>
<p>How can I send sensitive data over an
insecure channel</p>
</blockquote>
<p>With a pre-shared secret key. This is what you attempt in your suggested solution, but you can't send that key over the insecure channel. Someone mentioned DH, which will help you negotiate a key. But the other part of w... | 5,981 |
<p>I believe there's a way to find the kth largest element in an unsorted array of length n in O(n). Or perhaps it's "expected" O(n) or something. How can we do this?</p>
| <p>This is called finding the <strong>k-th order statistic</strong>. There's a very simple randomized algorithm (called <em>quickselect</em>) taking <code>O(n)</code> average time, <code>O(n^2)</code> worst case time, and a pretty complicated non-randomized algorithm (called <em>introselect</em>) taking <code>O(n)</cod... | <p>What I would do is this:</p>
<pre><code>initialize empty doubly linked list l
for each element e in array
if e larger than head(l)
make e the new head of l
if size(l) > k
remove last element from l
the last element of l should now be the kth largest element
</code></pre>
<p>You ... | 31,368 |
<p>At work I have a standard desk (4 legs, flat surface, you get the picture). For a while now I've been thinking about converting to a standing desk. What would be the best way to go about this on a limited budget? Are there some good laptop/keyboard stands I could place on my existing desk? Which ones are the bes... | <p>Talk to an occupational therapist and get their advice because you'll be drastically changing the way you posture yourself for hours at a time.</p>
<p>Agencies that assist people with disabilities and their carers (if you're in Australia, look up the Independent Living Centre in your capital city) would be a good s... | <p>This has been featured in a couple of blogs that are likely near and dear to most SOers:</p>
<ul>
<li><a href="http://lifehacker.com/software/contest/coolest-workspace-contest--diy-startup-desk-170906.php" rel="nofollow noreferrer">Lifehacker: Coolest Workspace Contest: DIY Startup Desk</a></li>
<li><a href="http:/... | 15,196 |
<p>I must be dense. After asking several questions on StackOverflow, I am still at a loss when it comes to grasping the new routing engine provided with ASP.NET MVC. I think I've narrowed down the problem to a very simple one, which, if solved, would probably allow me to solve the rest of my routing issues. So here ... | <p>What about</p>
<pre><code>routes.MapRoute(
"Profiles",
"{userName}",
new { controller = "Profiles", action = "ShowUser" }
);
</code></pre>
<p>and then, in ProfilesController, there would be a function</p>
<pre><code>public ActionResult ShowUser(string userName)
{
...
</code></pre>
<p>In the function,... | <p>You could handle that in the home controller, but the controller method would not be very elegant. I'm guessing something <em>like</em> this <em>might</em> work (not tested):</p>
<pre><code>routes.MapRoute(
"Root",
"{controller}/{view}",
new { controller = "Home", action = "Index", view = "" }
);
</code... | 49,378 |
<p>I got a Function that returns a <code>Collection<string></code>, and that calls itself recursively to eventually return one big <code>Collection<string></code>.</p>
<p>Now, i just wonder what the best approach to merge the lists? <code>Collection.CopyTo()</code> only copies to string[], and using a <cod... | <p>If you're using List<> you can use .AddRange to add one list to the other list.</p>
<p>Or you can use yield return to combine lists on the fly like this:</p>
<pre><code>public IEnumerable<string> Combine(IEnumerable<string> col1, IEnumerable<string> col2)
{
foreach(string item in col1)
... | <p>As far as merging goes:</p>
<blockquote>
<p>I wonder, is there a more efficient
way to have a recursive function that
returns a list of strings without
duplicates? I don't have to use a
Collection, it can be pretty much any
suitable data type.</p>
</blockquote>
<p>Your function assembles a return value... | 7,995 |
<p>I am exporting a report from MS Access(2003) to Excel (97-2003) output.</p>
<p>One of the columns has a character string that is numeric for some rows e.g. "05-0880". </p>
<p>When I open the output file in MS Excel the corresponding cell is set to the number <i>-372424</i>.</p>
<p>I assume this is caused by Excel... | <p>Actually, it is more like the other way around. MS Access is too dumb to export it properly from a report. You can armor the data with quotes or apostrophes; however, as you know, that's quite ugly and requires post processing.</p>
<p>My way around it was to carefully craft a query and then export the results of th... | <p>make sure you use the single quote not the other apostrophe. </p>
| 36,040 |
<p>Given a Django.db models class:</p>
<pre><code>class P(models.Model):
type = models.ForeignKey(Type) # Type is another models.Model class
name = models.CharField()
</code></pre>
<p>where one wishes to create a new P with a specified type, i.e. how does one make "type" to be a default, hidden field (from the ... | <p>To have a default Foreign Key in a model:</p>
<pre><code>mydefault = Type.objects.get(pk=3)
class P(models.Model):
type = models.ForeignKey(Type, default=mydefault) # Type is another models.Model class
name = models.CharField()
</code></pre>
<p>Note that using <code>pk=x</code> is pretty ugly, as ideally yo... | <p>If you go with Andrew's approach of including the hidden value in the url and still want to use one of Django's built in form templates, there are ways for you to exclude the hidden field.</p>
<p><a href="http://docs.djangoproject.com/en/1.1/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form" rel="nofoll... | 34,105 |
<p>I've been trying to programatically feed the paper on a pos printer (Epson TM-U220D). The problem I have is that the last line of the document don't get printed, instead, it is printed as the first line of the next document printed. I tried POS for .NET sending the "ESC|flF" command, also tried to send the raw esc/p... | <p>You will need sooner or later the full <code>ESC/POS Application Programming Guide</code>. I did obtained a copy from my EPSON dealer some years ago. In the meantime, I have found with Google a link to the <code>FAQ for ESC/POS</code> here:
<a href="https://web.archive.org/web/20111229102746/http://postechgroup.com/... | <p>If the printer is on LPT1, shell out to DOS and give to CMD.EXE or COMMAND.COM whatever the C# equivalent is of this BASIC expression:</p>
<pre><code>"ECHO " & Chr(12) & ">LPT1"
</code></pre>
<p>Either that or append a Chr(12) to the output text.</p>
| 25,416 |
<p>I simply wondered whether people thought it was worth learning to use the MSBuild syntax in order to customise the build process for a .net project, or whether it is really not worth it given the ease with which one can build a project using visual studio. </p>
<p>I am thinking in terms of nightly builds, etc., but... | <p>@kronoz<br>
I would say YES.<br>
The neat thing about MSBuild is that if you modify your csproj files to include custom build steps then those steps will happen from within VS or from MSBuild. Also if you ever have a build server you will not need to install full VS, only the SDK to build your projects.</p>
| <blockquote>
<p>@kronoz I would say YES. The neat
thing about MSBuild is that if you
modify your csproj files to include
custom build steps then those steps
will happen from within VS or from
MSBuild. Also if you ever have a build
server you will not need to install
full VS, only the SDK to build your
... | 7,021 |
<p>I would like to make a list of remarkable robot simulation environments including advantages and disadvantages of them. Some examples I know of are <a href="http://www.cyberbotics.com/" rel="noreferrer">Webots</a> and <a href="http://playerstage.sourceforge.net/" rel="noreferrer">Player/Stage</a>.</p>
| <p>This made me remember the <a href="http://www.spiderland.org/node/2598" rel="nofollow noreferrer">breve</a> project.</p>
<blockquote>
<p><em>breve is a free, open-source software package which makes it easy to build 3D simulations of multi-agent systems and artificial life.</em></p>
</blockquote>
<p>There is als... | <p>National Instruments' <a href="http://www.ni.com/labview/" rel="nofollow noreferrer">LabView</a> is a graphical programming environment for developing measurement, test, and control systems.
It could be used for 3D control <a href="http://cnx.org/content/m12977/latest/" rel="nofollow noreferrer">simulation</a> with ... | 20,139 |
<p>When I use the task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined.</p>
<p>When I print the value of the property, it gives true if the resource was available, but otherwise just prints the property name.</p>
<p>Is there a way to set the property to so... | <p>You can use a condition in combination with not:</p>
<p><a href="http://ant.apache.org/manual/Tasks/condition.html" rel="noreferrer">http://ant.apache.org/manual/Tasks/condition.html</a></p>
<pre><code> <condition property="fooDoesNotExist">
<not>
<available filepath="path/to/foo"/>
... | <p>The reason for this behaviour are the if/unless-attributes in targets. The target with such an attribute will be executed if/unless a property with the name is set. If it is set to false or set to true makes no difference. So you can use the available-task to set (or not) a property and based on this execute (or not... | 16,185 |
<p>I haven't used vim in a Unix system in a while, but as I recall there was no \r, it was always \n.</p>
<p>I'm using gVim under windows and when I <i>search</i> for new line characters I use \n. Searching for \r returns nothing. But when I <i>replace</i> the characters I have to use \r's. \n's give me ^@</p>
<p>Can... | <p>Lookup up:</p>
<pre><code>:set fileformat=unix
:set fileformat=dos
</code></pre>
<p>This can be used on either platform to switch to the other encoding.</p>
| <p>In Windows, if you open up a file in text mode, \n is interpreted as both the newline and linefeed characters. This normally isn't the case the *nix systems.</p>
| 45,651 |
<p>I have made a toolbar that I want to enable from a systray application written in C#, the actual toolbar enabling is done from a C++ part using [DLLImport].</p>
<p>Current I use:</p>
<pre><code>SHLoadInProc(__uuidof(MyBandLoader))
</code></pre>
<p>but this fails on vista (SHLoadInProc is not implemented any more)... | <p>On Vista there's a new poorly-documented interface called ITrayDeskBand. </p>
<p>Create an instance of this via CoCreateInstance, and then call ShowDeskBand([CLSID of your toolbar]) on the returned pointer (in C++ - I'm not sure how you create all the relevant bits for PInvoke in C# - might be easier to write a sim... | <p>I have used that one, but it only tells you have to make a toolbar, not how to enable it from another program.</p>
| 44,256 |
<p>I've got a bunch of legacy code that I need to write unit tests for. It uses pre-compiled headers everywhere so almost all .cpp files have a dependecy on stdafx.h which is making it difficult to break dependencies in order to write tests.</p>
<p>My first instinct is to remove all these stdafx.h files which, for the... | <p>Yes, there is a better way.</p>
<p>The problem, IMHO, with the 'wizard style' of precompiled headers is that they encourage unrequired coupling and make reusing code harder than it should be. Also, code that's been written with the 'just stick everything in stdafx.h' style is prone to be a pain to maintain as chang... | <p>I only use pre-compiled headers for the code that needs to include the afx___ stuff - usually just UI, which I don't unit-test. UI code handles UI and calls functions that do have unit-tests (though most don't currently due to the app being legacy).</p>
<p>For the bulk of the code I don't use pre-compiled headers.<... | 36,957 |
<p>We are embarking on a grand/huge project which will take us around 1 full year of coding (by 4 developers) to get off the launch pad.</p>
<p>It is a complete Business Management System.</p>
<p>We can use any commercially available RDBMS like Oracle, MS SQL Server, etc. but we are looking out to use freeware and op... | <p>I'd be as conservative as possible, since your client hardware and software will need tender loving care. Since SQL Server and VB6 (and Windows) all come from Microsoft, I don't see how you have any other choice.</p>
<p>You might even consider using an older version of SQL Server, since the standard OLEDB server an... | <blockquote>
<p>We can use any commercially available RDBMS like Oracle, MS SQL Server, etc. but we are looking out to use freeware and open source RDBMS system like FireBirdSQL, PostgreSQL, etc.</p>
</blockquote>
<p>What's wrong with the free versions of SQL Server, Oracle, or DB2? They are all significantly more p... | 46,768 |
<p>I run Vista (business x32) on my work machine, in which I do ASP.NET development. Because I use IIS to server the sites I build (I do a lot of CMS integrations so I need to use IIS not the inbuilt web development server) I always need to attach to w3wp for debugging.</p>
<p>The problem is that w3wp requires elevate... | <p>Have you asked the Domain Admins if they have a Group Policy which is re-enabling UAC?</p>
<p>It may be that Vista by default has only a few places that can run unrestricted and if you have Visual Studio installed outside those areas, it may be preventing it from running with elevated permissions.</p>
<p>Check whe... | <p>You could write a script that disables UAC and then run that script every time you restart your computer, or maybe just before you launch VS.</p>
<p>Modify registry:</p>
<ul>
<li><a href="http://www.mydigitallife.info/2007/04/23/how-to-disable-or-enable-vista-user-access-control-in-command-prompt/" rel="nofollow">... | 13,757 |
<p>Many optimistic concurrency examples refer to updates by using a database timestamp or flag.</p>
<p>However, I want to handle optimistic concurrency for INSERTS </p>
<p>To illustrate here is a fake scenario:</p>
<p>Multiple users can insert a journal entry at the same time, but allow only one journal entry is al... | <p>Whether or not you define an explicit unique key constraint, that's exactly what you're asking for.</p>
<p>You can write an IF block in your SQL code to check for the existence of a journal entry of the specified date.</p>
<p>But an explicit unique key constraint is going to give better performance.</p>
| <p>You could write an 'on insert' trigger to check the contents of the table, and then discard the insert if your criteria are not met. This is available for most RDBMS.</p>
| 24,712 |
<p>I want to create an associative array:</p>
<pre><code>var aa = {} // Equivalent to Object(), new Object(), etc...
</code></pre>
<p>And I want to be sure that any key I access is going to be a number:</p>
<pre><code>aa['hey'] = 4.3;
aa['btar'] = 43.1;
</code></pre>
<p>I know JavaScript doesn't have typing, so I can't... | <p>This may work for you:</p>
<pre><code>function getValue(id){
return (!isNaN(aa[id])) ? aa[id] : undefined;
}
</code></pre>
<p>Alternatively, I recommend this generic solution:</p>
<pre><code>function getValue(hash,key) {
return Object.prototype.hasOwnProperty.call(hash,key) ? hash[key] : undefined;
}
</code></... | <p>One possibility would be to use hasOwnProperty to check that the key is something you explicitly added to the array. So instead of:</p>
<pre><code>function findNumber(userEnteredKey) {
return aa[userEnteredKey];
}
</code></pre>
<p>you'd say:</p>
<pre><code>function findNumber(userEnteredKey) {
if (Object.pro... | 47,955 |
<p>I am wondering what to include when building my project. I have a library I need to reference for my project to build but that library has 10 dependencies itself. Should I reference those dependencies as well or should I copy them to the output directory using a post build event?</p>
<p>What is the best practice?</... | <p>It's just opinion. Either way will work.</p>
<p>Personally I hate post-build BAT files, so I would include the dependencies to get them copied to the output directory.</p>
<p>Another option is to put a link to them in your project - like in a resources directory. Have this set to BuildAction=None, and CopyToOutp... | <p>I suppose you are working in Visual Studio.</p>
<p>The short answer is to include only the assemblies needed for your project to compile.</p>
<p>Referencing more assemblies should not cause any problems, for your application will load assemblies when needed at run time, but having a long list of references can get... | 33,657 |
<p>How do I set gc.reflogExpire so that items will never expire?<br>
What other time interval formats does it accept?</p>
<p>The man page says that you can set it to "90 days or 3 months," but doesn't specify what format it expects.</p>
| <p>Setting gc.refLogExpire to "never" should do the trick.</p>
<pre><code>git config gc.reflogExpire "never"
</code></pre>
| <p>Setting in cli</p>
<ul>
<li>day: <code>git reflog expire --expire=180</code></li>
<li>never: <code>git reflog expire --expire=never</code></li>
</ul>
<p>Or</p>
<p>Setting this reflogExpire in you .gitconfig file</p>
<pre><code>[gc]
reflogExpire = never # Make reflog never expire
</code></pre>
| 24,354 |
<p>My designer handed me a design I'm not 100% sure how to do with jquery and css.
I am basicly trying to allow a user to "slide" the footer up to reveal more conent.</p>
<p>My html..</p>
<pre><code> <div id="footer">
<div id="expandingFooter"> hidden content</div>
content that is alway... | <p>You can leverage JQuery UI 1.6's Effects (<a href="http://ui.jquery.com/repository/real-world/effects/" rel="nofollow noreferrer">Effects Demo Page</a>). The following accomplished the desired effect for me.</p>
<pre><code>$('#toggleButton').bind('click', function(e) {
$('#expandingFooter').toggle(
'sl... | <p>Try something like this: </p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript" src="shared-scripts/jquery-1.2.4b.js"&g... | 47,478 |
<p>Recently I have been having issues with Firefox 3 on Ubuntu Hardy Heron.</p>
<p>I will click on a link and it will hang for a while. I don't know if its a bug in Firefox 3 or a page running too much client side JavaScript, but I would like to try and debug it a bit.</p>
<p>So, my question is "is there a way to ha... | <p>It's probably the <a href="http://shaver.off.net/diary/2008/05/25/fsyncers-and-curveballs/" rel="noreferrer">awesome firefox3 fsync "bug"</a>, which is a giant pile of fail.</p>
<p>In summary</p>
<ul>
<li>Firefox3 saves its bookmarks and history in an SQLite database</li>
<li>Every time you load a page it writes t... | <p>There's no "process explorer" kind of tool for Firefox; but there's <a href="https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Venkman" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Archive/Mozilla/Venkman</a> with profiling mode, which you could use to see the time spent by chr... | 2,909 |
<p>How do I toggle the visibility of an element using <code>.hide()</code>, <code>.show()</code>, or <code>.toggle()</code>?</p>
<p>How do I test if an element is <code>visible</code> or <code>hidden</code>?</p>
| <p>Since the question refers to a single element, this code might be more suitable:</p>
<pre><code>// Checks CSS content for display:[none|block], ignores visibility:[true|false]
$(element).is(":visible");
// The same works with hidden
$(element).is(":hidden");
</code></pre>
<p>It is the same as <a... | <p>if you hide with class - d-none</p>
<pre><code>if (!$('#ele').hasClass('d-none')) {
$('#ele').addClass('d-none'); //hide
}
</code></pre>
| 21,492 |
<p>Yesterday I got a call from a Microsoft representative asking if we supply "hosted solutions", presumably as part of the big Windows Azure push. As soon as I got off that call, our marketing director came into my office and said the majority of our customers are demanding Active Directory integration in the next ver... | <p>You're not. Active Directory can be run across the public Internet, though this complicates the security and setup of the network rather considerably.</p>
<p>Generally, authenticating an app against Active Directory means that your membership provider (for example) would call into Active Directory to do the authent... | <p>Active Directory can be run across the public internet but you will experience lag times which may cause your app to time out or crash depending on your bandwidth. In the past, I have setup accounts with another company called ultradns.com who specializes in these types of scenarios. hope that helps. </p>
| 47,456 |
<p>I've been playing with some algorithms on the internet for a while and I can't seem to get them to work, so I'm tossing the question out here;</p>
<p>I am attempting to render a velocity vector line from a point. Drawing the line isn't difficult: just insert a line with length <code>velocity.length</code> into the ... | <p><a href="http://mathworld.wolfram.com/RotationMatrix.html" rel="nofollow noreferrer">This</a> should do you</p>
| <p><a href="http://mathworld.wolfram.com/RotationMatrix.html" rel="nofollow noreferrer">This</a> should do you</p>
| 26,592 |
<p>I want to calculate the time span between 2 times which I saved in a database.
So literally I want to know the length of time between the 2 values.</p>
<p>14:10:20 - 10:05:15 = 02:05:05</p>
<p>So the result would be 02:05:05.</p>
<p>How would I be able to achieve this using C#?</p>
<p>14:10:20 is the format I sa... | <p>Read the two time values into TimeSpan variables, then perform a <code>.Subtract()</code> on the bigger TimeSpan variable to get the TimeSpan result.</p>
<p>E.g. <code>TimeSpan difference = t1.Subtract(t2);</code>.</p>
| <p>DateTime objects support the "-" operator so you can just read your times into such objects and subtract them. To test, check this out:</p>
<pre><code>DateTime then = DateTime.Now;
Thread.Sleep(500);
DateTime now = DateTime.Now;
TimeSpan time = now - then;
MessageBox.Show(time.ToString());
</code></pre>
| 15,991 |
<p>I've implemented a set of draggable elements that can be dropped into some containers using jQuery. What I need is an animation that moves an element to a specific container without user interaction. The problem is that the elements and the drop containers are in completely <strong>different parts of the DOM</strong... | <p>I never used jQuery, just looked up API, so I can assume you can do the following:</p>
<pre>
var o1 = $(element1).offset();
var o2 = $(element2).offset();
var dx = o1.left - o2.left;
var dy = o1.top - o2.top;
var distance = Math.sqrt(dx * dx + dy * dy);
</pre>
| <p>Using pure javascript.</p>
<pre><code>var dx = obj1.offsetLeft - obj2.offsetLeft;
var dy = obj1.offsetTop - obj2.offsetTop;
var distance = Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));
</code></pre>
| 27,881 |
<p>I'm trying to find an editor (or some simple JavaScript - preferably jQuery) that will allow me to edit the contents of a textarea.</p>
<p>I don't want it to be rich text or WYSIWYG; I just want to be able to select a bit of text, click a button/link and have some simple HTML tags that I define put either side of t... | <p>Would something like <a href="http://krijnhoetmer.nl/stuff/javascript/textarea/" rel="nofollow noreferrer">this</a> fit the bill? I think it just uses <code>document.selection</code> to identify where to insert the markup.</p>
| <p>I've made the one I created for my CMS freely available <a href="http://www.byrst.com.au/xhtml-editor/" rel="nofollow noreferrer">Byrst XHTML Editor</a></p>
| 37,756 |
<p>So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC?</p>
<p>I wrap the cache in a proxy class that implements a cache-like interface (tho much simpler) so that I can mock it during tests. B... | <p>Add the OutputCache attribute to your controller action in order to tell the framework to cache the output for you. You can read more about this attribute in <a href="http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx" rel="nofollow noreferrer">ScottGu's blog post on ASP.NET... | <p>Add the OutputCache attribute to your controller action in order to tell the framework to cache the output for you. You can read more about this attribute in <a href="http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx" rel="nofollow noreferrer">ScottGu's blog post on ASP.NET... | 21,594 |
<p>I'm trying to use a static library created by me in Visual C++ 2005 (unmanaged C++). I declare one function "int myF(int a);" into a .h file, I implement it in a .cpp file, I compile it - the .lib file is produced.</p>
<p>I create a new project (a separate solution) in VC++ 2005 (also native C++), I add the paths f... | <p>You need to also include the actual .lib file in your 2nd project (not just the path to it).</p>
<p>There should be an option in the linker settings to do this.</p>
| <p>Try setting additional dependencies in the linker input for a project properties.</p>
| 22,734 |
<p>This is probably a simple question but how can I best use an AJAX loader in ASP.NET to provide a loading dialog whilst the page is being built?</p>
<p>I currently have an UpdatePanel with an associated UpdateProgressPanel which contains the loading message and gif in a ProgressTemplate. </p>
<p>Currently I have a ... | <p>You can do it in HTML outside of .Net. In your ASPX page you have code like:</p>
<pre>
<div id="loading"><br />
<!-- Animated GIF or other indication that stuff is happening --><br />
</div>
</pre>
<p>At the very bottom of your page, right before the you can have a code snippet that looks like ... | <p>If you really want fine grained control you can use a progressbar based AJAX pre-loader. You can configure it so as to complete every time the state has changed. i.e. from 0 to 4 (5 ready states) with each state progressing by 20%.. Creating one is extremely simple. Have a container <code>div</code> which holds anot... | 30,032 |
<p>I found this via google: <a href="http://www.mvps.org/access/api/api0008.htm" rel="nofollow noreferrer">http://www.mvps.org/access/api/api0008.htm</a></p>
<pre class="lang-vb prettyprint-override"><code>'******************** Code Start **************************
' This code was originally written by Dev Ashish.
' I... | <p>You could also use Environ$ but the method specified by the question is better. Users/Applications can change the environment variables.</p>
| <p>there are lots of way to get the current logged user name in WMI.
my way is to get it through the username from process of 'explorer.exe'
because when user login into window, the access of this file according to the current user.</p>
<p>WMI script would be look like this:</p>
<pre><code>Set objWMIService = GetObje... | 20,360 |
<p>I'm using the .NET CF 3.5. The type I want to create does not have a default constructor so I want to pass a string to an overloaded constructor. How do I do this?</p>
<p>Code:</p>
<pre><code>Assembly a = Assembly.LoadFrom("my.dll");
Type t = a.GetType("type info here");
// All ok so far, assembly loads and I can ... | <pre><code>MyObj o = null;
Assembly a = Assembly.LoadFrom("my.dll");
Type t = a.GetType("type info here");
ConstructorInfo ctor = t.GetConstructor(new Type[] { typeof(string) });
if(ctor != null)
o = ctor.Invoke(new object[] { s });
</code></pre>
| <p>See if this works for you (untested):</p>
<pre><code>Type t = a.GetType("type info here");
var ctors = t.GetConstructors();
string s = "Pass me to the ctor of t";
MyObj o = ctors[0].Invoke(new[] { s }) as MyObj;
</code></pre>
<p>If the type has more than one constructor then you may have to do some fancy footwork ... | 4,908 |
<p>I was wondering how to use <code>cin</code> so that if the user does not enter in any value and just pushes <code>ENTER</code> that <code>cin</code> will recognize this as valid input.</p>
| <p>You will probably want to try <code>std::getline</code>:</p>
<pre><code>#include <iostream>
#include <string>
std::string line;
std::getline( std::cin, line );
if( line.empty() ) ...
</code></pre>
| <p>Try unbuffering cin (it's buffered by default).</p>
| 18,170 |
<p>Anyone have a decent example, preferably practical/useful, they could post demonstrating the concept?</p>
| <blockquote>
<p>(Edit: a small <a href="http://web.archive.org/web/20041012103936/http%3A//www.bagley.org/~doug/ocaml/Notes/okoans.shtml" rel="nofollow noreferrer">Ocaml FP Koan</a> to start things off)</p>
<blockquote>
<p><strong>The Koan of Currying (A koan about food, that is not about food)</strong></p>
... | <p>I gave a good example of simulating currying in C# <a href="http://azurecoding.net/blogs/brownie/archive/2010/01/18/accounting-for-cost-of-sales-with-currying.aspx" rel="nofollow">on my blog</a>. The gist is that you can create a function that is closed over a parameter (in my example create a function for calculati... | 2,988 |
<p>I have run into a common, yet difficult problem. I do not use Photoshop for image manipulation. Since all my work is web-based, <a href="http://en.wikipedia.org/wiki/GIMP" rel="noreferrer">GIMP</a> does what I need in 99% of the situations. The <em>problem</em> is that I occasionally receive <a href="http://en.wikip... | <p>Assuming you have access to a Windows computer, freewares like IrfanView or XnView can open it and resave in whatever format you need too. XnView knows more formats, and has a NConvert command line version for this task, but IrfanView can do command line operations as well - I usually install both, preferring IrfanV... | <p>Gimp has a plugin called <a href="http://www.id-meneo.com/img/Ghostscript-install-trouble.html" rel="nofollow">Ghostscript</a>, which seems to work for me. </p>
<p>late answer to the question and probably not around when you posed the question, but there you go. I do not know how well it works as I just started u... | 27,528 |
<p>I have a text box in wxPython that takes the output of dictionary.items() and displays it to the user as items are added to the dictionary. However, the raw data is very ugly, looking like </p>
<pre><code>[(u'BC',45)
(u'CHM',25)
(u'CPM',30)]
</code></pre>
<p>I know dictionary.items() is a list of tuples, but I can... | <p>There is no built-in dictionary method that would return your desired result.</p>
<p>You can, however, achieve your goal by creating a helper function that will format the dictionary, e.g.:</p>
<pre><code>def getNiceDictRepr(aDict):
return '\n'.join('%s %s' % t for t in aDict.iteritems())
</code></pre>
<p>Thi... | <p>Maybe the <a href="http://www.python.org/doc/2.5.2/lib/module-pprint.html" rel="nofollow noreferrer">pretty print</a> module will help:</p>
<pre><code>>>> import pprint
>>> pprint.pformat({ "my key": "my value"})
"{'my key': 'my value'}"
>>>
</code></pre>
| 29,427 |
<p>What is the best way in <strong>Perl</strong> to copy files to a yet-to-be-created destination directory tree?</p>
<p>Something like</p>
<pre><code>copy("test.txt","tardir/dest1/dest2/text.txt");
</code></pre>
<p>won't work since the directory <em>tardir/dest1/dest2</em> does not yet exist. What is the best way t... | <pre><code>use File::Path;
use File::Copy;
my $path = "tardir/dest1/dest2/";
my $file = "test.txt";
if (! -d $path)
{
my $dirs = eval { mkpath($path) };
die "Failed to create $path: $@\n" unless $dirs;
}
copy($file,$path) or die "Failed to copy $file: $!\n";
</code></pre>
| <p>See the other answers for doing the copying, but for creating the directory <a href="http://search.cpan.org/dist/Path-Class/" rel="nofollow noreferrer">Path::Class</a> is very nice to use:</p>
<pre><code>use Path::Class;
my $destination_file = file('tardir/dest1/dest2/test.txt');
$destination_file->dir->mkp... | 28,390 |
<p>I've tried disabling cookies in Internet Explorer 7, I've changed the settings under Internet Options->Privacy and this did nothing, when I reloaded the page.</p>
<p>I read somewhere that you need to restart IE7, than physically delete the Internet cache and cookie files first, and finally reload your page to disab... | <p>IE's cookie settings control panel applies to the Internet Zone only.</p>
<p>To disable cookies in other zones, use the IE8 developer toolbar (hit F12) and choose "Disable Cookies" from the menu.</p>
| <p>Does what's explained over <a href="http://www.ardmorewhisky.com/terms/cookies.html" rel="nofollow noreferrer">here</a> and <a href="http://www.mvps.org/winhelp2002/cookies.htm" rel="nofollow noreferrer">here</a> help?</p>
| 40,628 |
<p>I'm looking for a fixed-point standard to use for financial data, do you know any that is worth trying? Do you have any experience on the performance of that hand-made fixed-point classes?</p>
| <p>Dr.Dobb's has an article about a possible implementation of fixed-point arithmetic type in C++. Check <a href="http://www.ddj.com/cpp/184401992" rel="noreferrer">this</a> out.</p>
| <p>ISO specified a decimal extension to C, TR 24732, and to C++, TR 24733. They are available for money on the <a href="http://www.iso.org/" rel="nofollow">ISO website</a>. It's not yet part of any published C++ Standard. GCC provides <a href="http://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html" rel="nofollow">built... | 17,610 |
<p>I have a datalist with a OnDeleteCommand="Delete_Command".</p>
<p>I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event.</p>
<p>If I use DataKeyField I'm limited to only one key.
Any workarounds for this?</p>
| <p>You can access all of the keys:</p>
<pre><code>gridView.DataKeys[rowNum][dataKeyName]
</code></pre>
<p>where rowNum is e.RowIndex from the gridView_RowDeleting event handler, and dataKeyName is the key you want to get:</p>
<pre><code><asp:GridView ID="gridView" runat="server" DataKeyNames="userid, id1, id2, id... | <p>Oh, sorry, I missed it.</p>
<p>AFAIK there is no such a possibility by default. Maybe you can create a composite key from your primary keys, like </p>
<blockquote>
<p>Key1UnderscoreKey2UnderscoreKey3</p>
</blockquote>
<p>and split it in the event handler. So this is a DIY multi-key handler for DataList :-)</p>
... | 3,987 |
<p>Can I run ASP.NET 2.0 and 3.5 code on the same website? ...or, do I need to separate them by applications, and/or servers?</p>
| <p>.NET 3.5 is 2.0 with a few extra libraries. So the answer is yes you can run them on the same web site. In fact you cannot even set a web application to run under 3.5. It just runs under 2.0. You can check the ASP.NET tab in the properties of an IIS site to see that there isn't even an option to run your application... | <p>You can run them both at the same time as long as .NET 3.5 is installed.</p>
| 16,383 |
<p>I'm a new Windows programmer and I'm not sure where I should store user configurable application settings. I understand the need to provide a user friendly means for the user to change application settings, like an Edit | Settings form or similar. But where should I store the values after the user hits the Apply b... | <p><strong>Pros of config file:</strong> </p>
<ol>
<li>Easy to do. Don't need to know any Windows API calls. You just need to know the file I/O interface of your programming language. </li>
<li>Portable. If you port your application to another OS, you don't need to change your settings format. </li>
<li>User-editab... | <p>There is one drawback to ini or config files and that is locating them if the user has the option to select where the program is installed.</p>
| 2,831 |
<p>I have a space delimited list of files names, where spaces in the file names are prefixed by '\'</p>
<p>e.g. "first\ file second\ file"</p>
<p>How can I get my regex to match each file name?</p>
| <pre><code>(\\ |[^ ])+
</code></pre>
<p>Everything except spaces, except when they're escaped. Should work, sorry for misunderstanding your question initially.</p>
| <p>I would do it like this:</p>
<pre><code>/[^ \\]*(?:\\ [^\\ ]*)*/
</code></pre>
<p>This is Friedl's "unrolled loop" idiom. There will probably be very few escaped spaces in the target string relative to the other characters, so you gobble up as many of the other characters as you can each time you get a chance. T... | 40,474 |
<p>I am creating a Visual Studio Setup project. I want to un-install another component from the system from the install of my component. The other component is installed from my own setup created using Visual Studio.</p>
<p>Currently when I am calling the un-install of the other component from the install action of th... | <p>If you don't need to actually run the uninstall of the other component, you could use a Custom Action to remove files/folders you intend to replace.</p>
<p>Using a Custom Action will force you to do all the clean up actions the Uninstaller would do for you.</p>
<p>Is it that you're replacing something or are you j... | <p>I think you can run <code>uninst.exe</code> of that program through the shell command while setup starts..... </p>
| 24,011 |
<p>How do I save each sheet in an Excel workbook to separate <code>CSV</code> files with a macro?</p>
<p>I have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate <code>CSV (comma separated file)</code>. Excel will not allow you to save all sheets to different <code>CSV... | <p>Here is one that will give you a visual file chooser to pick the folder you want to save the files to and also lets you choose the CSV delimiter (I use pipes '|' because my fields contain commas and I don't want to deal with quotes):</p>
<pre><code>' ---------------------- Directory Choosing Helper Functions ------... | <p>Please look into <a href="http://www.mrexcel.com/forum/excel-questions/265154-saving-multiple-sheets-separate-csv-files-visual-basic-applications.html" rel="nofollow">Von Pookie's answer</a>, all credits to him/her. </p>
<pre><code> Sub asdf()
Dim ws As Worksheet, newWb As Workbook
Application.ScreenUpdating = Fal... | 8,351 |
<p>I am using JQuery to post with AJAX to another ASP page. Do I need this ASP page to return a full html page. Or can I just have it send back a value ( I just need a status ) . Here is my function.</p>
<pre><code> $.ajax({
url: "X.asp",
cache: false,
type: "POST",
data: queryString,
... | <p>If it's just a simple value you need, I'd simple use Json (JQuery has a dedicated method for that : <a href="http://docs.jquery.com/Ajax/jQuery.getJSON" rel="nofollow noreferrer">$.getJSON()</a>).</p>
<p>So no, you don't need your ASP page to return a full html page, just the value in simple JSON notation.</p>
| <p>Using AJAX, you can return anything, even binary data. Although it was designed for XML, you can use it for anything you can transfer across a web server. However, HTTP Requests are expensive, so don't abuse them too much!</p>
| 32,457 |
<p>I have a web application, written in ColdFusion, which periodically starts using 100% of the server's CPU and crashes the ColdFusion service.</p>
<p>Since I have been unable to reproduce the problem myself, I'd like to find a utility which will notify me by email when the CPU usage begins to climb, so I can hop on ... | <p>I had a similar problem a few weeks ago and was directed to a program called AlwaysUp.</p>
<p><a href="http://www.coretechnologies.com/products/AlwaysUp/" rel="nofollow noreferrer">http://www.coretechnologies.com/products/AlwaysUp/</a></p>
<p>Monitors any process by any combination of:</p>
<ul>
<li>Memory useage<... | <p>Another alternative is available to you if you are running Coldfusion 8 - the performance monitor. You can set up alerts to send you an email, call another CFC etc. for different criteria.</p>
<p>I use the server monitor a lot - it's a great tool even though I haven't used the alerts myself too much they are probab... | 35,814 |
<p>So regular expressions seem to match on the longest possible match. For instance:</p>
<pre><code>public static void main(String[] args) {
String s = "ClarkRalphKentGuyGreenGardnerClarkSupermanKent";
Pattern p = Pattern.compile("Clark.*Kent", Pattern.CASE_INSENSITIVE);
Matcher myMatcher = p.matcher(s);
... | <p>greedy vs reluctant is your friend here.</p>
<p>try: <code>Clark.+?Kent</code></p>
| <p>Use the relunctant <code>?</code> suffix: <code>Clark.*?Kent</code>
The quantifiers <code>?</code>, <code>*</code>, <code>+</code> can be followed by <code>?</code> to indicate that they should stop as soon as possible.</p>
<p>see <a href="http://perldoc.perl.org/perlre.html" rel="nofollow noreferrer"><a href="http... | 46,151 |
<p>I have a problem only in Google Chrome (Firefox, IE, Netscape, Safari and Opera are Okay) where a padding property which should be applied to text in a cell, is being applied to all empty cells aswell. It's easy to solve by adding more specific styles to my affected perimeter cells and using different styles, but th... | <p>The bad news: there are GUI tools to help with this, but its a skilled and wide ranging job. So they don't cover everything, its likely you will need to use command line stuff/sql statements etc to help. I've only really used the command line tools. I'll give a bit of an overview of things I know/have used:</p>
<p>... | <p>I found <a href="http://webyog.com/en/" rel="nofollow noreferrer">MONyog</a> to be a BIG help when I had a suffering mysql server.</p>
<p>It's a webbased system that analyses your system 24/7 and gives you decent suggestions for better values of system variables, cache sizes, etc...</p>
<p>It also has a built in my... | 47,274 |
<p>I want to create a hidden field and create a link in one helper and then output both to my erb.</p>
<pre><code><%= my_cool_helper "something", form %>
</code></pre>
<p>Should out put the results of</p>
<pre><code>link_to "something", a_path
form.hidden_field "something".tableize, :value => "something"
</... | <p>There are several ways to do this.</p>
<p>Remember that the existing rails helpers like <code>link_to</code>, etc, just output strings. You can concatenate the strings together and return that (which is what I do most of the time, if things are simple).</p>
<p>EG:</p>
<pre><code>link_to( "something", something_pa... | <p>This worked for me.</p>
<pre><code>def format_paragraphs(text)
text.split(/\r?\n/).sum do |paragraph|
tag.p(paragraph)
end
end
</code></pre>
| 13,735 |
<p>I have stumbled into several methods of looping in JavaScript, what I like the most is:</p>
<pre><code>for(var i = 0; i < a.length; i++){
var element = a[i];
}
</code></pre>
<p>But as tested here (<a href="http://www.robertnyman.com/2008/04/11/javascript-loop-performance/" rel="noreferrer">http://www.robert... | <p>I've started using iterators where relevant. Performance is reasonable, however more importantly it allows you to encapsulate the looping logic:</p>
<pre><code>function createIterator(x) {
var i = 0;
return function(){
return x[i++];
};
}
</code></pre>
<p>Then to use:</p>
<pre><code>var iter... | <p>So, first you identify the perfect javascript loop, I believe it should look like this:</p>
<p>ary.each(function() {$arguments[0]).remove();})</p>
<p>This may require the prototype.js library.</p>
<p>Next, you get disgustet with the arguments[0] part and have the code be produced automatically from your server fr... | 23,523 |
<p>I could use some help trying to track down an intermittent error that I've been having with our ASP.Net project for quite some time.</p>
<p>Intermittently when building the solution, the build will fail with the error "/: Build (web): Object reference not set to an instance of an object." The error has no associate... | <p>I've seen this when you have a web control in a page where there is invalid HTML. If your codebehind is trying to do something with the control, it won't be able to find it and will give you Object Reference... error at compile time. In my experience, it doesn't create a runtime error, and the project will build i... | <p>An "Object reference not set to an instance of an object" is clearly a run-time error, not a compile-time error. So what that says to me is that Visual Studio is choking on something, which may not necessarily be in your code, or which something in your code is only indirectly causing.</p>
<p>Next question I'd ask:... | 25,706 |
<p>I'd like to be able to click on a file to revert it, or check in a directory, etc. It would be much more convenient to have these available from the right click menu.</p>
| <p>Have you seen this?</p>
<p><strong>ProjectPlus</strong></p>
<p>ProjectPlus is a plug-in for TextMate which extends the functionality of project-related features.</p>
<p>Feature list:
* SCM status badges:
* Support for SVN, Git, Mercurial, Bazaar and Svk
* Displayed in the project file list and the window proxy ic... | <p>I don't think so. I'd recommend the <a href="http://ciaranwal.sh/2008/07/30/svnmate-update-for-subversion-15" rel="nofollow noreferrer">SVNMate bundle</a> though.</p>
| 16,590 |
<p>Where can I find a free, very quick, and reliable implementation of FFT in C#?</p>
<p>That can be used in a product? Or are there any restrictions?</p>
| <p><a href="http://code.google.com/p/aforge/" rel="noreferrer">AForge.net</a> is a free (open-source) library with Fast Fourier Transform support. (See Sources/Imaging/<a href="https://github.com/andrewkirillov/AForge.NET/blob/master/Sources/Imaging/ComplexImage.cs" rel="noreferrer">ComplexImage.cs</a> for usage, Sourc... | <p>For a multi-threaded implementation tuned for Intel processors I'd check out Intel's MKL library. It's not free, but it's afforable (less than $100) and blazing fast - but you'd need to call it's C dll's via P/Invokes. The Exocortex project stopped development 6 years ago, so I'd be careful using it if this is an ... | 20,558 |
<p>So, I'm setting a cookie that should expire. However, I want this to work around the world. So I need to adjust my expiry date for the user's timezone.</p>
<p>So, I need to find out the user's timezone, server-side. </p>
<p>Is there a way to do this in the BCL? As in, something like relying on the CultureInfo.... | <p>It's very simple. On the server, put a asp:hidden field and fill it with the current server's date/time. On the client, subtract the date/time in the hidden field from the current date on the client (new Date()) and you have your offset from GMT. Reverse for doing it on the server (e.g. new Date() in hidden field, s... | <p>There's no really good way to determine a clients time-zone. You could track their IP address, and then tried to attach a location to it, but that tricky and error-prone (Some locators put all AOL uses in Virginia)</p>
<p>I'd say that it would be best to do it on the client side.</p>
| 46,378 |
<p>I want to do exactly the same as in <a href="https://stackoverflow.com/questions/74451/getting-actual-file-name-with-proper-casing-on-windows">this question</a>:</p>
<blockquote>
<p>Windows file system is case insensitive. How, given a file/folder name (e.g. "somefile"), I get the actual name of that file/folder ... | <p>I seems that since NTFS is case insensitive it will always accept your input correctly regardless if the name is cased right.</p>
<p>The only way to get the correct path name seems to find the file like John Sibly suggested.</p>
<p>I created a method that will take a path (folder or file) and return the correctly ... | <p>It looks like the best way is to iterate through all folders in the path and get their proper caps:</p>
<pre><code> Public Function gfnProperPath(ByVal sPath As String) As String
If Not IO.File.Exists(sPath) AndAlso Not IO.Directory.Exists(sPath) Then Return sPath
Dim sarSplitPath() As String = sPath.Split(... | 42,224 |
<p>I'm working on an useragent that logs into teamcity and I'm trying to move the password encryption from js to c#.</p>
<p><a href="http://teamcity.jetbrains.com/res/-4045289697674020822.js" rel="nofollow noreferrer">this is the javascript</a> </p>
<p>the section called rsa.js and encrypt.js are important. They make... | <p>What you are wanting to create is not an XML declaration, but a "processing instruction". You should use the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlprocessinginstruction.aspx" rel="noreferrer">XmlProcessingInstruction</a> class, not the <a href="http://msdn.microsoft.com/en-us/library/system.... | <p>You would want to append a <strong>XmlProcessingInstruction</strong> created using the <strong>CreateProcessingInstruction</strong> method of the <em>XmlDocument</em>.</p>
<p>Example:</p>
<pre><code>XmlDocument document = new XmlDocument();
XmlDeclaration declaration = document.CreateXmlDeclaration("1.0", ... | 43,334 |
<p>Are there any good configuration file reading libraries for C\C++ that can be used for applications written on the linux platform. I would like to have a simple configuration file for my application. At best i would like to steer clear of XML files that might potentially confuse users.</p>
| <p>You could try <a href="http://library.gnome.org/devel/glib/unstable/glib-Key-value-file-parser.html" rel="noreferrer">glib's key-value-file-parser</a></p>
| <p>The question is what file format did you have in mind? The attribute "simple" is a bit of an underspecification.
If you are looking for a library that can use "windows .ini formated" config files you may want to check out ACE <a href="http://www.cs.wustl.edu/~schmidt/ACE/" rel="nofollow noreferrer">http://www.cs.wus... | 17,809 |
<p>The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell?</p>
| <p>Have you tried the <a href="http://www.mysql.com/products/tools/query-browser/" rel="nofollow noreferrer">MySQL Query Browser</a>? Works cross platform and is much nicer than the plain shell.</p>
| <p>It sounds like a GUI is not really what you were after, but maybe <a href="http://en.wikipedia.org/wiki/HeidiSQL" rel="nofollow noreferrer">HeidiSQL</a> would be worth a look. It's a GUI frontend for MySQL which I wouldn't say I quite <em>enjoyed</em> using, but I've certainly come across worse ways to talk with a d... | 5,715 |
<p>Given the string "ThisStringHasNoSpacesButItDoesHaveCapitals" what is the best way to add spaces before the capital letters. So the end string would be "This String Has No Spaces But It Does Have Capitals"</p>
<p>Here is my attempt with a RegEx</p>
<pre><code>System.Text.RegularExpressions.Regex.Replace(value, "[A... | <p>The regexes will work fine (I even voted up Martin Browns answer), but they are expensive (and personally I find any pattern longer than a couple of characters prohibitively obtuse)</p>
<p>This function </p>
<pre><code>string AddSpacesToSentence(string text, bool preserveAcronyms)
{
if (string.IsNullOrWhit... | <p>In addition to Martin Brown's Answer, I had an issue with numbers as well. For Example: "Location2", or "Jan22" should be "Location 2", and "Jan 22" respectively.</p>
<p>Here is my Regular Expression for doing that, using Martin Brown's answer:</p>
<pre><code>"((?<=\p{Ll})\p{Lu})|((?!\A)\p{Lu}(?>\p{Ll}))|((... | 34,321 |
<p>I have a DataTable that has a boolean column called [Invalid]. I need to divide this data up by this Invalid column - valid rows can be edited, invalid rows cannot. My original plan was to use two BindingSources and set the Filter property ([Invalid] = 'false', for instance), which plays right into my hands because ... | <p>I think you need to do another join to get ab's max val for each a.id first.</p>
<p>Something like this:</p>
<pre><code>select a.*
from a
left join (
select aid, max(val) as val
from ab
group by aid
) abmax on abmax.aid=a.id
inner join ab on ab.aid=abmax.aid and ab.val=abmax.val
inner join b on b.id=... | <p>I am not sure which sql you are using but in MS SQL I create a table-valued database function to return the max values from table A then join this to table B. I find this much easier to understand than complex joins when I look back on my queries at a later stage. </p>
| 27,182 |
<p>I have an <em>index.php</em> file which has to process many different file types. How do I guess the filetype based on the <code>REQUEST_URI</code>?</p>
<p>If I request <code>http://site/image.jpg</code>, and all requests redirect through <em>index.php</em>, which looks like this</p>
<pre><code><?php
include('... | <p>If you are sure you're only ever working with images, you can check out the <a href="http://us3.php.net/manual/en/function.exif-imagetype.php" rel="nofollow noreferrer">exif_imagetype()</a> PHP function, which attempts to return the image MIME type.</p>
<p>If you don't mind external dependencies, you can also check ... | <p>I got very good results using a user function from
<a href="http://php.net/manual/de/function.mime-content-type.php" rel="nofollow noreferrer">http://php.net/manual/de/function.mime-content-type.php</a>
@''john dot howard at prismmg dot com 26-Oct-2009 03:43''</p>
<pre><code>function get_mime_type($filename, $mimePa... | 16,327 |
<p>I can run the server on my local machine and connect to it on the same machine, but when I try to connect to it from a different computer over the internet, there is not sign of activity on my server, nor a response from the server on the computer I'm testing it on. I've tried both XP and Vista, turn off firewalls, ... | <p>I think that the problem is in your router, not your computer. When packets come from the Internet, it should be routed to an specific server. You have to configure your router to redirect the traffic on port <code>3326</code> to your server.</p>
| <p>If you are trying to host at home, your ISP may be restricting you.</p>
| 23,787 |
<p>Why does the order in which libraries are linked sometimes cause errors in GCC?</p>
| <p><sub>(See the history on this answer to get the more elaborate text, but I now think it's easier for the reader to see real command lines).</sub></p>
<hr />
<p>Common files shared by all below commands</p>
<pre><code>// a depends on b, b depends on d
$ cat a.cpp
extern int a;
int main() {
return a;
}
$ cat b.cpp
... | <p>I have seen this a lot, some of our modules link in excess of a 100 libraries of our code plus system & 3rd party libs. </p>
<p>Depending on different linkers HP/Intel/GCC/SUN/SGI/IBM/etc you can get unresolved functions/variables etc, on some platforms you have to list libraries twice. </p>
<p>For the most pa... | 6,694 |
<p>I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a <code>URLLoader</code> to load a XML file, and upon <code>Event.COMPLETE</code> creating a new XML object. 75% of the time this work fine, and every now and again I ... | <p>Have you tried checking that the bytes loaded are the same as the total bytes?</p>
<pre><code>URLLoader.bytesLoaded == URLLoader.bytesTotal
</code></pre>
<p>That should tell you if the file has finished loading, it wont help with the compleate event firing to early, but it should tell you if its a problem with the... | <p>As you mentioned in your question, the problem is very likely that your program is looking at the XML before it has actually been completely downloaded, I don't know that there's a surefire way to "parse" the XML because the parsing portion of your code is more than likely fine, it's simply a matter of whether or no... | 3,850 |
<p>I have several old 3.5in floppy disks that I would like to backup. My attempts to create an image of the disks have failed. I tried using the UNIX utility dd_rescue, but when the kernel tries to open (<code>/dev/fd0</code>) I get a kernel error,</p>
<pre><code>floppy0: probe failed...
</code></pre>
<p>I would li... | <p>I think you'll find the best resource <a href="http://www.hpcc.org/datafile/hpil/lif_utils.html" rel="nofollow noreferrer">here</a>.</p>
<p>Also, if you're going to use raw dd, LIF format has 77 cylinders vs 80 for a normal floppy.</p>
| <pre><code>dd if=/dev/floppy0 of=animage.bin conv=noerror
</code></pre>
| 11,333 |
<p>Are there some help resources, or can anyone give me a brief Idea how I would configure the .net 2 runtime security policies for the following scenario:</p>
<p>I have a windows forms control hosted in IE. The control tries to read from a serial port and write to the event log. Both of these operations fail due to... | <p>Try the following:</p>
<p>Control Panel -> Administrative Tools -> Microsoft .NET Framework 2.0 Configuration</p>
<p>Expand out and select:</p>
<p>.Net Framework 2.0 Configuration -> MyComputer -> Runtime Security Policy -> Machine -> Code Groups -> All_Code</p>
<p>Under that there are the different zones. I'm n... | <p>Since (I assume) you're running under IIS, you need to make sure that your I_USRmachinename account is in a security group that has the permissions you need, or that it is not in a group like "Guests," which would have restricted access to things like the system Event Log. Look at the permissions/groups for your I_... | 38,484 |
<p>Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this error. </p>
<p>I don't actually need Global because I am not adding anything to it, but after I remove it I get more errors.</p>
| <p>There are a few things you can try with this, seems to happen alot and the solution varies for everyone it seems.</p>
<ul>
<li><p>If you are still using the IIS virtual directory make sure its pointed to the correct directory and also check the ASP.NET version it is set to, make sure it is set to ASP.NET 2.0.</p></... | <p>Ensure compiled dll of your project placed in proper bin folder.</p>
<p>In my case, when i have changed the compiled directory of our subproject to bin folder of our main project, it worked.</p>
| 7,758 |
<p>I want to expose the functionality of an SAP program (transaction) as a BAPI.
I need to call a report and supply range filters such that the GUI is bypassed.</p>
<p>Does anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish what I need to do?</p>
| <p>Here is a working example:</p>
<pre><code>SUBMIT SAPF140
TO SAP-SPOOL "optional"
SPOOL PARAMETERS print_parameters "optional"
WITHOUT SPOOL DYNPRO "optional (hides the spool pop-up)"
VIA JOB jobname NUMBER l_number "optional"
AND RETURN ... | <p>You can wrap your report in an <a href="http://help.sap.com/saphelp_nwes72/helpdata/en/69/c250274ba111d189750000e8322d00/frameset.htm" rel="nofollow">BATCH INPUT session</a> and execute it inside a function. The only drawback is that you need to rewrite the BATCH INPUT every time you change the report.</p>
| 28,131 |
<p>Could anyone please help me with this. On the production site app_offline.htm works only till you start uploading dlls. As soon as you start uploading dlls it throws following error"Could not load file or assembly 'SubSonic' or one of its dependencies.
<strong>The process cannot access the file because it is being ... | <p>I have heard of people having problems with app_offline.htm if it did not have enough content in the file.</p>
<p>Fill it with a couple hundred kb's of Lorem Ipsum text and see if that helps.</p>
| <p>Ok this might not be your problem, but if it's the first time it happened you might want to restart your machine. Sometimes a process dies with a lock on a .dll, thus you can no longer use it until unlocked (thus need a restart of the OS).</p>
<p>The other possible problem is that the .dll, or its dependent .dll's,... | 48,852 |
<p>I'm trying to make a pull down menu post a form when the user selects (releases the mouse) on one of the options from the menu. This code works fine in FF but Safari, for some reason, doesn't submit the form. I re-wrote the code using jquery to see if jquery's .submit() implementation handled the browser quirks be... | <p>You should probably use the <code>onchange</code> event of the <code><select></code> instead (or as well).</p>
| <p>xxx.submit() has never seemed to work for me either. Simple, but ugly fix is to have the function which does the submit in the HEAD tag of the page as opposed to an external JS file, and, use document.getElementById('whatever_the_id_of_the_form_is).submit as opposed to defining a var then doing var.submit()</p>
<p>... | 43,205 |
<p>So I have written a Quaternion based 3D Camera oriented toward new programmers so it is ultra easy for them to integrate and begin using.</p>
<p>While I was developing it, at first I would take user input as Euler angles, then generate a Quaternion based off of the input for that frame. I would then take the Camera... | <p>Multiplying quaternions is going to suffer from accumulation of floating-point roundoff issues (even simple angles like 45 degrees won't be exact). It's a great way to composite rotations, but the precision of each of your quaternion components is going to drop-off over time. The bleed-through is one side-effect, a ... | <p>I've seen both argued for. I think the real question you'll have to deal with is flexibility in your camera system down the line; IMO yaw is generally more interesting in a third-person view (because you're going to rotate about the character's vertical axis). While you can arguably "yaw" around the vertical in fi... | 41,265 |
<p>Just wondering if there are any good server-side libraries for AJAX (prefer JSON rather then XML but anything is good) for classic ASP (VBScript)...</p>
<p>Rather not reinvent the wheel if it's already working and debugged.</p>
<p>Cheers,
Gaspard</p>
<p>EDIT: Server-side ASP VBScript... I have already seen many j... | <p>Try <a href="http://jquery.com/" rel="nofollow noreferrer">jQuery</a>. It's amazing!</p>
| <p>Try <a href="http://jquery.com/" rel="nofollow noreferrer">jQuery</a>. It's amazing!</p>
| 30,906 |
<p>I'm aware of the Substance look and feels and that they have a Office 2007 look-a-like look and feel. But this look and feel doesn't look like the Office 2007 design at all, the colors are a lot different for example.</p>
<p>Are there other look and feels which mimic the Office 2007 more accurately?</p>
| <p>Look!</p>
<p><a href="http://www.pushing-pixels.org/?p=1010" rel="noreferrer">http://www.pushing-pixels.org/?p=1010</a></p>
| <p>With the Windows 7/VS2010/.NET4 wave, the ribbon will become a standard component in Win32 and also the .NET framework I think.</p>
| 42,226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.