input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Converting a PDF to PNG <p>I'm trying to convert a PDF (at least the cover of one, I'm successfully extracting the first page of the PDF with pdftk) to a PNG. I'm using imagemagick to do the converstion:</p>
<pre><code>convert cover.pdf cover.png
</code></pre>
<p>This works, but unfortunately the cover.png comes thro... | <p>You can use one commandline with two commands (<code>gs</code>, <code>convert</code>) connected through a pipe, if the first command can write its output to stdout, and if the second one can read its input from stdin.</p>
<ol>
<li>Luckily, gs can write to stdout (<code>... -o %stdout ...</code>). </li>
<li>Luckily,... |
how to get a particular value from NameValueCollection's comma-delimited string? <p>i have a POST request</p>
<pre><code>firstname=1&lastname=10&firstname=2&lastname=20&firstname=3&lastname=30.
</code></pre>
<p>then i get comma-delimited lists of names and values</p>
<pre><code>Request.Form["firs... | <p><code>GetValues()</code> will return a <code>string[]</code></p>
|
How to delete the cache of SPNavigationNodes in Sharepoint 2007? <p>I have a website in Sharepoint.</p>
<p>As you know,in settings users can order the sites and pages as they want in exploration, and then you can get these items with this order with:</p>
<pre><code>SPWeb web = CurrentSite.OpenWeb(currentSite);
SPNav... | <p>i'm not 100% sure, but trying retrieving a new copy of the SPWeb object instead of using one from the current context:</p>
<pre><code>using ( SPSite l_site = new SPSite(SPContext.Current.Site.Url); )
{
using ( SPWeb l_web = l_site.OpenWeb() )
{
..
}
}
</code></pre>
|
WPF: Is ListBox or Panel responsible for mouse wheel navigation? <p>I have a custom ListBox which uses a custom Panel as ItemsHost. I want to have control over mouse wheel input, so that turning the wheel changes the single selected item.</p>
<p>I believe that the best method to do so is to handle the OnPreviewMouseWh... | <p>I think you should do this from the <code>ListBox</code>. <code>ListBox</code> inherits from <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.selector.aspx" rel="nofollow">Selector</a> which handles everything to do with selection.</p>
<p>The mousewheel selection behavior could a... |
convert xml to sorted dictionary <p>i have an xml file similar to this:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<data>
<resource key="123">foo</resource>
<resource key="456">bar</resource>
<resource key="789">bar</resource>
</data>
</code... | <p>This looks like a job for Linq to Xml</p>
<pre><code> static void Main(string[] args)
{
XDocument yourDoc = XDocument.Load("the.xml");
var q = from c in yourDoc.Descendants("resource")
orderby (int) c.Attribute("key")
select c.Attribute("key").Value... |
Why does the count() function require a parameter? <p>The <code>count()</code> function counts rows, and is very often used as <code>count(*)</code>. If I had a table with phoneNo and firstName, <code>count(phoneNumber)</code> returns the same number as <code>count(*)</code>. All columns are always present, if not po... | <p>There is a subtle difference. </p>
<p>If you specify a field , count(fieldname) will count records which have <em>non null</em> values for the field. count(*) will give you total rows. </p>
|
How to do with pointing the target html when doing xml transformation? <p>I want to generate a treeview from xml by xsl. In the output html, there are 2 frames: treeframe for the treeview and contentframe for displaying the content of the nodes when I click on the tree. </p>
<p>I wrote a tree.xsl to generate the tree ... | <p>Put displayContent function in the containing page code rather than in HTML for the Tree frame. Have the nodes call top.displayContent. Now the displayContent can instruct the content frame with the URL it needs to display.</p>
<p>Alternatively use anchors in the XSL and specify the target attribute to point at t... |
Highlight a list of words using a regular expression in c# <p>I have some site content that contains abbreviations. I have a list of recognised abbreviations for the site, along with their explanations. I want to create a regular expression which will allow me to replace all of the recognised abbreviations found in the... | <p>First you would need to <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.escape.aspx"><code>Regex.Escape()</code></a> all the input strings.</p>
<p>Then you can look for them in the string, and iteratively replace them by the markup you have in mind:</p>
<pre><code>string abbr ... |
GC.Collect in a loop? <p>I found this piece of code inside System.Web.ISAPIRuntime using Reflector</p>
<pre><code>public void DoGCCollect()
{
for (int i = 10; i > 0; i--)
{
GC.Collect();
}
}
</code></pre>
<p>Can anyone comment on this? Is there a reason to do GC.Collect() in a loop? Why 10 time... | <p>Yes, that's horrible. Firstly, you shouldn't need to do it at all. However, if you really want to force garbage collection as hard as you can, and wait for it to finish, you should probably use:</p>
<pre><code>GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
GC.WaitForPendingFinalizers();
// Collect anything ... |
How to configure symfony project in local server? <p>I am beginner for symfony. I have to configure the already developed project that is built using symfony. I changed the database information but when browse localhost/myproject/web there is nothing displayed. What can i do to configure the project in local server. I ... | <p>you need to point apache to the web folder in your symfony project. or if your project reside inside apache web root you could use:</p>
<p><strong><a href="http://localhost/myproject/web/index.php" rel="nofollow">http://localhost/myproject/web/index.php</a></strong> but that won't show any errors. insted of that yo... |
SQL/MySQL SELECT and average over certain values <p>I have to work with an analysis tool that measures the Web Service calls to a server per hour. These measurments are inserted in a database. The following is a snippet of such a measurement: </p>
<pre><code>mysql> SELECT * FROM sample s LIMIT 4;
+---------+----... | <p>You're probably best doing this with temp tables / views (I'd recommend a view over a temp table) or you will end up with a nasty case specific statement that will be a nightmare to manage over time.</p>
|
Can i display a portion of an image in iphone application using cocos2d? <p>I want to display portion of image not to display the total image.At first display the full image but after a delay time display the a portion of this image. I can not understand how can i do this. Like we can display portion of text by fixing ... | <pre><code>[someImage drawInRect:CGRectMake(0, 0, 30, 30)];
</code></pre>
|
C++ Optimization Techniques <p>Is there a site that provides a great list of common C++ optimization practices?</p>
<p>What I mean by optimization is that you have to modify the source code to be able to run a program faster, not changing the compiler settings.</p>
| <p>I will echo what others have said: a better algorithm is going to win in terms of performance gains.</p>
<p>That said, I work in image processing, which as a problem domain can be stickier. For example, many years ago I had a chunk of code that looked like this:</p>
<pre><code>void FlipBuffer(unsigned char *start... |
What is the most efficient way to convert an int to a String? <p>Say I have:</p>
<pre><code>int someValue = 42;
</code></pre>
<p>Now I want to convert that int value to a String. Which way is more efficient?</p>
<pre><code>// One
String stringValue = Integer.toString(someValue);
// Two
String stringValue = String.v... | <p>tested it for 10m assignments of the number 10</p>
<pre><code>One:
real 0m5.610s
user 0m5.098s
sys 0m0.220s
Two:
real 0m6.216s
user 0m5.700s
sys 0m0.213s
Three:
real 0m12.986s
user 0m11.767s
sys 0m0.489s
</code></pre>
<p>One seems to win</p>
<p>Edit:
JVM is standard '/usr/bin/java'... |
Variable variables in PHP and URL functions <p>Here's a piece of code:</p>
<pre><code>$obj = new myClass();
$obj->{$_GET["func"]}($_GET["param"])
</code></pre>
<p>It works based on variable variables, but I don't really understand how.
As far as I know, variable variables are used for stuff like this:</p>
<pre><c... | <pre><code>$obj->{$_GET["func"]}($_GET["param"])
</code></pre>
<p>Simply calls the method whose name is stored in $_GET["func"], and pass as a parameter $_GET["param"]. </p>
<p>The parentheses serve to disambiguate the method name (you also use parentheses in strings for similar purposes, e.g. <code>echo "calling ... |
Is using .h as a header for a c++ file wrong? <p>Is using .h as a header for a c++ file wrong?</p>
<p>I see it all over the place, especially with code written in the "C style".
I noticed that Emacs always selects C highlighting style for a .h header, but c++ for hpp or hh. </p>
<p>Is it actually "wrong" to label yo... | <p>nothing wrong with that. This is the default with Microsoft Visual C++.</p>
<p>Just follow the standard you like, and stick with it.</p>
|
I have to integrate an existing asp.net web app into another page by using jquery's load() method <p>I'm a bit stumped...</p>
<p>I have to integrate an existing, simple asp.net web forms app including postbacks etc. into another external site with a jquery load() call., an app that was intended to be integrated throug... | <p>First of all you should note that the <code>load()</code> function, like all ajax, can only work on the same domain. So if the 'external site' is on another domain ajax is the wrong choice. </p>
<p>It does sounds like a lot of hard work, depending on the complexity of the page. Postbacks can occur in many places - ... |
cleanup php session files <p>On my website I use PHP sessions. Session information is stored in files in my ./session path. After a few months I discovered that these session files are never deleted, by now there are 145.000 of them in this directory. </p>
<p>How should these be cleaned up? Do I have to do it program... | <p>To handle session properly, take a look at <a href="http://ar.php.net/manual/en/session.configuration.php">http://ar.php.net/manual/en/session.configuration.php</a>.</p>
<p>There you'll find these variables:</p>
<ul>
<li>session.gc_probability</li>
<li>session.gc_divisor</li>
<li>session.gc_maxlifetime</li>
</ul>
... |
Can I have an 'offscreen' control? <p>I'm trying to create a <code>DataGridView</code> cell class which hosts a control (all the time, not just while editing). So far, my approach has been to add the control to the grid and try to synchronise its position with that of the cell.</p>
<p>Would it be possible instead to ... | <p>You can create a control without adding it to the form, then using it as the Cell editor whenever you need to. Usually with grids, when you click on a cell to edit it, it's going to either create a new control and put it in the right place, or it's going to use an existing control. You can make this process a lot ... |
Modify value of a Django form field during clean() <p>I am adding custom validation to my forms and custom fields in my Django app. I would like to be able to modify the value of a field when triggering an error. For example, if there is an error, the form should be redisplayed with the field value corrected by clean()... | <p>change self data in the clean method to change the value which gets displayed</p>
|
ServiceTracker in OSGi r4.1 <p>Im using a <code>org.osgi.util.tracker.ServiceTracker</code> (PrintableServiceTracker implements ServiceTrackerCustomizer and simply prints when a new service is added).</p>
<pre><code>Filter filter = bc.createFilter("(objectClass=se.enea.print.Printable)");
tracker = new Servi... | <p>Not sure what pseudo registration means, but the method addingService in PrintableServiceTracker will be called not only for new services but also for existing services. </p>
|
c# wcf - exception thrown when calling open() on proxy class <p>I have the following problem, basically i have a WCF service which operates fine in small tests. However when i attempt a batch/load test i get an <code>InvalidOperationException</code> with the message when the open() method is called on the proxy class:<... | <p>How are you using proxy? Creating new proxy object for each call. Add some code regarding how you use proxy. </p>
<p>Desired way of using proxy is for each call you create new proxy and dispose it once completed. You are calling proxy.open() for opened proxy that is wrong. It should be just called once.</p>
<p>Try... |
browserCaps in an External Config File <p>The BrowserCaps setting is rather quite long. Is there a way to factor it into an external config file.</p>
<p>does anyone know the markup?</p>
| <ol>
<li><p>Create a new web.config file in your project and call it browserCaps.config</p></li>
<li><p>Paste the XML of the latest browserCaps (<a href="http://owenbrady.net/browsercaps/CodeProject.xml" rel="nofollow">http://owenbrady.net/browsercaps/CodeProject.xml</a>) into this new file.</p></li>
<li><p>In the exis... |
ColSpan for Silverlight Datagrid <p>I have a need to customize a Datagrid, for a TimeManagement system, using rowspawns.
My desired look is something like:</p>
<pre><code>Customers| Projects | Tasks | Moanday | Tuesday | Wednesday | Thursday | Friday |
| | Task 1 | 0 | 0 | 0 | ... | <p>Take a look at the "RowDetailsTemplate" in the DataGrid. It's a section that can be expanded beneath a row. Inside the RowDetailsTemplate you can add whatever you need, such as a grid or even a datagrid. Set the RowDetailsVisibilityMode attribute to Visible, and it will always be shown.</p>
<p>Good luck.</p>
... |
Programmatically detecting Release/Debug mode (.NET) <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/629674">How to find out if a .NET assembly was compiled with the TRACE or DEBUG flag</a> </p>
</blockquote>
<blockquote>
<p><strong>Possible Duplicate:</str... | <pre><code>Boolean isDebugMode = false;
#if DEBUG
isDebugMode = true;
#endif
</code></pre>
<p>If you want to program different behavior between debug and release builds you should do it like this:</p>
<pre><code>#if DEBUG
int[] data = new int[] {1, 2, 3, 4};
#else
int[] data = GetInputData();
#endif
int sum ... |
excel macro to change unformatted text data to correctly-typed data <p>I'm populating an excel sheet from DTS, but the resulting output is formatted as text since DTS sees the cells as varchar(255). I'm planning on adding a macro that will format the values correctly as numeric or datetime. What VBA would I use for thi... | <p>Seems you can just assign the value of a cell or range to itself and that lets Excel determine the datatype. You can do this a row at a time, eg: </p>
<pre><code>Worksheets("MySheet").Range("A:A").Value
= Worksheets("MySheet").Range("A:A").Value
</code></pre>
|
Is there a Java Collection (or similar) that behaves like an auto-id SQL table? <p>Note that I'm not actually doing anything with a database here, so ORM tools are probably not what I'm looking for.</p>
<p>I want to have some containers that each hold a number of objects, with all objects in one container being of the... | <p>None of the Collections classes will do what you need. You'll have to write your own!</p>
<p>P.S. You'll also need to decide whether your class will be thread-safe or not.</p>
<p>P.P.S. <a href="http://download.oracle.com/javase/1,5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html" rel="nofollow">Concurrent... |
multiquoted string in .rc2 file, VC++ <p>I was building a VC++ project and i happened to have data some thing like inside Resources.rc2 file</p>
<p>"My data contains "multiple quoted string" and also symbols like "<" ">" "\""</p>
<p>It seems Quotes and <, >, and \ are needed to be escaped.</p>
<p>I'm getting e... | <p>Without knowing more about your RC file, try: </p>
<p><a href="http://msdn.microsoft.com/en-us/library/k2z28y0f%28VS.71%29.aspx" rel="nofollow">Resource Compiler Error RC2104</a></p>
|
Is there any preferable way to get user/group information from an Active Directory domain in Python? <p>For a Django application that I'm working on, I wanted to allow group membership to be determined by Active Directory group. After a while of digging through the pywin32 documentation, I came up with this:</p>
<pre... | <p>AD's LDAP interface has quite a few 'quirks' that make it more difficult to use than it might appear on the surface, and it tends to lag significantly behind on features. When I worked with it, I mostly dealt with authentication, but it's probably the same no matter what you're doing. There's a lot of weirdness in... |
How can I prevent page-break in CFDocument from occuring in middle of content? <p>I am generating a PDF file dynamically from html/css using the cfdocument tag. There are blocks of content that I don't want to span multiple pages.</p>
<p>After some searching I found that the style "page-break-inside" is supported acco... | <p>Not an ideal solution, but I've forced page breaks before blocks that need to be kept together. Use page-break-before to trigger a page break before the block.</p>
<p>I don't think there is a way to specifically forbid breaking within (that is honored by the PDF engine).</p>
|
Help Creating a Style for a ListBoxItem <p>I am new to styles and need help to create a style for a ListBoxItem that will give the item a transparent background then have the Font turn Gold when hovered over. It should not change the color when clicked and return to normal when the mouse moves off. It must still pass... | <p>Unfortunately changing <code>BorderBrush</code> for the <code>ListBoxItem</code> won't have your desired effect, since the <code>Border</code> with the selection highlight is internal to the <code>ControlTemplate</code> of the <code>ListBoxItem</code>.</p>
<p>Instead, you can add a new <code>Brush</code> resource w... |
Running SSIS packages in separate memory allocations or increasing the default buffer size? <p>I have a SSIS package that has a child package that is failing. The error message isn't very helpful.</p>
<blockquote>
<p>The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020</p>
</blockq... | <p>How much memory is allocated to SQL Server?
How much memory is allocated outside of the SQL Server process space? </p>
<p>The reason I ask is becuase SSIS memory is allocated from the memToLeave area of memory that sits outside of the SQL Server process space.</p>
<p>See <a href="http://www.johnsansom.com/index.p... |
GIS Draw a parabola flight path in kml for google earth <p>I have to display flight paths on google earth and (still I got the exact flight plan path) want to show in a parabola way (markting side). From the taking off to the landing points.
Basically I'm looking for the math formula to calculate latlng point with alti... | <p>Maybe I'm wrong about this, but if I remember my physics right, and if the distance between the two points is relatively small compared to the earth's radius, aside from altitude, the path will just follow a <a href="http://en.wikipedia.org/wiki/Great%5Fcircle" rel="nofollow">great circle</a>.</p>
<p>If you write t... |
How to update and order by using ms sql <p>Ideally I want to do this:</p>
<pre><code>UPDATE TOP (10) messages SET status=10 WHERE status=0 ORDER BY priority DESC;
</code></pre>
<p>In English: I want to get the top 10 available (status=0) messages from the DB and lock them (status=10). A message with a higher priority... | <pre><code>WITH q AS
(
SELECT TOP 10 *
FROM messages
WHERE status = 0
ORDER BY
priority DESC
)
UPDATE q
SET status = 10
</code></pre>
|
Sending Rich Text Format email using Outlook 2003 <p>I am trying to send a Rich Text Format email message using Outlook 2003.
The following code results the RTF HTML source code to be dumped into the mail message body.</p>
<p>What should I do in order to fix that, and make Outlook display the formatted data and not th... | <p>If you must use RTF, you will need to convert your HTML to RTF format. Check out the <a href="http://pypi.python.org/pypi/zopyx.convert/1.1.9" rel="nofollow">zopyx package</a>.</p>
<p>To use HTML, change the line:</p>
<pre><code>mainMsg.Body = RTFTEMPLATE % (subject,body)
</code></pre>
<p>to:</p>
<pre><code>main... |
WCF Service invoking - without any reference added <p>I want to invoke a wcf service for testing on the http layer. I do not want to add a service reference and create a proxy and invoke. I want to create a new web test(VSTS) which sends a http request to the service and posts(Http post) the request in http body as an ... | <p>Well, you will have to create proxy - either statically by adding a service reference or running svcutil on your service metadata, or you can construct it dynamically totally in code, if you wish.</p>
<p>In that case, you'd have to have your service contract (ISomethingService) at hand, and check out the <a href="h... |
RFCs for content-type header? <p>I've looked @ <a href="http://www.faqs.org/rfcs/rfc2231.html" rel="nofollow">rfc 2231</a> and <a href="http://www.faqs.org/rfcs/rfc2183.html" rel="nofollow">2183</a>.
Dealing with a multipart/related mime payload.</p>
<p>I'm trying to decypher if the following is syntactically correct,... | <p>From <a href="http://www.ietf.org/rfc/rfc2387.txt" rel="nofollow"><strong>RFC 2387</strong> (The MIME Multipart/Related Content-type)</a>:</p>
<blockquote>
<p><strong>3.2. The Start Parameter</strong></p>
<p>The <code>start</code> parameter, if given, is the <code>content-ID</code> of the compound object's ... |
silverlight button does not stretch? <p>I have the below xaml markup, the button does not seen to stretch across the screen instead its left aligned. It is contained in a stack panel. What am I doing wrong here?</p>
<pre><code> <Grid>
<ListBox Name="SideNavBar">
<ListBox.ItemTemplate>
... | <p>It illogical for a StackPanel to stretch because it's job is to place each child control in a row or a column, side by side.</p>
<p>I think the same thinking applies to ListBox, but I'm unable to confirm at the moment.</p>
|
dynamic load data from xml to drop down box with jquery <p>I took over a small web application. I am learning JQuery so I like to rewrite the current java script with JQuery. Here is what I have
1. the xml file as following</p>
<pre><code><courses>
<course title="math">
<time>1:00pm<... | <p>This should get you started:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
var course_data; // variable to hold data in once it is loaded
$.get('courses.xml', function(data) { // get the courses.xml file
course_data = data; // save the data for future use
... |
How do I copy files to another directory using MSBuild? <p>I'm trying to copy several files in the $(TargetDir) to another folder (e.g. C:\BinCache), but for whatever reason I cannot get MSBuild to stop complaining.</p>
<pre><code> <Target Name="AfterBuild">
<Copy SourceFiles="$(TargetDir)\*.*"
... | <p>SourceFiles needs to be an Item list</p>
<p>you'll need something like</p>
<pre><code><Target Name="AfterBuild">
<ItemGroup>
<SourceFiles Include="$(TargetDir)\*.*" />
</ItemGroup>
<Copy SourceFiles="@(SourceFiles)" DestinationFolder="C:\BinCache" />
</Target>
</code... |
How do I force Visual Studio 2008 to use an Open instance when double clicking a file? <p>Certain non-project files that I use Visual studio for (.build, .xml, free-roaming html and css files) are already associated with visual studio and open in it when i double click them. </p>
<p>How can I get them to open in an e... | <p>Ok Richard helped point me in the right direction a bit, but I think I found exactly what I want.</p>
<ol>
<li>from an explorer window, go to Tools->Folder Options->File Types tab</li>
<li>find the extension you wish to change.</li>
<li>If there is a restore button click it.</li>
<li>Click Advanced</li>
<li>Click N... |
JQuery/WCF without ASP.NET AJAX: <p>I am proper struggling getting that "magic" moment when WCF is configured nicely and jQuery is structuring its requests/understanding responses nicely.</p>
<p>I have a service:</p>
<pre><code><%@ ServiceHost Language="C#" Debug="true" Service="xxx.yyy.WCF.Data.ClientBroker" Fact... | <p>At first glance there are three problems with your code:</p>
<p>1: you should use the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx" rel="nofollow">ServiceKnownTypeAttribute</a> to specify known types when exposing only base types in your operation contracts:</p... |
WPF WinForms Interop issue with Enable / Disable <p>I have a WinForms usercontrol hosting a WPF custom Listbox in it. After the WinForms user control gets disabled and then re-enabled the WPF control in the WinForms usercontrol is unresponsive. Has anyone else experienced this?</p>
<p>We had to hack a soultion into ... | <p>A co-worker (thanks KwB) of mine managed to find a fix for this issue: <a href="http://support.microsoft.com/kb/955753">http://support.microsoft.com/kb/955753</a> </p>
<p>It involves inheriting from ElementHost and manually telling the window region to enable:</p>
<pre><code>public class MyElementHost : ElementHos... |
Database history for client usage <p>I'm trying to figure out what would be the best way to have a history on a database, to track any Insert/Delete/Update that is done. The history data will need to be coded into the front-end since it will be used by the users. Creating "history tables" (a copy of each table used t... | <p>I have used very successfully a model where every table has an audit copy - the same table with a few additional fields (time stamp, user id, operation type), and 3 triggers on the first table for insert/update/delete.<br />
I think this is a very good way of handling this, because tables and triggers can be generat... |
Passing a smart pointer as argument inside a class: scoped_ptr or shared_ptr? <p>I have a class that creates an object inside one public method. The object is private and not visible to the users of the class. This method then calls other <strong>private</strong> methods inside the same class and pass the created objec... | <p>One further possibility is to create the object as a static_ptr for ease of memory management, but just pass the raw pointer to the other private methods:</p>
<pre><code>void privateMethod1(Foo *fooObj);
void showSomethingOnTheScreen() {
scoped_ptr<Foo> fooObj(new Foo);
privateMethod1(fooObj.get());
};
<... |
NHibernate fetch="join" mapping attribute does not appear to work <p>Mapping a dictionary with NH. Declaration is as follows:</p>
<pre><code><hibernate-mapping ...
<map
name="CostsByRole"
table="JobAccountingSnapshotCosts"
lazy="false"
fetch="join"
access="nosetter.camelcase-unde... | <p>HQL queries do not consider the values set for fetch in the mapping. You need to specify them exclusively in each HQL query. Its supposedly by design. The fetch attributes value is used only by Criteria queries and by Load/Get. </p>
|
How to configure IPython to use gvim on Windows? <p>This really looks like something I should be able to find on Google, but for some reason I can't make heads or tails of it. There's the EDITOR environment variable, the ipy_user_conf.py file, the ipythonrc file, some weird thing about running gvim in server mode and a... | <p>Setting the EDITOR environment variable to 'gvim -f' seems to work.</p>
<pre><code>set EDITOR=gvim -f
</code></pre>
|
Need help displaying xml as html <p>I'm trying to use the Macromedia XSLTransform class to convert XML returned from Amazon Web Services to HTML. Here's the PHP page that calls the transform:</p>
<pre><code><?php
require_once('includes/MM_XSLTransform/MM_XSLTransform.class.php');
$restquery = "http://ecs.amazonaw... | <p>You need to create a rule to match "/" or XSL will implicitly generate one for you based on a to-text conversion of the document tree.</p>
<p>I would rewrite the XSL to this:</p>
<pre><code><xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:aws="http://webservices.amaz... |
How can I execute a PHP script from Java? <p>I have a php script which is executed over a URL.
(e.g. www.something.com/myscript?param=xy)</p>
<p>When this script is executed in a browser it gives a coded result, a negative or positive number.</p>
<p>I want to execute this script from Java code(J2EE) and store that re... | <p>If your J2EE app is deployed on the same server the PHP script is on, you can also execute it directly through as an independent process like this:</p>
<pre><code> public String execPHP(String scriptName, String param) {
try {
String line;
StringBuilder output = new StringBuilder();
Process p... |
How to program a RPG game in C++ with SDL? <p>I want to know how to program a 2D RPG game in C++ with SDL. </p>
<p>I have searched, but was unable to find anything good. Many of the articles were too basic and didn't delve into anything practical. Can anyone help give me some articles, free books or other resources so... | <p>Do you have examples of articles that are too simple?</p>
<p>Are these too simple: <a href="http://www.devshed.com/c/a/Multimedia/Game-Programming-using-SDL-Getting-Started/">devshed</a> or <a href="http://gpwiki.org/index.php/C:SDL%5Ftutorials">gpwiki</a> ?</p>
<p>You might consider studying the topics separately... |
In Sql Server, how to convert binary strings to binary? <p>I have some data in string format that represents binary data (e.g. '0x0002'). Is there some function or trick where I can convert these from literal strings to binary? That is, I want '0x0002' to become 0x0002, and SELECT CAST('0x0002' AS BINARY(20)) obvious... | <p><a href="http://support.microsoft.com/kb/104829" rel="nofollow">Older code, SQL 7, sp_hexadecimal</a></p>
<p><a href="http://decipherinfosys.wordpress.com/2008/06/11/converting-a-hex-string-to-a-varbinary-or-vice-versa/" rel="nofollow">SQL 2005 (+ 2000 maybe), master.dbo.fn_varbintohexstr</a></p>
<p><a href="http:... |
Is OpenID necessarily a good choice for eCommerce? <p>As a Single Sign-On implementation, I think OpenID is great. Even so, is it necessarily a good choice for eCommerce? I know it can be used, but should it? Are you risking too much in putting all of one's access details in a single basket? </p>
<p>What's the gen... | <p>When I worked for a large eCommerce company, the company looked at OpenID.
Don't get upset by this, but the company rejected OpenID because they didn't like some of the clunkyness of the implementation, and they found that it actually reduced signup rates, when run through sample user community testing (the user com... |
Share a .NET Membership Database with SharePoint? <p>We have an FBA SharePoint implementation using a .NET Membership database. We would like to use this same database and collection of users for a new application. Has anyone tried this? I know in theory that it should work, but SharePoint can be finicky.</p>
| <p>I would normally worry a bit too, but it is similar to worrying if Sharepoint shares Active Directory well with another .NET application.</p>
|
Looking for a creational design pattern <p>I'm trying to find a design pattern I can use to simplify the construction of some objects.</p>
<p>Based on an incoming parameter, an custom class, I'm going to create various inheritors from the System.Windows.Forms.Control class.</p>
<p>For instance, if the custom class ha... | <p>The <a href="http://en.wikipedia.org/wiki/Factory%5Fmethod%5Fpattern" rel="nofollow">factory pattern</a></p>
|
ProgressBar not updating on change to Maximum through binding <pre><code><ProgressBar Foreground="Red"
Background="Transparent"
Value="{Binding NumFailed, Mode=OneWay}"
Minimum="0"
Maximum="{Binding NumTubes, Mode=OneWay, Converter={x:Static wpftools:DebuggingConve... | <p>It looks like the bar size is calculated in the private method <code>ProgressBar.SetProgressBarIndicatorLength</code>. It's only called from <code>OnValueChanged</code>, <code>OnTrackSizeChanged</code>, and <code>OnIsIndeterminateChanged</code>.</p>
<p>You could call <code>SetProgressBarIndicatorLength</code> thro... |
How could I get the bits from a string in c#? <p>If I had the following string "Blue Box", how could I get the bits that make up the string in c# and what datatype would I store it in.</p>
<p>If I do just the letter "o", I get 111 as the bytes and 111 as the bits. Is it chopping off the 0's and if I do "oo", I get 11... | <p>You could do the following:</p>
<pre><code>byte[] bytes = System.Text.UTF8Encoding.Default.GetBytes("Blue Box");
BitArray bits = new System.Collections.BitArray(bytes);
</code></pre>
|
How to create a "Processing" page? <p>Can someone tell me how to create to a "Please Wait" page. When the pageload is complete, the default.aspx page shows up. Is there a way to do that? I do not want processing images or anything like that. The actual page would be what I would want.</p>
| <p>I wrote a detailed blog post about this a while back. The good news is it is detailed. The bad news is it is very old. It is before AJAX, though it uses JavaScript and touches on some of the things that have made AJAX big.</p>
<p>Also, it is for preventing users from clicking "Order" twice and thus causing a double... |
Where can I find a .NET datagrid that performs updates and inserts out of the box? <p>Is there a built-in grid that I could do the following simply:</p>
<pre><code>SELECT * FROM MYTABLE
</code></pre>
<p>It would list all the rows, with paging support.</p>
<p>Allow me to update/delete/insert a row by double clicking ... | <p>Take a look at the <a href="http://quickstarts.asp.net/QuickStartv20/aspnet/" rel="nofollow">ASP.NET QuickStart Tutorials</a>. There's a tutorial on how to use the <code>GridView</code> for the purposes of adding data:</p>
<blockquote>
<p><a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/g... |
Why does T-SQL OpenXML bust with certain characters? <p>I have the following XML that I'm running in SQL Server, and it breaks, why?</p>
<pre><code> declare @xml varchar(max)
declare @hDoc int
set @xml = '<transaction>
<item itemId="1" value="Hello World" />
<item itemId="2" value="Hello &World... | <p>The values in the XML contain invalid characters. For XML in general you must escape the less than sign and the ampersand like so: &lt; and &amp;</p>
<pre><code> declare @xml varchar(max)
declare @hDoc int
set @xml = '<transaction>
<item itemId="1" value="Hello World" />
<item itemId="2... |
What is the best CASE tool for database development and why? <p>I know there are a large number of CASE tools out there, some better than others, but what are the ones used by those in the field, and why do you use those specific tools?</p>
<p>In this case, I am just interested in CASE tools for database design, and m... | <p>Hands down the best data modeling tool is <a href="http://www.ca.com/us/data-modeling.aspx" rel="nofollow">ERWin from CA</a>.</p>
<p>It's capable of quite a bit - logical and physical diagrams, multi-dimensional models, full forward and reverse engineering (i.e. generating a database from a diagram, and generating ... |
Can I get rows from SQLAlchemy that are plain arrays, rather than dictionaries? <p>I'm trying to optimize some Python code. The profiler tells me that SQLAlchemy's _get_col() is what's killing performance. The code looks something like this:</p>
<pre><code>lots_of_rows = get_lots_of_rows()
for row in lots_of_rows:
... | <p>Forgive the obvious answer, but why isn't row.x == row.y in your query? For example:</p>
<pre><code>mytable.select().where(mytable.c.x==mytable.c.y)
</code></pre>
<p>Should give you a huge performance boost. <a href="http://www.sqlalchemy.org/docs/05/sqlexpression.html#selecting" rel="nofollow">Read the rest of th... |
VMware Server 2 on Windows 2008 Server Core <p>I have an older server (retired database box in fact) that doesn't fit the requirements for VMware ESX/ESXi or Microsoft's Hyper-V but runs VMware Server 2 just fine. The host OS is currently Windows 2003 Standard. While it does the job just fine, I could hope for somethin... | <p>It won't work. This is answered on <a href="http://www.vmware.com/products/server/faqs.html" rel="nofollow">VMware's FAQ for VMware Server 2:</a></p>
<blockquote>
<p>Can I install VMware Server 2 on a
Core installation of Windows Server
2008 host operating system? </p>
<p><strong>No</strong>, VMware
Se... |
How does JIT compiling works for caching? <p>When you write an application in C#, and then run it, will it not be compiled again next time it's run, or everything that's used is gonna be recompiled every time the application starts up?</p>
<p>How does JIT compiling works for caching?</p>
| <p>For any DLL that is not in the ngen'd, every time you run the application, it will re-JIT the code that is used. There is no caching of the JIT code in between runs of the same non-ngen'd DLL. </p>
<p><strong>EDIT</strong> Cleared up a mistake with GAC and NGEN</p>
|
Create SQL Database from ADO.NET Typed Dataset <p>I have a DataSet defined and designed in visual studio.</p>
<p>Who knows of a tool to generate tables in SQL Server to match the dataset.</p>
| <p>Here's an article I found very very helpful in building a class to do just that.</p>
<p><a href="http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/4929a0a8-0137-45f6-86e8-d11e220048c3/" rel="nofollow">http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/4929a0a8-0137... |
Loading a lookup table from a database into a C# program - data structure? <p>I have a table full of id's,categories and weights that I need to reference in my program as I read in records that contain those categories. What is the most efficient method to read those from a database and put into a structure that I can ... | <p>Your best bet is to read in your table using a DataReader, and put each row into an object containing Category and Weight, then each object into a Dictionary.</p>
|
GAC vs JIT <p>Is everything under the GAC precompiled (ngened)? If so, then all of .NET is precompiled, so it's not possible for the CLR to optimize them at runtime?</p>
<p>Like if you use List in your application then CLR will not be able to optimize the List itself, but only how it's used in your app? Doesn't this d... | <p>No, the GAC is not automatically pre-JITted; however, GAC is a pre-requisite to pre-JIT. Actually, only a small minority of things are pre-JITted. Besides which - if the BCL was pre-JITted, then those optimisations <em>would have <strong>already</strong> been done</em> by NGEN, so the " losing all the potential opti... |
Implementation: How to retrieve and send emails for different Gmail accounts? <p>I need advice and how to got about setting up a simple service for my users. I would like to add a new feature where users can send and receive emails from their gmail account. I have seen this done several times and I know its possible.</... | <p>any library/source that works with imap or pop will work.</p>
|
What do you want an iPhone library to do for you? <p>I'm an undergraduate university student who also writes iPhone applications. Next year I'm expected to do a final project, something that lasts the full year and involves a fair bit of software engineering.</p>
<p>My original plan was to write an object-relational ... | <p>It's in the early stages, but a bunch of scientifically-minded Cocoa developers (headed by Drew McCormack) have joined together to start a BSD-licensed data charting / plotting / visualization framework called <a href="http://code.google.com/p/core-plot/" rel="nofollow">Core Plot</a> (mailing list <a href="http://gr... |
Print designers moving to web ... what do they need to know? <p>I'm trying to compile a guide for students used to publishing in print who are learning web design.</p>
<p>Some obvious things which web developers know but they don't:</p>
<ul>
<li>You can't rotate graphics in HTML</li>
<li>All objects have to be rectan... | <h3>web is not print</h3>
<ul>
<li>Layouts can be fluid.</li>
<li>elements don't have to be absolutely positioned</li>
<li>web pages need to be checked in several browsers for compatibility</li>
<li>avoid divitis; from experience people coming from print into this field do everything by brute force instead of trying t... |
How can I correctly close the application opened with using of Process? <p>I open the application using the Process class:</p>
<pre><code>System.Diagnostics.Process vsProc = new System.Diagnostics.Process();
vsProc.StartInfo.FileName = "program.exe";
vsProc.Start();
</code></pre>
<p>If I just kill it <code>vsProc.Kil... | <p>How to close a program 'correctly' depends 100% on the program you're dealing with. If you're the one writing the child program, you get to implement proper & sane behavior. If not, your best <b>general</b> bet is finding the application's main window and send it a close request... rather than terminating the pr... |
Disable context menu in Internet Explorer control <p>How do I disable the context menu in the IE <code>WebBrowser</code> control and instead perform custom handling of the right-click event in C#?</p>
| <p>Actually:</p>
<pre><code>WebBrowser browser;
browser.IsWebBrowserContextMenuEnabled = false;
</code></pre>
<p>This pretty much tells the WebBrowser that the right-click context menu is not welcome.</p>
|
How can I change source folders en masse in Wise Installation Studio? <p>I've got an existing Wise .wsi script that I would like to convert to using relative paths, but the problem is that it includes about 330 files and the only way I've found to fix the paths are to go into each file's Details and adjust the path man... | <p>The solution is to go to the Tools menu and select "Convert Source Paths". A dialog pops up that will allow you to convert paths to relative and specify that newly added files always use relative paths. The "Change All Paths to Relative" didn't work for me, but changing just folder paths at least took less time than... |
Is there any way to get readable gcc error and warning output at the command line? <p>For some long errors, the gcc output is dense and has lots of line-wrapping etc. Especially when errors are subtle, it can take me 10-30 seconds of squinting to parse it with my eyes.</p>
<p>I've taken to pasting this in an open cod... | <p>I've found <a href="http://schlueters.de/colorgcc.html">colorgcc</a> to be invaluable. By introducing coloring, it becomes much easier to mentally parse the text of gcc error messages, especially when templates are involved.</p>
|
Windows Workflow Delay Activity serialization errors <p>I have a state machine workflow hosted in SharePoint with a delay activity in one state. When the timer fires the delay activity, I get a serialization error: "Engine RunWorkflow: System.Runtime.Serialization.SerializationException: Cannot get the member 'SendEma... | <p>Restart the âwindows SharePoint timer serviceâ. Root cause was, whenever you have workflow that has got a delay activity, the event is fired by the service(SPTimerV3), before it fires, it has to load the assembly from its bin or from the GAC, only one file(module loads) based on the assembly information specifie... |
Why does "?b" mean 'b' in Ruby? <pre><code>"foo"[0] = ?b # "boo"
</code></pre>
<p>I was looking at the above example and trying to figure out:</p>
<ol>
<li>How "?b" implies the character 'b'?</li>
<li><p>Why is it necessary? - Couldn't I just write this:</p>
<p>"foo"[0] = 'b' # "boo"</p></li>
</ol>
| <blockquote>
<p>Ed Swangren: ? returns the character code of a
character.</p>
</blockquote>
<p>Not in Ruby 1.9. As of 1.9, <code>?a</code> returns 'a'. See here: <a href="http://dablog.rubypal.com/2009/1/16/son-of-10-things-to-be-aware-of-in-ruby-1-9" rel="nofollow">Son of 10 things to be aware of in Ruby 1.9!</a>... |
Do Poor Code Samples Turn You Away From Libraries? <p>I've been evaluating a framework that on paper looks great. The problem is that the sample code is incomplete and of poor quality. The supplied reference implementations are for the most part not meant to be used (so they can be considered as sample code as well) ... | <p>For me, it does. I tend to want to avoid libraries where the code samples are incomplete. If the library is open source, I will overlook it, since I can directly look at the code and see if the library's internals are reasonable, and I know that, if there is a problem someday, I could (if I had to) fix it.</p>
<p... |
Controller/Routing Errors with js, img files using a CommonServiceLocator ControllerFactory <p>I've set up an ASP.NET MVC RC2 application to use a custom controller factory backed by a CommonServiceLocator (using StructureMap). Routing to and instantiating controllers works fine, but for some reason I'm getting except... | <p>The problem was actually due to 404 errors- the path I was requesting for the static content didn't exist, and the base controller factory couldn't handle the request because there was nothing to deliver.</p>
|
Bind ASP.net object fails on test server, but not dev <p>I am getting the following error for an item in a GridView:
**A call to Bind was not well formatted. Please refer to documentation for the correct parameters to Bind.
** </p>
<pre><code><ItemTemplate>
<asp:LinkButton ID="lnkColumn" runat="server" ... | <p>At the risk of being rude: Is it worth double checking your database schema, looking for a missing field? Is anything different between your environments? Try using winmerge to compare your environments (its great!)</p>
<p>Another idea: comment out the 'bind' row, and replace it with these, to get a better idea wha... |
crystal report 9 <p>new page break is not working when exporting from Crystal report 9 using visual studio studio.net.
I have set the below options in crystal report 9 design </p>
<p>paper size is a3 and orientation is landscape.
I have created 2 report groups (date and org unit)
I want a page break after every new da... | <p>I said this in another <a href="http://stackoverflow.com/questions/570434/reportviewer-export-to-excel-adds-decimal-to-percentage-values-how-can-i-overrid/570507#570507">question</a> regarding exporting to Excel:</p>
<blockquote>
<p>If this was made with CR, I've found
that if a report is going to
consistentl... |
Capturing all the data that has changed during a Linux install <p>I am trying to figure out which files were changed when I run an app install via make install. I can look at the script, but that calls other scripts and may or may not touch other files, etc. How can I do this programmatically?</p>
| <p>Implementation: <a href="http://asic-linux.com.mx/~izto/checkinstall/" rel="nofollow">http://asic-linux.com.mx/~izto/checkinstall/</a></p>
<p>Several ways come to mind. First, use some sort of LD_PRELOAD to track all files opened. Second approach, compare filesystem before and after.</p>
|
How to install VeriSign's Intermediate CA Certificates? <p>I'm running tomcat on Solaris server and I would like to know how can install VeriSign's Intermediate CA certificates?</p>
<p>I have been struggling for days and keep having <em>keytool error: java.io.EOFException</em>
How do I solve it?</p>
| <p>You could try <a href="http://portecle.sourceforge.net" rel="nofollow">Portecle</a>. It's a graphical user interface to the java certificate management api.
Also you should make sure that the certificate does not contain unneccessary whitespaces.</p>
|
Not able to run SSIS PACKAGE by DOS commands <p>I want to run a SSIS package in command prompt...
for that i used the command
dtexec/f "C:/Filename.dtsx"...but when i executethis command i am getting an error like
"Product level is insufficient for the component "Data Conversion"...</p>
<p>but when i run the SSIS pac... | <p>See this post. <a href="http://blogs.msdn.com/michen/archive/2006/11/11/ssis-product-level-is-insufficient.aspx" rel="nofollow">ssis-product-level-is-insufficient</a></p>
|
Where can i get free GSM libraries/components for delphi or python? <p>Where can i get good free GSM libraries for <strong>Delphi</strong> or <strong>Python</strong>? Libraries i can use to send and receive sms's on my application?</p>
<p>Gath</p>
| <p>For free and open source <a href="http://sourceforge.net/projects/tpapro/" rel="nofollow">AsyncPro</a>></p>
<p>Not free but the components has active development <a href="http://www.deepsoftware.com/nrcomm" rel="nofollow">nrComm Lib</a></p>
<p>Another solution to use SMS gateway, such as <a href="http://www.clicka... |
What permissions are needed to deploy a report project in VS2005? <p>When I try to deploy reports to a newly installed SSRS 2005 server (remote server) I get the following error in VS2005:</p>
<p>The permissions granted to user 'CEINTERNAL\IUSR_COMPELLENT01' are insufficient for performing this operation. </p>
<p><b... | <p>Assign either the Admin or Publisher role to CEINTERNAL\IUSR_COMPELLENT01 to the root folder in the Report Manager hierarchy.</p>
<p>Hope this helps,</p>
<p>Bill</p>
|
Fastest way(s) to move the cursor on a terminal command line? <p>What is the best way to move around on a given very long command line in the terminal?</p>
<p>Say I used the arrow key or <kbd>Ctrl</kbd>-<kbd>R</kbd> to get this long command line:</p>
<pre><code>./cmd --option1 --option2 --option3 --option4 --option5 ... | <p>To be clear, you don't want a "fast way to move the cursor on a <strong>terminal</strong> command line".
What you actually want is a fast way to navigate over command line in you <strong>shell</strong> program.</p>
<p><a href="http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29">Bash</a> is very common shell, for ex... |
Query Unmapped Columns in NHibernate <p>I have a class that is mapped to a table using NHibernate. The problem is that only some of the properties are mapped to columns in the table. This is fine because the only columns we use for display are mapped, however I was wondering if there is any way to query against other c... | <p>Ayende Rahien posted an article which describes specifying <code>access="noop"</code> in the mapping to specify query-only properties. See <a href="http://ayende.com/Blog/archive/2009/06/10/nhibernate-ndash-query-only-properties.aspx">NHibernate â query only properties</a>. I have not tried this myself.</p>
|
Which is the "best" data access framework/approach for C# and .NET? <p>(EDIT: I made it a community wiki as it is more suited to a collaborative format.)</p>
<p>There are a plethora of ways to access SQL Server and other databases from .NET. All have their pros and cons and it will never be a simple question of which ... | <p>I think LINQ to SQL is good for projects targeted for SQL Server. </p>
<p>ADO.NET Entity Framework is better if we are targeting different databases. Currently I think a lot of providers are available for ADO.NET Entity Framework, Provider for PostgreSQL, MySQL, esql, Oracle and many other (check <a href="http://bl... |
Watin - how to test site with popup pages <p>I'm using WatiN (Web Application Testing in .Net) to do integration testing on a Dynamics CRM 4.0 website.
CRM uses a lot of popup windows - eg clicking on a Contact in a list opens a new browser window with the Contact's details.</p>
<p>I want to test:</p>
<ul>
<li>login ... | <pre><code>//after the click that opens the popup:
IE iepopup_1 = IE.AttachToIE(Find.ByUrl(theUrlOfThePopup));
//operate on iepopup_1
</code></pre>
|
Experiences with Javascript History Frameworks <p>I'm seeking a javascript history framework to handle navigation inside a page when the user selects multiple options which change the page behaviour.</p>
<p>There are multiple artefacts on the page that change the data loading of the page and I'd like to store this as ... | <p>I had the similar problem a while ago building a flash only site. We tried:</p>
<ul>
<li><a href="http://code.google.com/p/reallysimplehistory/" rel="nofollow">Really Simple History</a> (which had some problems in combination of safari and flash)</li>
<li><a href="http://extjs.com" rel="nofollow">ExtJS</a> which ha... |
Cumulative Plot with Given X-Axis <p>I have data that looks like this.
In which I want to plot accumulative value of dat1 with respect
to x-axis. Also plot it together with dat2.</p>
<pre><code>#x-axis dat1 dat2
-10 0.0140149 0.0140146
-9 0.00890835 0.00891768
-8 0.00672276 0... | <p>I think the function you are looking for is <code>cumsum()</code> which will do a cumulative sum on a vector. </p>
<pre><code>#put your data into 3 vectors
x<-c(-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10)
dat1<-c(0.0140149,0.00890835,0.00672276,0.00876399,0.00806879,0.0088366,0.00856872,0.0195384,0... |
Breakpoints cannot be set and have been disabled <p>If I add a breakpoint in a VC++ 6.0 project and then I start debugging, it displays this error message:</p>
<blockquote>
<p>One or more breakpoints cannot be set and have been disabled ,
Execution will stop at the beginning of the program</p>
</blockquote>
<p>an... | <p>Check :</p>
<ol>
<li><a href="http://www.tek-tips.com/viewthread.cfm?qid=326950" rel="nofollow">http://www.tek-tips.com/viewthread.cfm?qid=326950</a>]</li>
<li><a href="http://www.codeguru.com/forum/archive/index.php/t-118951.html" rel="nofollow">http://www.codeguru.com/forum/archive/index.php/t-118951.html</a></li... |
Java WebServiceException: Undefined port type with JBoss <p>I am new to Web Services with JBoss. A client is connecting to an EJB3 based Web Service
With JBoss AS 5 and JDK 6 using JAX-WS. I am stuck with the following exception:</p>
<pre><code>Exception in thread "main" javax.xml.ws.WebServiceException:
Undefined po... | <p>add endpointInterface in @WebSevice annotation, if you dont mention endpoint interface give fully qualified portname while using getPort method.</p>
|
How do I correctly create a Zend Feed? <p>I have successfully created a simple RSS feed, but entries keep coming back as unread and updated, and entries deleted from the client reappear everytime I ask mail to update the feed. </p>
<p>What am I doing wrong?</p>
<p>I use this simple function to create an rss feed:</p>... | <p>According to the Zend Framework Doc, you must use the <strong>lastUpdate</strong> parameter to set the last modification date of an entry.</p>
<pre><code> 'entries' => array(
array(
[...]
'lastUpdate' => 'timestamp of... |
Web services that take and return XML documents - why? <p>Are there benefits of writing a web service interface whose methods all take and return XML documents, rather than the more usual parameter lists of native types and classes?</p>
<p>We have some existing web services that are designed like this. The XML documen... | <p>If you absolutely know for sure what your end-user/client technology is (for example pure .NET and Java where the feature set is probably the richest) then by all means go ahead and take advantage of strongly typed interfaces where available. But if your client base is a mixed bag of Perl, PHP, ASP, Python etc, then... |
CMake : how to use bash command in CMakeLists.txt <p>I'm wondering how I can use bash command in CMakeLists.txt. What I want is to get the number of processor retrieved using :</p>
<pre><code>export variable=`getconf _NPROCESSORS_ONLN`
</code></pre>
<p>and set NB_PROCESSOR to variable using something like : </p>
<pr... | <p>This seems to do the trick, and saves the "set" too.</p>
<pre><code>execute_process(COMMAND getconf _NPROCESSORS_ONLN
OUTPUT_VARIABLE NB_PROCESSOR)
</code></pre>
|
How to compute precision and recall in clustering? <p>I am really confused how to compute precision and recall in clustering applications.</p>
<p>I have the following situation:</p>
<p>Given two sets A and B. By using a unique key for each element I can determine which of the elements of A and B match. I want to clus... | <p>I think you'll find wikipedia has a helpful <a href="http://en.wikipedia.org/wiki/Precision%5Fand%5Frecall">article on precision and recall</a>. In short:</p>
<p>Precision = true positives / (true positives + false positives)</p>
<p>Recall = true positives /( true positivies + false negatives)</p>
|
Should lookup tables be static <p>I have a Message class which parses text messages using lookup tables. I receive a lot of messages and create and destroy a lot of objects so I thought I declare those lookup tables as static members to prevent initializing the same tables with the same values again and again.</p>
<p>... | <p>If your message classes share lookup information that it may be worth abstracting your static lookups into a class of their own so that they really are only initialised once. </p>
<p>But regardless, static class members are definitely the way to go.</p>
|
Ant Flex problem <p>My Cairngorm program does some preliminary authentication against a RemoteObject before allowing Cairngorm's ServiceLocator to start using the same RemoteObject to get business data. Everything works fine with Flex Builder, but I need an Ant build. The Ant mxmlc task compiles everything ok, but at... | <p>It sounds like the ANT build might be missing the <em>-services</em> flag to compile in the <em>services-config.xml</em> file that configures the RemoteObject endpoints.</p>
<p>In FlexBuilder, look at the project properties and navigate to the Flex Compiler pane. You should see an "Additional Compiler Arguments" f... |
Output buffering in PHP? <p>I seem to be confused about PHP output buffering. I have code like this:</p>
<pre><code>function return_json($obj) {
ob_get_clean();
ob_start();
header("Content-Type: application/json");
echo json_encode($obj);
exit;
}
</code></pre>
<p>But it doesn't seem to like the ob_get_clean... | <p>To use ob_get_clean (), you have to be sure, that at some point you have ob_start ()'ed earlier. Otherwise, thereâs no buffer to clean, everything is already flushed to the user agent.</p>
|
Perl, LibXML and Schemas <p>I have an example Perl script which I am trying to load and validate a file against a schema, them interrogate various nodes. </p>
<pre><code>#!/usr/bin/env perl
use strict;
use warnings;
use XML::LibXML;
my $filename = 'source.xml';
my $xml_schema = XML::LibXML::Schema->new(location=&g... | <p>From the <a href="http://search.cpan.org/perldoc?XML::LibXML::Node" rel="nofollow">XML::LibXML docs</a>:</p>
<blockquote>
<p>A common mistake about XPath is to
assume that node tests consisting of
an element name with no prefix match
elements in the default namespace.
This assumption is wrong - by XPath
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.