input
stringlengths
51
42.3k
output
stringlengths
18
55k
Rails - Abstract/Shared Views <p>I have a few objects that are incredibly similar. In fact, they use STI and store all of the data in the same table in the DB. Currently, every time I add a feature or fix a bug, I have to update it in 3 different places, so I would like to DRY my code a little bit. The most common code...
<p>The <code>inherit_views</code> plugin might do the job: <a href="http://github.com/ianwhite/inherit%5Fviews/tree/master" rel="nofollow">http://github.com/ianwhite/inherit_views/tree/master</a>. I've used it successfully before.</p> <p>You could then have a common base controller class for all controllers needing to...
Is it possible to Shut down a local pc with group policies programatically through .net application? <p>I have a local application running with an user than have a group policy indicating this user can’t shutdown the pc.</p> <p>And then I use your code, but when I ask by user and password to impersonate my app. I re...
<p>I would try using the <a href="http://msdn.microsoft.com/en-us/library/ed04yy3t.aspx" rel="nofollow"><code>Process.Start()</code> overload that allows one to supply a username and password</a>. I would execute <code>shutdown.exe</code> on that new process.</p> <p>Of course, storing the username and password is not...
how to keep a track of last modified time <p>I have an PARTSORDER table. I want to keep the track of last modification time for easy record for easy access later (query orders which was modified two days ago). Should I have a column with datetime type to put time in it or a better way you usually use? thanks,</p>
<p>I almost always have the four following audit fields:</p> <pre><code>CREATED_BY CREATED_DATE MODIFIED_BY MODIFIED_DATE </code></pre> <p>These allow for recording the original user/date as well as the last modified user/date.</p> <p>Also,</p> <p>If you need a history of changes (more than just the most recent) th...
How do you install JDK? <p>I have eclipse and I can test run java apps but I am not sure how to compile them. I read that I should type javac -version into my cmd.exe and see if it is recognized. It is not. So I went to sun's website and downloaded/installed JDK v6. Yet it still says 'javac' is an unrecognized command....
<p>To setup Eclipse to use the JDK you must follow these steps.</p> <p>1.<strong>Download the JDK</strong></p> <p>First you have to download the JDK from Suns <a href="http://java.sun.com/javase/downloads/index.jsp">site</a>. (Make sure you download one of them that has the JDK)</p> <p>2.<strong>Install JDK</strong>...
DTD download error while parsing XHTML document in XOM <p>I am trying to parse an HTML document with the doctype declared to use the transitional dtd as follows:</p> <p>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</p> <p>When I do Buil...
<p>This solves the problem:</p> <pre><code>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(false); factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); Document document = factory.newDocumentBuilder...
sql table udt, vs 2008, csharp <p>I am trying to run a SQL stored proc from Visual Studio 2008 which takes a table-valued UDT parameter as an input. I added this parameter in Visual Studio 2008 but when I run this program it gets an "ArgumentException - Specified type isn't registered on target server." So I googled t...
<p>Basically, you got your setup almost right - halfway through :-)</p> <p>Check out those introductory articles to TVP's - table-valued parameters- which is what I <em>GUESS</em> you're trying to use, right?</p> <ul> <li>SQL Team: <a href="http://www.sqlteam.com/article/sql-server-2008-table-valued-parameters" rel="...
Store spreadsheet kind of data in SQL Database <p>I want to store the spreadsheet data in database, so right now i am using key/value pattern to store the same but its taking too much time to retrieve it from data base, if the data is huge. Do anyone has the best way to do the same. How Google saves their spreadsheet d...
<p>A <strong>naive</strong> schema for storing a spreadsheet:</p> <pre><code>create table spreadsheet ( id INTEGER primary key, name TEXT UNIQUE not null ); create table cell ( id INTEGER primary key, spreadsheet_id INTEGER NOT NULL REFERENCES spreadsheet(id), row INTEGER not null, col INTEGER not null, content TEXT ...
jQuery vs Standard Backend Programming <p>I'm curious to know people's preferences...</p> <p>I've recently gone head-first into jQuery and I am loving it. However, I'm finding that I'm replacing a lot of (somewhat trivial) backend (tech: ASP.NET) functions with tiny jQuery functions. For instance, rather than assign a...
<p>Javascript is an extra layer on top of HTML and CSS. When you're building an accessible website, everything should be available in just the HTML. Both CSS and Javascript should only be used to enhance the user experience.</p> <p>I would even go as far as to say that for every single page interface or RIA, there sho...
Parsing XML structure without expanding entities in PHP <p>I'm trying to extract the structure of an XML document in PHP without expanding the entities within. I'm aware that entities are usually expanded <em>before</em> the structure is parsed, and that ignoring this means that the XML may not be well-formed, but I'm ...
<p>After a bit of browsing through XMLReader: Have you tried this:</p> <p><a href="http://us3.php.net/manual/en/xmlreader.setparserproperty.php" rel="nofollow">XMLReader::setParserProperty</a> in combination with <a href="http://us3.php.net/manual/en/class.xmlreader.php#xmlreader.constants.subst-entities" rel="nofollo...
Great resources in F# for beginners use and examples for business <p>Are there some links to great resources for F# for:</p> <ol> <li>Beginners use.</li> <li>Examples in applying it to business and enterprise applications.</li> </ol> <p>What I meant by great is similar to the videos presented in the Learn section of ...
<p>For a beginner, the best place to start is by watching this <strong><a href="http://channel9.msdn.com/pdc2008/TL11/" rel="nofollow">video by Luca Bolognese</a></strong>, the F# program manager. Then, start watching these series of <strong><a href="http://tomasp.net/articles/fsharp-webcast-functional.aspx" rel="nofol...
MySQL - Geo-Spatial Object <p>I've been working in Postgis for point in poly's and i have this function:</p> <p>select * from table_name where st_contains(column, st_setsrid(st_makepoint(-92.095109, 46.804100),4326));</p> <p>the column is a multipoly(((points)))</p> <p>I'm trying to find a way to do a similar exerci...
<p>MySQL does not implement a lot of spatial queries -- I don't know for sure about contains but there are ways of approximating it and other functions. For example, you can do distances between points by pulling all results with coordinates in a given rectangle and then calculating the distance as described <a href="...
Dynamically generated drop-down menu appears in upper left corner of screen <p>I've plugged some code into the MouseDown and Click events of a ToolStripMenuItem to generate a menu at run-time, but the menu appears at the upper left corner of the screen instead of under the menu item. It doesn't matter if the code is in...
<p>Move the code from the <code>MouseDown</code> event to the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripdropdownitem.dropdownopening.aspx" rel="nofollow"><code>DropDownOpening</code></a> event; that should give you the correct behavior.</p>
What do you do when you start a new POJO class? <p>Let's say that you are setting up a POJO. </p> <p>What do you define when you setup the class?</p> <p>Here's my list</p> <ul> <li>Constructor to create an object with supplied fields (so that I can make fields final and hence immutable)</li> <li>toString</li> <li>eq...
<p>If I know what I want to do usually write a test first and then write the class to make it run.</p>
DynamicData: use custom type as return type <p>can I force the DBML designer to use my custom types instead of the Auto-generated Types? I can edit the database.designer.cs, but these changes will be lost when I modify the tables.</p> <p>If not, how can I easily "convert" from the auto-generated type to my custom type...
<p>The DBML designer is code-gen, plain and simple - although the dml may help as the mapping file</p> <p>There are various options here:</p> <ul> <li>use SqlMetal to generate the mapping file</li> <li>decorate your existing objects with the standard attributes</li> <li>use an external xml file to describe the relati...
Changing C++ cin <p>When you enter a space ' ' while typing into cin, it will take the first string before the space as the first value and the later one as the next.</p> <p>So let's say we have this code:</p> <pre><code>cout &lt;&lt; "Enter your Name"; cin &gt;&gt; name; cout &lt;&lt; "Enter your age"; cin &gt;&gt;...
<p>To read a line in C++:</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; using namespace std; int main() { cout &lt;&lt; "Enter some stuff: " ; string line; getline( cin, line ); cout &lt;&lt; "You entered: " &lt;&lt; line &lt;&lt; endl; } </code></pre>
Is &#x10; a valid character in XML? <p>On this data:</p> <pre><code>&lt;row Id="37501" PostId="135577" Text="...uses though.&amp;#x10;"/&gt; </code></pre> <p>I'm getting an error with the Python sax parser:</p> <pre><code>xml.sax._exceptions.SAXParseException: comments.xml:29776:332: reference to invalid character n...
<p>As others have stated, you probably meant <code>&amp;#10;</code>. The reason why <code>&amp;#x10;</code> (0x10 = 10h = 16) is invalid is that it's explicitly excluded by the XML 1.0 standard: (<a href="http://www.w3.org/TR/xml/#NT-Char">http://www.w3.org/TR/xml/#NT-Char</a>)</p> <pre><code>Char ::= #x9 | #xA | #xD ...
Why can't an iframe set its parent's location.hash? <p>I have a window containing an iframe, containing an iframe, like so:</p> <pre><code>+---------------+ | Top | | +-----------+ | | | Middle | | | | +-------+ | | | | | Inner | | | | | +-------+ | | | +-----------+ | +---------------+ </code></pre> <p>...
<p>Parent frames can set children's iframe 'src' attribute (here with jquery) using:</p> <pre><code>$("#iframeWindow").attr('src', "http://&lt;CHILD URL&gt;/#hello"); </code></pre> <p>Children iframes can set parent window's href (address bar content) using:</p> <pre><code>window.top.location.href = "http://&lt;PARE...
Why can't iterator methods take either 'ref' or 'out' parameters? <p>I tried this earlier today:</p> <pre><code>public interface IFoo { IEnumerable&lt;int&gt; GetItems_A( ref int somethingElse ); IEnumerable&lt;int&gt; GetItems_B( ref int somethingElse ); } public class Bar : IFoo { public IEnumerable&lt...
<p>C# iterators are state machines internally. Every time you <code>yield return</code> something, the place where you left off should be saved along with the state of local variables so that you could get back and continue from there.</p> <p>To hold this state, C# compiler creates a class to hold local variables and ...
How to get all subsets of an array? <p>Given an array: <code>[dog, cat, mouse]</code></p> <p>what is the most elegant way to create:</p> <pre><code>[,,] [,,mouse] [,cat,] [,cat,mouse] [dog,,] [dog,,mouse] [dog,cat,] [dog,cat,mouse] </code></pre> <p>I need this to work for any sized array.</p> <p>This is essentially...
<p>Elegant? Why not Linq it.</p> <pre><code> public static IEnumerable&lt;IEnumerable&lt;T&gt;&gt; SubSetsOf&lt;T&gt;(IEnumerable&lt;T&gt; source) { if (!source.Any()) return Enumerable.Repeat(Enumerable.Empty&lt;T&gt;(), 1); var element = source.Take(1); var haveNots = Su...
C++ "hello world" Boost tee example program <p>The Boost C++ library has <a href="http://www.boost.org/doc/libs/1%5F39%5F0/libs/iostreams/doc/functions/tee.html">Function Template tee</a></p> <blockquote> <p>The class templates tee_filter and tee_device provide two ways to split an output sequence so that all data...
<p>Based on help from the question John linked:</p> <pre><code>#include &lt;boost/iostreams/tee.hpp&gt; #include &lt;boost/iostreams/stream.hpp&gt; #include &lt;fstream&gt; #include &lt;iostream&gt; using std::ostream; using std::ofstream; using std::cout; namespace bio = boost::iostreams; using bio::tee_device; usi...
check texture memory use on iPhone programmatically <p>Is there a way to programmatically check the OpenGL ES texture memory usage on the iPhone?</p> <p>I know you can use Instruments to monitor it, but I would like to do in in the app is possible.</p>
<p>I don't think there's a built-in way to do this. Have you considered writing your own functions to malloc and free texture memory? I imagine you use malloc() to create memory for each texture. You could create another function that called through to malloc and also logged the amount of memory being allocated. It'd b...
which of the following is better for eventhandling C# <p>WOW<br> remind me never again to use 50+lines of java-like constructs when this can be done so easily in C# with implicit casting</p>
<p><strong>Ye Olde New Answer</strong></p> <p>Here are some Stack Overflow questions that deal with implementing MVC in a Windows Form Application:</p> <ol> <li><a href="http://stackoverflow.com/questions/654722/implementing-mvc-with-windows-forms">Implementing MVC with Windows Forms</a>.</li> <li><a href="http://sta...
Is it possible to execute a string in MySQL? <p>I have to convert a MSSQL stored proc that passes a <code>varchar</code> that is a query:</p> <pre><code>INSERT INTO Results EXEC (@Expresion); </code></pre> <p>This isn't working. I'm pretty sure that <code>EXEC</code> and <code>EXECUTE</code> aren't MySQL commands, ...
<p>EXECUTE is a valid command in MySQL. <a href="http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-prepared-statements.html">MySQL reference manual</a></p>
.split removes tabs/spaces in string? <p>i am trying to split a string up into separate lines with the following code, but for some reason it is also removing the spaces in the string.</p> <pre><code>Dim calculationText As String calculationText = File.ReadAllText(fileName) Dim fields() As String fields = calculation...
<p>If you are reading from a file, can you use:</p> <pre><code> Sub Main() Dim fields As New List(Of String) ' read file into list Using sr As System.IO.StreamReader = My.Computer.FileSystem.OpenTextFileReader(filename) Try Do While sr.Peek() &gt;= 0 fields.Add(sr.Re...
PHP/GD - Cropping and Resizing Images <p>I've coded a function that crops an image to a given aspect ratio and finally then resizes it and outputs it as JPG:</p> <pre><code>&lt;?php function Image($image, $crop = null, $size = null) { $image = ImageCreateFromString(file_get_contents($image)); if (is_resource...
<p>You will have to modify your resizing code not to be based on the cropped image to start with. Since you want to do the cropping and resizing in one go you need to calculate it independently.</p> <pre><code>&lt;?php function Image($image, $crop = ':', $size = null) { $image = ImageCreateFromString(file_get_con...
How are persistent database connections stored in PHP? <p>As stated in the documentation on <a href="http://de.php.net/manual/en/function.sqlite-popen.php" rel="nofollow">sqlite_popen</a> php tries to make use of a persistent resource mechanism. Where is this mechanism described in detail? Is it possible to view all re...
<p>sqlite_popen uses the (executor) global hashtable "persistent_list" to store the connection resource. This hashtable is not part of the php "instance" which executes your script but of the php "runtime", which means it's not cleared/removed after the script is done but held in memory as long as the php .so/.dll/fast...
Question about pure virtual destructor <p>If we define a abstract class which has a pure virtual destructor, why do we have to give a definition of a destructor in the abstract class?</p>
<p>The destructor for the base class must be called when the object is destroyed, so it needs a definition.</p>
Let the SequenceEqual Work for the list <p>I have a class named Country. It has the public members, 'CountryName' and 'States'. </p> <p>I have declared a list of Countries. </p> <p>Now I want to write a function which accepts a new 'Country' and decides if CountryList already has the 'Country'.</p> <p>I tried writin...
<p>Break it down into many simple queries, and then put those queries back together. </p> <p>Let's start by making a sequence of items that match by name:</p> <pre><code>var nameMatches = from item in itemList where item.Name == p.Name select item; </code></pre> <p>We need to compare those items against the sequence...
Natural Language Processing in Ruby <p>I'm looking to do some sentence analysis (mostly for twitter apps) and infer some general characteristics. Are there any good natural language processing libraries for this sort of thing in Ruby?</p> <p>Similar to <a href="http://stackoverflow.com/questions/870460/java-is-there-a...
<p>Three excellent and mature NLP packages are <a href="http://nlp.stanford.edu/software/corenlp.shtml">Stanford Core NLP</a>, <a href="http://opennlp.apache.org/">Open NLP</a> and <a href="http://alias-i.com/lingpipe/index.html">LingPipe</a>. There are Ruby bindings to the <a href="https://github.com/louismullie/stanf...
How can I update ListView when my data source changes? <p><a href="http://windowsclient.net/learn/video.aspx?v=108085" rel="nofollow">http://windowsclient.net/learn/video.aspx?v=108085</a></p> <p>In that video, when I changes data source by add more data the list view doesn't update? Please help me!</p>
<p>You should use an <a href="http://msdn.microsoft.com/en-us/library/ms668604.aspx" rel="nofollow">ObservableCollection</a> (or any collection that implements <a href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.inotifycollectionchanged.aspx" rel="nofollow">INotifyCollectionChanged</a>, real...
Setting a style's TargetType property to a generic class <p>Is it possible to set a style's TargetType property in XAML to a Generic Class?</p> <pre><code>public class Selector&lt;T&gt; : Control { } </code></pre> <p>and then in xaml</p> <pre><code>&lt;Style x:TargetType="Selector"&gt; &lt;Setter Property="MyPropert...
<p>You cannot bind to an open generic type like <code>List&lt;T&gt;</code>, you can however bind to a closed generic type like <code>List&lt;Person&gt;</code> by defining a placeholder type. </p> <p><strong>C#</strong>:</p> <pre><code>class People : List&lt;Person&gt; {} </code></pre> <p><strong>XAML</strong>:</p> ...
How to config Asp.net Mvc for redirecting every request to configuration page? <p>For Asp.net Mvc project, I need to <strong>redirect every request</strong> to configuration page when user(should be admin of this website) visit this website at the first time. This operation like default login page(every request will be...
<p>From your description, this appears to be an authorization concern, so I would recommend a custom Authorize attribute class (inherit from AuthorizeAttribute).</p> <p>From here you can override the OnAuthorization method where you can check if the user has completed your required configuration steps and set the filt...
Expected FS format '2' found format '3 git-svn <p>I was just checking out git-svn and thought I would give it a try with one of my existing repository. When I ran git-svn I got this error.</p> <p>Couldn't open a repository: Unable to open an ra_local session to URL: Unable to open repository '{MyFilePath}': <strong>...
<p>If you access your Subversion repository using a network protocol (such as <code>svn://</code>) instead of local file access, then things should work properly for you. It appears as though you're asking <code>git-svn</code> to access the repository directly, causing the problem you've shown. The Subversion network p...
Integer out of range on Postgres DB <p>Simple rails app using Postgres DB, getting 'integer out of range' error when trying to insert 2176968859. Should be an easy fix to the migrations, but I'm not sure. Right now I've got...</p> <pre><code>create_table :targets do |t| t.integer :tid ... end </code></pre>
<p>Here's the magic incantation in your migration when you declare the column:</p> <pre><code>create_table :example do |t| t.integer :field, :limit =&gt; 8 end </code></pre> <p>The :limit => 8 is the magic in this case as postgres only does signed 4-byte integers when you just say integer. This uses 8-byte signed i...
I want to make my web site point to different server dynamically <p>I'm new to web.config and ASP.NEt. I want to make my client to point to different servers which ever is free dynamically....</p> <p>Is it possible???</p> <p>It's their a way to have multiple entries in web.config file which we can choose at run time...
<p>Redirect might work for you:</p> <p><a href="http://www.w3schools.com/asp/met_redirect.asp" rel="nofollow">http://www.w3schools.com/asp/met_redirect.asp</a></p> <p>Also you could try using a proxy server:</p> <p><a href="http://www.iisproxy.net/" rel="nofollow">http://www.iisproxy.net/</a></p> <p>or load balanci...
How to implement HandleError Filter on an Ajax Request? <p>When an exception occurs in an action called from an Ajax Request, the default HandleError filter can not work correctly. Can someone help me solve it?</p>
<p>You can also override the OnException method in your controller to catch all unhandled exceptions and return a custom view or JSON/XML in case of an error.</p> <pre><code> protected override void OnException(ExceptionContext filterContext) { filterContext.ExceptionHandled = true; filterContext.Re...
Help with IzPack - Creating Java and JNLP One Click Installations <p>I took the advice I've been given here to look at IzPack to create a JNLP based one click installation for computer illiterate clients who are using a Java desktop application I've created.</p> <p><a href="http://stackoverflow.com/questions/944144/ja...
<p>Another approach perhaps?</p> <p>If all what you need is to allow the user invoke a JAR, then consider using JSmooth to wrap it in an exe file. The exe file knows how to invoke java correctly and prompt the user to download if not present.</p> <p>We also have used one-jar to wrap multiple jars in a single jar f...
tradeoffs of different compression algorithms <p>What are the tradeoffs of the different compression algorithms?</p> <p>The purpose is backup, transfer &amp; restore. I don't care about popularity, as long as a mature enough tool exists for unix. I care about </p> <ul> <li>time</li> <li>cpu</li> <li>memory</li> <li>c...
<p>Tar is not a compression algorithm per se.</p> <p>You may use zip/gzip when time for compression/decompression is the most important issue. </p> <p>You may use bzip when you need a better compression rate.</p> <p>You may use LZMA when even bigger compression rate needed, but CPU time bigger.</p> <p><a href="http...
How to learn c++ generic programming and template? <p>How to learn c++ generic programming and template? Recommend some good books about this topic.</p>
<ul> <li><a href="http://rads.stackoverflow.com/amzn/click/0201734842">C++ Templates: The Complete Guide</a> - D.Vandevoorde and N.Josuttis </li> <li><a href="http://rads.stackoverflow.com/amzn/click/0321227255">C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond</a> - D.Abrahams and A.G...
how to integrate assembly code when i am designing a compiler in c? <p>i am designing a compiler in c . but for certain problems like big integers i have to code in assembly code . so how can i integrate assembly code in c?</p> <p>i am wrting my code in dev cpp.. which i suppose uses gcc ... in windows..!!.. </p> <p>...
<p>using asm </p> <p>Good article : <a href="http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html" rel="nofollow">GCC-Inline-Assembly-HOWTO</a></p>
Display Progress Bar at the Time of Processing <p>If I am getting data from the database from start time to end time, during that time (of processing / querying), I want to display a progress bar (something like, “Processing, please wait”). How can I do this?</p>
<p>Steps of geting data from db:</p> <ol> <li>app send query to db</li> <li>db analyzes query and prepares result</li> <li>db send result back to app</li> </ol> <p>In most cases you cannot say how much time it will take, so instead of progress bar think about combination of:</p> <ul> <li>hour glass mouse pointer</li...
Data binding to SelectedItem in a WPF Treeview <p>How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it.</p> <p>You might think that it is <code>SelectedItem</code> but apparently that <s>does not exist</s> is readonly and therefore unusable.</p> <p>This ...
<p>I realise this has already had an answer accepted, but I put this together to solve the problem. It uses a similar idea to Delta's solution, but without the need to subclass the TreeView:</p> <pre><code>public class BindableSelectedItemBehavior : Behavior&lt;TreeView&gt; { #region SelectedItem Property pu...
sharing ruby code within an organisation <p>Me and my team are starting to build up a few re-usable scripts. They're re-usable within our org only as they work with proprietry apps and our particular server environment. So not really suitable for rubyforge or github, etc.</p> <p>My question is, what is the best prac...
<p>This depends on some factors, like how many people want to change the code (only your team, or someone else too), or how much money you have for this?</p> <p>Personally I'd create a build+gem server, where you can upload the scripts using some versioning system (like git or svn, depends on how many people are worki...
Groovy: deploying a war file <p>Hi I have a groovy application running locally on my desktop. Apparently it runs error free. At least all unit tests I wrote are fulfilled. I want to deploy the application using a <strong>war</strong> file. For this I use the command</p> <pre><code>grails war </code></pre> <p>in the h...
<p>I think you'll have to find the source of <code>Gant.groovy</code> and see what it's doing on that line. Apparently there is some problem caused by your project's specific configuration (since such a show-stopper bug would have been caught if it always occurred), but the error message does not contain much informati...
What's aopalliance all about? And why is guice using it? <p>I'm using guice for dependency injection with aop from <a href="http://aopalliance.sourceforge.net/">aopalliance</a>. I can't quite figure out what's aopalliance all about and who implemented the version (dated from 2004) that's on their sourceforge page. Why ...
<p>AOP Alliance is a set of interfaces that multiple frameworks implement (see <a href="http://aopalliance.sourceforge.net/motivations.html">AOP Alliance Motivations</a>), including both Guice and Spring. </p> <p>AOP Alliance was chosen for Guice because it has a high capability and a simple API.</p> <p>The Guice wik...
Python - Print on stdout on a "terminal" <p>Before starting, I ask you all to apologize for the question. Maybe it is stupid, but I cannot find a solution. I am working on a remote machine, and have no idea what type. </p> <p>My python code, that seems to work, is the one below. The problem is that I am trying to prin...
<pre><code>import sys print "Hi!" sys.stdout.flush() </code></pre>
Add (collect) exit codes in bash <p>I need to depend on few separate executions in a script and don't want to bundle them all in an ugly 'if' statement. I would like to take the exit code '$?' of each execution and add it; at the end, if this value is over a threshold - I would like to execute a command.</p> <p>Pseudo...
<p>A quick experiment and dip into bash info says:</p> <pre><code>declare -i RESULT=$RESULT + $? </code></pre> <p>since you are adding to the result several times, you can use declare at the start, like this:</p> <pre><code>declare -i RESULT=0 true RESULT+=$? false RESULT+=$? false RESULT+=$? echo $RESULT 2 </code...
how important is having knowledge about pointers? <p>i am very weak in pointers , blame it on not having access to some good books .. while designing a compiler in c , how important is it to have a good knowledge about pointers?.. any good books??</p>
<p>On a scale from 1-10, about 12. It's a vital part of the language, and an even more vital part of a compiler.</p>
How to get the names of all resources in a resource file <p>Within a Visual Basic Project I have added a resource file (resx) that contains a bunch of images.</p> <p>Now I want to query the names of the images. If I open the resx file in the designer view in the Visual Studio IDE and select an image, the property grid...
<p>See if this piece of code helps.</p> <pre><code> Dim runTimeResourceSet As Object Dim dictEntry As DictionaryEntry runTimeResourceSet = My.Resources.ResourceManager.GetResourceSet(System.Globalization.CultureInfo.CurrentCulture, False, True) For Each dictEntry In runTimeResourceSet If (dictE...
Is there an option to configure a priority in memcached? (Similiar to Expiry) <p>A hashtable in memcached will be discarded either when it's Expired or when there's not enough memory and it's choosen to die based on the Least Recently Used algorithm.</p> <p>Can we put a Priority to hint or influence the LRU algorithm?...
<p>Not that I know of. memcached is designed to be very fast and very straightforward, no fancy weights and priorities keep it simple.</p> <p>You should not rely on memcache for persistent session storage. You should keep your sessions in the DB, but you can cache them in memcache. This way you can enjoy both worlds.<...
Setting requested Culture when consuming web services <p>I am looking for some solution how I could easily set the requested Culture at client and get it on server. So I would get for example return error message in requested language.<br /> Is there way to set it on WebRequest or WebMethod? </p> <p>Any suggestion mo...
<p>You could pass the desired culture as a parameter and set the culture at server side with:</p> <pre><code>Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); </code></pre>
Why does [[UIApplication sharedApplication] delegate]; return a nil object <p>I have an iphone application with multiple views and related controllers and xib files. In the controller for the first view that is loaded I am trying to access the delegate for the application but the object that is returned is nil </p> ...
<p>Because it is not (yet) set. The UIApplication delegate is usually instantiated and set from the MainWindow nib file. If you access it before the nib is loaded completely (e.g. an init method in a controller in the same nib), it is nil.</p>
What do I do with this csv dataset I just downloaded from dbpedia? <p>I just downloaded this csv of infoboxes of wikipedia from dbpedia. However I have no idea how to use it :-S I want to import all this data into a database but am not so sure how to take it from here. I downloaded it from <a href="http://wiki.dbpedia....
<p>To import CSV data into MySQL you can use a <a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html" rel="nofollow">LOAD DATA INFILE</a> statement, e.g.</p> <pre><code>LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3); </...
How to get what files have been changed from previous build to this build and who did the changes in subversion <p>is it a possible to get the files changed from previous build to the next build and who did the changes.</p>
<p>If you know the revision numbers of the two builds you can use <a href="http://svnbook.red-bean.com/en/1.0/re15.html" rel="nofollow"><code>svn log</code></a>:</p> <pre><code>svn log -r &lt;previous rev&gt;:&lt;next rev&gt; </code></pre> <p>For example:</p> <pre><code>svn log -r 1066:1105 </code></pre>
Including required DLLs into a windows project solves a perceived problem? <p>We have recently decided to start shipping the versions of some of the DLL files that a product requires with the product itself.</p> <p>This is to guard against the situation where (for example) the MVC DLL file is updated on the server to ...
<p>Assuming you meant the MSVC (Microsoft Visual C++) DLLs, the correct solution is to use an application manifest. The MSVC DLLs support Side by Side installation (SxS). This means that a new version of those DLLs does not replace an old version. Your application manifest tells Windows which DLL version(s) you want.</...
twitter status message update through bot using php and twitter oauth <p>I have followed the steps defined in the following link for twitter oauth implementation.</p> <p><strong>https://docs.google.com/View?docID=dcf2dzzs_2339fzbfsf4</strong></p> <p>Its working fine when i run through web browser but i want a user sh...
<p>When you authenticate with twitter using oauth your given credentials you can store and use later when posting updates.</p>
CheckboxList - Use web.config value in text field <p>The scenario I'm dealing with is I have a set of entries in a database that have an image associated with them. This image needs to be 'accepted' or 'rejected' via a web interface.</p> <p>I'm using ASP.NET WebForms.</p> <p>I'm attempting to databind my recordset of...
<p>I believe you're using the wrong &lt;% tag. In order to evaluate in a binding expression like that it should be &lt;%#</p>
How to keep a Python script output window open? <p>I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I keep it open?</p>
<p>You have a few options:</p> <ol> <li><p>Run the program from an already-open terminal. Open a command prompt and type:</p> <pre><code>python myscript.py </code></pre> <p>For that to work you need the python executable in your path. Just check on <a href="http://superuser.com/questions/284342/what-are-path-and-oth...
hibernate cascade deletion <p>i have one class called course and one class called tutorials in class i hav set of tutorials .Wnen i delete course i want all tutorials associaed with that course to be deleted . But presently the tutorials are not geting deleted when i delete the owner course only the foreign key course...
<p>Try</p> <pre><code>cascade="all-delete-orphan" </code></pre>
Time refreshment in the HTML via AJAX <p>I have one html page with links of chart whenever i refresh HTML paget the chart refreshs.</p> <p>I heard from my friend that with the help of AJAX that chart will refresh automatically with given time interval without refreshing that html page.</p> <p>please help me with the ...
<p>You could use the <a href="http://www.switchonthecode.com/tutorials/javascript-tutorial-using-setinterval-and-settimeout" rel="nofollow">setInterval()</a> method in javascript, along with a simple framework like jQuery for the <a href="http://docs.jquery.com/Ajax" rel="nofollow">AJAX</a>.</p> <p>It would look somet...
What is virtual directory? What's the use of it? <p>Please someone explain to me by example what is a virtual directory and why do we need it?</p>
<p>In essence, in IIS, it's like a shortcut to another directory on your computer while seeming like it is a subdirectory of the current directory.</p> <p>I.E.</p> <p>www.example.com/bob/phil</p> <p>bob may be a subdirectory of the root, while phil is a directory elsewhere on the computer, not necessarily in bob</p>...
Which ruby ORM framework to use in a standalone ruby app? <p>I would like to use postgresql with foreign keys to define relationships in data so that other platforms/apps would also be able to easily use the same database. Having some kind of ruby DSL to define database schema with migration support would also be great...
<p>Check out <a href="http://datamapper.org/docs/" rel="nofollow">DataMapper</a>. I <a href="http://alicebobandmallory.com/articles/2009/06/11/an-average-application-in-the-clouds" rel="nofollow">recently used it</a> with Sinatra and deployed the app to Heroku. The only SQL I had to write was CREATE DATABASE. Everythin...
What is "over-engineering" as applied to software? <p>I wonder what would be a good definition of term "over-engineering" as applied to software development. The expression seems to be used a lot during software design discussions often in conjunction with "excessive future-proofing" and it would be nice to nail down a...
<p>Contrary to most answers, I do not believe that "presently unneeded functionality" is over-engineering; or it is the least problematic form.</p> <p>Like you said, the worst kind of over-engineering is usually committed in the name of future-proofing and extensibility - and achieves the exact opposite:</p> <ul> <li...
Programmatically administering custom attributes in ADAM <p>Has everyone ever programatically created a custom attribute? (At the moment I've just used the Scheme snap-in) </p> <p>Ideally I want (admin) users to be able to administer an ADAM instance through a web interface. I'm writing web-services to be able to do t...
<p>Here is an example LDIF file that adds an attribute to the schema. Replace "X", attributeID, attributeSyntax, schemaIDGUID and the others with values you need to have. Programmatically you might try to send this LDIF file using LDAP, or using ADAM's command line utility <code>ldifde</code> (I hope I remember it's na...
Console based progress in Java <p>Is there are easy way to implement a rolling percentage for a process in Java, to be displayed in the console? I have a percentage data type (double) I generated during a particular process, but can I force it to the console window and have it refresh, instead of just printing a new li...
<p>You can print a carriage return <code>\r</code> to put the cursor back to the beginning of line.</p> <p>Example:</p> <pre><code>public class ProgressDemo { static void updateProgress(double progressPercentage) { final int width = 50; // progress bar width in chars System.out.print("\r["); int i = 0;...
Sax invalid XML character exception <p>I have downloaded the xml dump of the Stack Over Flow site. While transferring the dump into a mysql database I keep running into the following error: Got an Exception: Character reference "some character set like &amp;#x10" is an invalid XML character. </p> <p>I used UltraEdit...
<p>The set of characters permitted in XML is <a href="http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char" rel="nofollow">here</a>. As you can see, #x10 is not one of them. If these are present in the stackoverflow dump, then it's not XML compliant.</p> <p>Alternatively, you're reading the XML using the wrong character...
How to define a function with same name which is present in different file <p>I want to define a class like this</p> <pre><code>class HttpRestAccessor { public: IResource&amp; UpdateResource(string&amp; , IResource&amp; ); }; </code></pre> <p>and implementing in cpp file</p> <pre><code>IResource&amp; HttpRestAcc...
<p>Just undefine it:</p> <pre><code> #undef UpdateResource </code></pre> <p>then redefine later if you actually need it.</p> <p>EDIT: However, you should reconsider your aversion to renaming the method. As others have said, that's a more elegant solution.</p>
How to write a UTF-8 file with Java? <p>I have some current code and the problem is its creating a 1252 codepage file, i want to force it to create a UTF-8 file</p> <p>Can anyone help me with this code, as i say it currently works... but i need to force the save on utf.. can i pass a parameter or something??</p> <p>t...
<p>Try this</p> <pre><code>Writer out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("outfilename"), "UTF-8")); try { out.write(aString); } finally { out.close(); } </code></pre>
How can I access to the iPhone address book in a web app? <p>I'm currently developing a web app for my company. In this application, there's a form with input fields containing informations about contacts. I would like to create a button which allows to create a contact in the address book on a click.</p> <p>Is there ...
<p>If this turns out to be possible, I'm eating my <a href="http://store.apple.com/us/product/MB111LL/A/Wireless-Mighty-Mouse?fnode=MTY1NDA1Mg&amp;mco=MjE0Njk1MA" rel="nofollow">Mighty Mouse</a> ..</p> <p><em>I apologize for the slightly unrelated answer</em></p> <p>P.S: to make this answer slightly more related; you...
Ruby Equivalent of ASP.NETs Application_Start? <p>I'd like to kick off a thread that wakes up every so many seconds to do some processing within a Ruby-on-Rails web app. In .NET, the logical place would have been to create a thread in the global.asax file and start it in <code>Application_Start</code>.</p> <p>Is ther...
<p>Rails doesn't really have an equivalent. The <a href="http://github.com/javan/whenever/tree/master" rel="nofollow">Whenever</a> RubyGem is a nice abstraction of Cron that lets you use syntax like the example below from within your Rails application:</p> <pre><code>every 30.seconds do # Do something interesting......
Adding alt img tags to an existing php website <p>I am currently trying to add in alt <code>img</code> tags for an existing website running the interspire shopping cart platform, I have gotten pretty close I bleieve, but i cannot seem to get it right. Any help would be grealty appreciated.</p> <pre><code>// Is there a...
<p>It looks to me like you have two double quotes after you open the alt attribute, then the text, then another closing quote.</p>
What is the best free SQL GUI for Linux for various DBMS systems <p>As I make the full switch from Windows to Linux (CentOS 5) I'm in search of the best free GUI SQL Client tool for MSSQL, MySQL, Oracle, etc... any suggestions?</p> <p>I've tried DBVisualizer (The best bet so far but still limited by the free version, ...
<p>I can highly recommend <a href="http://squirrel-sql.sourceforge.net/">Squirrel SQL</a>.</p> <p>Also see this similar question:</p> <p><a href="http://stackoverflow.com/questions/721852/developer-tools-to-directly-access-databases">Developer tools to directly access databases</a></p>
Java bytebuffer to C <p>From a C program on Windows we need to read and write like a Java bytebuffer which stores binary in BIG_ENDIAN</p> <p>The algorithm is described at : <a href="http://mindprod.com/jgloss/binaryformats.html" rel="nofollow">http://mindprod.com/jgloss/binaryformats.html</a></p> <p>Need to read and...
<p>I assume the difficulty is in converting between Big Endian and Little Endian.</p> <p>This article should help you out with the Endian conversions. It contains code to swap the byte order on integers, long integers, floating point numbers, and byte arrays of arbitrary length.<br> <a href="http://www.codeproject.co...
Should I pass sensitive data to a Process.Start call in .NET? <p>I'm working on a .NET Windows application that will use Process.Start to launch another internally developed .NET application running on the same PC. I need to pass database connection information, including a user ID and password, to the target applicati...
<p>Retrieving the arguments that a process was called with is quite easy, so they'll be exposed locally to a technically-minded user. If that's not a problem for you, then I wouldn't worry about it, since you say you're not transmitting over the network and your question asks us to assume the machine's not compromised....
How to pass-through requests not going to specific directories to index.php/path? <p>In my present project I've got several directories: application (my MVC files, which mustn't be accessed), images, css, and js. Effectively I want all requests to images/css/js to proceed unchanged, but all others I wish to call <code...
<p>This is what I have in my .htaccess for my framework:</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine on #This will stop processing if it's images RewriteRule \.(css|jpe?g|gif|png|js)$ - [L] #Redirect everything to apache #If the requested filename isn’t a file…. RewriteCo...
Inviting friends in facebook application <p>I have a facebook application that is published at facebook platform and i used facebook API to invite friends and i have succeeded in creating invitation form but the problem is that when u invite friend and send invitation and the invitation request sent to the user and the...
<p>In FBML if you are using the <strong><a href="http://wiki.developers.facebook.com/index.php/Fb:friend-selector" rel="nofollow">friend-selector</a></strong> you can pass it an array <strong>exclude_ids</strong>. If you use the api to find the users' friends who are already using your app, you can exclude them this wa...
Which text editors handle both Windows- and Unix-style line breaks properly? <p>Which text editors (free or commercial) handle character encoding and Windows/Unix line breaks properly?</p>
<p><a href="http://en.wikipedia.org/wiki/Comparison%5Fof%5Ftext%5Feditors#Newline%5Fsupport">Here's a list of Text editors and their newline support.</a></p> <p>Also see <a href="http://en.wikipedia.org/wiki/Comparison%5Fof%5Ftext%5Feditors#Basic%5Ffeatures">this list</a> and look at the Newline conversion field</p>
Changing a constructor param type breaks class in another jar <p>I have the following class in a common jar:</p> <pre><code>public class Common { public Common(List list) { ... } } </code></pre> <p>I then change the constructor parameter from a <code>List</code> to a <code>Collection</code> as follows:...
<p>javac resolves exactly which method or constructor to call at compile time. This does not occur at link time. As the constructor signature has changed, the linking step cannot find the requested method and therefore throws an error. You can fix the error by providing to constructors - one which takes an <code>Collec...
hibernate cascade deletion example <p>can any one provide me full 2 mapping file which implements cascade delete. measn if A contasis a set of B then when A is deleted B shold automatically be deleted.</p>
<p>You only need 1 mapping file: the one of the parent object. E.g. this example from <a href="http://rads.stackoverflow.com/amzn/click/193239415X" rel="nofollow">Hibernate in action</a></p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hi...
Is there an Ubuntu 9.04 OpenJDK equivalent of sun-java6-plugin? <p>I'm wondering if there exists an implementation of a firefox plugin for OpenJDK, or how one would get firefox to use OpenJDK's java for applets. I've searched endlessly, and I can't seem to find any good resources.</p> <p>Any ideas?</p>
<p>I think you're looking for <strong>icedtea6-plugin</strong>.</p>
Overriding ApplicationHelper? <p>There is an <code>ApplicationHelper</code> in an engine we're using that looks like this:</p> <pre><code>module ApplicationHelper def page_title() # ... end end </code></pre> <p>This gets called by a number of views in the engine. I'd like to override this method in my applica...
<p>Did you define the page_title method in your <code>ApplicationHelper</code> module? Just having an ApplicationHelper by itself won't do it.</p> <p>By default, your <code>ApplicationHelper</code> module should already be in <code>app/helpers/application_helper.rb</code>. Your app files are required by rails after it...
Making a .NET 2.0 Windows Form Application backward compatible with .NET 1.1 <p>I have created a Windows Form Application using Visual C# 2008 Express Edition with target as .NET 2.0. Now I need to build this project for .NET 1.1. The problem I am facing is that the designer classes are not supported in .NET 1.1. They ...
<p>Partial classes just separate your code from the designer generated code. So to make the forms 1.1 compatible you have to copy the code from your partial class into the class containing the designer-generated code, making it a single class.</p>
Unable to upload zip files occasionally <p>Tomcat server runs in US. I am connecting to the server from China using Java's HTTPURLConnection. Please see the code snippet used in client side and the https connector configuration in the tomcat server side below. </p> <pre><code>&lt;!-- Define a SSL Coyote HTTP/1.1 Conne...
<p>Probably a network timeout. But to be sure, have a look at the server log files. They will contain an error message, too.</p> <p>I also suggest to have a look at the <a href="http://hc.apache.org/httpclient-3.x/" rel="nofollow">HttpClient Java library</a> which makes things like these much more simple any reliable....
Apache2 access restricted to local LAN <p>Until recently, I had a bunch of virtual sites set up like so:</p> <pre><code>&lt;VirtualHost 127.0.0.1:1234&gt; ... </code></pre> <p>This works fine for testing on my local machine, where I use a Linux desktop. In order to test how MS and explorer displays my pages from...
<p>Belongs on <a href="http://serverfault.com">serverfault</a>, but whatever:</p> <p>The parameter(s) of <code>&lt;VirtualHost</code> are the local addresses you listen to, not the remote ones.</p> <p>You are looking for <a href="http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html">authz_host</a> configuration:<...
Grails web flow <p>Is there any way to pass model data to a view state? Consider the following example view state:</p> <pre><code>class BookController { def shoppingCartFlow = { showProducts { on("checkout").to "enterPersonalDetails" on("continueShopping").to "displayCatalogue" } } } </code></p...
<p>Hmm, it's been a bit since I did a flow, and your example is simplistic (just for being an example's sake, I hope).</p> <p>What your missing is the initial action in the flow. Keep in mind that a "view" flow action as your showProducts is just says what to do when your showProducts gsp POSTS. It's the action that...
Sending Multiple Items to MVC Controller via jQuery.Ajax <p>If youa are serializing a form using something like jQuery, it will often map the JSON keys and values to the properties of a object on the Controller Action you are posting to. So:</p> <p>jQuery:</p> <pre><code>function PostForm() { $.ajax({ url...
<p>dataType parameter in $.ajax method is the type of response (the type of data that you're expecting back from the server), not request. Try this instead:</p> <pre><code>function PostForm() { $.ajax({ url: "/Home/TestMVC", type: "POST", dataType: "application/JSON", data: $('#form...
Getting the current request in rails from a file in lib/ <p>I've put all of my user-authentication code in one place, namely lib/auth.rb. It looks like this:</p> <p><strong>lib/auth.rb</strong></p> <pre><code>module Admin def do_i_have_permission_to?(permission) # Code to check all of this goes here end en...
<p>In a typical Rails application, authentication information is stored in the active session, not the parameters. As such, it's pretty straightforward to write a helper that does what you want.</p> <p>It seems rather unorthodox to create a module that is then included in ApplicationHelper. The traditional approach is...
ASP.NET + jQuery + Dynamically Created HyperLink controls <p>I have an ASP.NET application that uses jQuery. My ASP.NET application dynamically generates some HyperLink elements based on some values in a database. When a user clicks one of these HyperLink elements, I want to display a jQuery dialog box that allows the ...
<p>What you're trying to do isn't possible that way. You create links every time the page is created. Although you change the name of these links in JavaScript, these values are not posted back to you.<br /> On <code>Sumbit</code>, only form elements get posted back to the server (<code>&lt;input&gt;</code>s, for examp...
How does the OS know what to do with a file when the "Open With..." option is selected? <p>Explanation: I don't remember about Linux and I don't know about OS X, but in Windows you can right-click a file and select a program to open it. But how does the OS know exactly how to make the program open it? Does it keep trac...
<p>For Windows, the answer is in the registry. If you're comfortable reading the registry, run regedit.exe on your Windows machine.</p> <p>Under HKEY_CLASSES_ROOT, you will see a key list of all file types, .doc, .txt, etc. Each of these keys contains a key called "OpenWithList" or "OpenWithProgIds". An application...
what does "&" mean in front of classes in php? <p>I've just inherited this code in PHP which seems to do some kind of web service call to googles api. I'm not quite an expert on PHP and there is a few syntax questions I have specifically relating to the following line $soapClients = &amp;APIlityClients::getClients(...
<p>When you use an ampersand in front of a variable in PHP, you're creating a reference to that variable. </p> <pre><code>$foo = 'bar'; $baz = &amp;$foo; echo $foo //bar echo $baz //bar $foo = 'foobazbar'; echo $foo //foobazbar echo $baz //foobazbar </code></pre> <p>Prior to PHP5, when you created an object from a...
Why can I not access bitmap data of FLV video coming from Amazon S3? <p>I have a video player that loads progressive flv video from a server and applies a reflection to it. I do this by creating a bitmapData object and then drawing the video to it. This worked absolutely fine until we moved our content from testing ser...
<p>This most likely has to do with Flash player's security restrictions and domains. If you aren't getting any errors, try installing the debug version of the player and see what comes up.</p> <p>Also take a look to <a href="http://jessewarden.com/2009/03/handling-crossdomainxml-and-302-redirects-using-netstream.html"...
Why does JSP/JSTL division by 1000 sometimes give remainder? <p>When dividing by 1000 I sometime run across a bug that doesn't do the division "correctly". For example, when dividing 90.55 by 1000 instead of getting .09055 I get .090549999999.</p> <pre><code>&lt;c:out value="${bean.paPrice / 1000}" /&gt; </code></pre...
<p>It's not a problem, it's just a natural result of the binary representation of floating point. Round your values and don't worry about it.</p>
Which scripting languages support multi-core programming? <p>I have written a little python application and here you can see how Task Manager looks during a typical run. <img src="http://weinzierl.name/temp/multicore-hires.png"/></p> <p>While the application is perfectly multithreaded, unsurprisingly it uses only one ...
<p>You seem use a definition of "scripting language" that may raise a few eyebrows, and I don't know what that implies about your other requirements.</p> <p>Anyway, have you considered TCL? It will do what you want, I believe.</p> <p>Since you are including fairly general purpose languages in your list, I don't know...
Advanced Formal logic / Automata Theory textbook <p>I know this is more a Math/Formal Language/Automata/Computer science question than an a programming one, but I hope I can get some advice on a <strong>comprehensible textbook</strong> (not an indecipherable monograph) on formal logic beyond Propositional and Predicate...
<p>So this is the best curriculum I can come with :</p> <p><strong>For Beginners in Logic :</strong></p> <p>Peter J. Cameron, <em>Sets, Logic and Categories</em>, Springer, Springer Undergraduate Mathematics Series, 1999, <a href="http://www.maths.qmul.ac.uk/~pjc/slc/">URL</a>.</p> <p>James L. Hein, <em>Discrete Str...
tcl/tk widget combobox loses focus <p>The tcl/tk widget iwidgets::combobox with a terrible flaw: when the list goes away, the focus goes away from the gui so you can't type in entry boxes unless you move the mouse out of the gui and back in. </p> <p>This problem has been noted in other places, but I have not seen any...
<p>As of Tcl/Tk 8.5, there is a combobox widget built into the core language as part of the Tile set of widgets. The command is <code>ttk::combobox</code>. You can download a prebuilt version of Tcl/Tk from ActiveState, at:</p> <p><a href="http://www.activestate.com/activetcl/" rel="nofollow">http://www.activestate....
Improvements to C++/CLI in .NET framework releases <p>There have been substantial features and improvements in C# with each new release of the .NET framework, and in the upgrade from .NET1.0 to .NET2.0, Managed C++ was replaced with C++/CLI, which was a great improvement.</p> <p>Have there been any improvements in C++...
<p>Be warned: <a href="http://blogs.msdn.com/vcblog/archive/2009/05/27/rebuilding-intellisense.aspx#9644735" rel="nofollow">Visual Studio 2010 no longer supports Intellisense for C++/CLI</a>.</p> <p><em>"While the lack of Intellisense for C++/CLI is unfortunate, we expect that it only represents a small portion of you...
How do I get jQuery's Uploadify plugin to work with ASP.NET MVC? <p>I'm in the process of trying to get the jQuery plugin, <a href="http://www.uploadify.com/">Uploadify</a>, to work with ASP.NET MVC.</p> <p>I've got the plugin showing up fine with the following JavaScript snippet:</p> <pre><code>&lt;script type="text...
<pre><code>public string Upload(HttpPostedFileBase FileData) {} </code></pre> <p>is correct - the file uploaded by uploadify will get binded to FileData. No need to get into Request.Files to retrieve the file - which makes it harder to mock and test.</p> <p>If your action isn't firing at all (i.e. try debugging and ...
How do you have a called bat file not kill it's calling bat file? <p>I am on a Windows 2003 system and need to script the deletion and creation of a profile in WebSphere Application Server. This requires me to call manageprofiles.bat twice, once to delete the existing profile and once to create a new profile.</p> <p>...
<p>Change both occurrences of "manageprofiles.bat" to "call manageprofiles.bat". Without the "call", execution is transferred to the manageprofiles.bat file but doesn't return.</p>
How to append value from form field in a new form field <p>Here's the story.</p> <p>I have a form with some form fields.</p> <p><strong>Example:</strong> </p> <ul> <li>name</li> <li>email</li> <li>message</li> </ul> <p>What I would like to do is when I click to submit the form, get JQuery to grab the email field va...
<pre><code>$("#message").val ($("#message").val () + $('#email').val()); </code></pre>
Emacs talking to XCode <p>I use emacs on my mac to program in Xcode. It works really well for the most part. I double click on a file in xcode, and it pulls it up in an existing emacs window. I compile, and get syntax errors, double click, and they come up in the active emacs window. great.</p> <p>This is all XCode ta...
<p>You can actually use AppleScript to set breakpoints in XCode from within Emacs by embedding the AppleScript inside of elisp.</p> <p><a href="http://han9kin.doesntexist.com/tag/Breakpoint" rel="nofollow">This page contains the code you need</a>. It's in Korean, but there's actually not much Korean to understand. The...