input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Conditions for a meta-circular evaluator <p>Are there any conditions that a language must satisfy so that a meta-circular evaluator can be written for that language? Can I write one for BASIC, or for Python? </p>
| <p>To quote <a href="http://weblog.raganwald.com/2006/11/significance-of-meta-circular%5F22.html" rel="nofollow">Reg Braithwaite</a>:</p>
<blockquote>
<p>The difference between self-interpreters and meta-circular interpreters is that the latter restate language features in terms of the features themselves, instead o... |
Photoshop Undo System <p>The question probably applies to drawing systems in general. I was wondering how the undo functionality is implemented in PS. Does the program take snapshots of the canvas before each operation? If so, wouldn't this lead to huge memory requirements? I've looked into the Command pattern, but I c... | <p>It's called the <a href="http://en.wikipedia.org/wiki/Command%5Fpattern" rel="nofollow">command pattern</a>. It's simple to implement as useful for any sort of editor.</p>
<p>Photoshop applies stacked transformations upon the original image. One opetation one command. It simply unapplies the transformation when you... |
Smooth screen recording software <p>I am preparing for my senior thesis presentation. I'd like to back myself up in case there is no internet connection available. Therefore I want to record a video showing the functionality of my software. I have tried Camtasia but all the smooth and slick animations I've created, do ... | <p>List of <a href="http://en.wikipedia.org/wiki/List%5Fof%5Fscreencasting%5Fsoftware" rel="nofollow">screencasting</a> software</p>
<p>Also, this <a href="http://www.screentoaster.com/" rel="nofollow">ScreenToaster</a> <a href="http://www.lifehacker.com.au/2009/01/screentoaster%5Frecords%5Fscreencasts%5Fand%5Faudio%5... |
efficient java object graph serialization <p>What is the best approach for serializing java object graphs?</p>
<p>My requirements for serialization library are
1) speed of deserialization
2) size - as small as possible (smaller than in java default serialization)
3) flexibility - annotation based definitions of what h... | <p>For small objects, the Java serialised form is likely to be dominated by the description of the serialised classes.</p>
<p>You may be able to write out serialised data for commonly used classes, and then use that as a common prefix for a series of serialised streams. Note that this is very fragile, and you'll proba... |
extract title tag from html <p>I want to extract contents of title tag from html string. I have done some search but so far i am not able to find such code in VB/C# or PHP. Also this should work with both upper and lower case tags e.g. should work with both <code><title></title></code> and <<code>TITLE&g... | <p>You can use regular expressions for this but it's not completely error-proof. It'll do if you just want something simple though (in PHP):</p>
<pre><code>function get_title($html) {
return preg_match('!<title>(.*?)</title>!i', $html, $matches) ? $matches[1] : '';
}
</code></pre>
|
Python's subprocess.Popen returns the same stdout even though it shouldn't <p>I'm having a very strange issue with Python's subprocess.Popen. I'm using it to call several times an external exe and keep the output in a list. </p>
<p>Every time you call this external exe, it will return <strong>a different string</stro... | <p>It is possible (if <code>C_KEY_MAKER</code>'s random behaviour is based on the current time in seconds, or similar) that when you run it twice on the command line, the time has changed in between runs and so you get a different output, but when python runs it, it runs it twice in such quick succession that the time ... |
Configure Log4Net for NHibernate <p>This has got to be a lamer question:</p>
<p>In my test project I am attempting to configure log4net. The following method call gives the error.</p>
<p>BasicConfigurator.Configure();</p>
<p>"type name expected but method found"</p>
<p>What am I overlooking?</p>
<p>Thanks,
Nick</... | <p>Is this a compile time error or runtime error? Do you have a <code>using log4net.Config</code> statement in your class file? Does it still happen if you change it to reference the full class name?</p>
<pre><code>log4net.Config.BasicConfigurator.Configure();
</code></pre>
|
Comparing HTTP and FTP for transferring files <p>What are the advantages (or limitations) of one over the other for transferring files over the Internet?</p>
<p>(I am aware of secure forms of both protocols. I'd like to hear comparisons through personal experiences in terms of performance, reliability, file size limit... | <p>Here's a <a href="http://www.isi.edu/lsam/publications/http-perf/">performance comparison</a> of the two. HTTP is more responsive for request-response of small files, but FTP may be better for large files if tuned properly. FTP used to be generally considered faster. FTP requires a control channel and state be ma... |
Debugging flash with gdb-mode in Emacs <p>I'm trying to debug a swf using fdb, the flash debugger that comes with the flex SDK, on Linux. Debugging from a terminal works, but if I do it from within Emacs by doing</p>
<pre><code>M-x gdb
fdb -f myswf.swf RET
</code></pre>
<p>fdb seems to hang as soon as I issue any com... | <p>I realize this one is a bit late, but I'm leaving it here for posterity: The command to use is <code>gud-gdb</code>. You should then run fdb with <code>fdb -f</code>. Once you're inside fdb, point the debugger to the swf using <code>run <path_to_swf></code>.</p>
|
Best way to offload heavy processing (like image resizing) out of PHP request <p>I'm working on a PHP web interface that will receive huge traffic. Some insert/update requests will contain images that will have to be resized to some common sizes to speed up their further retrieval.</p>
<p>One way to do it is probably... | <p>If what you're doing is really high volume then what you're looking for is something like <a href="http://xph.us/software/beanstalkd/" rel="nofollow">beanstalkd</a>. It is a distributed work queue processor. You just put a job on the queue and then forget about it.</p>
<p>Of course then you need something at the ot... |
When to use asynchronous operations in asio <p>When should I use asynchronous operations in boost::asio instead of synchronous operations in seperate threads?</p>
| <p>Does the <a href="http://www.boost.org/doc/libs/1%5F37%5F0/doc/html/boost%5Fasio/overview/rationale.html">Rationale</a> section help?</p>
<blockquote>
<p>Most programs interact with the outside world in some way, whether it be via a file, a network, a serial cable, or the console. Sometimes, as is the case with n... |
input and output without a library in C <p>I'm writing a small kernel for my programs in C.</p>
<p>This is not (at the moment) an OS kernel, it's merely a way for me to keep track of input and output in programs without relying on external source (i.e. stdio.h). You might ask me why I'd ever want to do this; it's just... | <p>There is a lot of room between the bare metal and stdio. You have said you aren't writing an OS kernel, but not whether or not you are running under an OS.</p>
<p>Running directly on hardware without an OS, you will still want to encapsulate all of your I/O operations in a module, even if you don't formally define ... |
Trouble using sandbox of symfony <p>I'm new to symfony and I am trying to run a simple command on the command line but I get an error message.</p>
<p>When I try to execute the command:</p>
<pre><code>d:\new_xam\xampp\htdocs\sf_sandbox_1_2\sf_sandbox>symfony propel:build-model "
</code></pre>
<p>I get the error:</... | <p>This is a fairly common issue on Windows systems for people new to Symfony and/or PHP. It seems to be an issue with the PHP path. See here: <a href="http://forum.symfony-project.org/index.php/m/44895/?srch=php.exe%2Bcommand#msg%5F4489" rel="nofollow">http://forum.symfony-project.org/index.php/m/44895/?srch=php.exe... |
Is Ruby really an interpreted language if all of its implementations are compiled into bytecode? <p>In the chosen answer for <a href="http://stackoverflow.com/questions/716543/what-is-the-significance-for-ruby-programmers-of-saps-new-implementation-of-ruby">this question about Blue Ruby</a>, Chuck says:</p>
<blockquot... | <p>Yes, Ruby's still an interpreted language, or more precisely, Matz's Ruby Interpreter (MRI), which is what people usually talk about when they talk about Ruby, is still an interpreter. The compilation step is simply there to reduce the code to something that's faster to execute than interpreting and reinterpreting t... |
Running a stubborn executable in Dos Batch file <p>I've got a pretty stubborn executable that I would like to execute sequentially multiple times from within a Dos batch file. (Due to IT constrains currently constrained to using Dos batch files.)</p>
<p>I am able to use START to launch the executable, however, it see... | <p>You can pipe the input from other file, for example,</p>
<p>Write a text file with one carriage return and call it like..</p>
<p>start "YourExe.exe < text.txt",</p>
|
java.lang.OutOfMemoryError: Java heap space with NetBeans <p>This is the error I get when I run my web application in an instance of the Tomcat servlet container started by NetBeans. To fix this I even changed the heap size in netbeans.conf, but still it shows the same error. How can I keep this from happening?</p>
<p... | <p>Changing the heap size in netbeans.conf only changes the heap for NetBeans itself, not for applications run through NetBeans.</p>
<p>The correct way is to right-click on the project and select "Properties" and then "Run"; there you can set the VM options appropriately (<code>-Xmx256m</code>, for instance). It shoul... |
request.getresponse() giving error bad username and password <p>Im trying to access a file using request.getstream() on a server A and I have also given the network credentials.Those credentials have the admin rights on that server.
But while using request.getresponse() it is showing me error Login failure: bad usernam... | <p>You may have to supply the domain as well in the username for instance "DOMAIN\USERNAME"</p>
|
ASP.NET MVC - Pass array object as a route value within Html.ActionLink(...) <p>I have a method that returns an array (string[]) and I'm trying to pass this array of strings into an Action Link so that it will create a query string similar to:</p>
<pre><code>/Controller/Action?str=val1&str=val2&str=val3...etc
... | <p>Try creating a RouteValueDictionary holding your values. You'll have to give each entry a different key.</p>
<pre><code><% var rv = new RouteValueDictionary();
var strings = GetStringArray();
for (int i = 0; i < strings.Length; ++i)
{
rv["str[" + i + "]"] = strings[i];
}
%>
<... |
Does the Python library httplib2 cache URIs with GET strings? <p>In the following example what is cached correctly? Is there a Vary-Header I have to set server-side for the GET string?</p>
<pre><code>import httplib2
h = httplib2.Http(".cache")
resp, content = h.request("http://test.com/list/")
resp, content = h.reques... | <p>httplib2 uses the full URI for the cache key, so in this case each of the URLs you have in your example will be cached separately by the client.</p>
<p>For the chapter and verse from the <code>__init__.py</code> file for httplib2, if you would like proof, have a look at call to the cache on around line 1000:</p>
<... |
Getting the last record inserted into a select query <p>I am creating a small message board and I am stuck</p>
<p>I can select the subject, the original author, the number of replies but what I can't do is get the username, topic or date of the last post.</p>
<p>There are 3 tables, boards, topics and messages.</p>
<... | <p>if your SQL supports the LIMIT clause, </p>
<pre><code>SELECT m.author, m.date, t.topicname FROM messages m
JOIN topics t ON m.topicid = t.topicid
ORDER BY date desc LIMIT 1
</code></pre>
<p>otherwise:</p>
<pre><code>SELECT m.author, m.date, t.topicname FROM messages m
JOIN topics t ON m.topicid = t.topicid
W... |
Can I call a Stored Procedure from an EntityDataSource? <p>(ASP.net 3.5, C#, SQL Express 2008)</p>
<p>I want to have a Web Form, where I can search for "Solutions" (my table) using a keyword entered by the user and after the result comes back and populates a GridView. </p>
<p>I already have parts of this search via a... | <p>Try using the <code>Function Import</code>.</p>
<ol>
<li>Right click on the EntitySet Name (the heading part)</li>
<li>Choose Add->Function Import</li>
</ol>
<p>Here is a good blog post for you to check out. <a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/12/17/ado-net-entity-framework-tools-store... |
Jquery passing variable problem <pre><code> for(var n=0;n<10;n++)
{
$('#content-scroll'+n).mousewheel(function(event, delta) {
if (delta > 0) sliderUp(n-1);
else if (delta < 0) sliderDown(n-1);
return false; // prevent default
});
n++;
}
</code></pre>
<p>I have a problem with this ... | <p>My take on this using a fully jQuery solution.</p>
<pre><code>$("[id^='content-scroll']").mousewheel( function(event,delta) {
var n = this.id.replace(/content-scroll/,'');
if (delta > 0)
sliderUp(n);
else if (delta < 0)
sliderDown(n);
event.preventDefault();
});
</code></pr... |
How to install SimpleJson Package for Python <p><a href="http://pypi.python.org/pypi/simplejson">http://pypi.python.org/pypi/simplejson</a></p>
<p>I am just diving into the Python world and want to make a simple twitter application which requires the installation of simplejson but not sure how I can set it up and get ... | <p>I would recommend <a href="http://pypi.python.org/pypi/setuptools#windows">EasyInstall</a>, a package management application for Python.</p>
<p>Once you've installed EasyInstall, you should be able to go to a command window and type:</p>
<pre><code>easy_install simplejson
</code></pre>
<p>This may require putting... |
Pass by name and pass by value-result languages <p>For my programming languages course, I'm trying to write some code snippets in languages that use pass by name or pass by value-result, preferably by default, but any language that even supports either of those would be fine. However, I haven't been able to find a sing... | <p>The <a href="http://en.wikipedia.org/wiki/Evaluation%5Fstrategy" rel="nofollow">wikipedia article on evaluation strategy</a> suggests that call-by-value-result is supported by fortran. Call-by-name is supported by algol 68.</p>
|
Downloading webpage image from SSL + WatiN <p>I've been thinking about this and can't seem to find a way to do this:
I've got some code running on WatiN 2.0 which connects to a site via an SSL tunnel, and after performing certain tasks (which there're no other feasible ways to automate without relying on a browser) sho... | <p>If I understand you correctly, you are trying to go to a web page (via multiple steps) and then save a copy of an image (dynamically generated) on that page right?</p>
<p>If so, I don't think there's a way to do this built in to WatiN, but I stumbled across <a href="http://sourceforge.net/mailarchive/forum.php?thre... |
How can you find the polynomial for a decimated LFSR? <p>I know that it if you decimate the series generated by a linear feedback shift register, you get a new series and a new polynomial. For example, if you sample every fifth element in the series generated by a LFSR with polynomial x<sup>4</sup>+x+1, you get the se... | <p>Recently read this article and thought of it when seeing your question, hope it helps.. :oÃ</p>
<p>Given a primitive polynomial over GF(q), one can obtain another primitive polynomial by decimating an LFSR sequence obtained from the initial polynomial. This is demonstrated in the code below. </p>
<blockquote>
<... |
How to apply <p></p> tags to a text field <p>I've got a varchar() field in SQL Server that has some carriage return/linefeeds between paragraph marks. </p>
<p>I'd like to turn it into properly formatted HTML. </p>
<p>For instance:</p>
<p>---------- before ----------</p>
<p>The quick brown fox jumped over the lazy ... | <p>A regular expression is not required for something like this. Plain string operations can do it. (Example in C#):</p>
<pre><code>text = "<p>" + text.Replace("\r\n", "</p><p>") + "</p>";
</code></pre>
<p>(Depending on if the line breaks are system dependent or not you should use either a spe... |
What version of SQL Server do I need to move database to production server? <p>I have just finished developing an ASP.NET on my local Windows XP machine. I used Visual Studio 2008 and SQL Server express to develop the site.</p>
<p>My problem is that now I would like to move the SQL Server database from my XP machine t... | <p>SQL Server Express will be just fine for this- it uses the same native file format as the more-expensive editions. All you need to do is detach the db file, copy it to production, attach the production server to the copied file, and you're good... well, mostly good. This won't cover certain things, like logins or m... |
Trying to upload a file with ASP.NET MVC <p>I am trying to upload a file with ASP.NET MVC.</p>
<p>The following code work perfectly fine:</p>
<pre><code>// Read in the image data.
byte[] binaryData = null;
HttpPostedFileBase uploadedFile = Request.Files["ImageFileName"];
if (uploadedFile != null &&
upload... | <p>No bloody way :(</p>
<p>I figured out that answer and it's pretty lame.</p>
<p>I had to have the argument <em>NAME</em> being identical to the Id/Name values of the input type="file" element!!! (not sure if it's either or both element values ... i didn't check that bit out).</p>
<p>so this is the answer.</p>
<h3... |
Segmentation fault in strcpy <p>consider the program below</p>
<pre><code> char str[5];
strcpy(str,"Hello12345678");
printf("%s",str);
</code></pre>
<p>When run this program gives segmentation fault.</p>
<p>But when strcpy is replaced with following, program runs fine.</p>
<pre><code>strcpy(str,"Hello123... | <p>There are three types of standards behaviour you should be interested in.</p>
<p>1/ <em>Defined behaviour</em>. This will work on all complying implementations. Use this freely.</p>
<p>2/ <em>Implementation-defined behaviour</em>. As stated, it depends on the implementation but at least it's still defined. Impleme... |
Maintaining page breaks <p>In my Rails app, I have a lot of data that is declared as <code>text</code> in the migration file. But when I print these attributes/fields out in the view, all the line breaks are lost and I get one large chunk of text. How do I maintain the line breaks?</p>
| <p>This is an HTML problem. Its rules state that consecutive whitespace is converted to a single space.</p>
<p>Rails has a <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001719" rel="nofollow"><code>simple_format</code></a> function that wraps blocks of text in <p> tags so you get the ... |
C# dictionary<> missing key <p>When i do val = dict["nonexistent key"] i get System.Collections.Generic.KeyNotFoundException
Is there a way i have my dictionary call a member function with the key as a param to generate a value?</p>
<p>-edit-
Maybe i should of been more specific. I want to AUTOMATICALLY call a member ... | <p>Use an extension method:</p>
<pre><code>static class DictionaryExtensions {
public static TValue GetValueOrDefault<TKey, TValue>(this Dictionary<TKey,TValue> dic, TKey key, Func<TKey, TValue> valueGenerator) {
TValue val;
if (dic.TryGetValue(key, out val))
return val;
... |
Not nullable types <p>Is there a way to create a non nullable type in C# (like DateTime or TimeSpan).?</p>
<p>Also is there a way (an attribute maybe) to enforce that not null arguments wouldn't be passed to methods and properties without adding </p>
<pre><code>if(arg1 == null)
{
throw new ArgumentNullException("t... | <p><code>DateTime</code> and <code>TimeSpan</code> are not-nullable since they are <code>struct</code>s rather than <code>class</code>es. </p>
<p>As for your second question, there is no standard way you can do this in C#. You can do this using PostSharp, which is an AOP framework, or with <a href="http://research.mic... |
How to traverse a binary tree in O(n) time without extra memory <p>Given a binary tree with an integer, Left & Right pointers, how can one traverse the tree in O(n) time and O(1) extra memory (no stack/queue/recursion)?</p>
<p><a href="http://nandacumar.blogspot.com/2006/06/traversing-tree.html">This guy</a> gave ... | <p>Any good algorithm book will have this algorithm, look e.g. in Knuth (TAOCP I.2.3.1 Traversing binary trees, excercise 21). However, because this algorithm modifies the tree in place, you must use <em>extreme</em> caution in a multi-threaded environment.</p>
<p>You might also use threaded trees (see in Knuth).</p>
|
Stretch right float div width? <p>I have 2 float:left div, the first is fixed and i want the second div stretch the remain space.</p>
<pre><code><div id="container">
<div id="leftform"> </div>
<div id="rightform"> </div>
</div>
</code></pre>
<p>Any idea? Thanks</p>
| <p>In CSS2:</p>
<pre><code>#container {display:table; table-layout:fixed;}
#leftform, #rightform {display:table-cell;}
#leftform {width:100px;}
</code></pre>
<p>In world of IE hacks:</p>
<pre><code>#container {padding-left:100px;}
#leftform {float:left; width:100px; margin-left:-100px;}
</code></pre>
|
Visual Studio add-in API resources <p>Where can I find examples and API information, besides the MSDN, on creating add-ins for Visual Studio .net 2008?</p>
| <ol>
<li>Download the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=30402623-93ca-479a-867c-04dc45164f5b&DisplayLang=en">Visual Studio SDK</a>.</li>
<li>Go to the <a href="http://msdn.microsoft.com/en-us/vsx/default.aspx">Visual Studio Extensibility</a> Developer Center</li>
<li>Visit the <a hre... |
Conversion tool comparisons for visual basic 6.0 <p>Has anyone here used either of the following (or any other tool) to convert your vb6 code to a .net language?</p>
<p><a href="http://www.artinsoft.com/pr%5Fvbcompanion.aspx"><strong>Artinsoft's upgrade companion</strong> </a> (converts to c# and vb.net)</p>
<p><a hr... | <p>I am Eugenio La Mesa, general manager at Code Architects. I read a few comments on our VB Migration Partner and conversion tools in general, and thought I might add some hopefully useful hints.</p>
<p>First, our conversion software does support all VB6 graphic properties and methods â with the only exception of D... |
Quick sort in GLSL? <p>I'm considering porting a large chunk of processing to the GPU using a GLSL shader. One of the immediate problems I stumbled across is that in one of the steps, the algorithm needs to maintain a list of elements, sort them and take the few largest ones (which number is dependent on the data). On ... | <p>Disclosure: I really don't know GLSL -- I've been doing GPGPU programming with the AMD Stream SDK, which has different programming language.</p>
<p>From you comment on Bjorn's answer, I gather that you are <strong>not</strong> interested in using the GPU to sort a huge database -- like creating a reverse phone boo... |
Why POP3 protocol survives? <p>I am getting some basic knowledge e-mail protocol. It seems that IMAP is more powerful than POP3. Then, why POP3 protocol survives? and it is still supported by popular email service like GMail?</p>
<p>Thanks.</p>
| <p>Read the IMAP specification(s) and you know. POP3 is more KISS than IMAP.</p>
|
ASP.NET Workflow CallExternalMethod <p>I'm not sure if im missing something obvious, with Windows Workflow used from within ASP.NET I don't really know how to get output from the Workflow back to the ASP.NET workflow. </p>
<p>I have my workflow setup to handle external event, so my web page can invoke it, which works ... | <p>This link has information about passing information in and out of workflows:</p>
<p><a href="http://books.google.com/books?id=s5eVXpNmQxgC&pg=PA32&dq=pro%2Bwindows%2Bworkflow%2Bfoundation#PPA241,M1" rel="nofollow">http://books.google.com/books?id=s5eVXpNmQxgC&pg=PA32&dq=pro+windows+workflow+foundati... |
NSArray with Custom Objects in NSTableDataSource <p>I am trying to make NSTableDataSource compatible object and give this object to NSTableView as DataSource, however when table tries to display data, it crashes. </p>
<pre><code>@interface NSArrayDataSource : NSObject{
NSArray* internalArray;
}
-(id) initWithArray... | <p>In answer to your question about <code>NSArray</code> object creation, yes, each object receives a <code>retain</code> message when it is added to the array, and a <code>release</code> message when it is removed. From the Apple docs:</p>
<blockquote>
<p>In general, objects that you add to an array arenât copied... |
Is there an async version of DirectoryInfo.GetFiles / Directory.GetDirectories in dotNet? <p>Is there an asynchronous version of DirectoryInfo.GetFiles / Directory.GetDirectories in dotNet? I'd like to use them in an F# async block, and it'd be nice to have a version that can be called with AsyncCallbacks. </p>
<p>P... | <p>I didn't find an async version of GetFiles, however if you look at the sourcecode for other Async operations, they're defined as follows:</p>
<pre><code>module FileExtensions =
let UnblockViaNewThread f =
async { //let ctxt = System.Threading.SynchronizationContext.Current
d... |
Kohana - where do you put AJAX scripts? <p>I am using <a href="http://kohanaphp.com/">Kohana</a> but this question applies to Rails, CI, or any other MVC web development framework. Where is the best place to stick one's server side AJAX scripts? </p>
<p>I was <em>planning</em> on creating an Ajax_Controller and using ... | <p>I tend to put my ajax actions in the same controller as the non-ajax actions for any given model.</p>
<p>When I can, I try to use the same actions and only change the output type. Most tasks should have a non-ajax version anyway, so this tends to work quite well. Very handy for reducing logic duplication.</p>
|
Is it possible to deploy a Common Lisp (or other dialect) desktop application for several platforms? <p>I would like to develop a graphical application in Common Lisp or other Lisp dialect that could be deployed in Mac, Windows and Linux as a way of improving my knowledge of this language. Ideally:</p>
<ol>
<li>would ... | <p>I'm one of the developers of lispbuilder-sdl which is currently hosted on google code.</p>
<p><img src="http://img10.imageshack.us/img10/7664/mandelbrot.jpg" alt="alt text" /></p>
<p><a href="http://code.google.com/p/lispbuilder/">http://code.google.com/p/lispbuilder/</a></p>
<p>This gives you a way of running co... |
Why won't this Javascript Function Work? <p>I have a JavaScript function that is not working now that I put in a new one under it. Here is what is in the head of my document.</p>
<pre><code> <head>
<link rel="stylesheet" href="9j3nz/style.css" type="text/css">
<script src="jquery.js"></script&g... | <p>Seems like your stopRKey is always returning false which could be blocking your isNumberKey.</p>
<p>Try re-arranging your parens.</p>
<pre><code>if ((evt.keyCode == 13) && (node.type=="text"))
$("label#enter_error").show();
{return false;}
</code></pre>
<p>Should be</p>
<pre><code>if ((evt.keyCode == 1... |
Where is the log file when I'm using svn+ssh? <p>Title is pretty much the question. I have a post-commit that has taken me ages to get permissions working correctly.</p>
<p>I can run it manually and it works, however, when I actually make a commit (as the same user that I know works manually) nothing happens.</p>
<p... | <p>Did you try debugging the hook per the subversion directions? </p>
<p><a href="http://subversion.tigris.org/faq.html#hook-debugging" rel="nofollow">Why aren't my repository hooks working?</a></p>
<blockquote>
<p>They're supposed to invoke external programs, but the invocations never seem to happen.</p>
<p>B... |
SciFi-HiFi Keychain problem - SecKeychainItemRef undeclared error <p>I'm trying to use this class:</p>
<p><a href="http://log.scifihifi.com/post/55837387/simple-iphone-keychain-code" rel="nofollow">http://log.scifihifi.com/post/55837387/simple-iphone-keychain-code</a></p>
<p>to save data to the keychain on the iPhone... | <p>I believe the full iPhone Keychain API is now available in the simulator (as of 3.0)... just make sure any #ifdefs that refer to <pre>TARGET_ IPHONE_SIMULATOR</pre> are disabled, and you should be fine.</p>
|
Updating ModelState with model object <p>The problem: How to update ModelState in posting+validation scenario.</p>
<p>I've got a simple form:</p>
<pre><code><%= Html.ValidationSummary() %>
<% using(Html.BeginForm())%>
<%{ %>
<%=Html.TextBox("m.Value") %>
<input type="submit" />
&... | <p>I know this post is fairly old but it's a problem I've had before and I just thought of a simple solution that I like - just clear the ModelState after you've got the posted values.</p>
<pre><code>UpdateModel(viewModel);
ModelState.Clear();
viewModel.SomeProperty = "a new value";
return View(viewModel);
</code></p... |
Finding duplicate iPhone apps <p>How do I most efficiently determine whether my idea for an iPhone app has been done already? iTunes's search isn't great for this purpose, and the websites I've seen covering iPhone apps are not comprehensive in their coverage. (Perhaps I just haven't found THE website that does it.) I'... | <p>The following blog post</p>
<p><a href="http://theappleblog.com/2008/12/26/one-juicer-managing-the-app-store-beast/" rel="nofollow">One Juicer: Managing the App Store Beast</a></p>
<p>has some hints how you could achieve this. For example by using AppShopper's RSS feed. Maybe you're able to scrape some data off th... |
Eclipse RCP: Communication between elements created in different ViewPart? <p>what's the best way to make communications between page widgets residing on differents ViewPart?</p>
<p>via listener or via shared object instances like "getViewSite().getPart()/getPage()" ?
what pro/contra and what's the best strategy for ... | <p>The answer depends on the nature of the changes. Why is one ViewPart causing changes in another ViewPart?</p>
<p>For example, if the change is because one ViewPart is changing the model data and the other ViewPart is displaying the same data then you should be going through the model. One ViewPart updates the mod... |
Purity of methods in C#, evaulation and custom compiler? <p>Have you ever been frustrated by Visual Studio not re-evaluating certain watch expressions when stepping through code with the debugger?</p>
<p>I have and does anyone here care about pure methods? Methods with no side-effects? There's so many great things abo... | <p>Not really. If I want different language options I've already got:</p>
<ul>
<li>F# for a functional bent</li>
<li>Boo for a DSL helper with custom compilation stages</li>
</ul>
<p>The chances of a "design by committee" (or even "design by single amateur language designer") language ending up as well thought out as... |
Linq - How to aggregate the results of another query <p>I want to take the results of a where clause on a list and then take that result set and create just one new type that has all its fields constructed from aggregates of the original query. So given the basic example below, is there anyway to combine the 2 linq st... | <p>This solution iterates the list only once with <code>Aggregate()</code>, but for empty lists it will return the seed value. By the way, the seed values are <code>int.MaxValue</code> and <code>int.MinValue</code> because <code>Math.Min(int.MaxValue, C)</code> will always return C and likewise <code>Math.Max(int.MinVa... |
Sending values with jQuery's Get function <p>I am currently coding something to check my database to check for duplicate errors. It is a form and I am having the following function check for duplicate values using jQuery.get. </p>
<pre><code>function makeAjaxRequest()
{
$("label#bad_error").hide();
$("label#good... | <p>I believe</p>
<pre><code>$.get(url,{sheetnum: '$("input#sheetnum").val()'},verifyDb);
</code></pre>
<p>should be</p>
<pre><code>$.get(url,{sheetnum: $("input#sheetnum").val()},verifyDb);
</code></pre>
|
open source dev environment for C++: what's better? <p>I want to do some coding in my spare time, but the thing is, I don't want to spend the money on this.</p>
<p>Would the following set of development tools be The Right Thing, or is there something I'm forgetting?</p>
<ul>
<li>Eclipse for C++</li>
<li>SVN for sourc... | <p>Microsoft Visual C++ Express is free and easily the best IDE for Windows. Furthermore, you can use it to work on cross-platform code - it more depends on writing standards-adhering code and using portable libraries.</p>
<p>If you want to write cross-platform code, I recommend a cross-platform build tool. I use CMak... |
How do I set Session name with Cherrypy? <p>In PHP I would do it like this:</p>
<pre><code>session_name("special_session_name");
</code></pre>
<p>So how do I do it with Cherrypy?
Just need to find exact equivalent for it.
PHP manual page:
<a href="http://fi2.php.net/session_name" rel="nofollow">http://fi2.php.net/se... | <p>Reading the docs and the source most probably you have to set "tools.sessions.name" in your config file:</p>
<pre><code>cherrypy.config.update({'tools.sessions.name': "special_session_name"})
</code></pre>
|
C#: Streaming an Audio file from a Server to a Client <p>I am currently writing an application that will allow a user to install some form of an application (maybe a Windows Service) that will open a port on it's PC and given a particular destination on the hard disk, will then be able to stream mp3 files.</p>
<p>I wi... | <p>There is no effective difference between streaming and downloading. They're the same thing. Any difference is purely semantic.</p>
<p>If you wanted to, you could "download" an MP3 from any web server and start playing it while you were downloading it. It just requires that you buffer some of the data and start s... |
Correcting a known bias in collected data <p>Ok, so here is a problem analogous to my problem (I'll elaborate on the real problem below, but I think this analogy will be easier to understand).</p>
<p>I have a strange two-sided coin that only comes up heads (randomly) 1 in every 1,001 tosses (the remainder being tails)... | <p>You are calculating the following</p>
<pre><code>calculatedRatio = heads / (heads + tails / 1000)
</code></pre>
<p>and you need</p>
<pre><code>realRatio = heads / (heads + tails)
</code></pre>
<p>Solving both equations for tails yields the following equations.</p>
<pre><code>tails = 1000 / calculatedRatio - 100... |
submit php variables with javascript (link?) <p>I'm creating a browser based game and at the moment I'm designing the script that updates the position of my character when he/she clicks on a different part of the map.</p>
<p>I am using a bit of ajax to do this which send a request to a php file called position_update.... | <p>You need to hit the URL:</p>
<pre><code>position_update.php?var1=val1&var2=val2
</code></pre>
<p>PHP will parse the get string into $_GET</p>
|
IE Input Select Box <p>I'm looking for the easiest solution to fixing a problem I have in Internet Explorer (6,7 & 8), be it CSS or using jQuery. I have a SELECT Input with a defined width (because of where it sits in the layout). Because of the defined width select is cut off from showing their full values, unlike... | <p><a href="http://css-tricks.com/select-cuts-off-options-in-ie-fix/" rel="nofollow">Here</a> is information and a solution using jQuery.</p>
|
PHP immediate echo <p>I have quite a long data mining script, and in parts of it I echo some information to the page (during a foreach loop, actually.)</p>
<p>However I am noticing that the information is being sent to the browse not immediately as I had hoped, but in 'segments'.</p>
<p>Is there some function I can u... | <p>You probably want <code>flush()</code>. However, PHP may be using output buffering. There are a few ways that this can change things, but in a nutshell, you can <code>flush()</code>, then <code>ob_flush()</code>.</p>
|
Why doesn't this for-each loop work? <p>In this code, why isn't my array initialised as I want it to? Is the for-each loop not designed to do that, or am I just not using it correctly?</p>
<pre><code> int[] array = new int[5];
//initialise array -> Doesn't work! Array still full of 0's
for(int i : array)
i = 2... | <p>The for-each loop will not work for this case. You cannot use a for-each loop to initialize an array. Your code:</p>
<pre><code>int[] array = new int[5];
for (int i : array) {
i = 24;
}
</code></pre>
<p>will translate to something like the following:</p>
<pre><code>int[] array = new int[5];
for (int j = 0; ... |
Using value from related table in LINQ where clause <p>I was expecting the following LINQ query to retrieve all contacts with the specified phone number but instead it returns all contacts that don't have a phone number at all.</p>
<pre><code>var query = from contact in dc.Contacts
where contact.Phones.All... | <p>I should have been using the Any extension method, not All.</p>
<p>The following code works just fine:</p>
<pre><code>var query = from contact in dc.Contacts
where contact.Phones.Any(p => p.PhoneNumber == "5558675309")
select contact;
</code></pre>
|
XML serialize annotations <p>I have a situation where I have an xml file that I don't want to modify.
The AddAnnotation function in XElement class provides an option to add memory-only data which is not serialized and not part of the XML. </p>
<p>I want to be able to save these annotations (for example: to another xml... | <p>It sounds to me like the simplest approach would be to use regular nodes, but in a different xml namespace - i.e.</p>
<pre><code><foo standardAttrubute="abc" myData:customAttribute="def">
<standardElement>ghi</standardElement >
<myData:customElement>jkl</myData:customElement>
&... |
Visual C++ error C2143: syntax error: missing ')' before 'constant' <p>I'm getting an error in Visual C++ that is giving me a really hard time.</p>
<p>The error is error c2143 reading: syntax error: missing ')' before 'constant'</p>
<p>My code line is:</p>
<pre><code>coefficient[i] = (1 - (2 * depth)) + ((t - floor(... | <p>I'm not quite sure if this is the same error that the compiler is giving you, but you have to put a '*' sign in front of the second '2' so that this:</p>
<pre><code>coefficient[i] = (1 - (2 * depth)) + ((t - floor( t + 0.5 ) + 1 ) 2 * depth);
</code></pre>
<p>Becomes this:</p>
<pre><code>coefficient[i] = (1 - (2 ... |
Internal and external interfaces and collections <p>What would be the best way to implement the following?</p>
<p>I have a collection of objects that implement an interface, internally I want to be able to expose set and get on the properties and externally only get.</p>
<p>Here's an example of the sort of thing I wa... | <h3>Use this:</h3>
<pre><code>public interface ITable
{
string Name { get; }
}
public class Table : ITable
{
public string Name { get; internal set; }
}
public class Database
{
public List<ITable> Tables { get; private set; }
}
</code></pre>
<p><strong>Note</strong>: The accessibility modifier use... |
Where does <_o3a_p> come from on a webpage? <p>i got a question from a webdeveloper in my company who got it from a client: when inserting (russian) text into a webpage <strong><_o3a_p></strong> tags appear on the website.</p>
<p>I have (ofcourse) tried to google it but i only stumble upon websites that have these ... | <p>I can't find the cause, but the Google results show it happening on non-Russian pages too.</p>
<p>I'd suggest therefore that internationalisation is <em>not</em> the cause, but that it may be something special about the editor used.</p>
<p>Also, on each page I looked at these were written as HTML tags, but were re... |
I cannot grok MVC, what it is, and what it is not? <p>I cannot grok what MVC is, what mindset or programming model should I acquire so MVC stuff can instantly "lightbulb" on my head? If not instantly, what simple programs/projects should I try to do first so I can apply the neat things MVC brings to programming.</p>
... | <p>I like the way Martin Fowler puts it :)</p>
<p><a href="http://martinfowler.com/eaaCatalog/modelViewController.html" rel="nofollow">http://martinfowler.com/eaaCatalog/modelViewController.html</a></p>
<p>.. and from <a href="http://martinfowler.com/eaaDev/uiArchs.html" rel="nofollow">http://martinfowler.com/eaaDev/... |
Better hashing than SHA1 <p>I'm working on an application and I need to store the users password, so I'm thinking I'll store it in the current-user class of the registry, but I also want to hash it for the obvious reason, and I've seen news items that state that SHA1 has been cracked, is there a better (uncracked) hash... | <p>SHA1 is not <a href="http://en.wikipedia.org/wiki/Encryption" rel="nofollow">encryption</a>, it's a <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="nofollow">cryptographic hash function</a>. And yes it has been broken, which means it's possible to generate collisions faster than a brute force... |
Pinning a delegate within a struct before passing to unmanaged code <p>I'm trying to use an unmanaged C dll for loading image data into a C# application. The library has a fairly simple interface where you pass in a struct that contains three callbacks, one to receive the size of the image, one that receives each row o... | <p>I had a similar problem when registering a callback delegate (it would be called, then poof!). My problem was that the object with the method being delegated was getting GC'ed. I created the object in a more global place so as to keep it from being GC'ed.</p>
<p>If something like that doesn't work, here are some o... |
calling externalinterface.call from embedded swf from another server is not working in Firefox <p>I have an index.html on server A. </p>
<p>In index.html I embed a swf from server B.</p>
<p>The swf contains a init with
flash.external.ExternalInterface.call("alert", "externalalert"); </p>
<p>When I run the swf on... | <p>The fix is to add</p>
<pre><code>System.security.allowDomain("*");
</code></pre>
<p>in your AS code. <code>ExternalInterface</code> requires the <code>allowDomain</code> to be set when HTML-SWF cross-scripting is performed.</p>
<p>Note that you will also need to set <code>allowScriptAccess="always"</code> in the ... |
Removing specific items from Django's cache? <p>I'm using site wide caching with <a href="http://en.wikipedia.org/wiki/Memcached">memcached</a> as the backend. I would like to invalidate pages in the cache when the underlying database object changes. </p>
<p>If the page name changes then I would invalidate the whole c... | <p>I haven't done a lot of caching with Django, but I think what you want here are <a href="http://docs.djangoproject.com/en/dev/topics/signals/" rel="nofollow"><code>signals</code></a>.</p>
<p>You can set up a <code>post_save</code> signal on the underlying object, and have the callback function invalidate that page ... |
web service call returns html <p>I am calling web services from within Microsoft Access and getting html that looks like </p>
<pre><code>"
</code></pre>
<p></p>
<p></p>
<pre><code><link rel="alternate" type="text/xml" href="pfp.asmx?disco"/>
<style type="text/css">
BODY { color: #000000; background-c... | <p>Generally in web services, you get HTML back when the server returns a fault like error 500 or 404. The reason is that the server returns a page with the error details. Is the above the whole text that you get back from the server, or was there an error pasting to StackOverflow??</p>
|
Do you know any real-world, useful WPF/Silverlight applications using MVVM? <p>I'm looking for code of full applications that <strong>(1) use the MVVM pattern</strong> and <strong>(2) are approachable for WPF/Silverlight/MVVM beginners</strong>. So far I have only found:</p>
<ul>
<li><a href="http://www.codeplex.com/c... | <p>I too class myself as a beginner in MVVM developing a large scale application for about a month now. I'm over most of the main hurdles, but keep getting confused up by a few things.</p>
<p>Be careful with the suggestions from Kent. They'll get you started, but the subtle differences in Silverlight and WPF will trip... |
Firefox not able to find iframe <p>This is the iframe I'm trying to access:</p>
<pre><code> <div class="mceBody" id="additionalTxt_b">
<iframe frameborder="0" id="additionalTxt_f" src='javascript:""' class="punymce"/>
</div>
</code></pre>
<p>Using this line:</p>
<pre><code>frames['addition... | <p>The <code>window.frames[]</code> array is indexed by the [i]frame's <code>name</code> attribute (aka frame target). <code>id</code> can't be relied upon to also workâââalthough it may in IE <8, which often thinks names and ids are the same thing.</p>
<p>If you want to access a frame's content via ID, use t... |
ASP.NET Site Membership Fee Processing <p>I am building a site where people will sign up and pay to use an online web app (a yearly fee). What I've been looking for, but can't seem to find is a very simple checkout/order processing component for this type of scenario. I really don't want or need a full-blown shopping c... | <p>Sounds like you've already done the research you need. There isn't any "de-facto standard" library out there for this. But there are definitely a lot of them. Find one that fits your scenario and try it out.</p>
<p>Not much help, I know. I was just going to suggest the two you mentioned already anyway, PayPal and A... |
What to return from a failed method and when to throw? <p>I´ve lately been thinking about the things i´m returning from methods and I noticed that there are 4 different things i return when the method fails. </p>
<p>What bothers me about it, is that my code is not very consitent in this regard, so i wanted to ask ab... | <p>I'd choose between an empty list and an exception depending on the nature of the failure.</p>
<p>E.g.</p>
<p>If your database failed to connect - exception.</p>
<p>If your query didn't return results - empty list.</p>
|
jQuery hyperlinks - href value? <p>On my website I use jQuery to hook the events of elements, namely hyperlinks. As these hyperlinks only perform actions on the current page, and do not lead anywhere, I have been putting a href attribute of "#" in:</p>
<pre><code><a href="#">My Link</a>
</code></pre>
<p>H... | <pre><code>$('a').click(function (event)
{
event.preventDefault();
//here you can also do all sort of things
});
</code></pre>
<p>Then you can put in every <code>href</code> whatever you want and jQuery will trigger the <code>preventDefault()</code> method and you will not be redirected to that place.</p... |
Standardized email regex <blockquote>
<p>Why is there not a standardized email
regex? I was recently involved in a
project where we had a hickup where
the email passed our email regex but
failed when creating the MailMessage
object. A small error but it had
rather big consequences</p>
<ul>
<li>Is t... | <p>Because even <a href="http://ex-parrot.com/~pdw/Mail-RFC822-Address.html" rel="nofollow">this regex doesn't match every valid email address</a>:</p>
<pre><code>(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ ... |
What is the difference between a 'function' and a 'procedure'? <p>Generally speaking, we all hear about the "functions" or the "procedures" in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong).</p>
<p>So, my question is: What is the difference... | <p>A function returns a value and a procedure just executes commands.</p>
<p>The name function comes from math. It is used to calculate a value based on input.</p>
<p>A procedure is a set of command which can be executed in order.</p>
<p>In most programming languages, even functions can have a set of commands. Hence... |
Excel VBA macro to track changes in separate sheet <p>I am trying to write a VBA macro to track changes to a workbook in a separate sheet.</p>
<p>If you do this manually, the sequence of commands is Tools > Track Changes > Highlight Changes, taking the option Separate Worksheet. You have to do two iterations of the co... | <p>The HighlightChangesOptions method will only work if the workbook is already shared. In the UI, turning on HighlightChange will share the workbook automatically, but not so in VBA.</p>
<pre><code>Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs , , , , , , xlShared
.KeepChangeHistory = True
... |
Infragistics ultrawebgrid custom paging <p>Hi iam using infragistics ultarawebgrid in my appliccation when i use custompaging iam not able to retrive the specified no of records per page</p>
<p>the code i written is
string[] cusLabel;</p>
<p>in the grid initialise</p>
<pre><code>grid.DisplayLayout.Pager.AllowCu... | <pre><code><table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td width='12%' align='left'>
[currentpageindex]/[pagecount]
</td>
<td width='76%'>
<b>[page:1:First]&nbsp;[prev]</b>
&nbsp;&nb... |
Are there any databases or indexes of Web Services? <p>I'm looking for something that categorizes the various services and then either (1) documents how to use them or (2) links to the documentation so I can learn more.</p>
| <p>You may like <a href="http://www.programmableweb.com/matrix" rel="nofollow">ProgrammableWeb Mashup Matrix</a>, under APIs section.</p>
|
kill all programs from user x with vb.net <p>I try to kill all processes of a specified user.</p>
<p>i use</p>
<pre><code> Try
Shell("C:\WINDOWS\system32\taskkill.exe /S localhost /U userx /P passwort /f /FI " & Chr(34) & "USERNAME eq userx" & Chr(34))
Catch ex As Exception
Messa... | <pre><code>foreach (Process p in Process.GetProcesses())
{
if (String.Equals(p.ProcessName, name))
{
p.Kill();
}
}
</code></pre>
<p>or</p>
<pre><code>Process.GetProcesses()
.Where(p => String.Equals(p.ProcessName, name))
.First()
.Kill(); // kills only first
</code></pre>
<p>or</p>
<pre><code>Process.GetPro... |
Display a Photo Gallery using Asp.Net and SQL <p>I have recently added photos to my SQL database and have displayed them on an *.aspx page using Asp:Image. The ImageUrl for this control stored in a separate *.aspx page. It works great for profile pictures.</p>
<p>I have a new issue at hand. I need each user to be able... | <p>"The ImageUrl for this control stored in a separate *.aspx page. It works great for profile pictures." - rather than an .aspx page, why not a generic ASP.NET handler (.ashx) instead? They are a little more lightweight than an .aspx. Just search "ASP.NET Generic Handler" and you'll find a number of samples. It's b... |
Strong Signed Assemblies <p>I have a project I made in Visual Basic 2008 Express. I converted it from someone else's C# project, but it works. It has several DLL dependencies. I went to publish my project so I can install it on another machine and for each DLL, I get an error: "Assembly must be strong signed in order t... | <p>If you're publishing via ClickOnce, go to the publish page and click on "Application Files". From there you should see a list of your DLL's. Ensure that the ones that are giving you trouble have their Publish Status marked as "Include" rather than "Prerequisite".</p>
<p>What this error message means is that the cur... |
Is there a good reference card that compares T-SQL and PL/SQL side-by-side? <p>I'm looking for a good reference card / cheat sheet that compares T-SQL and PL/SQL data manipulation language commands side-by-side.</p>
<p>I've previously searched SO but there isn't any older thread covering this particular subject so I t... | <p><a href="http://troels.arvin.dk/db/rdbms/" rel="nofollow">This</a> is pretty good. In ye olde paper and inke, <a href="http://oreilly.com/catalog/9781565927445/" rel="nofollow">SQL in a nutshell</a> is also useful.</p>
|
extJS - Can not get data to render in GridPanel <p>The below code uses <code>Ext.data.Store</code> to retrieve a JSON with table metadata (for the column headings) and the table's data. The backend PHP script is working correctly and the <code>Ext.data.Store</code> contains valid records for the data - I just can't get... | <p>Wow - this has been giving us trouble for three days. Turns out I was making an array within an array at <code>var queryFields = Ext.data.Record.create([fields]);</code></p>
<p>Changing that to: <code>var queryFields = Ext.data.Record.create(fields);</code> fixed the issue.</p>
|
dat idx files database recognition <p>I have some .dat and .idx files and one .sup file in a directory , and i would like to know if there is any tool or .net programming tecnique to find out what type of database is? </p>
<p>I dont know if this could help, but if i open one .dat file as text file, i get this: 0~09040... | <p>Linux has a <a href="http://linux.die.net/man/1/file" rel="nofollow">file</a> command that uses a listing of <a href="http://linux.die.net/man/5/magic" rel="nofollow">magic numbers</a> to try and id a file type. There's a <a href="http://gnuwin32.sourceforge.net/packages/file.htm" rel="nofollow">Win32 port</a> - but... |
MVVM + Datacontext + DataTemplate + Blend = problems <p>I'm currently using MVVM in a WPF project, all works very well.
I have one Master view and many Detail views that I manage using a currentView property in my MasterViewModel. By using a datatemplate, I bind a view to a viewmodel.
In fact, my master view has a cont... | <p>I've got a blog post on this issue: <a href="http://www.robfe.com/2009/08/design-time-data-in-expression-blend-3/" rel="nofollow">http://www.robfe.com/2009/08/design-time-data-in-expression-blend-3/</a></p>
<p>My post is all about showing data in blend <em>without</em> having to have that data displayed or even cre... |
php accelerator review <p>1) Can you recommend me a PHP accelerator for PHP V5.2.6?<br/>
2) Do you know about any recent test comparation/review of those modules(Alternative PHP Cache, eAccelerator, XCache, Zend Optimizer, Zend Platform, ionCube PHP Accelerator, Turck MMCache, Nusphere PhpExpress)?</p>
| <p><a href="http://www.php.net/manual/en/book.apc.php"><strong>APC</strong></a> — standard choice, included in PECL, comes prepackaged in most Linux distros, to be bundled in by default in PHP6. As a bonus it can serve as <a href="http://www.php.net/manual/en/function.apc-store.php">data cache</a> (something like... |
Adding a post-build event to a web site in Visual Studio 2008 <p>I am using a "web site" in visual studio 2008, and i would like to add a post-build event which would append the build time to the web.config file. Is it possible? </p>
| <p>I'm afraid this isn't supported for web sites, you'll need to use a web application project.</p>
|
What's the best way to search GitHub? <p>The search feature on the site seems pretty awful. </p>
<p>Are there any external sites that do a better job of categorizing projects with tags, etc? </p>
<p>Or maybe I'm just not using GitHub correctly?</p>
| <p>I haven't tried this, but I understand that very often Google does a better job of searching a website than the site's own search tools. Have you tried that?</p>
<p>Go to their <a href="http://www.google.com/advanced%5Fsearch" rel="nofollow">advanced search</a> page and fill out github.com in the "Only return resul... |
ASP.Net MVC Controller Namespace array <p>I noticed that the MapRoute extension includes an overload that accepts a string[] parameter which is called 'namespaces'. I read what Google had for me on it, and supposedly this is to help the framework find controllers in places it wouldn't otherwise look.</p>
<p>I did some... | <p>Ok, so after further testing, I figured out that it is not a filter, exactly, but it kinda is also. I gave you 'answer' credit even though you're partially wrong.</p>
<p>So, it does, after all, act like I thought it should which is to say it disambiguates. Basically, the logical flow is something like this:</p>
... |
ActiveSync support across Windows CE/Mobile machines <p>Is ActiveSync supported on all Windows CE x86 machines or are there any exceptions?</p>
| <p>Windows CE is a modular, componentized OS. It is completely up to the OEM whether or not they include the ActiveSync components into the OS image. They can also include ActiveSync core support without any entity (Contact, Calendar, etc) sync capability.</p>
<p>The supported transport(s) (serial, USB, ethernet, RN... |
Implementing clickable page numbers in search result <p>Classic scenario: Take user input, get a search-result and display it in pages to the user. I then need to display buttons for First, Next, Previous etc, and I maintain the users current page in viewstate. All is good, works fine.</p>
<p>Then I need to implement ... | <p>I'm going to recommend against a LinkButton and recommend Hyperlinks / QueryString parameters instead. For several reasons:</p>
<ol>
<li>Your page will be much more efficient without the viewstate overhead of a link button.</li>
<li>If these are public facing pages, you'll get better indexing of all the pages if th... |
Using reflection to check if a method is "Extension Method" <p>As part of my application I have a function that receives a MethodInfo and need to do specific operations on it depending if that method is "Extension Method".</p>
<p>I've checked the MethodInfo class and I could not find any <em>IsExtension</em> property ... | <p>You can call the <strong>IsDefined</strong> method on the MethodInfo instance to find this out by checking to see if the <strong>ExtensionAttribute</strong> is applied to the method:</p>
<pre><code>bool isExtension=someMethod.IsDefined(typeof(ExtensionAttribute),true);
</code></pre>
|
What's an OCCI context and environment? <p>I'm exploring a piece of software making use of Oracle API and as far as I can see often object methods expect as an argument a "OCCI context" or a "OCCI environment" values.</p>
<p>An example is a constructor of an Account object:</p>
<pre><code>Account( oracle::occi::Envir... | <p><code>OCCI Environment</code> lets you define your own memory management functions which <code>OCCI</code> will later use.</p>
<p>When you create an <code>environment</code>, you pass the pointers to your own <code>malloc</code>, <code>realloc</code> and <code>free</code>:</p>
<pre><code>static Environment * creat... |
How can I get generic Type from a string representation? <p>I have <code>MyClass<T></code>.</p>
<p>And then I have this <code>string s = "MyClass<AnotherClass>";</code>. How can I get Type from the string <code>s</code>?</p>
<p>One way (ugly) is to parse out the "<" and ">" and do: </p>
<pre><code>Typ... | <p>The <a href="http://msdn.microsoft.com/en-us/library/w3f99sx1.aspx">format for generics</a> is the name, a ` character, the number of type parameters, followed by a comma-delimited list of the types in brackets:</p>
<pre><code>Type.GetType("System.Collections.Generic.IEnumerable`1[System.String]");
</code></pre>
<... |
Sql Server Ce 3.5 Check Constraints <p>Does Sql Server ce Suports Check Constraints?
I wanted to do something like
"ALTER TABLE WITH NOCHECK ADD CONSTRAINT id_range_check CHECK ( BETWEEN and )</p>
<p>and this will give an error on 'WITH'</p>
| <p>SQL Server Compact does not support CHECK constraint <a href="http://technet.microsoft.com/en-us/library/ms174123(v=sql.110).aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/ms174123(v=sql.110).aspx</a></p>
|
Double.Parse - Internationalization problem <p>This is driving me crazy. I have the following string in a ASP.NET 2.0 WebForm Page</p>
<pre><code>string s = "0.009";
</code></pre>
<p>Simple enough. Now, if my culture is Spanish - which is "es-ES" - and I try to convert the string to Double, I do the following:</p>
<... | <p>It <strong>is</strong> taking the culture you gave and applying the correct formatting. You provided a string of "0.009" and told it that it was Spanish...then you complain that it properly interpreted it as Spanish! Don't tell it that the string is Spanish when you know it isn't.</p>
<p>You should pass the Parse ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.