input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Amazon S3 Url rewrite <p>How can I change the Amazon S3 url from <a href="http://bucket.amazons3.com/imagepath.jpg" rel="nofollow">http://bucket.amazons3.com/imagepath.jpg</a> to <a href="http://image.mydomain.com/imagepath.jpg" rel="nofollow">http://image.mydomain.com/imagepath.jpg</a> </p>
<p>EDIT:
Basically th... | <p>If I understand, you need to specify your domain name instead of S3. To do this, you need to write a handler which will act as a proxy to the amazon server.</p>
<p>But, that would actually double your bandwidth as you need to send the image to the client as well fetch the image for S3. </p>
<p>I am not sure is the... |
Populate a constant values table <p>In a Rails application, I need a table in my database to contain constant data. </p>
<p>This table content is not intended to change for the moment but I do not want to put the content in the code, to be able to change it whenever needed.</p>
<p>I tried filling this table in the mi... | <p>What you are probably observing is that the test framework is not running the migrations (db:migrate), but loading db/schema.rb directly (db:load) instead.</p>
<p>You have two options:</p>
<ol>
<li>continue to use the migration for production and development; for the test environment, add your constant data to the... |
How to debug JavaScript/jQuery event bindings with Firebug (or similar tool) <p>I need to debug a web application that uses jQuery to do some fairly complex and messy <a href="http://en.wikipedia.org/wiki/Document_Object_Model">DOM</a> manipulation. At one point, some of the events that were bound to particular element... | <p>See <a href="http://stackoverflow.com/questions/446892/how-to-find-event-listeners-on-a-dom-node/447106#447106">How to find event listeners on a DOM node</a>.</p>
<p>In a nutshell, assuming at some point an event handler is attached to your element (eg): <code>$('#foo').click(function() { console.log('clicked!') })... |
Can you build ASP.net User controls as assemblies? <p>Is there some setting in VS2K8 or some command line utility that can compile my user controls as .net assemblies? Is it even possible?</p>
| <p>There is no settings provided by default to support this. But there is a hack and is explained here <a href="http://www.cmswire.com/cms/tips-tricks/aspnet-reusing-web-user-controls-and-forms-000915.php" rel="nofollow">ASP.NET: Reusing Web User Controls and Forms</a></p>
|
How do I read the standard output from a child process in VB6? <p>When creating a process in VB6 (related to <a href="http://stackoverflow.com/questions/570295/can-i-spawn-a-synchronous-process-in-vb6-and-retrieve-its-return-value">this</a> question:), I'm using the following struct:</p>
<pre><code>Private Type STARTU... | <p>Following up <a href="http://stackoverflow.com/questions/570295/can-i-spawn-a-synchronous-process-in-vb6-and-retrieve-its-return-value">this other question by the OP</a>, I post an alternative method to execute a command and get hold of stdout:</p>
<pre><code>' References: "Windows Script Host Shell Object Model" '... |
Is there Java CAPS equivalent from .NET <p>I am looking for an integration framework for building and managing SOA composite applications consist of exposing web services, calling 3rd party web services, performing business logic and invoking database.</p>
<p>It is similar to Sun Java Composite Application Platform Su... | <p>It sounds like you may be looking for BizTalk from Microsoft. </p>
<p>However, depending on how heavy-duty your needs are, you may find that they are served by the basics of WCF (the Microsoft platform for developing web services and clients for them), plus the features of Windows Workflow Foundation (WF). One can ... |
jQuery tabs interfering with SimpleModal in IE <p>I have a page that has two tabs created using jQuery, and I am also using Eric Martin's SimpleModal plugin. However when I am in IE7, the SimpleModal overlay is appearing completely opaque, and not the 50% opacity I wanted. If I remove the tabbing, the modals appear j... | <p>Without more code it's tough to tell.</p>
<p>I would recommend using the <a href="http://docs.jquery.com/UI/Dialog" rel="nofollow">jQuery UI Dialog</a> if you can. They're both made by the UI team and should work fine together.</p>
|
import csv or sql thru phpmyadmin and skip PK? <p>Is it possible to have phpmyadmin or other tool to import a csv or sql backup into an existing DB and skip the primary key or is this a manual, table by table process of inserting with queries and manually removing the primary key?</p>
| <p>Many ways lead to Rome:
1 way:</p>
<pre><code>LOAD DATA LOCAL INFILE 'file.txt'
INTO TABLE t1 (column1, column2, column3);
</code></pre>
<p>another way:</p>
<pre><code>CREATE TABLE `import` (
`column1` int(11) NOT NULL,
`column2` varchar(128) NOT NULL,
`column3` varchar(128) NOT NULL
) ENGINE=MyISAM CHARS... |
How do I suppress the results from a stored procedure from within a stored procedure? <p>I've got a stored procedure (we'll call it A) that calls another stored procedure (we'll call this one B). B includes a SELECT that I do not want to send back to the caller of A.</p>
<p>Here is some really rough pseudocode, but it... | <p>You can try something like this:</p>
<pre><code>/* Assume this table matches the output of your procedure */
DECLARE @tmpNewValue TABLE (newvalue int)
INSERT INTO @tmpNewValue
EXEC ProcedureB
</code></pre>
|
Writing video frames with variable framerate <p>I'm using the <a href="http://www.codeproject.com/KB/audio-video/avifilewrapper.aspx" rel="nofollow">AVIFile Wrapper</a> to create video from my WPF app. I'm using CompositionTarget to grab an image for each frame but I'm having problems with framerate. As my app slows do... | <p>The standard way to do this with AVI files is to write out a zero-size video frame for each skipped sample.</p>
|
Make SQL Server faster at manipulating data - turn off transaction logging? <p>I use SQL Server 2005 as a data store for a lot of data I do analytic work on. This is not a transactional database as I am not hitting it with updates or capturing real time data. I get a few gigs of data from my clients, load them into SQL... | <blockquote>
<p>How can I configure SQL Server so that it runs with little or no logging? I</p>
</blockquote>
<p>I don't believe you can.</p>
<p>However if you configure the database (each database on a server can be different) for simple backups the log file won't grow until you back it up. This is done by setting... |
Adding elements to python generators <p>Is it possible to append elements to a python generator?</p>
<p>I'm currently trying to get all images from a set of disorganized folders and write them to a new directory. To get the files, I'm using os.walk() which returns a list of image files in a single directory. While I c... | <p>You are looking for <a href="http://docs.python.org/library/itertools.html"><code>itertools.chain</code></a>. It will combine multiple iterables into a single one, like this:</p>
<pre><code>>>> for i in itertools.chain([1,2,3], [4,5,6]):
... print i
...
1
2
3
4
5
6
</code></pre>
|
container for quick name lookup <p>I want to store strings and issue each with a unique ID number (an index would be fine). I would only need one copy of each string and I require quick lookup. I check if the string exist in the table often enough that i notice a performance hit. Whats the best container to use for thi... | <p>I would suggest tr1::unordered_map. It is implemented as a hashmap so it has an expected complexity of O(1) for lookups and a worst case of O(n). There is also a boost implementation if your compiler doesn't support tr1.</p>
<pre><code>#include <string>
#include <iostream>
#include <tr1/unordered_m... |
Is there a vr (vertical rule) in html? <p>I know there is a hr (horizontal rule) in html, but I don't believe there is a vr (vertical rule). Am I wrong and if not, why isn't there a vertical rule?</p>
| <p>No, there is no vertical rule.</p>
<p>It does not make logical sense to have one. HTML is parsed sequentially, meaning you lay out your HTML code from top to bottom, left to right how you want it to appear from top to bottom, left to right (generally)</p>
<p>A vr tag does not follow that paradigm.</p>
<p>This is ... |
Why is Java EE scalable? <p>I heard from various sources that Java EE is highly scalable, but to me it seems that you could never scale a Java EE application to the level of the google search engine or any other large website. </p>
<p>I would like to hear the technical reasons why it is so scalable.</p>
| <p>Java EE is considered scalable because if you consider the EJB architecture and run on an appropriate application server, it includes facilities to transparently cluster and allow the use of multiple instances of the EJB to serve requests. </p>
<p>If you managed things manually in plain-old-java, you would have to ... |
How do I create a Setup And Deployment project that can run any number of times on a machine without requiring an uninstall? <p>How do I create a Setup And Deployment project that can run any number of times on a machine without requiring an uninstall?</p>
<p>I've created an installer to install a WCF service to an II... | <p>Ok, I've got this working, I figured I'd answer it.</p>
<ol>
<li>I downloaded the Orca windows installer editing tool (Part of the Windows SDK) </li>
<li><p>In the InstallExecuteSequence table, changed the following values to 0</p>
<p><strong>RegisterUser
RegisterProduct
PublishFeatures
PublishProduct</strong></... |
Can someone explain in detail how the clear works in this code? <p>I am new to CSS. I have a Top, Right, and Content div. I want it to look like this:</p>
<pre><code>Top Right
Content
</code></pre>
<p>However, it is showing up like this:</p>
<pre><code>Top Content Right
</code></pre>
<p>I know I need a clear... | <p>Put the <code>clear</code> on the Content <code><div></code>:</p>
<pre><code><div style="float:left; width:600px; height:100px;
border:1px solid black;">Top</div>
<div style="float:right; width:200px; height:800px;
border:1px solid red;">Right</div>
<div st... |
Disabling Log4J Output in Java <p>How can one quickly turn off all Log4J output using a log4j.properties file?</p>
| <p>Set level to OFF
(instead of DEBUG, INFO, ....)</p>
|
Is there chemistry in you development team? <p>I've had two intership at the same company and one things that bothered me is the fact that everyone was in their own world doing their stuff and listening to music. I knew I would not want to work there after I graduate even though they would offer me a job if i'm interes... | <p>There's an awful lot of converting oxygen to carbon dioxide. In fact, for some that seems to be their primary (and arguably only) skill. On the other hand from some team members we have some conversion of carbon dioxide to oxygen so I guess that balances out.</p>
|
NSColor with calibrated values works differently than regular color? <p>I'm using a method in my view to set a color, and in awakeFromNib I pass it a color using
[NSColor colorWithCalibratedRed: green: blue: alpha:]</p>
<p>The application kept crashing, with the error with "[NSCFNumber set] unrecognized selector."
Aft... | <blockquote>
<p>The application kept crashing, with the error with "[NSCFNumber set] unrecognized selector."</p>
</blockquote>
<p>That means that you over-released the color, and then another object (in this case, an NSNumber) got allocated to the same pointer. Then you sent the <code>set</code> message to the objec... |
Destroy session variables in another application <p>I have two applications, one is the front end application, another is the backend one. </p>
<p>Each application has their own copy of identical user database. When a user logs into the front end application, I will also simultaneously log int the backend application ... | <p>Yes it is.</p>
<p>I asume that you are using the same session ID name for both front and back. I think the default is PHP_SESSID. If this is the case, then all the session details will be being stored in the one location. </p>
<p>I am also asuming that the domain of front and back end is teh same.. if it is differ... |
MultiLine Regular Expression and outputting to a file in windows <p>I have an log file that I need to extract specific patterns from. I need to find and then process them into a new file. grep on Linux would usually do the trick but the regular expression spans multiple lines, which I understand grep does not do.</p>
... | <p>This is a good candidate for <code>awk</code>, <code>perl</code> and the like <em>stateful parsing</em> (these will run in both Windows's <code>CMD.EXE</code>, provided you have <code>perl</code> and/or <code>awk/sed</code> in your <code>PATH</code>, as well as, of course, on Linux and other unices):</p>
<p><code>a... |
Perl regex: How to grab the part that is the same <p>I'm creating a ladder system for some games and I've encountered a problem regarding the clan base system. You see, every player who joins are parsed and put into a players table. Like this:</p>
<pre><code>chelsea | gordon
chelsea | jim
chelsea | brad
</code></pre>... | <p>Here's a shot:</p>
<pre><code>use strict;
use warnings;
my($strip) = shift || 0;
print FindTeamName("TEAMJimBob", "TEAMJoeBob", "TEAMBillyBob"), "\n";
print FindTeamName("TEAM|JimBob", "TEAM|JoeBob", "TEAM|BillyBob"), "\n";
print FindTeamName("TEAM | JimBob", "TEAM | JoeBob", "TEAM | BillyBob"), "\n";
print FindT... |
About DPI issue <p>I have a WIN32 SW which the UI was designed in 96 DPI, so when user changes the windows DPI from 96 to 120 or bigger, the UI will be wrong. I want to know if there is API to force my SW to display the UI with 96DPI.</p>
| <p>Starting with Windows Vista, scaling for DPI is supposed to happen automatically. I don't have any direct experience to know how well it works, but here's the page that explains how to turn it off:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms701681(VS.85).aspx" rel="nofollow">http://msdn.microsoft.co... |
is a great memory a requirement for great programming <p>Do you think having a great memory is REQUIRED to be a great programmer? </p>
<p>I don't consider myself a great programmer but I do think I am decent. But my memory is REALLY bad so I find myself always having to remind myself how to do things. I mean I "know w... | <p>Surely apocrapful, but here's <a href="http://weblogs.macromedia.com/jd/archives/2005/12/search_user_mut.html">Einstein's number</a>:</p>
<blockquote>
<p>A reporter interviewed Albert
Einstein. At the end of the interview,
the reporter asked if he could have
Einstein's phone number so he could
call if he ... |
Avoiding conflicts while using git-svn <p>Folks I'm facing repeated code conflicts while pulling from the shared git repo in the following scenario:</p>
<ol>
<li><p>There is a common svn repository</p></li>
<li><p>There are several developers who track/sync this common svn repo with their own local git repos using git... | <p><a href="http://git-scm.com/docs/git-svn">git-svn(1)</a> says:</p>
<blockquote>
<p>For the sake of simplicity and
interoperating with a less-capable
system (SVN), it is recommended that
all git-svn users clone, fetch and
dcommit directly from the SVN server,
and avoid all
git-clone/pull/merge/push ope... |
Libtool slowness, double building? <p>In my project, modules are organized in subdirs for tidiness.</p>
<p><strong>My project dir hierarchy:</strong></p>
<pre><code>$ ls -R
.: configure.in Makefile.am Makefile.cvs src
./src: log Makefile.am main.cpp
./src/log: log.cpp Makefile.am
</code><... | <p>By default Libtool creates two types of libraries: static and shared. (aka libfoo.a and libfoo.so)</p>
<p>Static and shard require different compilation flags. Dynamic libraries -- shared objects
use Position Independent Code with following gcc flags:</p>
<pre><code>-fPIC -DPIC
</code></pre>
<p>Static are not. Yo... |
CPython internal structures <p>GAE has various limitations, one of which is size of biggest allocatable block of memory amounting to 1Mb (now 10 times more, but that doesn't change the question). The limitation means that one cannot put more then some number of items in list() as CPython would try to allocate contiguou... | <p>On a 32-bit system, each of the 8000000 lists you create will allocate 20 bytes for the list object itself, plus 16 bytes for a vector of list elements. So you are trying to allocate at least (20+16) * 8000000 = 20168000000 bytes, about 20 GB. And that's in the best case, if the system malloc only allocates exactly ... |
Looking for particular alert box behavior <p>I'm interested in alert boxes such as,</p>
<p><a href="http://www.visual-blast.com/javascript/nice-alert-box-with-jquery-impromptu/" rel="nofollow">http://www.visual-blast.com/javascript/nice-alert-box-with-jquery-impromptu/</a></p>
<p>and</p>
<p><a href="http://woork.blo... | <p>Sounds like the jQuery UI dialog widget might do what you need?</p>
<p><a href="http://jqueryui.com/demos/dialog/" rel="nofollow">http://jqueryui.com/demos/dialog/</a></p>
|
C# Scaling UserControl content to match users Dpi/Font Size <p>How do I get my OwnerDrawn UserControl to respect the users dpi (96/120/xxx) and/or font-size (normal, large, extra large)?</p>
<p>Some people suggest to use the DpiX and DpiY properties on a Graphics object, but that doesn't seem to to anything in my cont... | <p>You would need to set the AutoScaleMode property of the UserControl to AutoScaleMode.Dpi, and <strong>not</strong> set the AutoScale property to true. If you do, it will reset the AutoScaleMode back to None. The AutoScale property is obsolete and is there only for backwards compatibility (see the <em>Important Note<... |
Store text in BLOB? <p>I'm making a little forum for my clans website. I'm wondering if I should store the thread text in TEXT or BLOB? Whats the difference? I've seen that phpBB does that.</p>
<p>What is BLOB anyway? cant find much about it on Google.</p>
| <p>A blob is just a bunch of bytes. An arbitrary number of bytes, nothing more.</p>
<p>If you were to store text as a blob, you'd have to worry about encoding (the process of translating text to bytes). But if you store things as text whatever database transport your using will make sure that the text stored in the da... |
How to retrieve the pre edited value of the cell of a datagrid to an itemeditor in a flex <p>I wrote a custom item editor for a datagrid in flex. My question is how to retrieve the pre-edited value of the datagrid cell after the item editor initializes and also in the custom item editors code. </p>
| <p>I don't think it is possible to get the old value once you are in the item editor. I would do this manually by listening to the "itemEditBeginning" event and keeping a variable with the value of the cell. You can then reference that value through the "parent", "parentDocument" or "outerDocument" properties in the it... |
javascript pointer function <p>if I have:</p>
<pre><code>function init(t,y,u)
{
alert(t + " " + y + " " + u);
}
// String.prototype.add = init(5, 6, 7); // 1)
// window.onload = init(5,6,7); // 2)
</code></pre>
<p>in the 1) <code>init</code> will be executed and then it pointer assegned to <code>String.proto... | <blockquote>
<p>in the 1) init will be executed and then it pointer assegned to String.prototype.add</p>
</blockquote>
<p>No it won't. The function will simply be executed and its return value (<code>undefined</code>) will be assigned to <code>String.prototype.add</code>. No function pointer will be assigned. To do ... |
Change the values of _Session in another application <p>Is it possible to modify the values inside the super global array <a href="http://www.php.net/session" rel="nofollow">_Session</a> in PhP? Assume that the _Session is writing to files. </p>
<p>The reason I ask this is because I have two application, the front end... | <p>If the two application are sharing a PHP session, then each can happily modify <code>$_SESSION</code>.</p>
<p>For this to happen you will need to make sure both applications are storing the sessions in the same place and either:</p>
<ul>
<li>Both are on the same domain and the
cookie path has not been changed e.g.... |
Convert characters to HTML Entities in Cocoa <p>I am currently trying to put together an URL where I specify some GET parameters. But I want to use japanese or other characters too in this URL.</p>
<p>Is there a way to convert a NSString to a string containing the HTML entities for the 'special' characters in my NSStr... | <p>To properly URL encode your parameters, you need to convert each name and value to UTF-8, then URL encode each name and value separately, then join names with values using '=' and name-value pairs using '&'.</p>
<p>I generally find it easier to put all the parameters in an NSDictionary, then build the query str... |
Can't use WPF designer in VS2008 SP1 <p>i searched several hours four solution and nothing found. If I open WPF Designer in my VS2008 Team Suite SP1 I become following error:</p>
<blockquote>
<p>Loading this assembly would produce a
different grant set from other
instances. (Exception from HRESULT:
0x80131401)... | <p>First of all not only you receive this error so may be you should <a href="http://www.google.com/search?q=Loading+this+assembly+would+produce+a+different+grant+set+from+other+instances&ie=utf-8&oe=utf-8" rel="nofollow">google it first</a>? As you can see there are many behaviors of this problem and we are no... |
How To Do Performance Profiling in Visual Studio 2008 "Pro" <p>Microsoft make this piece of software called "Visual Studio 2008 Professional". I have found that there doesn't appear to be an application performance profiler or something similar in it, making it seem not so "professional" to me. </p>
<p>If Microsoft do... | <p>There are a couple of free profilers, not as complete or polished as the commercial ones, but they can definately help a lot:</p>
<p><a href="http://www.eqatec.com/tools/profiler?gclid=CM_xvqDx7ZgCFRxNagod_Xic1Q" rel="nofollow">Eqatec</a> - This was designed for Windows CE, but works just fine for normal applicatio... |
Why CSS files not loading when compressing HTTP response using GZipStream? <p>I am developing an application using asp.net 2.0 (C#), in which I am trying to implement the compression of my files, so that performance of my website will improve.</p>
<p>For that I have added a code in my Global.asax file to compress all ... | <p>For static files, you can configure IIS to do the compression for you, no need to implement it yourself.</p>
<p>In IIS6 this is a global setting (properties of the "Web Sites" node in IIS manager, service tab).</p>
<p>In IIS7 this is set on a per folder basis, and it will also compress dynamic content for you. It ... |
Can I embed a sqlite database in an Air application? <p>Is it always necessary to create a database for the user in an adobe air application or can you ship an empty database as part of the distributed app?</p>
| <p>Look up the section 'Distributing a pre-populated database' in Flex 3.0 documentation. From the documentation:</p>
<blockquote>
<p>[...]As an alternative to creating the database, structure, and data programmatically, you can distribute a pre-populated database with your application. To distribute a predefined da... |
Include header path change from Windows to Linux <p>I'm porting an application written in C++ from Windows to Linux. I have a problem with the header files path. Windows uses <code>\</code> and Linux uses <code>/</code>. I am finding it cumbersome to change this in each and every source and header file. Is there some w... | <p>Always use forward slashes in #include paths. It is the compiler's job to map the path to whatever slash/directory scheme the underlying OS supports.</p>
|
How to reference Resources folder in code <p>I'm porting a c++ Qt application from Windows to OSX and cannot wrap my head around the .app bundle concept. I hope someone can help me understand.</p>
<p>My executable lives here: MyProgram.app/Content/MacOS/MyProgram.exe</p>
<p>My resource folder lives here: MyProgram.ap... | <pre><code>QApplication::applicationDirPath()
</code></pre>
<p><a href="http://doc.qt.io/qt-5/qcoreapplication.html#applicationDirPath" rel="nofollow">http://doc.qt.io/qt-5/qcoreapplication.html#applicationDirPath</a></p>
|
Domain Specific Language for Business Objects? <p>I'm thinking of writing a domain specific language (DSL) to model business objects. The DSL will not be executed, instead it will be used by a template based code generator (probably CodeSmith) to generate the .NET & SQL.</p>
<p>The DSL will need to support the def... | <p>It's fairly easy to automatically convert the structure you present into XML. From there, I imagine it's possible to write some sort of transformation via XSLT or XQuery into whatever end result you desire. I wrote a Visual Studio add-in called <a href="http://code.google.com/p/codegenutils" rel="nofollow">CodeGenUt... |
How do I define HAVE_STDIO_H in VC++ 2005? <p>I just built an updated version of SDL.dll, an open-source C DLL that my Delphi project uses, with the Express edition of Visual C++ 2005. I dropped it in the folder with my EXE and tried to run it, but it won't load:</p>
<pre><code>The procedure entry point SDL_RWFromFP ... | <p>Most often in the Unix/Linux world, names like <code>HAVE_STDIO_H</code> indicate that the code has been 'autoconfiscated' (which is the official term used to describe the state of having been made to work with the 'autotools' such as 'autoconf'). In such a set up, the configure process would determine whether <cod... |
How to get started on Information Extraction? <p>Could you recommend a training path to start and become very good in Information Extraction. I started reading about it to do one of my hobby project and soon realized that I would have to be good at math (Algebra, Stats, Prob). I have read some of the introductory books... | <blockquote>
<p>Just to answer one of the comment. I
am more interested in Text Information
Extraction.</p>
</blockquote>
<p>Depending on the nature of your project, <a href="http://en.wikipedia.org/wiki/Natural_language_processing">Natural language processing</a>, and <a href="http://en.wikipedia.org/wiki/Compu... |
Which algorithm for assigning shifts (discrete optimization problem) <p>I'm developing an application that optimally assigns shifts to nurses in a hospital. I believe this is a <a href="http://en.wikipedia.org/wiki/Linear_programming#Integer_unknowns">linear programming</a> problem with discrete variables, and therefor... | <p>This is a difficult problem to solve well. There has been many academic papers on this subject particularly in the <a href="http://en.wikipedia.org/wiki/Operations_research">Operations Research</a> field - see for example <a href="http://www.asap.cs.nott.ac.uk/watt/resources/NR_2008_REFS.pdf">nurse rostering papers ... |
Import data from Google Checkout into Quickbooks? <p>Is there any way to import data from Google Checkout into Quickbooks? (Or another accounting package)?</p>
| <p>Yep - you can export CSV from Google and import that into Quickbooks (and presumably into other accounting packages):</p>
<p><a href="http://checkout.google.com/support/sell/bin/answer.py?answer=134476&topic=8951" rel="nofollow">Google Checkout - Reporting and reconciliation</a></p>
<p><a href="http://support.... |
Howto print java class garbage collection events? <pre>
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)
</pre>
<p>I'm trying to debug a NullPointerException I'm getting for passing a reference to statically define... | <p>To trace GC activity add this to java command:</p>
<blockquote>
<p>-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails</p>
</blockquote>
<p>NPE that you are getting is probably you passing null value.</p>
|
Drupal: how to change taxonomy header on page with items? <p>I have a menu item like
<a href="http://localhost/drupal/?q=category/articles/php" rel="nofollow">http://localhost/drupal/?q=category/articles/php</a></p>
<p>It's supposed to output all stories about PHP,
But in resulting page header (with term name (PHP) ) ... | <p>Your best bet for customizing the page is to use the Views Module and activate the taxonomy_term view. Then, you can add to the header field or even create a new template just for that view. </p>
<p>The Drupal Handbook has a lot of great resources for theming and building views:
<a href="http://drupal.org/node/3529... |
C++ Vector <p>Look this code(and forgive the miss of knowlegde).It outputs errors that I couldnot solve.I need to declare a vector of elements of struct C,but I need the number of elements be i(a input of type int).I also tried others aproachs but in all of them I recieved an error(cannot convert C to int,etc).How can... | <p>Let's try with an explanation :)</p>
<pre><code>cin >> array[i];
</code></pre>
<p>That tries to extract from <code>cin</code> into an object of struct C. Well, so it needs an operator>> that actually does that work:</p>
<pre><code>istream & operator>>(istream &is, C &c) {
is >> c... |
Application.DoEvents(); <p>How do I keep my C# form that, lets say is in a for-loop, from locking up? Do I call Application.DoEvents(); before the loop or after? From what I've heard using the DoEvents method will keep my app from locking.</p>
| <p>You should not use Application.DoEvents() in order to keep your application responsive. </p>
<p>Calling this method will allow any waiting windows messages to be dispatched. This means if a user clicks on a button (or performs any other user interaction) that action will be processed. This can therefore cause reent... |
One view ( frontpage ) for many controllers (sub views) <p><em>Notes:</em> Cannot use Javascript or iframes. In fact I can't trust the client browser to do just about anything but the ultra basics.</p>
<p>I'm rebuilding a legacy PHP4 app as a MVC application, with most of my research currently focused with the Pylon's... | <p>While in most cases I'd recommend what you originally stated, using Javascript to load each widget, since that isn't an option I think you'll need to do something a little different.</p>
<p>In addition to using the approach of trying to have a single front controller go through all the widgets needed and building t... |
Apache2 isn't serving index.php <p>My server is fairly old (based on SuSE 9), and while I try to go through the pain of updating to the latest Apache2, PHP5 and MySQL, I ran into this problem with one of my hosted domains.</p>
<p>The site has an index.php, and if I browse to their site example.org/index.php it display... | <p>Ugh, I cleared the cache in my browser and the problem went away. Let me say "Never mind."</p>
|
Is there an advantage to use a Synchronized Method instead of a Synchronized Block? <p>Can any one tell me the advantage of synchronized method over synchronized block with an example?</p>
| <blockquote>
<p><em>Can any one tell me the advantage of synchronized method over synchronized block with an example?Thanks.</em></p>
</blockquote>
<p>There is not a clear advantage of using synchronized method over block. </p>
<p>Perhaps the only one ( but I wouldn't call it advantage ) is you don't need to includ... |
What does the operator '=>' mean in C#? <p>What does the '=>' in this statement signify?</p>
<pre><code>del = new SomeDelegate(() => SomeAction());
</code></pre>
<p>Is the above declaration the same as this one?</p>
<pre><code>del = new SomeDelegate(this.SomeAction);
</code></pre>
<p>Thanks.</p>
| <p>Basically it's specifying an anonymous function, that takes no parameters that calls SomeAction. So yes, they are functionally equivalent. Though not equal. Using the lambda is more equivalent to:</p>
<pre><code>del = new SomeDelegate(this.CallSomeAction);
</code></pre>
<p>where CallSomeAction is defined as:</p>... |
Transferring files with metadata <p>I am writing a client windows app which will allow files and respective metadata to be uploaded to a server. For example gear.stl (original file) and gear.stl.xml (metadata). I am trying to figure out the correct protcol to use to transfer the files. </p>
<p>I was thinking about u... | <p>You could wrap it in a zip file like the "new" office document format does. You might even be able to use their classes to package it all up.</p>
<p><strong>Edit:</strong> </p>
<p>Take a look at the <a href="http://msdn.microsoft.com/en-us/library/system.io.packaging.package.aspx" rel="nofollow" title="System.IO.P... |
IE 7 error: "An outgoing call cannot be made since the application is dispatching an input-synchronous call" <p>I am getting this error (see post title) from time to time as I interact with a web application I created. The application uses Ajax to communicate with a server, but doesn't do anything fancy specific to IE.... | <p>This is a generic COM error. What is happening is that the AJAX component, XmlHttpRequest is a COM object, and therefore follow the rules for COM. What is likely happening here is that XmlHttpRequest is dispatching an incoming event. In the response to this event, there's probably code that calls out to a different ... |
How to Design Data Transfer Objects in Business Logic Layer <h2>DTO</h2>
<p>I'm building a Web application I would like to scale to many users. Also, I need to expose functionality to trusted third parties via Web Services.</p>
<p>I'm using LLBLGen to generate the data access layer (using SQL Server 2008). The goal i... | <p>1: That is a pretty standard approach, that lends itself well to a "repository" implementation for the best unit-testable approach.</p>
<p>2: Exceptions (which should be declared as "faults" on the WCF boundary, btw) will get raised automatically. You don't need to handle that directly. For data - there are three c... |
Jquery append using multiline <p>I have been working on a project that dynamically creates a javascript file using ASP.NET which is called from another site.</p>
<p>This jquery javascript file appends a div and fills it with a rather large HTML segment and in order to do that I need to turn the segment into a string l... | <p>Some ideas:</p>
<ul>
<li>You can replace new lines with spaces and create a huge line. There shouldn't be a problem with it.</li>
<li><p>Use string concatenation. Split the string and lines and do:</p>
<p>var html = line1 +
line2 +
...
linen;</p></li>
<li><p>Make an Ajax call to fi... |
Add fields to ActiveRecord model dynamically in Rails 2.2.2? <p>Say I wanted to allow an administrative user to add a field to an ActiveRecord Model via an interface in the Rails app. I believe the normal ActiveRecord::Migration code would be adequate for modifying the AR Model's table structure (something that would ... | <p>To access the columns which are currently defined for a model, use the <a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M002239" rel="nofollow">columns</a> method - it will give you, for each column, its name, type and other information (such as whether it is a primary key, etc.)</p>
<p>However, m... |
Core Animation - Sheet-like Window Sliding <p>How difficult would it be to use core animation to make an NSView slide in an out of view like a sheet? Generally speaking, what would be involved in accomplishing this? I've been reading through the CA documentation, but it's been hard for me to pinpoint which parts are re... | <p>Since you're talking of a NSView, you're probably using Cocoa's animation support, not CA directly. In this case, you just need to set the view's frame through the view's animator object:</p>
<pre><code>[theView setFrame:offscreenFrame];
[[theView animator] setFrame:finalFrame];
</code></pre>
<p>Unfortunately, Coc... |
Sharing PHP-CGI between Apache and NGINX <p>I've been running most of my PHP apps on my website on a fastcgi backend, served by NGINX. I have a new application which seems pretty well integrated with Apache; it's heavily dependent on dynamically written .htaccess files, for example. I'm working on modifying it to work ... | <p>Problem solved. The trick was to use the following lines</p>
<pre>
FastCGIExternalServer /var/www/fast-cgi-fake-handler -host 127.0.0.1:9000
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /fast-cgi-fake-handler
</pre>
<p>The relative path in Action + the full path in FastCGIExternalS... |
Python: How to ignore an exception and proceed? <p>I have a try...except block in my code and When an exception is throw. I really just want to continue with the code because in that case, everything is still able to run just fine. The problem is if you leave the except: block empty or with a #do nothing, it gives you ... | <pre><code>except:
pass
</code></pre>
|
How do I add/remove a class in a <div> when it already has classes <p>How do I add/remove a class from a div when it already has one or more classes?</p>
<pre><code><div class="class1 class2" id="id1">some text</div>
$("#id1").toggleClass("class3"); // doesn't work
$("#id1").toggleClass(" class3"); //... | <p>Your code should definitely work. In fact, the <a href="http://docs.jquery.com/Attributes/toggleClass" rel="nofollow"><code>toggleClass</code> example</a> <em>uses</em> multiple class names!</p>
|
How to keep special characters when running ./mysqldump? <p>How do you keep the special characters when you run mysqldump?</p>
<p>On the database it appears correctly when i do a query. But on the file after i export, all special characters look like this:</p>
<pre><code>'R. Antââ¥nio Lt1, 1¬⫠Dt¬â«'
</code>... | <p>Use the correct character set by either setting it in your editor or (better) force one you like (such as UTF8) on dumping (this also helps avoiding all those problems moving database dumps across servers).</p>
<p><code>mysqldump --default-character-set=UTF8</code></p>
|
Need well formatted data for testing <p>Sometimes you need data for tests, like <a href="http://www.youtube.com/watch?v=d9IjZJ0D_bo" rel="nofollow">Adobe Thermo</a> has prewritten "sets" of data, like 1-word strings, 3-word strings, etc for use in populating data controls.</p>
<p>I need:</p>
<ul>
<li>Continuous text,... | <p><a href="http://www.generatedata.com/#about" rel="nofollow">GenerateData.com</a> is a free, open source script written in JavaScript, PHP and MySQL that lets you quickly generate large volumes of custom data in a variety of formats for use in testing software, populating databases.</p>
<ul>
<li>JS-enabled and brows... |
64-bit linux, Assembly Language, Issues? <p>I'm currently in the process of learning assembly language.
I'm using <a href="http://en.wikipedia.org/wiki/GNU%5FAssembler" rel="nofollow">Gas</a> on <a href="http://en.wikipedia.org/wiki/Linux%5FMint" rel="nofollow">Linux Mint</a> (32-bit). Using this book:
<a href="http://... | <p>Your code examples should all still work. 64-bit processors and operating systems can still run 32-bit code in a sort of "compatability mode". Your assembly examples are no different. You may have to provide an extra line of assembly or two (such as .BITS 32) but that's all.</p>
<p>In general, using a 64-bit OS ... |
How can you have folds for a LaTeX file in XEmacs? <p>I would like to have automatic folds for comments in my AquaEmacs.</p>
| <p>have a look at <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Hideshow.html" rel="nofollow"><code>hs-minor-mode</code></a>. it's not automatic though. for a more automatic approach, i guess you could customize the hideshow mode the following way:</p>
<ol>
<li>hide comments via <code>hs-hide-comme... |
Setting a timeout on ifstream in C++? <p>We're trying to read data from 2 usb mice connected to a linux box (this data is used for odometry/localization on a robot). So we need to continuously read from each mouse how much it moved. The problem is that when a mouse is not moving, it doesn't send any data, so the file s... | <p>A common way to read from multiple file descriptors in linux is to use select(). I suggest starting with the <a href="http://linux.die.net/man/2/select">manpage</a>. The basic system flow is as follows:</p>
<p>1) Initialize devices<Br>
2) Obtain list of device file descriptors<br>
3) Setup the time out<br>
4) Cal... |
How to solve TPTP Monitor error ( IWAT0435E ) in Eclipse, on Debian-based Linux? <p>After installing Test & Performance Tools Platform in Eclipse Ganymede on, whenever I tried to profile a Java application, I was confronted by the launch configuration dialogue which contained an error along the lines of:</p>
<pre>... | <p>After searching for a while I found the solution in a couple of blogs, so thanks to
<a href="http://goodenoughjava.blogspot.com/2008/10/profiling-with-eclipse-tptp-problem.html" rel="nofollow">Pablo</a> and <a href="http://myjavanotebook.blogspot.com/2008/04/libstdc210-glibc22-on-ubuntu-hardy-804.html" rel="nofollo... |
Objective-C use of #import and inheritance <p>I have a hypothetical UIViewController class named "foo". foo inherits from class bar and class bar #import's "Class A", a class which foo uses extensively. The problem is, when I'm using an instance of class A in foo, I don't get any compiler errors, but I do get a warning... | <p>It sounds like you have a circular dependency issue. In order to resolve it, yes, each imlementation file (<code>.m</code>) needs to <code>#import</code> the proper header file. However, if you try to have the <em>header</em> files <code>#import</code> each other, you'll run into problems.</p>
<p>In order to use ... |
Is there an in-memory provider for Entity Framework? <p>I am unit testing code written against the ADO .NET Entity Framework. I would like to populate an in-memory database with rows, and make sure that my code retrieves them properly.</p>
<p>I can mock the Entity Framework using Rhino Mocks, but that would not be suf... | <p>An InMemory provider is included in <strong>EF7</strong> (pre-release).</p>
<p>You can use either the <a href="http://www.nuget.org/packages/EntityFramework.InMemory" rel="nofollow">NuGet package</a>, or read about it in the <a href="https://github.com/aspnet/EntityFramework/wiki/Using-EF7-in-Traditional-.NET-Appli... |
Use of @synthesize/@property in Objective-C inheritance <p>If you have Class A with an instance var "foo" which has a @property/@synthesize directive, and Class B inherits from Class A, does it also need to @property/@synthesize "foo"? The reason I ask is because when I try to use Class B's "foo", the calling class say... | <p>No, you don't. Synthesized properties are added to class A and its subclasses automatically.</p>
|
How can I generate scaffolding as code in CakePHP? <p>I have a cakephp app with some controllers using scaffolding for the logic and views... How can I make cake actually generate those as files and functions in my project that I can then modify and take ownership of... </p>
<p>It's nice to have this stuff as a starti... | <p>You can bake the code using the cake console script. It's all explained in <a href="http://book.cakephp.org/view/113/Code-Generation-with-Bake" rel="nofollow">the cookbook</a></p>
|
Which browsers claim to support HTTP compression but are actually flaky? <p>Are there any known issues with older/buggy browsers that claim to support gzip/deflate compression but don't handle it very well? I'm obviously only turning it on for browsers that claim to support it, but for the best user experience, I want... | <p>Here are some links to documents that name some browsers that donât support compression though claiming it:</p>
<ul>
<li><a href="http://httpd.apache.org/docs/2.2/mod/mod_deflate.html#recommended">Apacheâs sample configuration in the mod_deflate module documentation</a></li>
<li><a href="http://schroepl.net/pro... |
Optimizing the speed of insertion in java.util.Map/Set <p>is there a way to optimize the speed of the insertions in a java.util.Collection by specifying the order of the items ?</p>
<p>For example</p>
<pre><code>java.util.Set<String> set = java.util.TreeSet<String>();
</code></pre>
<p>will this solution:... | <p>The easy answer is "time it and see". </p>
<p>The other answer is "it won't matter". This seems to be a micro-optimization that is hardly worth the effort. I think it falls into the category of <a href="http://www.codinghorror.com/blog/archives/001218.html" rel="nofollow">"The Sad Tragedy of Micro-Optimization ... |
Why can't gcc find the random() interface when -std=c99 is set? <p>I do <code>"#include <stdlib.h>"</code> at the top of the source.</p>
<p>Example compilation:</p>
<pre><code>/usr/bin/colorgcc -std=c99 -fgnu89-inline -g -Wall -I/usr/include -I./ -I../ -I../../ -I../../../ -I../../../../ -O3 -o f8 f8.c
In ... | <p><code>man srandom</code> says that the function is <em>not</em> part of C99 but part of POSIX. </p>
<p>Activate <code>_BSD_SOURCE</code> or <code>_XOPEN_SOURCE >= 500</code> or any other suitable feature test macro that declares the srandom/random function (see <code>man feature_test_macros</code> and <code>man ... |
Update .NET Compact Framework - when? <p>As many of you know, in Barcelona last week at the Mobile World Congress, Microsoft presented a "beta" of Windows Mobile 6.5 which will probably be launched later on this year.</p>
<p>I have been reading a lot of articles on the web about this congress and the new features of W... | <p>My guess is that you shouldn't hold your breath. I really don't think there's anything new for 6.5 concerning .NET CF, but for 7.0 I'd say that a new .NET CF will be in ROM.</p>
|
URL Encoding using C# <p>I have an application which I've developed for a friend. It sends a POST request to the VB forum software and logs someone in (with out setting cookies or anything).</p>
<p>Once the user is logged in I create a variable that creates a path on their local machine.</p>
<p>c:\tempfolder\date\use... | <p>I've been experimenting with the various methods .NET provide for URL encoding. Perhaps the following table will be useful (as output from a test app I wrote):</p>
<pre><code>Unencoded UrlEncoded UrlEncodedUnicode UrlPathEncoded EscapedDataString EscapedUriString HtmlEncoded HtmlAttributeEncoded HexEscaped
A ... |
Where to place a primary key <p>To my knowledge SQL Server 2008 will only allow one clustered index per table. For the sake of this question let's say I have a list of user-submitted stories that contains the following columns.</p>
<p>ID (int, primary key)<br />
Title (nvarchar)<br />
Url (nvarchar)<br />
UniqueName ... | <p>In the first place you can put the clustered index on unique name, it doesn't have to be onthe id field. If you do little or no joining to this table you could get rid of the id. In any event I would put a unique index on the unique name field (you may find in doing so that it isn't as unique as you thought it would... |
PHP Lexical and Syntax analyzer written in C/C++ <p>I'm writing a PHP IDE in Qt4 for my Master's project. I am trying to duplicate a lot of the functionality of Eclipse or Visual Studio without all the bloat and the overhead. I'm trying to do some code completion but I need to do some syntax analyzing to have intellige... | <p>PHP does not have anything even <em>remotely</em> close to a formal LALR(1) or LL(k) grammar that you could use to implement this in a manner suitable for academia. Zend's parser is not context-aware and is full of ad-hoc disambiguations from what I've seen.</p>
<p>That is not to say you cannot write something that... |
Associative arrays in javascript <p>I have this object:</p>
<pre><code>function formBuddy()
{
var fields = new Array();
var labels = new Array();
var rules = new Array();
var count=0;
this.addField = function(field, label, rule)
{
fields[count] = field;
labels[field] = label;
... | <p>Use objects instead:</p>
<pre><code>function formBuddy()
{
var fields = {};
var labels = {};
var rules = {};
var count = 0;
this.addField = function(field, label, rule)
{
fields[count] = field;
labels[field] = label;
rules[field] = rule;
count++;
}
}
</co... |
What's the difference between grep and map in Perl? <p>In Perl both <code>grep</code> and <code>map</code> take an expression and a list, and evaluate the expression for each element of the list.</p>
<p>What is the difference between the two?</p>
| <p><code>grep</code> returns those elements of the original list that match the expression, while <code>map</code> returns the result of the expression applied to each element of the original list.</p>
<pre><code>$ perl -le 'print join " ", grep $_ & 1, (1, 2, 3, 4, 5)'
1 3 5
$ perl -le 'print join " ", map $_ &am... |
Java Regex - reduce spaces in a string <p>I don't have time to get my head around regex and I need a quick answer. Platform is Java.</p>
<p>I need the string </p>
<pre><code>"Some text with spaces"
</code></pre>
<p>...to be converted to</p>
<pre><code>"Some text with spaces"
</code></pre>
<p>i.e., 2 or more co... | <pre><code>String a = "Some text with spaces";
String b = a.replaceAll("\\s+", " ");
assert b.equals("Some text with spaces");
</code></pre>
|
In NHibernate, can I use factory to build complex aggregate object (Entity)? <p>In NHibernate, can I use factory to build complex aggregate object (Entity)?
If yes then how?
If not.. then what is your approach?</p>
| <p>Yes. If you can make the object as a POCO, you can map in to your database with NHibernate.</p>
<p>However, you don't actually understand exactly what you need, so please post clearer requirements and I'll be able to help you better.</p>
|
Confusion about streamwriters and how compression works <p>Before I begin, is it possible to write a .doc file with mixed content using a streamwriter? For example, I may have a .doc file with images and text - would a streamwriter be suitable for this? I assume a textwriter is for writing a text only document.</p>
<p... | <p>I think you are confused about compression in general.</p>
<p>You "compress" any data to reduce its size. But by reducing it size the structure of the data must also be changed.</p>
<p>So if you save an MS Word document a .doc file, you will get MS Word document structure in the .doc file.</p>
<p>But if you then ... |
Is the Content folder sacred in asp.net mvc? <p>Is the Content folder special to the underlying framework of MVC? I can't find any reference to it in routing code or configuration.</p>
<p>I'm just wondering if static content can be handled in different ways.</p>
<p>On a related note, stackoverflow's script and css co... | <p>No magic, the System.Web.Routing.RouteCollection class has a property RouteExistingFiles which controls the behavior.</p>
<p>The default is false, which means ASP Routing should not route the URL, but just return the default content. In this case the "/Content/all.min.css?v=251" skips the MVC routing rules entirel... |
How to obtain the keycodes in Python <p>I have to know what key is pressed, but not need the code of the Character, i want to know when someone press the 'A' key even if the key obtained is 'a' or 'A', and so with all other keys.</p>
<p>I can't use PyGame or any other library (including Tkinter). Only Python Standard ... | <p>See <a href="http://docs.python.org/library/tty.html">tty</a> standard module. It allows switching from default line-oriented (cooked) mode into char-oriented (cbreak) mode with <a href="http://docs.python.org/library/tty.html#tty.setcbreak">tty.setcbreak(sys.stdin)</a>. Reading single char from sys.stdin will resul... |
How do I access the original method of a monkeypatched method in Perl? <p>I'm trying to <a href="http://en.wikipedia.org/wiki/Monkey_patch" rel="nofollow">monkey patch</a> a Perl class: I want to change the behavior of an existing method. </p>
<p><a href="http://www.perlmonks.org/?node_id=694332" rel="nofollow">This n... | <h2>Typeglob assignment</h2>
<pre><code>*ExistingClass::oldExistingFunction = *ExistingClass::existingFunction;
</code></pre>
<p>Quick and dirty. This aliases all <code>existingFunction</code> symbols to <code>oldExistingFunction</code>. This includes the sub you're interested in, but also any scalars, arrays, hash... |
Set default values for a global variable in a custom class? <p>I have a custom class that has quite a few accessor methods for customizing it. My question is, if a programmer uses this class and doesn't bother to assign values for ALL of these methods because he doesn't know about them or doesn't want to bother, how ca... | <p>I'm confused about what you're trying to do. If you want to set default values for class members, just assign to them in your <code>init</code> method(s):</p>
<pre><code>- (id) init
{
if((self = [super init]))
{
member1 = member1default;
member2 = member2default; // etc.
}
return s... |
Are Denormalized Updates Possible With NHibernate Without Using a Stored Procedure? <p>I'm pondering the use of NHibernate on a project that has a database with some degree of planned denormalization (planned by the DBAs). Reading from one set of tables and mapping one column to one property is not a problem. However w... | <p>Yes, you can register an event listener inheriting from DefaultSaveOrUpdateEventListener, override OnSaveOrUpdate and update the other entities.</p>
<p>Here are some blog posts about event listeners:</p>
<ul>
<li><a href="http://nhforge.org/blogs/nhibernate/archive/2008/09/06/soft-deletes.aspx" rel="nofollow">http... |
Which C Compiler do you recommend for windows <p>Which C Compiler do you recommend for Windows (Not C++, C ANSI)</p>
<p>Related:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/116368/c-compiler-for-windows">c compiler for windows</a></li>
<li><a href="http://stackoverflow.com/questions/397377/c-c-compiler-f... | <p><a href="http://www.mingw.org">Mingw</a></p>
<p>Free. Open source. GNU. Compiles native windows binaries. Can't get much better than that.</p>
|
Is a Ruby module equivalent to a Java Interface? <p>As I understand it, an interface is Java is intended to enforce a design by laying out methods for classes implementing the interface to fill in. Is this the idea with a Ruby module also? I see that just like with Interfaces in Java, you can't instantiate a module in ... | <p>The short answer is no.</p>
<p>Here's the reasoning, a Java/C# interface defines the method signatures an implementing class will provide at minimum. </p>
<p>Additionally:</p>
<ul>
<li>With ruby modules there is no such contract because of the duck-typing. </li>
<li>Modules are just a way to extract out common fu... |
Property-values database <p>I have a number of objects, each one have an arbitrary number of shared, and distinct property-value pairs (more specifically: files, and their related properties -such as width, and height values for images, album/artist/length for music files, etc). I'd like to be able to search for object... | <p>Searching for an object having some properties makes me think about a RDF datastore. Have a look a a RDF API (see JENA , sesame, virtuoso ).</p>
<p>Or BerkeleyDB ?</p>
|
NSTimeInterval to readable NSNumber <p>NSTimeInterval == double; (e.g. 169.12345666663)</p>
<p>How can I round up this double so that there are only 2 digits left after the "dot"?<br />
It would be very good if the result is a NSNumber.</p>
| <p>If this is for display purposes, take a look at <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumberFormatter_Class/Reference/Reference.html">NSNumberFormatter</a>.</p>
<p>If you really want to round the double in your calculations for some reason, you can use the standard C... |
How can I unobtrusively disable submit buttons with Javascript and Prototype? <p>So I found <a href="http://stackoverflow.com/questions/326919/disabling-button-with-javascript-ff-vs-ie/327152#327152">this</a> recommendation, but I can't quite seem to figure out how.</p>
<p>This is the code I originally started with:</... | <p>You need to do exactly what the answer says :</p>
<p>"Do not disable the button in its "onclick", but save it, and do it in form's onsubmit."</p>
<p>So in greySubmits() keep the line that sets the hidden value, but remove the line that disables all the submit buttons.</p>
<p>Then add another event handler in your... |
Changing an IIS6 website directory remotely <p>First, the prior situation: We have this project with a one-click build script. It's cobbled together with TFS Deployer + PowerShell + VB Script. TFS Deployer sits on the production machine, copies the new website files into a brand new directory, and then calls a VB Scr... | <p>Could you change the vbscript file into an ASP file in a different website on the same server? This would allow you to call it remotely.</p>
|
What's the best way to diff two database backup files with MS Sql Server 2005? <p>I have two database backup files. I would like to know if there is any difference between the two. I could go row by row, field by field and do a diff (I'm not looking for differences in schema but rather data, although I expect the schem... | <p>Restore both backups to temporary database (might need to use 'WITH MOVE' to rename logical name), and then use a tool like RedGate's Data Compare.</p>
|
Asynchronous Webrequest best practices <p>What is the best practice for getting a webrequest asynchronously?</p>
<p>I want to download a page from the internet (doesn't matter what)
and avoid blocking a thread as much as possible.</p>
<p>Previously I believed that it was enough to just use the 'BeginGetResponse' and ... | <p>You could code this all yourself or you could just use WebClient which does a lot of the grunt work for you. For example, to download file as a string you would call DownloadStringAsync() which eventually will trigger the OnDowloadStringCompleted event. If the file is binary you might try using DownloadDataAsync() i... |
Lock android app after a certain amount of idle time <p>My android application requires a password to be entered in the first activity. I want to be able to automatically send the application back to the password entry screen after the application has been idle for a fixed amount of time.</p>
<p>The application has mu... | <p>I know another answer is accepted already, but I came across this working on a similar problem and think I'm going to try an alternate much simpler approach that I figured I may as well document if anyone else wants to try to go down the same path.enter code here</p>
<p>The general idea is just to track the system ... |
Which is better code for converting BSTR parameters to ANSI in C/C++? <p>So far I've discovered I can convert incoming BSTRs to ANSI in two (of many?) ways, and I'm curious to know whether one is "better" than the other with respect to speed / efficiency etc.</p>
<p>The way I've been using for a while is use the <code... | <p>From <a href="http://msdn.microsoft.com/en-us/library/87zae4a3(vs.71).aspx" rel="nofollow">MSDN</a>:</p>
<blockquote>
<p>[...]The recommended way of converting to and from BSTR strings is to use the <a href="http://msdn.microsoft.com/en-us/library/zh7x9w3f(VS.71).aspx" rel="nofollow">CComBSTR</a> class. To conver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.