input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
SAP .NET Connector: System exception thrown while marshaling .NET type <p>My app sends lots and lots of data to SAP. To di this, it builds up an SAP table object and sends it over. I get this error somewhat regularly, but not reliably:</p>
<pre><code>System exception thrown while marshaling .NET type 20081219 to RFCTY... | <p><strong>Update 4:</strong> In second thought, I don't think that the librfc version is important. The exception seems to come from the managed code. The options that I can think of are:</p>
<ul>
<li>Try to use debugger on the single threaded version.</li>
<li>The magical way. Even without finding the bug ( That is ... |
Securly download file inside browser with correct filename <p>I am doing some work on a web site that has a secure area which is available to users only after they have logged in. In this area there is a page with links to pdf documents which can be downloaded. The physical documents are outside of the web site's root ... | <p>I've finally come up with a work around for this problem.</p>
<p>Although the RFC 2183 shows that a filename parameter can be used for both attachment and inline for the Content-Disposition header field, it seems that browsers ignore the filename parameter when inline is used but rather try to work out what the fil... |
How do I redirect output to stderr in groovy? <p>I'm looking for a way to redirect output in a groovy script to stderr:</p>
<pre><code>catch(Exception e) {
println "Want this to go to stderr"
}
</code></pre>
| <p>Just off the top of my head couldn't you do a bit of self-wiring:</p>
<pre><code>def printErr = System.err.&println
printErr("AHHH")
</code></pre>
<p>but that is a bit manual</p>
|
Help with ActiveRecord exception "Failed to lazily initialize a collection - no session" <p>I am writing a web app using Castle ActiveRecord, and I keep getting this exception whenever I try to access a lazy loaded list of related objects. Here is my code:</p>
<pre><code> using(new SessionScope())
{
... | <p>I think you're getting confused about sessions. <code>RegistrationFields</code> is a lazy property of <code>eventObj</code>. It is the session that loaded <code>eventObj</code> that would be responsible for loading <code>RegistrationFields</code>. You're explicitly opening a new session by using <code>new SessionSco... |
Should we always favor polymorphism over enums? <p>After watching: <a href="http://www.youtube.com/watch?v=4F72VULWFvc">The Clean Code Talks -- Inheritance, Polymorphism, & Testing</a></p>
<p>I checked my code and noticed a few switch statements can be refactored into polymorphism, but I also noticed I only used s... | <p>First of all, Java actually has great enums that can be used polymorphically. I'm no Java programmer so someone else can certainly give a good example (I can't). Also, consider that polymorphism is often just overkill. I've also just seen the talk, and it's great, but it only provides guidelines, no silver bullet.</... |
What is a good design pattern to implement a dynamic data importer tool? <p>We are planning to build a dynamic data import tool. Basically taking information on one end in a specified format (access, excel, csv) and upload it into an web service. </p>
<p><strong>The situation is that we do not know the export field n... | <p>I am not sure where the complexity is in your application, so I will just give an example of how I have used patterns for importing data of different formats. I created a factory which takes file format as argument and returns a parser for particular file format. Then I use the builder pattern. The parser is provide... |
Browser Add-On/Extension and Browser Form data <p>Can someone point me to an article (or discuss here) that explains how an add-on/extension can read what a user has completed in a form in a browser so you can present data to them based on the search parameters?</p>
<p>An example would be the Sidestep extension that o... | <p>extension to what? your body?:)</p>
<p>If you're talking about a browser extension, then i'm pretty sure you are on the wrong way.
You could just search for forms in the current page, and based on the field names try to figure out what did the user searched for...
A js file, and an AJAX-call is all you need, and yo... |
How Pass some parameter to MVC User Control that is not in ViewData <p>I want to pass some parameters to my MVC UserControl like ShowTitle(bool) and the ViewData.Model.Row . How I define my usercontrol and pass them to it?
Tanx</p>
| <p>You can use the RenderAction HtmlHelper, found in the MVC futures dll available at <a href="http://www.codeplex.com/aspnet">codeplex</a>. In your main page
...
<% Html.RenderAction("actionName", "controllerName", new {showTitle=true, row=ViewData.Model.Row}); %></p>
<p>You need an action method on the controll... |
Getting back on track after disruptions <p>Over the past few weeks it seems like I've been interrupted by maintenance tasks from old projects quite a bit in addition to a taking a training class. I feel like I've lost all forward momentum on my current project. It's difficult to even start coding because I'm not sure... | <ul>
<li><p>Take a minute to write notes to yourself (on paper right in front of you) about the project you're putting down before you go and pick another up</p></li>
<li><p>Still messed up? Headphones on, music on, loud enough to drown out your surroundings and no lyrics</p></li>
<li><p>Really messed up? Go for lunch,... |
C++ experts: is the offset of a member variable to its class constant under these conditions? <p>Given a variable <code>foo</code> of type <code>FooClass*</code> and a member variable in that class named <code>bar</code>, is the distance between <code>foo</code> and <code>&(foo->bar)</code> the same in any situa... | <p>After you have compiled your program, <strong>Yes*</strong>.</p>
<p>The offset will remain constant.</p>
<p>There is one very important restriction, however: <strong>foo must be pointing specifically to a FooClass object</strong>. Not a class derived from FooClass, or anything else for that matter.</p>
<p>The r... |
Latex using eps images builds slowly <p>Working with a latex document with eps images as in the example below...</p>
<pre><code>\documentclass[11pt]{paper}
\usepackage[dvips]{graphicx}
\usepackage{fullpage}
\usepackage{hyperref}
\usepackage{amsmath}
\DeclareMathSizes{8}{8}{8}{8}
\author{Matt Miller}
\title{my paper... | <p>Some additional ideas:</p>
<ul>
<li>try making a simpler figure (e.g. if it's a bitmapped figure, make a lower-resolution one or one with a low-resolution preview)</li>
<li>use pdflatex and have the figure be a .jpg, .png, or .pdf source. </li>
</ul>
<p>I generally take the latter approach (pdflatex).</p>
|
How does the syndication part of RSS work? <p>I understand how to make an RSS file. The XML for it is simple enough. But do I have to anything special for updates to get distributed or do I just need to update the file periodically and the rest will take care of itself? All of the stuff I've found on rss talk about wha... | <p>Clients periodically or occasionally re-download your RSS resource, based in part on the update schedule you can suggest in the RSS data itself. If the clients retained what they downloaded before, then they can notice what's new from last time.</p>
|
How to import word documents into wiki? <p>Anyone knows? Because i think one of the stumbling blocks for people to embrace wiki is of the fact that they need to separately upload the images to the wiki instead of just doing simple copy/paste to the word document</p>
| <p><a href="http://www.openoffice.org">OpenOffice</a> can save as a Mediawiki text file, ready to be pasted into the edit box online.</p>
|
What is the easiest approach to synchronize and duplicate oracle db schema? <p>I find it hard to generate the dbscripts from TOAD. I get errors when executing the scripts things like looping chain of synonyms or certain statement not abel to exceute etc.</p>
<p>Is there any seamless way in said like connecting a remot... | <p>Syncing an entire schema, data and all, is fairly easily done with exp and imp:</p>
<pre><code>$ exp username/password@source-sid CONSISTENT=Y DIRECT=Y OWNER=schema FILE=schema.exp
$ â® # some command(s) to nuke objects, see below
$ imp username/password@dest-sid FROMUSER=schema FILE=schema.exp
</code></pre>
<p>Y... |
ADO.NET Entity : limiting data selection based on View <p>Consider following example:</p>
<p>SQL Table Customer:</p>
<pre><code>ID: Primary Key
Name: Name
</code></pre>
<p>SQL View ViewCustomerSelection:</p>
<pre><code>ID: Link to Customer ID
SomeOption: Not important
</code></pre>
<p>I'd like to create ADO.NET an... | <p>With my understandings you need create new entities inherited from ViewCustomerSelection. </p>
<p>I hope this <a href="http://mosesofegypt.net/post/Inheritance-and-Associations-with-Entity-Framework-Part-1.aspx" rel="nofollow">article</a> might help.</p>
|
How can I convince skeptical colleagues about proper namespaces in .Net? <p>My team is working on a conversion project to convert one product (but with many facets) from VB6 to .Net (we have over ~300k LOC). Before I got on board, the decision was made that regardless of the location of the assembly, or folder structur... | <h1>Good answers, already</h1>
<p>I read a lot of good answers (the drive folder's image is a good one, for example, as is the object/concept separation/organization).</p>
<p>Still, some other, less "technical" arguments could help, not to explain why namespaces are better than the alternative, but to unearth the bad... |
Keyup Event After a Time Interval <p>I have this jQuery code that queries an API on a keyup event (via keyterms.php). It works as it is, but I'm trying to figure out how to implement a "pause" so to speak such that it will only do a query after a certain amount of time (say 2sec.) after the last keyup. Any help will ... | <p>You can use the jQuery plugin that StackOverflow uses for its <a href="http://stackoverflow.com/users">Users Page</a>; it's called <a href="https://github.com/medihack/typewatch" rel="nofollow">TypeWatch</a></p>
<p>It can be applied like such:</p>
<pre><code><input type="text" id="tb" />
<script>
$("... |
In Mac OS X, is there a programmatic way to get the machine to go to sleep/hibernate? <p>Is there some command line or AppleScript that I can write/run to make the machine go to sleep automatically or even better, into hibernate mode? </p>
<p>I can run the program as root.</p>
| <pre><code>osascript -e 'tell application "Finder" to sleep'
</code></pre>
|
Using Python's ctypes to pass/read a parameter declared as "struct_name *** param_name"? <p>I am trying to use Python's ctypes library to access some methods in the scanning library <a href="http://www.sane-project.org/" rel="nofollow">SANE</a>. This is my first experience with ctypes and the first time I have had to ... | <p>A <code>const SANE_Device ***</code> is a three-level pointer: it's a pointer to a pointer to a pointer to a constant SANE_Device. You can use the program <a href="http://gd.tuwien.ac.at/linuxcommand.org/man_pages/cdecl1.html">cdecl</a> to decipher complicated C/C++ type definitions.</p>
<p>According to the <a hre... |
Processing CSV files from the Web using embedded Java database <p>Short version: assuming I don't want to keep the data for long, how do I create a database programmaticly in HSQLDB and load some CSV data into it to? My schema will match the files exactly and the files do have adequate column names.</p>
<p>This is an ... | <p>Check <a href="http://opencsv.sourceforge.net/" rel="nofollow">opencvs</a>. It helps you to parse CSV files.</p>
|
ActionLinks doesn't always work in FireFox and Safari <p>I've been learning the new ASP.NET MVC framwork lately and I've developed a test site for a friend who runs a "light café" in Sweden. The plan is to release it within a week or so after performing some final adjustments and fixing some security issues. </p>
<p>... | <p>Your "main" div is being placed on top of the "links" div so they can't be clicked.</p>
<p>Adding a:</p>
<p>float: right;</p>
<p>To the CSS for #main allows the links to be clicked.</p>
|
Create local user with PowerShell (Windows Vista) <p>I've installed PowerShell recently and one of the first things I started looking for was how to create a new user. After looking for some time I still haven't found this.
I have a little experience in bash on linux and find it very effective. Creating users there is ... | <p>You can use the localhost's <a href="http://msdn.microsoft.com/en-us/library/aa772170.aspx">ADSI</a>:</p>
<pre><code>function create-account ([string]$accountName = "testuser") {
$hostname = hostname
$comp = [adsi] "WinNT://$hostname"
$user = $comp.Create("User", $accountName)
$user.SetPasswo... |
using (Fluent) NHibernate with StructureMap (or any IoCC) <p>On my quest to learn NHibernate I have reached the next hurdle; how should I go about integrating it with StructureMap?</p>
<p>Although code examples are very welcome, I'm more interested in the general procedure.</p>
<p>What I was planning on doing was...<... | <p>I use StructureMap with fluent-nhibernate (and NH Validator) in 3 of my current projects. 2 of those are ASP MVC apps and the third is a WCF web service.</p>
<p>Your general strategy sounds about right (except you won't be making your own Session or SessionFactory, as was already pointed out in comments). For detai... |
Intersection of two lines defined in (rho/theta ) parameterization <p>Have created a c++ implementation of the Hough transform for detecting lines in images. Found lines are represented using rho, theta, as described on wikipedia:</p>
<blockquote>
<p>"The parameter r represents the distance between the line and the ... | <p>Looking at the <a href="http://en.wikipedia.org/wiki/Hough_transform">Wikipedia page</a>, I see that the equation of a straight line corresponding to a given given r, θ pair is</p>
<pre>r = x cosθ + y sinθ </pre>
Thus, if I understand, given two pairs r1, θ1 and r2, θ2, to find the intersection you must solve... |
Is there any plugin framework for Java Applets? <p>We have a large Java application that run as applet or Java Web Start. And it grow more and more. Typical a user need only a small part of the classes. Because Java does not know which class can it found in which jar file that it load all jar files until it find the cl... | <p>I've heard that you can implement custom class loaders and I've seen tutorials on this subject. With this you should be able to control what gets downloaded more precisely. Sorry, I haven't tried this myself.</p>
|
flex 3 and acessing remote java objects <p>im just starting to learn flex and im trying to understand how Flex does remoting? From what i have read it looks like Flex provides a LifeCycle data services war which sits on your server and intercepts your remote calls , is this close?</p>
<p>Im concerned that if i use thi... | <p>Blaze DS is based off the same APIs / code base as LiveCycle Data Services and is completely free and open source:</p>
<p><a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/" rel="nofollow">http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/</a></p>
<p>There are a number of other options avail... |
Silverlight button style how to prevent the focused state when the button is pressed? <p>In my custom button I need to show that it had focus(provides some tactile feel to tabbing to the button) and show that its pressed but what I have found is my focused state is displaying rather then my pressed state. How can I ... | <p>When you press it is becomes focused, can't do anything about that...you can clear the Visual State Manager's Focus content and then it won't <em>look</em> focused, but it get focus from the mouse interaction no matter what you do.</p>
|
Mapping of strings to integers <p>What is the easiest way in Java to map strings (Java <code>String</code>) to (positive) integers (Java <code>int</code>), so that</p>
<ul>
<li>equal strings map to equal integers, and</li>
<li>different strings map to different integers?</li>
</ul>
<p>So, similar to <code>hashCode()<... | <p>Have a look at <a href="http://en.wikipedia.org/wiki/Perfect_hash_function">perfect hashing</a>.</p>
|
Converting MySql DateTime type into something more friendly <p>I have a Java web app that reads a MySql db and returns DateTime fields. What is the best way to convert the DateTime fields returned in the resultset into something more readable?</p>
<p>Currently the DateTime fields print as:</p>
<p>2008-12-14 16:30:00... | <p>Another option is to use the JSTL. The formatting library makes it easy to display a date in any format and it is i18n aware. The advantage is that you can leave the date as a Date object and manipulate it as such but only convert it when you need to display. The format tag will look like this:</p>
<pre><code><f... |
consume a asp.net web service that returns json from an stand alone html page <p>I've developed a web service in asp.net and am able to test it from an in-project aspx page and can readily display the information that was returned in JSON format.</p>
<p>I now need to consume the web service from a stand-alone html pag... | <p>See this link:</p>
<p><a href="http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/" rel="nofollow">http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/</a></p>
<p>Use JQuery</p>
<p>www.jquery.org</p>
<p>Essentially, you make your Web Service script callable,... |
Django objects.filter, how "expensive" would this be? <p>I am trying to make a search view in Django. It is a search form with freetext input + some options to select, so that you can filter on years and so on. This is some of the code I have in the view so far, the part that does the filtering. And I would like some i... | <p>filter itself doesn't execute a query, no query is executed until you explicitly fetch items from query (e.g. get), and list( query ) also executes it.</p>
|
Need to re-format phone number entries in a PHP Formmail script <p>I have a simple text field for "Phone Number" in a contact form on a client's website. The formmail script returns whatever the user types into the field. For example, they'll receive "000-000-0000", "0000000000", (000) 000-000, etc. The client would li... | <pre><code><?php
function formatPhone($number)
{
$number = preg_replace('/[^\d]/', '', $number); //Remove anything that is not a number
if(strlen($number) < 10)
{
return false;
}
return substr($number, 0, 3) . '-' . substr($number, 3, 3) . '-' . substr($number, 6);
}
foreach(array('... |
Private method naming convention <p>Is there a convention for naming the private method that I have called "<code>_Add</code>" here? I am not a fan of the leading underscore but it is what one of my teammates suggests.</p>
<pre><code>public Vector Add(Vector vector) {
// check vector for null, and compare Length t... | <p>I usually see and use either "AddCore" or "InnerAdd"</p>
|
Database Abstraction in a Reporting Application <p>In a reporting application, Is it possible to abstract reporting logic and the database schema details? </p>
<p>I have a Reporting Services application with a reasonably complex reporting logic, I am trying to migrate the application to some other databases. (Database... | <p>It would be hard to do this sort of thing in a one-size-fits-all way in the general case but you could try one of these:</p>
<ul>
<li><p>Build some views over the database schema and
write the reporting sprocs against
those. This means that you have some flexibility in the underlying database schema and can use th... |
What is the best library for Java to grid/cluster-enable your application? <p>This is the ability to run your application on a cluster of servers with the intent to distribute the load and also provide additional redundancy.</p>
<p>I've seen a presentation for <a href="http://www.gridgain.com/">GridGain</a> and I was ... | <p>There are several:</p>
<ul>
<li><a href="http://www.terracotta.org/">Terracotta</a> (<a href="http://www.terracotta.org/confluence/display/wiki/FAQ#FAQ-Q%3AWhat%27syourlicense%3F">open source, based on Mozilla Public License</a>);</li>
<li><a href="http://www.oracle.com/technology/products/coherence/index.html">Ora... |
Add references manually <p>Is there anyway I can make the process of adding references to C# projects less painful?</p>
<p>Every time I create a new C# class library project. I have to use the Add Reference dialog for 5 times at least.</p>
| <p>Install the <a href="http://code.msdn.microsoft.com/PowerCommands" rel="nofollow">PowerCommands for Visual Studio</a>. You can then simply copy and paste a bunch of references between projects (plus lots of other useful commands). Some of the other useful commands are:</p>
<ul>
<li>Collapse Projects (my favourite)<... |
Smart pointers for Windows Mobile 6 SDK <p>I cannot get std::tr1::shared_ptr for my WinMobile project since the STL for WinCE is maintained by a different team at Microsoft :( aarrgh...</p>
<p>Anyone worked with another thread-safe, reference counting smart pointers? I'm actually using yasper which seems to be good. <... | <p>I'd also recommend boost::shared_ptr. You can do what I did for a library, and use a #define to switch between std::tr1::shared_ptr and boost::shared_ptr, depending on the capabilities of the compiler. That way your code doesn't need to be modified [much] if/when the CE team add tr1 support. Just my 2c.</p>
|
C++ Operator Ambiguity <p>Forgive me, for I am fairly new to C++, but I am having some trouble regarding operator ambiguity. I think it is compiler-specific, for the code compiled on my desktop. However, it fails to compile on my laptop. I think I know what's going wrong, but I don't see an elegant way around it. Pleas... | <p>This is explained in the book "C++ Templates - The Complete Guide". It's because your operator[] takes size_t, but you pass a different type which first has to undergo an implicit conversion to size_t. On the other side, the conversion operator can be chosen too, and then the returned pointer can be subscript. So th... |
CSS "see-through" background - crazy navigation menu problem <p>I have a crazy navigation menu that I have to code. It's kind of tough. Please see the screenshot of the design here:</p>
<p></p>
<p><a href="http://i41.tinypic.com/307xfo9.png" rel="nofollow">navigation menu screenshot</a></p>
<p>As you can see, the ba... | <p>You can use either:</p>
<pre><code>background: transparent;
background: inherit;
</code></pre>
<p>But, you'll need to structure your HTML so that the <strong><em>Home</em></strong>, <strong><em>Journal</em></strong>, etc. links are embedded in the box with the background.</p>
<p><hr /></p>
<p>For rounded corners... |
What is the best method for paging with datagrid performance? <p>On a site with a high number of users, should paging be handled in code, or with a stored procedure. If you have employed caching, please include your success factors.</p>
| <p>Personally, I never page stuff outside SQL Server. I do this at database level as if you have a million records to be paged, if you retrieve it in application layer and page it there, you are already paying a <b>huge</b> cost.</p>
|
Why .NET strips off one <form> tag from the page if there is already a form with runat server attribute? <p>It doesn't remove everything inside the 2nd form tag but just hides the and tags from the page</p>
<p>Any ideas and workaround?</p>
| <p>Nesting of forms is not allowed in html. So you cant add another form inside the server-form.</p>
<p>But it is perfectly legal in ASP.NET to add get-forms outside of the server form.</p>
|
jQuery, ThickBox with Ajax content for beginner <p>Here is the scenario: </p>
<p>ThickBox is opened from parent window (when button is pressed) with Ajax content (div based form) that contains the set of inputs with autocomplete support. Once ThickBox(form) is closed the input values should be passed to parent window.... | <p>My prefered option is to investigate other modal plugin options such as <a href="http://dev.iceburg.net/jquery/jqModal/#how" rel="nofollow">jqModal</a>. This does expose onShow and onHide event hooks that you can utilise.</p>
<p>Thickbox is showing its age, it does not expose any 'show' events that you can observe.... |
Singleton with a public (single-instance) constructor <p>As an exercise, I'm translating parts of our large and battle-hardened Delphi-framework to C#. </p>
<p>Included in this framework is a generic singleton parent class. Of course, implementing a singleton in C# is fairly easy (there is even a Jon Skeet article, so... | <p>You would do a Proxy (Edit: As Tom points out below, the proper design pattern is Monostate):</p>
<pre><code>public class MyClass {
MyActualClass _actual;
public MyClass() {
_actual = MyActualClass. Instance;
}
public DoStuff() {
_actual.DoStuff();
}
}
internal class MyActualClass {
private MyA... |
How do I make a generic object list work from a specific base class? <pre><code> TMyDataList<T: TBaseDatafile, constructor> = class(TObjectList<TBaseDatafile>)
public
constructor Create;
procedure upload(db: TDataSet);
end;
</code></pre>
<p>I read in a blog post (I don't remember where ... | <p>The definition of TObjectList<> is:</p>
<pre><code>TObjectList<T: class> = class(TList<T>)
</code></pre>
<p>So you like to do something like:</p>
<pre><code>TMyDataList<T: TBaseDatafile> = class(TObjectList<T>)
</code></pre>
<p>Unfortunately, that won't work. Luckily: </p>
<pre><code>... |
How-To: Copy dependent assembly in case it is not in GAC? <p>I am building a Setup Package using VS2008. This is a regular setup package installing a COM Add-In app for Outlook. It works Ok, so far. However I need to improve it a little...</p>
<p>The story is that installation package copies all dependent assemblies i... | <p>Just always copy it to the folder. If it's already in the GAC, the GAC'd assembly will be used first anyway.</p>
<p>In other words the runtime checks the GAC first. Then, checks application base, etc.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/yx7xezcf(VS.71).aspx" rel="nofollow">http://msdn.microsof... |
Drupal How to see document attached to Node for anonymous users <p>I am finishing up a Drupal site and I have attached a word document on one of my page nodes. I want anonymous people to be able to download it, but they don't even see the document. I do as a logged in user.</p>
<p>Any Ideas?</p>
| <p>You need to give anonymous users permission to view uploaded files.
I'm guessing that you used the upload module.
The permissions page is at /admin/user/permissions and under the group "upload module" you are looking for "view uploaded files".</p>
<p>-Ed</p>
|
Adding javascript to the OnBlur property of an ASP.NET text box control <p>Is there a way to specify some JavaScript to execute on the OnBlur event of an ASP.NET text box? It seems to me like if I add any event handlers to the TextBox object they will just cause postbacks to the server isntead of doing what I want. B... | <p>In your codebehind, add this:</p>
<pre><code>myTextBox.Attributes.Add("onblur","alert('1234');");
</code></pre>
|
is SFig language syntax efficient and clear (and better than Spring-Framework's XML DSL)? <p><strong>ADDENDUM EDIT:</strong></p>
<blockquote>
<p>Have not accepted an answer to this as
there has not been any feedback from
experienced Spring Framework
developers.</p>
</blockquote>
<p>I've been working on a repl... | <p>I haven't much experience with the Spring XML you refer, so you should take the following feedback with a pinch of salt. </p>
<p>As a second and third caveat: </p>
<ul>
<li>providing a snippet of code will give a <em>flavour</em> of what the language and its semantics are. It is difficult to completely understand ... |
Streaming audio from server to iPhone <p>I'm looking to stream some audio files I have on my server to an iPhone-client application I'm writing. Some of the audio files can be rather large in size, even after compression. My question is, is there a Cocoa framework that helps me with buffering the audio so it becomes av... | <p>Brad mentioned a post that I wrote to stream audio via HTTP. That was this one: <a href="http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html">Streaming and playing an MP3</a>. I don't mean to be the person that links to his own blog but it does kind of address your question.</p>
<p>In regard... |
How do I do lots of processing without gobbling cpu? <p>I know the question title isn't the best. Let me explain.</p>
<p>I do a TON of text processing which converts natural language to xml. These text files get uploaded fairly fast and thrown into a queue. From there they are pulled one-by-one into a background worke... | <p>Perhaps just placing the background worker at a lower scheduling priority (e.g. using <a href="http://en.wikipedia.org/wiki/Nice_(Unix)">nice</a>) would help. This means that your server can handle requests when it needs to, but when it's not busy you can go full blast with the text processing.</p>
<p>Methinks it w... |
A piece of PHP code I'm not so sure about <p>I have here a piece of PHP code that deletes a directory and all files in it if present.
However, I'm not too sure about it, it looks to me like it'll delete all sub-maps too and then files in those and so on...</p>
<p>I basically want to give and optional true/false parame... | <blockquote>
<p>And what I'm basically wondering is: what can go wrong here? Is there a situation where this piece of code can seriously screw up?</p>
</blockquote>
<p>If the dir contains a symlink to somewhere else, it would be followed (unless I'm mistaken - You should check this). That could lead to a wildfire, w... |
Windows Gadgets & Jquery <p>I am creating a Vista Gadget and I haven't been able to get JQuery to work. I have tried a few very simple calls like this:</p>
<pre><code>$(function() {
$('a').click(function() {
$('#box').html("test");
});
});
</code></pre>
<p>I know you can use JavaScript so it doe... | <p><a href="http://arsecandle.org/twadget/" rel="nofollow">Here</a> is a widget for vista done with jquery.
Might help you.</p>
<p>Above link is dead - here is another <a href="https://code.google.com/archive/p/timetablegadget/source/default/source" rel="nofollow">https://code.google.com/archive/p/timetablegadget/sour... |
How to do a custom asp.net routing (hardcoding the controller) <p>I'm trying to create a route for the following urls:
www.mysite.com/user/username
www.mysite.com/user/username/pictures</p>
<p>I tried doing that with the following code:</p>
<pre><code>routes.MapRoute(
"UserProfile",
"user/{sn}... | <p>Looks like your code is correct.</p>
<p>The order of the rules is important. Try to place this above all other rules.
And if it will intefere with other rules, you should provide some constraints for the best matches.</p>
|
User Breakpoint from nowhere <p>I have some code in MS VC++ 6.0 that I am debugging. For some reason, at this certain point where I am trying to delete some dynamically allocated memory, it breaks and I get a pop up message box saying "User Breakpoint called from code at blah blah".. then the Disassembly window pops u... | <p>You're probably hitting code in the debug heap routines that have found heap corruption.</p>
<p>What does the call stack look like when you've hit the Int 3?</p>
<p>Edit: Based on the stack trace in your comments, the routine <code>_CrtIsValidHeapPointer()</code> is saying that the pointer being freed is bad. Her... |
Variable watch in PHP <p>Does PHP have the ability to watch a variable (or object property) and run a function when its value changes, similar to <a href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Object/Watch" rel="nofollow">Gecko's Javascript <code>watch</code> function</a>?</p>
| <p><a href="http://www.xdebug.org/" rel="nofollow">XDebug</a> <em>might</em> have this, but I don't know for sure.</p>
<p>If you're trying to debug a member variable on an object, you can use overloading:</p>
<pre><code>public function __set($var, $val)
{
if ($var == 'interesting') {
echo "$var set to: ";... |
Missing AVFoundation.framework <p><code>AVFoundation.framework</code> is not where the documentation says it should be. I have iPhone SDK 2.2 installed (never had previous sdk versions installed) and I can't find that folder under <code>/System/Library/Frameworks</code></p>
<p>I did find it under</p>
<pre><code> /Dev... | <p>I've used the AVFoundation classes in my code, and added it the same way you did. You cannot browse the headers for some unknown reason, but putting this in your classes header file compiles just fine:</p>
<pre><code>#import <AVFoundation/AVAudioPlayer.h>
</code></pre>
<p>I've submitted my app and had it app... |
Asp.Net MVC - Best approach for "dynamic" routing <p>I am trying to come up with an approach to create "dynamic" routing. What I mean, exactly, is that I want to be able to assign the controller and action of a route for each hit rather than having it mapped directly.</p>
<p>For example, a route may look like this "pa... | <p>You can always use a catch all syntax ( I have no idea if the name is proper).</p>
<p>Route:
<code>
routeTable.MapRoute(
"Path",
"{*path}",
new { controller = "Pages", action = "Path" });</code></p>
<p>Controller action is defined as:
<code>public ActionResult Path(string path)</code></p>
<p>In the ac... |
How can I use PHP to obfuscate email addresses so they are not easily harvested by spammers? <p>I'm programming in PHP and would like to create web pages which have email addresses that are easily read by humans but not easily harvested by spammers. The email addresses are coming from user input, and I think I can ide... | <h2>Use <a href="http://in2.php.net/gd" rel="nofollow">GD</a> and create image of your Email ID</h2>
<p>You can use the <a href="http://in2.php.net/gd" rel="nofollow">PHP GD library</a> to easily create an image of any given text.</p>
<p>A sample code will look like,</p>
<pre><code><?php
header("Content-type: i... |
How do I setup a callback mechanism for RichEdit in win32 <p><strong>In win32, how do I setup a callback mechanism for RichEdit I have not created myself?</strong></p>
<p><strong>PART 1</strong></p>
<p><a href="http://stackoverflow.com/questions/352236/reading-from-a-text-field-in-another-applications-window">I'm rea... | <p>Win32 controls don't work on message-specific callbacks that you can subscribe to. They just send messages to their parent window when something happens, in this case EN_UPDATE, EN_CHANGE and all that. Even these events don't tell you what text changed. They only tell you that it <em>did</em> change.</p>
<p>You cou... |
How do you deal with failing Unit Tests? <p>I have a number of projects in a solution file that have unit tests written for them and I am wanting to set them up to be run by our continuous integration server. However, because many of the tests have been written poorly and have not been run regularly there are many that... | <p>Since you have a running automated build (with test failure notification!), this sounds like it's time for 5-a-day (freely from ubuntu community):</p>
<p>In each test method that's failing insert the following (pseudocode):</p>
<pre><code>if ( DateTime.now < new DateTime(2008, 12, 24, 11, 00, 00)) return;
</c... |
Timed Subscription Schedule in SSRS sends out duplicate emails <p>I have created a one-time subscription in SSRS report manager 2008. However I keep getting duplicate emails sent out by the subscription. The interval between each email is about 30 minutes. </p>
<p>I have checked SQL agent job and it looks the SQL agen... | <p>Update on this problem. </p>
<p>When I enable the reporting service log, the problem never happens again. </p>
<p>To the configuration file, the following is added.</p>
<pre><code><system.diagnostics>
<switches>
<add name="DefaultTraceSwitch" value="3" />
</switches> </s... |
Silverlight WebPart in Sharepoint <p>I am new to Silverlight 2.0 and I am actually trying to deploy the Silverlight as webpart in Sharepoint 2007.</p>
<p>I have done the following Installations:</p>
<ol>
<li>VS 2008 with SP1</li>
<li>Silverlight 2.0 SDK and exe</li>
<li>Silverlight Tools for VS 2008</li>
<li>MOSS 200... | <p>I was able to resolve my issue by ensuring that my SharePoint web.config was properly configured for ASP.NET AJAX. It is not set up properly by default. See this site for details on how to do that:</p>
<p><a href="http://aspalliance.com/1719_Integrating_ASPNET_Ajax_WebPart_with_SharePoint_30.5" rel="nofollow">Inte... |
JavaScript - Identify whether a property is defined and set to 'undefined', or undefined <p>Say I have the following code:</p>
<pre><code>function One() {}
One.prototype.x = undefined;
function Two() {}
var o = new One();
var t = new Two();
</code></pre>
<p><code>o.x</code> and <code>t.x</code> will both evaluate t... | <p>A slightly simpler way than your method is to use the <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/in_Operator">Javascript in operator</a></p>
<pre><code>alert('x' in o); // true
alert('x' in t); // false
</code></pre>
|
Problem with an expect script <p>I'm trying to create a script to update a password in a
non-interactive way. It's working on my laptop but fails on my server.
Both are running the same configuration, using Etch.</p>
<p>This is the script:</p>
<pre><code>#!/usr/bin/expect -f
# Change user passwd
set timeout 30
strace... | <p>Maybe the password policy is different on the server?</p>
|
What's wrong with nullable columns in composite primary keys? <p>ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other "enterprise-level" systems.</p>
<p>At the same time, most systems also allow <em>unique</em> contraints on nullable colum... | <p>Primary keys are for uniquely identifying rows. This is done by comparing all parts of a key to the input. Per definition, NULL cannot be part of a comparison - the result of such a comparison would always be NULL again.</p>
<p>Additonally, NULL is allowed in a foreign key, to mark an optional relationship.<sup>(*)... |
Drupal Aggregator input format <p>Drupal Aggregator core module is a useful one but suffers many problems. There are many talking about improving it in Drupal 7.</p>
<p>Right now I'm using Aggregator module which comes with Drupal 6. I'm building an aggregation site, and there is one BIG problem. Sometimes feeds conta... | <p>You might want to consider moving to one of the newer solutions built on top of FeedAPI </p>
<p><a href="http://drupal.org/node/326601" rel="nofollow">http://drupal.org/node/326601</a> </p>
<p>As you can see starting from there, this is where the action is, aggregation-wise.</p>
|
Possible to search multiple tables with a single query? [MSAccess/SQL Server] <p>So my goal here is to have a single search field in an application that will be able to search multiple tables and return results.</p>
<p>For example, two of these tables are "performers" and "venues" and there are the following performer... | <p>I think you are looking for the "union" sql keyword</p>
|
How can I hide "defined but not used" warnings in GCC? <p>I have a bunch of compile time asserts, such as:</p>
<pre><code>CASSERT(isTrue) or CASSERT2(isTrue, prefix_)
</code></pre>
<p>When compiling with GCC I get many warnings like <code>'prefix_LineNumber' defined but not used</code>. Is there a way I can hide warn... | <p>Just saw this thread while searching for solutions to this problem. I post here for completeness the solution I found...</p>
<p>The GCC compiler flags that control unused <a href="http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html">warnings</a> include:</p>
<pre><code>-Wunused-function
-Wunused-label
-Wunused-... |
What fields should be indexed on a given table? <p>I've a table with a lot of registers (more than 2 million). It's a transaction table but I need a report with a lot of joins. Whats the best practice to index that table because it's consuming too much time.</p>
<p>I'm paging the table using the storedprocedure paging... | <p>The SQL Server 2008 Management Studio query tool, if you turn on "Include Actual Execution Plan", will tell you what indexes a given query needs to run fast. (Assuming there's an obvious missing index that is making the query run unusually slow, that is.)</p>
<p><img src="http://img208.imageshack.us/img208/4108/ima... |
resize images with canvas - css overflow issue <p>I'm working on a JavaScript image resizing feature which rely on the IE only DXImageTransform addon.</p>
<p>Wanting to address modern browsers as well, I gave a shot to canvas, with pretty good results.</p>
<p>However, I face an issue in my resize function, which is t... | <p>I haven't tried that myself, but perhaps you can create a canvas element out of the Dom, with <code>document.createElement</code>. It could be of arbitrary size without disturbing the display.</p>
<p>Now, I lack context (why do you resize images this way instead of using width and height attributes, among other que... |
Initialize generic object with unknown type <p>How can I initialize a list containing generic objects whose types can be different?</p>
<p>For example, I have the following:</p>
<pre><code>this.Wheres = new List<Where<>>();
</code></pre>
<p>As you know, <> is not valid syntax. However, sometimes the t... | <p>Well, you haven't really given enough context (what's SqlWhere?) but normally you'd use a type parameter:</p>
<pre><code>public class Foo<T>
{
private IList<T> wheres;
public Foo()
{
wheres = new List<T>();
}
}
</code></pre>
<p>If you want a single collection to contain multip... |
What are the IDE advantages of recorded macros? <p>Just as the title says, I see a lot of editors touting macro recording as a feature but cannot find a way to take advantage of these functions myself. So what can you use it for? The type where you can record mouse movement and/or keystrokes? Is it really that helpf... | <p>I use them all the time. Say, for example, I want to go down a list, indenting by 4 and adding a "|* ". In EMACS, I hit <code>C-x (</code> to start recording, do one example line to see that it's what I want, ending with <code>C-n C-a</code> to move to the next line, and end the macro with <code>C-x )</code>. The... |
best compression algorithm with the following features <p>What is the best compression algorithm with the following features:</p>
<ul>
<li>should take less time to decompress (can take reasonably more time compress)</li>
<li>should be able to compress sorted data (approx list of 3,000,000 strings/integers ...)</li>
</... | <p>Entire site devoted to compression benchmarking <a href="http://www.maximumcompression.com" rel="nofollow">here</a></p>
|
Getting Started with IronRuby on Rails <p>Can somebody point me to a tutorial and/or Getting Started document to get IronRuby running Rails? I'm particularly interested in a detailed, step-by-step reference, <em>not</em> general guidelines.</p>
| <p>IronRuby already 'runs' Rails today. We demo'd it running Rails back at RailsConf 08. That said, we have a lot of fit and finish work to do on IronRuby to get it to a state where it can run Rails <em>well</em>. </p>
<p>Where we're lacking right now is:</p>
<p><LI> Startup speed - this is critical for a decent expe... |
console output formatting <p>Are there any conventions for formatting console output from a command line app for readability and consistency? For instance, do you indent sub-information, when do you print a blank line, if ever, how should you accent important statements.</p>
<p>I've found output can quickly degenera... | <p>I'd differentiate two kinds of programs:</p>
<p>Do you print information that <em>might</em> be used by a script (i.e. it should be parseable)? Then define a pretty strict format and use only that (for example fixed field separators).</p>
<p>Do you print information that need not be parsed by a script (or is there... |
Is it possible for a Asp.Net developer on 64-bit windows to work with a team that has 32-bit? <p>Are there any compatibility issues that would prevent this from working? Do I need to have a 32-bit VM to use when working on projects for this team?</p>
| <p>No. Should work perfectly well.</p>
<p>Read a little here: <a href="http://msdn.microsoft.com/en-us/library/ms973190.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms973190.aspx</a></p>
|
Which is the best import / export LaTeX tool? <p>Working in academia publishing CS/math, you sooner or later find yourself trying to publish in a journal that will only accept .doc/.rtf. This means tedious, boring hours of translating line after line, especially equations, from LaTeX to an inferior format. Over the yea... | <p>AFAIK there isn't really a convenient and effective way to achieve what you're trying to do. What I usually do in those rare occasions is that I export to pdf, then select all the text, and paste into word. It's horrible and messes things up and of course doesn't adjust your citations. </p>
<p>To this day I don't u... |
Removing images with Greasemonkey? <p>I would like to stop images from loading, as in not even get a chance to download, using greasemonkey. Right now I have </p>
<pre><code>var images = document.getElementsByTagName('img');
for (var i=0; i<images.length; i++){
images[i].src = "";
}
</code></pre>
<p>but I do... | <p>If you want to disable images downloading for all websites (which I guess you might not be doing) and are using firefox, why not just disable them in preferences? Go to the content tab and switch off "Load images automatically".</p>
|
Java command-line launchers <p>I am working on a .jar file library to implement a bunch of helper classes to interface a PC to a piece of external hardware. I'll also add some simple applications, either command-line or GUI, to handle common tasks using the library.</p>
<p>My question is, is there a recommended way to... | <ol>
<li>When you use <code>-jar</code>, then<code>-cp</code> (and the <code>CLASSPATH</code> variable) will be ignored</li>
<li>Just provide a executable jar. "<code>java -jar TheApp <whateverargumentsyouwant></code>" shouldn't be too hard (you can have a <a href="http://java.sun.com/javase/6/docs/technotes/guid... |
MyGeneration command line input <p>I have looked all over the internet, mygenteration's forum, and mygenteration's website and I cannot figure out how to pass parameters into a template through the command line using the xmldatapath switch. Does anyone know how to do this?</p>
<p>--edit--</p>
<p>I did a little resea... | <p>Have you seen <a href="http://community.entityspaces.net/forums/thread/10816.aspx" rel="nofollow">this post</a>, which indicates that the <code>-i xmldatapath</code> works with a saved output file created by MyGeneration itself. You don't detail what your exact issue is, have you tried using -c to create the file th... |
Rhino Mocks: AAA test syntax without static MockRepository methods? <p>I have been using (and liking) the new Rhino Mocks AAA syntax. However, one thing that puzzles me is that I have to create my stubs and mocks like this:</p>
<pre><code>var v1 = MockRepository.GenerateStub<MyClass>();
</code></pre>
<p>instea... | <p>I checked rhino mocks with reflector.</p>
<p>MockRepository.GenerateStub actually creates a repository and calls the non static stub. Here is what the static methods actually do (copied from reflector)</p>
<pre><code>public static object GenerateStub(Type type, params object[] argumentsForConstructor)
{
MockRe... |
Hide Tab headers in WPF TabControl <p>What is the best way to hide Tab headers when there is only a single visible Tab?</p>
<p>I want to hide TabControl chrome completely, while leaving the content of the Tab visible.</p>
| <p>You can use a Style applied to TabItem with a DataTrigger that will collapse it if the parent TabControl has only one item:</p>
<pre><code><Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/w... |
Show HH:mm 24H format in TemplateField using text property <p>I'm trying to show a 24 hours format using this line:</p>
<pre><code>Text='<%# Bind("Appointment", "{HH:mm}")
</code></pre>
<p>So how it'll be formated for showing for example 16:40 instead 4:40? </p>
| <p>if you don't need to <em>bind</em> it, try:</p>
<p>Text='<%# string.Format("{0:HH:mm}", Eval("Appointment"))%>'</p>
<p>otherwise i suppose you can update the field value in the OnDataBound event. </p>
|
OpenSocial server implementation <p>What is the preferred method of implementing the OpenSocial platform? I'm aware of Apache Shindig but can't really find any useful information on it. Also, is it possible to use an existing solution like the Rails-based <a href="http://lovdbyless.com/" rel="nofollow">lovdbyless</a> a... | <p>I've ported shindig over to .NET at <a href="http://code.google.com/p/pesta/" rel="nofollow">http://code.google.com/p/pesta/</a> and a sample site using it from partuza at <a href="http://www.codeplex.com/raya" rel="nofollow">http://www.codeplex.com/raya</a></p>
|
Synchronous work in a BackgroundWorker <p>My application performs time consuming work independently on several files. I created a BackgroundWorker to pass the work off to on each file, but it appears the backgroundworker is only capable of performing asynchronous work. Is it possible to do several asynchronous tasks ... | <p>The background worker is usually used to update the UI and/or to pass off work so you don't freeze the UI when a long running process takes place. This means that you "pass" the background worker process the "file work" and then use a callback to update the UI(usually) all during which your APP remains responsive.</... |
Where would you put your new open-source .NET project? <p>I'm currently working on a .NET project that I will probably make open source.</p>
<p>There are lots of places to put it though, anyone have any experience for a friction-less effort? Codeplex? Google-code?</p>
<p>Note: I prefer Subversion for the projects sou... | <p><strong><a href="http://code.google.com/" rel="nofollow">Google code</a> is my favorite.</strong> It has similar powerful simplicity and reliability just like other products from the Gmail.</p>
<p><strong>I would not recommend SourceForge</strong> to anyone. Reasons:</p>
<ul>
<li>Version control is slow</li>
<li>I... |
Variable amount recurring billing <p>Hi i'm looking for a payment gateway that can do recurring billing that changes month to month. Fogbugz do this, they charge based on how many active users there were that month. All of the APIs that i've found only let you set a fixed amount and it's difficult/impossible to vary t... | <p><a href="http://www.braintreepaymentsolutions.com/">BrainTree</a> might be a good solution if you are manually triggering the re-bill each month. They will give you a 'token' that represents the credit card number originally supplied.</p>
<p>You can store this number, which is worthless to a potential thief.</p>
|
Windows UPS (Uninterruptible Power Supply) service - turn off UPS? <p>I'm using the UPS service to monitor the state of my UPS from an application -- the key at HKLM\SYSTEM\CCS\Services\UPS\Status has all the information you can get from the Power control panel. BUT -- I'd like to be able to tell the UPS to shut down ... | <p>Check my comments to Herman, you want to shut the UPS down, not the UPS SERVICE, correct? I mean, you want that thing to shut off, kill the power, etc, right?</p>
<p>If so, you are looking it on a UPS by UPS model. I doubt two of them would work the same.</p>
<p>In your searches, instead of UPS, try "APC", or "b... |
How can I make this Ruby on Rails page more efficient? <p>I'm building a site where users can track their collection of figures for Dungeons & Dragons (www.ddmdb.com). The models/relationships involved in this funcitonality are the following:</p>
<p><strong>User:</strong></p>
<ul>
<li>id</li>
<li>login (username... | <p>The first thing I would say is that the User model should own the code that works out how many of a given miniature the user owns, since it seems like "business logic" rather than view formatting.</p>
<p>My suggestion would be to add a method to your User model:</p>
<pre><code>def owns(miniature_id)
o = ownershi... |
Fast eclipse mode for PHP <p>Does anybody know of a fast PHP mode for eclipse? I have tried the Aptana PHP mode, and PDT, but neither can place a character in under a second, which is no way to write code.</p>
<p>Its probably due to my editing on a network drive, but it seems silly that an editor would depend so heav... | <p>Try to disable Code Folding under Window > Preferences > PHP > Editor > Code Folding. If file is larger than 200 lines of code, this feature cause Eclipse to run really slow!</p>
<p>They said that this bug is fixed back in 2008. but I still have this problem :)</p>
|
How to make an image center (vertically & horizontally) inside a bigger div <p>I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div. </p>
<p>How can it be done?</p>
<p>I am able to get it centered horizontally by using <code>text-align: center</code> for the div. But vertical a... | <p>Personally, I'd place it as the background image within the div, the CSS for that being:</p>
<pre><code>#demo {
background: url(bg_apple_little.gif) no - repeat center center;
height: 200px;
width: 200px;
}
</code></pre>
<p>(Assumes a div with <code>id="demo"</code> as you are already specifying <code>... |
Architectural Suggestions in a Linux App <p>I've done quite a bit of programming on Windows but now I have to write my first Linux app. </p>
<p>I need to talk to a hardware device using UDP. I have to send 60 packets a second with a size of 40 bytes. If I send less than 60 packets within 1 second, bad things will happ... | <p>I've done a similar project: a simple software on an embedded Linux computer, sending out CAN messages at a regular speed.</p>
<p>I would go for the two threads approach. Give the sending thread a slightly higher priority, and make it send out the same data block once again if the other thread is slow in computing ... |
Can you run EJB 2.1 beans in OSGi? <p>I have a J2EE 1.3 app that uses EJB 2.1 session and entity beans. Currently this app runs as an EAR file on JBoss. I'd like to switch to the SpringSource dm Application Server because of all the benefits that OSGi provides.</p>
<p>Does anyone know if there's an OSGi bundle that ca... | <p>hope that it could help you: </p>
<p><a href="http://darrylnelson.wordpress.com/2008/08/22/openejb-in-felix/#" rel="nofollow">http://darrylnelson.wordpress.com/2008/08/22/openejb-in-felix/#</a></p>
<p>It helps me a lot :-)</p>
|
Stacktrace information preserving paths of original source <p>I am using C#.net for application development.</p>
<p>To log and debug exceptions, I use the stacktrace.</p>
<p>I executed my application on another machine, but when errors occur it refers to the path of my development machine.</p>
<pre><code>Ex: D:\Pr... | <p>The original compiled path is stored in the debug information within the PDB files.</p>
|
Unicode characters in Windows command line - how? <p>We have a project in TFS that has a non-English character (Å¡) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the <strong>Å¡</strong> letter to the command line tools. Command prompt or what not else messes it up... | <p>Try:</p>
<pre><code>chcp 65001
</code></pre>
<p>which will change the code page to UTF-8. Also, you need to use Lucida console fonts.</p>
|
Read .config file in another assembly <p>Is there any possiblity to read a .config file in a dll assembly? At the moment I use OpenExeConfiguration on a Assembly.Location Property which seems to work. But I want to create separate .config files for different usages like ConfigModuleA.config, ConfigModuleB.config etc. <... | <p>Are you wanting to read another applications config file or just have some sections of the config file in a separate file (say, to make it more managable)?</p>
<p>If the latter just provide a <code>configSource</code> attribute on the config section you want to put somewhere else.</p>
<p>See - <a href="http://msdn... |
TestDriven.net with Gallio, MbUnit and NCover problems <p>Why doesnt TestDriven.Net work with my gallio/mbunit tests?</p>
<p>I've used TDD.Net with MbUnit v2 and not had any problems, but with the new gallio release on my new pc, it does nothing.</p>
<p>From the tdd right click menu in solution explorer, if i do "tes... | <p>You just need to make sure you install TestDriven.Net before Gallio. Otherwise the Gallio installer will not install its extensions for TestDriven.Net.</p>
|
Regular expression for allow only numbers <p>I want to check the following with regular expression</p>
<pre><code>{Today,Format}
</code></pre>
<p>Today - will be remains as it is.
In the place of Format, we can allow the digits from 0 to 12.</p>
<p>for example: we have to allow</p>
<pre><code>{Today,0}
{Today,1}
{T... | <pre><code>\{Today,(\d|1[012]|Format)?\}
</code></pre>
<p>Meaning:</p>
<ul>
<li>Open curly brace;</li>
<li>'Today,';</li>
<li>Optionally one of the following: a digit (0-9), 1 followed by 0, 1 or 2 (10,11,12), 'Format'; and then</li>
<li>Close curly brace.</li>
</ul>
<p>As for resources I can recommend <a href="http... |
How do I use the built in password reset/change views with my own templates <p>For example I can point the <code>url '^/accounts/password/reset/$'</code> to <code>django.contrib.auth.views.password_reset</code> with my template filename in the context but I think need to send more context details.</p>
<p>I need to kn... | <p>If you take a look at the sources for <a href="http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/views.py">django.contrib.auth.views.password_reset</a> you'll see that it uses <a href="http://code.djangoproject.com/browser/django/trunk/django/template/__init__.py"><code>RequestContext</code></a>... |
Checking flash file loading with javascript <p>Is there a way to check how much a flash file is (down)loaded to the page before it is shown?
Our team cant put loading indicator inside the flash file because the swf file is uploaded by our client. Is there some kind of property on xmlhttprequest that we can use to indic... | <p>Do you have control over how the file is loaded in the browser? i have a theory that you could create a second flash movie, that would load the clients movie into it, and during that process you could show a progress indicator. </p>
<p>Flash has support for loading external .swf files, look <a href="http://kb.adobe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.