input
stringlengths
51
42.3k
output
stringlengths
18
55k
iPhone URL Request: Add value to HTTP header field <p>I'm trying to add a value to the header for a URL request. </p> <p>Something like this works just fine:</p> <pre><code>[urlRequest addValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; </code></pre> <p>But this doesn't even show up in the header:</p> <pre><co...
<h2>The true problem.</h2> <p>The string I was pulling from NSUserDefaults already had a line ending. When set as a header, another <code>\r\n</code> is appended, which apparently isn't valid. Thus, the header wouldn't appear in any outgoing packets.</p> <h2>The fix:</h2> <p>Use this to trim off the characters befor...
Autoscale Font in a TextBox Control so that its as big as possible and still fits in text area bounds <p>I need a TextBox or some type of Multi-Line Label control which will automatically adjust the font-size to make it as large as possible and yet have the entire message fit inside the bounds of the text area.</p> <p...
<p>I haven't seen an existing control to do this, but you can do it the hard way by using a RichTextBox and the TextRenderer's MeasureText method and repeatedly resizing the font. It's inefficient, but it works.</p> <p>This function is an event handler for the 'TextChanged' event on a RichTextBox.</p> <p>An issue I'v...
How to programatically add a tracepoint for Visual Studio? <p>I am looking for a method to monitor a running program that I have the source code. Basically, when the user runs it, I need to know what functions and parameter is called sequentially. </p> <p>I can write a trace output code to all functions to achieve thi...
<p>You should cast your breakpoints to EnvDTE80.Breakpoint2. Then you'll be able to use</p> <pre><code>breakpoint.BreakWhenHit = false; breakpoint.Macro = "YourMacro"; </code></pre>
Law Of Demeter on Factory Pattern and Dependency Injection <p>hello all I have a question regarding dependency injection.</p> <p>say i want to create a class call it, WebGetTask</p> <p>WebGetTask would need a dependency to HttpService</p> <p>bad code 1 Code:</p> <pre><code>private HttpService httpService; ... L...
<p>I'm going to assume that the code you have shown is part of a DownloadManager class, and that you inject your dependencies via the constructor. In this case, I would expect the start-up code which glues everything together to look like this:</p> <pre><code>IHttpService httpService = new HttpService(); IWebGetTaskFa...
Based on your experience, how many of you would recommend fluent NHibernate over Nhibernate way of doing things for my new project? <p>I just want to do a quick poll to see if Fluent Nhibernate is well received or if it is having lot of issues. I like Nhibernate but I definitely see the problem with xml to do mapping. ...
<p>I like Fluent NHibernate and I think it's mature enough if you are going to start a new project. Using it on a new project should allow the Fluent NHibernate project to continue to mature as yours progresses. There is a possibility for breaking changes (as happened recently with the convention mappings) but you shou...
fstream replace portion of a file <p>When I do</p> <pre><code>fstream someFile("something.dat", ios::binary|ios::out); someFile.seekp(someLocation, ios::beg); someFile.write(someData, 100); </code></pre> <p>It seems to replace the entire file with those 100 bytes instead of replacing only the appropriate 100 bytes, a...
<p>AFAIR ios::out only specifies the file is for output and ios:binary only specifies the files is binary. The default behaviour for a stream is to create a new file and overwrite the old file. If you want to modify an existing file you must open the file with the ios::app flag.</p> <p>ATM I cannot check my references...
Whats the most efficient method for transitioning between two images (Like Mac wallpaper change) <p>I'm working on a wallpaper application. Wallpapers are changed every few minutes as specified by the user.</p> <p>The feature I want is to fade in a new image while fading out the old image. Anyone who has a mac may s...
<p>Sounds like an issue of trade-off.</p> <p>It depends on the emphasis:</p> <ul> <li>Speed of rendering</li> <li>Use of resources</li> </ul> <p>Speed of rendering is going to be an issue of how long the process of the blending images is going to take to render to a screen-drawable image. If the blending process tak...
Why do SQL statements take so long when "limited"? <p>consider the following pgSQL statement:</p> <pre><code>SELECT DISTINCT some_field FROM some_table WHERE some_field LIKE 'text%' LIMIT 10; </code></pre> <p>Consider also, that some_table consists of several million records, and that some_field has a b-tree...
<p>You have a DISTINCT. This means that to find 10 distinct rows, it's necessary to scan all rows that match the predicate until 10 <em>different</em> some_fields are found.</p> <p>Depending on your indices, the query optimizer may decide that scanning all rows is the best way to do this.</p> <p>10 distinct rows coul...
Using SendMessage for Simulating User Mouse Clicks <p>I need to use SendMessage fro simulating user clicks in a target program as SendMessage blocks until the event that it triggers is finished processing. The reason for this is that this blocking gives opportunity to detect if any dialogs have opened up as a result o...
<p>Unfortunately, this page on <a href="http://msdn.microsoft.com/en-us/library/ms997537.aspx" rel="nofollow">win32 hooks</a> says</p> <blockquote> <p>Simulate mouse and keyboard input (WH_JOURNALPLAYBACK). Hooks provide the only reliable way to simulate these activities. If you try to simulate these events by sendi...
When to close WCF client? <p>I've put an instance of the client proxy for the WCF service into a property on the App class so I can get it from anywhere in the app. </p> <p>I am not closing the client, I'm leaving it open for the duration of the app. The main reason for this is that if I were to follow the // Comment ...
<p>You should close it as advised. And yes, if you're using the async methods then you have to close it only after the call completes.</p> <p>Creating (opening) and closing clients is the norm for WCF clients. There is no noticeable performance penalty for continuously creating and closing new clients.</p>
iPhone/Xcode: can different project targets have different bundle identifiers? <p>I'm a little confused how this works - this is my understanding:</p> <ul> <li>A target's provisioning profile is linked to a specific app ID</li> <li>The bundle identifier for a target is found under <strong>Target info\Properies\Identif...
<p>There isn't a precedence, the properties dialog is just serving as another way for you to see your Info.plist.</p> <p>To share the plist between the targets but have different identifiers, make sure that the "Expand Build Settings in Info.plist File" option is enabled for both targets. Then, for each target, make a...
Auto comment all public members in a file <p>I have turned on warnings as errors and now i need to XML comment all of my public methods.</p> <p>just to get my program compiling, i just want to put placeholders for now.</p> <p>Is there anyway to automatically add XML comments to all of the public members in a class or...
<p>You could turn off the specific warning for the lack of comments with <a href="http://msdn.microsoft.com/en-us/library/7f28x9z3%28VS.80%29.aspx" rel="nofollow">/nowarn</a>.</p>
TSQL Return Guid that occurs the most in a column <p>If I have a table with two columns, e.g. Name, and ID, where ID is GUID's, how do I return the Guid value from Column 2 that occurs the most?</p>
<p>Untested:</p> <pre><code>SELECT TOP 1 ID, COUNT(*) AS CountOfRows FROM UnknownTable GROUP BY ID ORDER BY CountOfRows DESC </code></pre>
Django: How can I identify the calling view from a template? <p><strong>Short version:</strong></p> <p>Is there a simple, built-in way to identify the calling view in a Django template, without passing extra context variables?</p> <p><strong>Long (original) version:</strong></p> <p>One of my Django apps has several ...
<p>Since Django 1.5, the <code>url_name</code> is accessible using:</p> <pre><code>request.resolver_match.url_name </code></pre> <p>Before that, you can use a Middleware for that :</p> <pre><code>from django.core.urlresolvers import resolve class ViewNameMiddleware(object): def process_view(self, request, vie...
How to round floats to integers while preserving their sum? <p>Let's say I have an array of floating point numbers, in sorted (let's say ascending) order, whose sum is known to be an integer <code>N</code>. I want to "round" these numbers to integers while leaving their sum unchanged. In other words, I'm looking for an...
<p>One option you could try is "cascade rounding".</p> <p>For this algorithm you keep track of two running totals: one of floating point numbers so far, and one of the integers so far. To get the next integer you add the next fp number to your running total, round the running total, then subtract the integer running ...
DataExport to Excel Error <p>Hi I am trying Export data to excel sheet from GridView but having this error.</p> <p>RegisterForEventValidation can only be called during Render();</p> <p>Here is my code</p> <pre><code> Dim attachment As String attachment = "attachment; filename=Contacts.xls" Res...
<p>You can do this in the web.config file but in this case the eventValidation will be turned off for all the pages.</p> <p></p> <p>or you can do this in the Page directive which will turn off the validation for a single page.</p> <p>&lt;%@ Page Language="C#" EnableEventValidation = "false" AutoEventWireup="true"</p...
svn stumbling blocks <p>I face a few problems when I use svn. Here is a list</p> <ul> <li>at some point in time, all my commands like svn commit, svn add, etc worked, but I did something so that none of them would work without running them as root user (sudo). what specific actions would cause this, and how to fix it?...
<p>It seems like you have at least 2 different users <strong>updating</strong> the same working copy:</p> <ul> <li>www-data:www-data (web user)</li> <li>your own user</li> </ul> <p>That's a problem. You could use root (i.e. sudo) for all svn operations - it isn't clean, but will work.</p>
writing logic to store data in Mysql to store Metadata of Files <p>Lemme explain the scenario: I need to fetch all the Metadata of Files, i.e., Title, author, subject.. and Custom Attributes.( Custom attributes are not fixed, they are not fixed and can be of any numbers).</p> <p>Now to Store this Struvture I have Desi...
<p>You need an external program in some programming language to do these things. A database is to store data, not a general purpose programming language like Java, Python or C.</p>
Is GC.SuppressFinalize guaranteed? <p>My observation in practice has been that <a href="http://msdn.microsoft.com/en-us/library/system.gc.suppressfinalize.aspx" rel="nofollow"><code>GC.SuppressFinalize</code></a> does not always suppress the call to the finalizer. It could be that the finalizer gets called nontheless. ...
<p>One oddity you <em>may</em> be seeing is that the finalizer can still run even while an instance method is still running, so long as that instance method doesn't use any variables later on. So in your sample code, the <code>Dispose</code> method doesn't use any instance variables after the first line. The instance c...
Module name scopes in routing <p>I have an intranet application with several modules, I want them to separate when routing. For example:</p> <pre><code> http://intranet/calendar/... http://intranet/site_admin/... http://intranet/tasks/... </code></pre> <p>Each of module can have many or single controller. How to wr...
<p>You can try using namespaces:</p> <pre><code>map.namespace :calendar do |calendar| calendar.resources :first_controller calendar.resources :second_controller end </code></pre> <p>And so on. Very often people put admin part of application in admin namespace (look <a href="http://stackoverflow.com/questions/1191...
Create List<int> with values at compile time <p>It is possible to create an array at compile time like;</p> <pre><code>int[] myValues = new int[] { 1, 2, 3 } ; </code></pre> <p>But I would like to do something like this;</p> <pre><code>List&lt;int&gt; myValues = new List&lt;int&gt;() { 1, 2, 3 }; </code></pre> <p>T...
<pre><code>List&lt;int&gt; myValues = new List&lt;int&gt;(new int[] { 1, 2, 3 } ); </code></pre> <p>This will create an intermediate array however so there may be a more efficient way of doing the same thing.</p> <p>EDIT:</p> <p>John Feminella suggested creating a factory method to accept a list of parameters and re...
Is there a 'NotImplementedAttribute' in .NET? <h3>Duplicate</h3> <blockquote> <p><a href="http://stackoverflow.com/questions/154109/custom-compiler-warnings">Custom Compiler Warnings in .NET</a></p> </blockquote> <p>I'd like to be able to tag my code with a <code>NotImplementedAttribute</code> and have the compiler...
<p>This has been discussed here:</p> <p><a href="http://stackoverflow.com/questions/154109/custom-compiler-warnings">http://stackoverflow.com/questions/154109/custom-compiler-warnings</a></p>
Is there any ready to use module for test feedback for web applications? <p>I want to implement test feedback in my web application in the following manner - when a user with testing privileges logs in, every page in the web app will open small feedback window and dock it to the corner. Testers can use this window to d...
<blockquote> <p>Talking about ASP.NET, I envision this as a class that inherits Page, implementing defaults. To enable testing you inherit from this class. After the testing is complete you could disable the entire thing by inheriting from Page again...</p> </blockquote> <p>Although it's an interesting i...
How to calculate "views"? <p>What is a reasonable, efficient, and fair method to calculate page views?</p> <p>For example, how does Stack Overflow compute question views? I thought that Stack Overflow computes views per registered user. However, <a href="http://stackoverflow.com/questions/184618/what-is-the-best-comm...
<p>With a black-box approach, I'd imagine that it is a similar approach to things like Flickr, which would count a view as a request per session (which would inherently be "per user" as well), but ignore views by the content creator.</p>
Globally catch exceptions in a WPF application? <p>We are having a WPF application where parts of it may throw exceptions at runtime. I'd like to globally catch any unhandled exception and log them, but otherwise continue program execution as if nothing happened (kinda like VB's <code>On Error Resume Next</code>).</p> ...
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.application.dispatcherunhandledexception.aspx"><code>Application.DispatcherUnhandledException Event</code></a>. See <a href="http://stackoverflow.com/questions/1472498/wpf-global-exception-handler">this question</a> for a summary (see <a href="...
Database Reporting Services in Django or Python <p>I am wondering if there are any django based, or even Python Based Reporting Services ala JasperReports or SQL Server Reporting Services?</p> <p>Basically, I would love to be able to create reports, send them out as emails as CSV or HTML or PDF without having to code ...
<p>"I would love to be able to create reports ... without having to code the reports" </p> <p>So would I. Sadly, however, each report seems to be unique and require custom code.</p> <p>From Django model to CSV is easy. Start there with a few of your reports.</p> <pre><code>import csv from myApp.models import This...
XML-documentation for a namespace <p>Would you write xml-doc for a namespace? And if yes, how and where?</p> <p>I would think, if it is possible, maybe an almost empty file like this:</p> <pre><code>/// &lt;summary&gt; /// This namespace contains stuff /// &lt;/summary&gt; namespace Some.Namespace { } </code></pre> ...
<p>NDoc supports this by recognising a special <code>NamespaceDoc</code> class located in each namespace, and using the documentation from that. I haven't tried it, but Sandcastle appears to support the same trick.</p> <p><strong>Edit:</strong> For example:</p> <pre><code>namespace Some.Namespace { /// &lt;summar...
retrieve bounding box of a geodjango multipolygon object <p>How can I get the bounding box of a MultiPolygon object in geodjango? Can't find anything in the API <a href="http://geodjango.org/docs/geos.html" rel="nofollow">http://geodjango.org/docs/geos.html</a> ...</p>
<p>Use the <code>extent</code> property: <a href="http://geodjango.org/docs/geos.html#extent">http://geodjango.org/docs/geos.html#extent</a>. It returns a 4-tuple comprising the lower left and upper right coordinates, respectively.</p> <p>You can also use the <code>envelope</code> property if you want a <code>Polygon...
segmented control in iPhone application <p>I've put UIsegment Control in my IPhone application.To load the pages I've this function - (void) segmentSelected:(id)segmentedCntl{ NSLog(@"Selected Segment Index = %d", [segmentedCntl selectedSegmentIndex]); int index = [segmentedCntl selectedSegmentIndex];</p> <pr...
<p>Namastey saikamesh</p> <p>Please check proper u'r UISegmentControl property setting it will be working.</p>
Why are DataContext and ItemsSource not redundant? <p>In WPF Databinding, I understand that you have <strong><code>DataContext</code></strong> which tells an element what data it is going to bind to and <strong><code>ItemsSource</code></strong> which "does the binding". </p> <p>But e.g. in this simple example it doesn...
<p><code>DataContext</code> is just a handy way to pick up a context for bindings for the cases where an explicit source isn't specified. It is inherited, which makes it possible to do this:</p> <pre><code>&lt;StackPanel DataContext="{StaticResource Data}"&gt; &lt;ListBox ItemsSource="{Binding Customers}"/&gt; ...
Adding fields to the List Forms - Sharepoint <p>I'm looking to add a new field onto my NewForm.aspx, EditForm.aspx and DispForm.aspx pages in Sharepoint Designer 2007. I've managed to add a new textbox webpart and have edited the Common Textbox Tasks to make the Data Field my new field (Contacts..)</p> <p>But how do I...
<p>It doesn't count as "development", but wouldn't creating a new List column, Site Column or Content Type add this additional field to all your list forms just fine? How does this not work in your particular case?</p>
What is the most annoying thing about the revision control system (SCM) you use? <p>This question is <em>not</em> asking what revision control software I should use. Rather, I would like to hear what you think are the downsides of some of the SCMs you've used.</p> <p>Websites and marketing material only highlight the ...
<p>In my last two jobs I have been required to use <a href="http://www-01.ibm.com/software/awdtools/clearcase/">IBM's Rational ClearCase</a> and counting the ways in which this deficient and frustrating package saps my will to live on a daily basis would take me at least a week. Off the top of my head my main complaint...
My linq-query doesn't work when adding the xmlns-attribute to the root-element in my XML-document <p>I'm trying to get more into LINQ-to-XML, so I've made myself a neat little example XML-document to try things out on. In addition, I tried (and successfully) made my own XML-schema for that file, just to test things out...
<p>When you're searching by descendants and element, you need to specify the namespace. This is pretty easy with LINQ to XML. It looks like you were nearly there, but didn't do it for the elements:</p> <pre><code>XDocument xmlDoc = XDocument.Load(currentDir + "\\Cars.xml"); // I don't think namespace URIs are really r...
iPhone UITextField: how to insert new line by the return key? <p>I want to get a carriage return/new line by hitting the return key on an UITextField's keyboard. I've found out, that textFieldShouldReturn gets called.</p> <p>But how do I insert a carriage return in the text field?</p>
<p>You want to use a UITextView instead. UITextFields are meant for single line input whereas UITextViews support multi-line input.</p>
CompilerParameters.ReferencedAssemblies -- Add reference to System.Web.UI.WebControls <p>I am compiling classes at run-time using the <code>CodeDomProvider</code> class. This works fine for classes only using the <code>System</code> namespace:</p> <pre><code>using System; public class Test { public String HelloWo...
<p>You can loop through all the currently loaded assemblies:</p> <pre><code>var assemblies = AppDomain.CurrentDomain .GetAssemblies() .Where(a =&gt; !a.IsDynamic) .Select(a =&gt; a.Location); cp.ReferencedAssemblies.AddRange(assemb...
Unable to understand a line in .bashrc <p>I found the following code in <a href="http://www.pixelbeat.org/settings/.bashrc" rel="nofollow">someone's .bashrc</a></p> <pre><code># Source global definitions [ -f /etc/bashrc ] &amp;&amp; . /etc/bashrc </code></pre> <p>It apparently caused my Bash duplicate a lot.</p> <...
<p>It checks for existence of file /etc/bashrc and executes it if the check is successful. The dot command is an alias for 'source' command.</p>
For TFS 2008 Team Build, how do I change where $Temp points to? <p>We have recently built a new TFS 2008 Team Build server. I don't want users putting their builds in the default temp directory that is pointed to by $Temp for the Build Agent, but I also don't want to force developers to change the path to somewhere els...
<p>The $Temp value is the value of the Temp environment variable for the user that the build agent process is running as. You could change the temp location for the build user - however that might not be what you want as that is a setting you will have to do to the build users environment, not just localized to the bu...
.NET guidelines: Why exception for two-letter acronyms? <p>Microsofts Framework Design Guidelines define, among other things, the following:</p> <blockquote> <p>"Do capitalize both characters of two-character acronyms, except the first first word of a camel-cased identifier"</p> </blockquote> <p>So there is an ex...
<p>They're saying that if the first part of an identifier is camel-cased, you should keep it camel-cased rather than capitalizing it just because it's an acronym. That's because it's more important for you to be able to tell that, for example (and this is right out of the book in question, which I love by the way), you...
Zend_Mail reading Mail <p>The documentation for sending mails with Zend_Mail is great but receiving mails is a pain right now. I currently want to get the plaintext part and the html part of the email. Right now I have writen a long function which goes through the parts and then looks at the headers and look at it whet...
<p>AFAIK, MIME emails have no standard for the order of the different parts (HTML, plaintext, embeds). Therefore you do have to iterate over all parts and get the parts you need. </p> <p>But because the structure of Zend_Mail is recursive iterating should be pretty easy. Maybe you can share your code with us so we can...
building timezone feature in PHP web application <p>This is almost similar question to this one: -</p> <p><a href="http://stackoverflow.com/questions/346770/dealing-with-timezones-in-php">http://stackoverflow.com/questions/346770/dealing-with-timezones-in-php</a></p> <p>I read that thread, and have some more issues, ...
<p>When faced with this exact issue, I found <a href="http://www.unicode.org/cldr/data/docs/design/formatting/zone%5Flog.html#windows%5Fids" rel="nofollow">this reference</a>, which maps the succinct, Windows-style timezone list to a subset of the ridiculously exhaustive Unix-style timezone list. </p> <p>Users are pr...
"Hello World" - The TDD way? <p>Well I have been thinking about this for a while, ever since I was introduced to TDD. Which would be the best way to build a "Hello World" application ? which would print "Hello World" on the console - using Test Driven Development.</p> <p>What would my Tests look like ? and Around wha...
<p>You need to hide the Console behind a interface. (This could be considered to be useful anyway)</p> <p><strong>Write a Test</strong></p> <pre><code>[TestMethod] public void HelloWorld_WritesHelloWorldToConsole() { // Arrange IConsole consoleMock = MockRepository.CreateMock&lt;IConsole&gt;(); // primitive in...
Algorithm for deleting one element in an single linked list with O(1) complexity <p>I'm a student of computer science in Germany. My professor gave use the following question to think about:</p> <p>'Given a reference to a node in a single linked list (which is not the last node). Give an algorithm to delete this eleme...
<p>It depends on whether or not the nodes are mutable (in value).</p> <p>There <em>is</em> a way of doing it, if you can do what you like with the nodes:</p> <pre><code>toDelete.value = toDelete.next.value toDelete.next = toDelete.next.next </code></pre> <p>All the information from <code>toDelete</code> has now been...
Getting file names with scriptaculous <p>I am looking to create basically an image rotator with scriptaculous. The trick is I want to use the images that are in a certain directory to drive the rotations. </p> <p>For Example if there are 3 files in the directory then it rotates with 3 images, 5 it will rotate five i...
<p>Scriptaculous is simply a JavaScript library. Being JavaScript means it cannot access the filesystem. You'll need some server-side code to do this and integrate the list of files into JavaScript as a string or JSON.</p> <p>Something like:</p> <pre><code>imgList="a.gif,b.gif,c.gif".split(",") </code></pre> <p>......
Cannot post successfully if not using cassini for JQuery posts in ASP.NET MVC <p>When i set my project to start app using Visual Studio Development server (Cassini:Port) my JQuery posts properly to the following URL</p> <p>"SomeController/SomeMethod".</p> <p>When i use localhost to run with the following URLS, it doe...
<p>Try using Url.Action to map the URLs so that they are correct no matter what the virtual root.</p> <pre><code>$.post( '&lt;%= Url.Action( "SomeMethod", "SomeController" ) %&gt;' data, function() { ...callback.. }, 'json' ); </code></pre> <p>If this still doesn't work, then we'll probably ne...
Entity/value object selection <p>In domain driven design, it is common knowledge that an object with an identity is an entity. For example, any person will have several forms of identity (name, etc).</p> <p>But value objects are those objects with no identity. One common value object is address, however address has no...
<p>I think you have the concepts of the distinction between entities and value types correct as they are understood within domain driven design (though I am far from an expert in this matter - perhaps better to say you match my understanding of these concepts). However I would advise against using this as a deciding me...
Good Zend Framework example apps to learn from <p>Do you know of any open-source Zend Framework applications besides Magento that show in a good OOP-way how to develop big apps with Zend Framework?</p> <p>My problem right now is, that I'm pretty good at PHP and OOP, but I don't have enough knowledge of the Zend Framew...
<p>Have a look at:</p> <ul> <li>JotBug (from 2009): <a href="http://www.ohloh.net/p/jotbug" rel="nofollow">http://www.ohloh.net/p/jotbug</a> (<a href="http://akrabat.com/wp-content/uploads/jotbug.zip" rel="nofollow">zip file of code</a>)</li> <li>Pastebin: <a href="http://github.com/weierophinney/pastebin/" rel="nofol...
I have PHP running on Google App Engine - How do I use a DB? <p>I followed <a href="http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/" rel="nofollow">PHP on the Google appengine</a> to setup and it works great. Any suggestions on how to use a database / datastore with PHP on GAE?</p>
<p>Because Google provides low-level access to the datastore in Java API</p> <p><a href="http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html" rel="nofollow">http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/package-summary.html<...
text-align syntax for sifr? <p>I'm having trouble finding usage/syntax for the text-align feature of sifr. This feature goes inside the flashvars parameter correct? So would it be something like:</p> <p>sIFR.replace(fontname, { selector: 'h1', wmode: 'transparent', flashvars: 'textalign=center' });</p> <p>I tri...
<p>Apparently you only need to edit the all.css file. <a href="http://www.coffeecup.com/help/articles/how-do-i-change-the-text-alignment/" rel="nofollow">Here's</a> someone talking about this.</p> <p>If you don't want to change the css styling of a root element, then you can specify what CSS selection you are applying...
are they adding copy_if to c++0x? <p>It's very annoying that <code>copy_if</code> is not in C++. Does anyone know if it will be in C++0x?</p>
<p>Since the C++0x is not yet finalized, you can only take a look at the most recent <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2857.pdf" rel="nofollow">draft</a>.</p>
Link tables issue for Compiled Access (mde) file <p>I have an old compiled Access Application <code>mde</code> file. This application has linked tables to network shared folder. I tried to upgrade main database using upsizing wizard on main database and everything went well. Then when the application starts it gives er...
<p>Many questions:</p> <ol> <li><p>do you have the source MDB file? I can't recall if creating an MDE fails if the linked tables are not correctly connected. In any event, should you end up needing to alter the app, you're going to need the source MDB file.</p></li> <li><p>the error message you report should give the ...
Excel sum with relative positions <p>How do I sum from whats in B2 to C2 ?</p> <p>B2 = A10 or just 10 (preferred)<br /> C2 = A25 or just 25 (preferred)</p> <p>Normally you would just use SUM(A10:A25), but the values in B2 and C2 are not fixed, they change based on input. I can use MATCH to find the numbers, but how d...
<p>You can use the INDIRECT function for this, e.g.</p> <pre><code>=SUM(INDIRECT(B2):INDIRECT(C2)) </code></pre> <p>if you can live with entering the entire cell name (A10, A25).</p> <p>Or to just have the numbers in B2 and C2, you could use</p> <pre><code>=SUM(INDIRECT(ADDRESS(B2;1)):INDIRECT(ADDRESS(C2;1))) </co...
Update all bindings in UserControl at once <p>I need to update all the bindings on my UserControl when its visibility changes to Visible. Pretty much all my bindings are bound to the DataContext property of the user control so I'm trying to update the target of that binding:</p> <pre><code>BindingOperations.GetBinding...
<p>Well, you <em>could</em> just re-assign the <code>DataContext</code>:</p> <pre><code>var dataContext = DataContext; DataContext = null; DataContext = dataContext; </code></pre> <p>FYI, resetting the property to its value (i.e.<code>DataContext = DataContext</code>) won't work.</p>
What is lisp used for today and where do you think it's going? <p>Never been a <em>lisp</em> user, so don't take me as too dense while reading this. However;</p> <ul> <li>What is lisp used for today?</li> </ul> <p>I know there are several variants of the language in existence, at least one which will keep it alive co...
<p>The Lisp dialect Clojure seems to be growing in popularity - you might ask out at <a href="http://clojure.org/">http://clojure.org/</a> in one of the forums to see what real-world apps people are building with it.</p>
How to create ASP.NET user/server control that uses a list of asp:ListItem as child controls? <p>I am looking to create a user/server control that will be created with something like the following:</p> <pre><code>&lt;my:MyListControl runat="server"&gt; &lt;asp:ListItem Text="Test1" Value="Test1" /&gt; &lt;asp:Li...
<p>You can add a property on a user control's code behind like:</p> <pre><code>[PersistenceMode(PersistenceMode.InnerProperty)] public List&lt;ListItem&gt; Items { get; set; } </code></pre> <p>Your markup would then be:</p> <pre><code>&lt;my:MyListControl runat="server"&gt; &lt;Items&gt; &lt;asp:ListIt...
SQL Pivot for foreign key column <p>I have a table like so: Fiscal Year, Region, Country, Office1, Office2, Office3, Office4</p> <p>Where office 1-4 are foreign keys.</p> <p>I would like to get output like so: Office 1: Fiscal Year, Region, Country Office 2: Fiscal Year, Region, Country Office 3: Fiscal Year, Region,...
<p>That's more like UNPIVOT I think:</p> <pre><code>SELECT [Fiscal Year], Region, County, OFfice FROM (SELECT [Fiscal Year], Region, County, OFfice1, Office2, Office3, Office4 FROM unpvt) p UNPIVOT (yourtable FOR Office IN (Office1, Office2, Office3, Office4) ) AS unpvt; </code></pre> <p>But you can ...
cakephp and get requests <p>How does cakephp handle a get request? For instance, how would it handle a request like this... <a href="http://us.mc01g.mail.yahoo.com/mc/welcome?.gx=1&amp;.rand=9553121_pg=showFolder&amp;fid=Inbox&amp;order=down&amp;tt=1732&amp;pSize=20&amp;.rand=425311406&amp;.jsrand=3" rel="nofollow">htt...
<p>Also note that you could use named parameters as of Cake 1.2. Named parameters are in key:value order, so the url <a href="http://somesite.com/controller/action/key1:value1/key2:value2" rel="nofollow">http://somesite.com/controller/action/key1:value1/key2:value2</a> would give a a $this->params['named'] array( 'key...
Visual Studio Debugging/Building <p>I have a solution that has a plain old asp.net website and a winforms app.</p> <p>I have the winforms app set as my startup application.</p> <p>When I press (CTRL+)F5, it just runs the app without building. So, my changes aren't built into the program.</p> <p>What should I do to f...
<p>I had to go into the properties for my solution and select the projects that I want to include during builds.</p>
Propagating data among view controllers <p>I've got a table view controller. Some of the rows of the table open new controllers to let the user enter more data or use pickers, etc. It's just like the built-in Calendar app. When the user taps "Save" on the second screen, I want the value from that screen to propagate ba...
<p>Many of Apple's frameworks support the MVC (Model View Controller) design pattern. The controller (UITableViewController in this case) orchestrates acquisition of the data for handoff to the view (a UITableView in this case). To take full advantage of this pattern your data should come from a Model object. This is a...
what is asp's Request.ServerVariables("AUTH_USER") jsp equivalent? <p>well, on a IIS web site with integrated windows authentication and no anonymous access, I can retrieve the logon username of the user, something like like domain\user...</p> <p>is it possible to achieve this with jsp on tomcat? (or any other contain...
<p>You can use request.getHeader("AUTH_USER") or even request.getUserPrincipal() . This kind of information is independent from the language, it is a browser/server issue.</p>
In Flash: gotoAndStop and nested MovieClip issues <p>This is kind of an odd question, I hope this enough information to go on:</p> <p>In the flash IDE, I have a MovieClip that has 3 frames. In each frame, I have a series of TextFields. It's a poor mans viewstack basically - so here's the issue - in FP10 I can write ...
<p>Yes, it has changed. This <em>was</em> possible in as2 but disappeared in as3, taking much of the simplicity of shorter timeline scripts with it. So, it was reinstated in FP10. I've read a blog post by someone at adobe about this, but i can't find it right now. </p>
Does Index of Array Exist <p>I've inherited some code at work that has a really bad smell. I'm hoping to find the most painless solution possible.</p> <p>Is there a way to check if some arbitrary number is a valid element in an array?</p> <p>Example - I need to check if array[25] exists.</p> <p>Preferably I would p...
<p>Test the length</p> <pre><code>int index = 25; if(index &lt; array.Length) { //it exists } </code></pre>
Java Cross Hatching Texture <p>Any know how to recreate a cross hashing texture in Java? The C# code belows shows how to accomplish this for the .NET framework. The Java snippet is close, but I've been unable to correctly rotate the lines by 45 degrees.</p> <p>C#</p> <pre><code>HatchBrush crossHatch = new Hat...
<p>Here's one that should cross-hatch at 5-pixel intervals:</p> <pre><code>BufferedImage bufferedImage = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = bufferedImage.createGraphics(); g2.setColor(backColor); g2.fillRect(0, 0, 5, 5); g2.setColor(stripeColor); g2.drawLine(0, 0, 5, 5); // ...
CSS 100% height + header with static height; <p>I am building a layout which includes a header, which is 40 px in height. Underneath this header a SWF resides that should take up the rest of the available space.</p> <p>The best solution untill now has been working with a table, giving the first row 40px height and the...
<p>Try setting your header as static. So it floats over the main body, and set the main body to 100% height. Then give the body a 40px padding on the top.</p>
Algorithm for suggesting products <p>What's a good algorithm for suggesting things that someone might like based on their previous choices? (e.g. as popularised by Amazon to suggest books, and used in services like iRate Radio or YAPE where you get suggestions by rating items)</p>
<p><strong>Simple and straightforward (order cart):</strong></p> <p>Keep a list of transactions in terms of what items were ordered together. For instance when someone buys a camcorder on Amazon, they also buy media for recording at the same time.</p> <p>When deciding what is "suggested" on a given product page, loo...
TFS user can't view history <p>I have a very strange situation.... After migrating from StarTeam to TFS (using TimlyMigration == awesome) there is one oddity.</p> <p>When I look at any given file in the Source Control view, I see all the history that was migrated. However if anybody else on the project looks at the f...
<p>Does the history include any renames/moves? TFS permissions are based on paths, so if people don't have rights to the "old" path then they won't see the history entries before the move.</p>
SQL Tuning <p>How do we insert data about 2 million rows into a oracle database table where we have many indexes on it? I know that one option is disabling index and then inserting the data. Can anyone tell me what r the other options? </p>
<p>bulk load with presorted data in index key order </p>
Common design by obfuscation practices? <p>What are some common practices you have seen used in the design by obfuscation crowd? I find it interesting to be on projects that are not allowed to be rewritten while, that would be the faster and most efficient solution to the problem.</p>
<p>My favorites always revolve around variables...leaving ones in the code that are no longer used, then giving them all meaningless names. Of course, you have to be careful to avoid nearly all convention if you really want to obfuscate. So, a perfect one would be to have two similarly used variables, one named myVar1,...
Retrieving cached data from existing Crystal Reports file <p>Is there any way to retrieve the cached data from a previously refreshed report and say, dump it to a file? Basically, I'm looking for the dataset that is being used by the report, and hand-dragging each field onto the canvas or even exporting the file doesn...
<p>there is a setting in the file menu option to 'save data with report' and if you export that data, you will get the report formatted data (ie certain fields; formula return results, etc) however it will be only in the report object itself. what are you missing if you export that data? It seems you should see it al...
Parameter missing a value <p>I am new to reporting services and have a reporting services 2005 report that I am working on to use as a base report template for our organization. I am trying to place the date that the report was last modified on the report server into the page header of the report. However, I keep gett...
<p>If I understand what you're doing, it sounds like you want to be using a field where you're implementing a parameter...</p> <p>You are returning the ModDate from the data source, correct? If you're doing this, you can simply throw a text box in there, and use something like this: =Fields!modDate.Value to display it...
Java is NEVER pass-by-reference, right?...right? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/40480/is-java-pass-by-reference">Is Java “pass-by-reference”?</a> </p> </blockquote> <p>I found an unusual Java method today:</p> <pre><code>private void add...
<p>As Rytmis said, Java passes references by value. What this means is that you can legitimately call mutating methods on the parameters of a method, but you cannot reassign them and expect the value to propagate.</p> <p>Example:</p> <pre><code>private void goodChangeDog(Dog dog) { dog.setColor(Color.BLACK); // w...
sharepoint public form <p>I have a MOSS 2007 running a site that has a public facing form that any anonymous user can fill and save. But I require that only blank forms are visible to anonymous user and that the forms filled up by other users are not visible/accesible to anonymous users.</p> <p>For that I have a form ...
<p>You can create simple workflow that move new document from public document library to protected one. Or you can email enable document library to get filled form as attachment to protected document library. <br> Here free workshop on with videos, detailed descriptions of the development environment etc. on how to b...
How to perform common post-initialization tasks in inherited Python classes? <p>The initialization process of group of classes that share a common parent can be divided into three parts: common part1, class-specific part, common part2. Currently the first two parts are called from the __init__ function of each child cl...
<p>Template Method Design Pattern to the rescue:</p> <pre><code>class BaseClass: def __init__(self, specifics=None): print 'base __init__' self.common1() if specifics is not None: specifics() self.finalizeInitialization() def common1(self): print 'common 1' ...
Interactive polygon editing with Microsoft Virtual Earth <p>Does Virtual Earth have any kind of built-in support for interactive polygon editing? Something like Google Maps' polygon.enableEditing() would be ideal.</p>
<p>There are a few example of how to do this posted at the following link:</p> <p><a href="http://garzilla.net/vemaps/" rel="nofollow">http://garzilla.net/vemaps/</a></p>
Best Squid Logfile Analysis Tool <p>I have recently been tasked with installing and configuring Squid Proxy server for filtering and monitoring our internal wireless network. I posted recently <a href="http://stackoverflow.com/questions/682099/best-squid-administrators-guidebook">requesting guidance</a> in selecting a ...
<p>calamaris is a good analyzer...</p>
Curses Window in Linux Causing Abort <p>I have some legacy C code that I recently compiled on Linux. On the original HPUX the application opens and closes multiple curses windows. On the Linux box it can handle one window, but if I close that window, it crashes the program with an error message of "Aborted". Any ide...
<p>Yes. Change your options with <em>ulimit(1)</em> so when it aborts you save a core dump. Then look at the core dump with <em>gdb(1)</em> to find out where it's aborting and get back to us.</p>
Reverse Engineering: How do I identify an unknown compression method? <p>I'm with a group of modders attempting to reverse engineer and mod a Blu-Ray player. We're stuck because the firmware code seems to be compressed, and the decompression code is nowhere to be found. Presumably, the decompression is handled by hardw...
<p>I would recommend looking at the hardware, and seeing if that support any native encryption or compression schemes. I note encryption because such a string is possible as well; for example the Nintendo DS uses RSA encryption that I would presume is handled at a hardware level to some degree, though don't quote me o...
How to compare value of 2 fields in Django QuerySet? <p>I have a django model like this:</p> <pre><code>class Player(models.Model): name = models.CharField() batting = models.IntegerField() bowling = models.IntegerField() </code></pre> <p>What would be the Django QuerySet equivalent of the following SQL?<...
<p>In django 1.1 you can do the following:</p> <pre><code>players = Player.objects.filter(batting__gt=F('bowling')) </code></pre> <p>See the <a href="http://stackoverflow.com/questions/433294/column-comparison-in-django-queries">other question</a> for details</p>
Google Wildcard Operator (*) <p>I am using the google ajax rest api and I'd like to get local results by prefix. For example: I type in "sta" and I get "starbucks". </p> <p>I wonder if there is a documented or undocumented wildcard operator that that allows you to find results that <em>start</em> with a string. </p> ...
<p>What you're looking for is a Google Suggest API for the local search. Given that there seems to be no official Google Suggest API, you aren't likely to find one for the local search. However, there are plenty of products (including Firefox and the Google Toolbar) that make use of Google Suggest, so the methods they ...
Nested use of C# Object Initializers <p>so, object initializers are all kinds of handy - especially if you're doing linq, where they're downright necessary - but I can't quite figure out this one:</p> <pre><code>public class Class1 { public Class2 instance; } public class Class2 { public Class1 parent; } </code...
<blockquote> <p>can I simply not make nested references using object initializers?</p> </blockquote> <p>You are right - you cannot. There would be a cycle; A requires B for initialization but B requires A before. To be precise - you can of course make nested object initializers but not with circular dependencies.</p...
How to deserialize an object persisted in a db now when the object has different serialVersionUID <p>My client has an oracle data base and an object was persisted as a blob field via objOutStream.writeObject, the object now has a different <code>serialVersionUID</code> (even though the object has no change, maybe diffe...
<p>Jorge I found one solution on <a href="http://forums.sun.com/thread.jspa?threadID=518416">http://forums.sun.com/thread.jspa?threadID=518416</a> which works.</p> <p>Create the below class in your project. Whereever you creating object of ObjectInputStream, use DecompressibleInputStream instead and it deserializes th...
legacy linker (uses libc5) fails on linux kernel 2.6.25 <p>We have a legacy linker that uses libc5, and due to several factors we only have the binary and not the source. Yes, version control would have saved us from our current problem... that is now in use for our full tool chain and product line, but this particular...
<p>It does not answer your question exactly, but in your situation, I would create a chroot with a known-to-work libc + libstdc++ combination, or even kernel+libc+libstdc++ (in which case you need a virtual machine, obviously). This way, you can try things relatively easily, without disrupting anything else.</p> <p>Th...
Correlate one set of vectors to another in numpy? <p>Let's say I have a set of vectors (readings from sensor 1, readings from sensor 2, readings from sensor 3 -- indexed first by timestamp and then by sensor id) that I'd like to correlate to a separate set of vectors (temperature, humidity, etc -- also all indexed firs...
<p>The simplest thing that I could find was using the scipy.stats package</p> <pre><code>In [8]: x Out[8]: array([[ 0. , 0. , 0. ], [-1. , 0. , -1. ], [-2. , 0. , -2. ], [-3. , 0. , -3. ], [-4. , 0.1, -4. ]]) In [9]: y Out[9]: array([[0. , 0. ], [1. , 0. ], [2. , 0. ],...
Change highlight color <p>jQuery's highlight method will highlight any div with a yellow background.</p> <p>How do I specify what color to use instead of yellow for highlight?</p>
<p>According to the <a href="http://docs.jquery.com/UI/Effects/Highlight">documentation</a>:</p> <pre><code>$(this).effect("highlight", {color: 'blue'}, 3000); </code></pre>
regex: matching same expression unknown number of times <p>With the help of some of the guys here I have some regex to match strings in quotes that aren't in brackets:</p> <pre><code>"one" - matches ("two") - doesn't match </code></pre> <p>Is it possible to repeat the match so the input:</p> <pre><code>"one" ("two")...
<p>You need the <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.matches.aspx" rel="nofollow"><code>Regex.Matches()</code></a> function which returns all of the substrings that match the regex.</p>
Open a pop up window maximumize to the user's screen configuration <p>What is best way to open a pop up window maximized to the user's screen configuration? I am using C# ASP.NET 3.5 web site project.</p> <p><b>Update:</b></p> <p>@Anthony - The windows xp task bar covers up some of the browser window. How do I set ...
<p>Use javascript to run </p> <p><code>var newWindow = window.open(); newWindow.resizeTo(screen.width, screen.height);</code></p> <p>Obviously, you need to use the appropriate parameters to the <code>window.open()</code> statement.</p> <p><a href="http://www.boutell.com/newfaq/creating/maximize.html" rel="nofollow">...
True until disproven or false until proven? <p>I've noticed something about my coding that is slightly undefined. Say we have a two dimension array, a matrix or a table and we are looking through it to check if a property is true for every row or nested dimension.</p> <p>Say I have a boolean flag that is to be used to...
<p>Depends on which one dumps you out of the loop first, IMHO.</p> <p>For example, with an OR situation, I'd default to false, and as soon as you get a TRUE, return the result, otherwise return the default as the loop falls through.</p> <p>For an AND situation, I'd do the opposite.</p>
F# and ADO.NET to Connect To Access 2007 <p>I am very new to F#, and I was trying to find the simplest way to connect to Access 2007 using System.Data.OleDb. I have done this with C#, but I cannot figure out how to convert the syntax to F#. The following is what I know so far:</p> <pre><code>#light open System.Windo...
<p>This is so NOT the F# way to do things, but this works ...</p> <pre><code>open System.Data open System.Data.OleDb let cmd = new OleDbCommand( "SELECT * FROM TABLE1" ); let conn = new OleDbConnection( @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Temp\Database1.mdb;Persist Security Info=False;" ) conn.Open(...
Detecting load of <link> resources? <p>Browsers provide load events for <code>&lt;script&gt;</code> and <code>&lt;img&gt;</code> tags. Is there a way to detect whether a request to a element has completed?</p> <p>Specifically, I'm wishing to detect when a <code>&lt;link&gt;</code>'d stylesheet has been loaded.</p> ...
<p>There may be a simpler way to do it, but this worked for me.</p> <p>Make sure your <code>&lt;link&gt;</code> tag has a <code>title</code> attribute:</p> <pre><code>&lt;link title="myStyles" rel="stylesheet" href="style.css" /&gt; </code></pre> <p>Then use a function like this to check for the presence of a style ...
Does order of declaration matter in models.py (Django / Python)? <p>I have something like this in models.py</p> <pre><code>class ZipCode(models.Model): zip = models.CharField(max_length=20) cities = City.objects.filter(zip=self).distinct() class City(models.Model): name = models.CharField(max_length=50) ...
<p>Apart from order issues, this is wrong:</p> <pre><code>cities = City.objects.filter(zip=self).distinct() </code></pre> <p>It is not inside a method, so "self" will also be undefined. It is executed only once, at class-creation time (i.e. when the module is first imported), so the attribute created would be a clas...
Xdebug profiler and xdebug_time_index() give different values <p>I used Xdebug to profile my PHP application. </p> <p>When I open the generated profile file with WinCacheGrind, it gives me a total cumulative time of 3ms for {main} (0.003s).</p> <p>However, when I use the function xdebug_time_index() at the end of my ...
<p>Any chance adding that function actually increases the time needed?</p> <p>Also, I can imagine the profiler will actually start running when PHP runs (time index 0) while XDebug's internal counter can start a bit earlier.</p>
Is it possible to have validations for basic_model (couchdb) in Ruby on Rails? <p>is it possible to use validations like:</p> <pre><code>class Post &lt; ActiveRecord::Base validates_presence_of :name, :title validates_length_of :title, :minimum =&gt; 5 end </code></pre> <p>with <a href="http://github.com/topfu...
<p>The validations in ActiveRecord are very coupled with ActiveRecord itself, so you won't be able to easely use AR's validation code outside of AR. They're well aware of this, and Rails 3.0 will have ActiveModel, which decouples it from ActiveRecord, so that you could have done something like this:</p> <pre><code>cla...
Transferring Rich Text data from Access to Word <p>I've been saddled with supporting an old Access 2003 database (with SQL backend) produced by a now out-of-business contractor.</p> <p>The database includes several 'unconventional' reports. They all use Automation through VBA to output fields directly to a Word docume...
<p>Ah! A duplicate question apparently.</p> <p>Here's the answer:</p> <p><a href="http://stackoverflow.com/questions/22326/word-automation-write-rtf-text-without-going-through-clipboard/22335">http://stackoverflow.com/questions/22326/word-automation-write-rtf-text-without-going-through-clipboard/22335</a></p>
IIS7 Creating Virtual Directory to files on another server <p>I am migrating some ASP.Net applications from IIS6 to IIS7 and all has gone well until now. I am trying to create several virtual directories on 1 server that will point to files on another server. In IIS6, all I had to do was make anonymous authentication u...
<p>When using a virtual directory that's pointed to a UNC share, go to advanced settings for the virtual directory, then choose a specific user account that has the appropriate rights to access the folder. It works for my virtual directory in my asp.net app that is pointed to a UNC share on a remote server.</p>
Rails has_many association count child rows <p>What is the "rails way" to efficiently grab all rows of a parent table along with a count of the number of children each row has?</p> <p>I don't want to use <code>counter_cache</code> as I want to run these counts based on some time conditions.</p> <p>The cliche blog exa...
<p>This activerecord call should do what you want:</p> <pre><code>Article.find(:all, :select =&gt; 'articles.*, count(posts.id) as post_count', :joins =&gt; 'left outer join posts on posts.article_id = articles.id', :group =&gt; 'articles.id' ) </code></pre> <p>This will return a...
XSL + Java Script Issue ... Unable to call javascript function from xsl file <p>I am a newbie to XSL world and facing few issues with XSL</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/...
<p>In your XSL I don't see any JavaScript file (.js) included nor I see the javascript function you mentioned. Secondly where is the ie variable defined which you using in the function changeColor?</p> <p>Check the html which is getting generated by doing the view source on your browser to see if all is correct. Add s...
What's the best way to deploy an image servlet to maintain confidentiality of images? <p>I have a servlet for allowing manipulations of images - zoom, etc.</p> <p>What's the best way to deploy this service so that the users of the servlet keep their images confidential?</p> <p>I assume this means they need to run the...
<p>They have to give you the image for you to transform it. You can promise that you delete it immediately afterwards, but your users will have to take your word for that.</p> <p>File hosting services can maintain confidentiality by hosting only encrypted files that the service operator cannot open themselves. But you...
How to specify a ToolTip for a control in a Style from XAML? <p>I'm using a the WPF datagrid from the Microsoft CodePlex project. I have a custom control that I want to databind to a field from the row of the datagrid. I can't for the life of me figure out how to specify a tooltip on a datagrid row. </p> <p>The closes...
<p>Figured it out... took me about 6 hours...</p> <p>For some reason, I can't set the value directly using Value.Setter. If I define the content for the tooltip as a static resource though, and then set it in the Style property of the DataGrid.RowStyle it works. </p> <p>So, the datagrid row style looks like: </p>...
Append declaration to XML file <p>Creating XML out of data in Database by calling proc with bcp as </p> <pre><code>SET @SQL= 'bcp "exec dbo.proc" queryout '+ @FileName +' -w -r -t -Sdd\SQL2005 -T ' </code></pre> <p>(proc produced below) Everything is fine => creates XML as desired. Now task is to Add Declaration to...
<p><a href="http://social.msdn.microsoft.com/Forums/fr-FR/sqlxml/thread/17fdee4a-06ab-4bbb-876c-52adca018ca0" rel="nofollow">This page</a> suggests that you need to hard-code the declaration:</p> <pre><code>SELECT '&lt;?xml version="1.0" ?&gt;' + SELECT ( SELECT TOP 1 ... rest of your code goes here... </code></pre...
i need to update the current time in a sql query <p>Usage of Time.now or Time.now.to_s or Time.now.to_datetime is throwing error.</p> <p>Usage of Date.today doesn't help as it stores the date with time as 12.00 AM and not the current time stamp.</p> <p>Please help me in resolving this issue.</p>
<p>I'm not sure why and what is throwing an error, but if you're trying to generate a date string that is correct SQL from Ruby (specifically Rails here) you can use <code> Time.now.to_s(:db)</code>.</p>
PHP Zend Framework Generator <p>I am in the phase of learning Zend Framework for PHP development, I have been doing 'dirty' PHP programming for about 2 years now and I have learnt quite a bit from my mistakes.</p> <p>I have been introduced to Ruby On Rails, it is a great framework and Ruby is quite an interesting lang...
<p><a href="http://framework.zend.com/manual/en/zend.tool.framework.html">Zend Tool</a> is your friend!</p>