instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>Different iPhones have different published memory 4GB, 8GB and 16GB. The touch can have 32GB. My understanding is this is the off-line memory (disk alike). </p> <p>How much actual fast ram is there in the device available for my Cocoa Application? </p> <p>Is there a preconfigured virtual amount?</p>
<h1>iPhone</h1> <ul> <li>iPhone (June 2007): 128MB</li> <li>iPhone 3G (July 2008): 128MB</li> <li>iPhone 3GS (June 2009): 256MB</li> <li>iPhone 4 (June 2010): 512MB</li> <li>iPhone 4S (October 2011): 512MB</li> <li>iPhone 5 (September 2012): 1GB</li> <li>iPhone 5S (September 2013): 1GB</li> <li>iPhone 6 (September 2014...
<p>Go to <a href="https://stackoverflow.com/questions/5887248/ios-app-maximum-memory-budget">ios app maximum memory budget</a> to see more devices and RAM amount that can be really allocated.</p>
48,495
<p>I'm currently working with Db2 Enterprise Server V 8.2 with FixPak 10</p> <p>And I want to retrieve list of all the open active connections with an instance.</p> <p>In Oracle there is a utility program called &quot;Top Session&quot; which does the similar task. Is there any equivalent in DB2?</p>
<p>CLP:</p> <pre><code>db2 list applications </code></pre> <p>QUERY:</p> <pre><code>SELECT * FROM SYSIBM.APPLICATIONS SELECT * FROM SYSIBM.SESSION </code></pre>
<p>The command you seek is:</p> <pre><code>LIST APPLICATIONS </code></pre> <p>In the DB2 Command Center there is a tool which list the applications and displays them in a human friendly format as well.</p>
32,697
<p>I have seen many people saying on this site and many other 3D printing websites that 24 V systems are safer, compared to 12 V systems. By safer, I am talking in terms of fires or other electrical and component failures. </p> <p>Why would a 24 V system cause less danger? I would think that 12 V would be safer becaus...
<p>The most important "safety" advantage when using 24V (compared to 12V) is that to get the same power, you only need half the current. A 192W heated bed would need 16A at 12V, but only 8A at 24V.</p> <p>Since one of the most common safety issues is underrated screw terminals being used for the heated bed (just searc...
<p>From a pure safety standpoint there is nothing about a 24v system that is distrinctly more safe than a 12v system. I see you added comments about something involving wire sizes. This is not really a factor.. I would say not knowing what wire size to use is a whole other issue. There is nothing stopping you from putt...
503
<p>Is there a difference in passing parameters to <code>.load</code></p> <pre><code>$("#myDiv").load("myScript.php?var=x&amp;var2=y&amp;var3=z") </code></pre> <p>vs</p> <pre><code>$("#myDiv").load("myScript.php", {var1:x, var2:y, var3:z}) </code></pre> <p>Also, is there a size limit to how much <code>.load</code> c...
<p>In the first case, the data are passed to the script via GET, in the second via POST.</p> <p><a href="http://docs.jquery.com/Ajax/load#urldatacallback" rel="noreferrer">http://docs.jquery.com/Ajax/load#urldatacallback</a></p> <p>I don't think there are limits to the data size, but the completition of the remote ca...
<p>In the first case, the data are passed to the script via GET, in the second via POST.</p> <p><a href="http://docs.jquery.com/Ajax/load#urldatacallback" rel="noreferrer">http://docs.jquery.com/Ajax/load#urldatacallback</a></p> <p>I don't think there are limits to the data size, but the completition of the remote ca...
33,057
<p>I am trying to populate a string with a double value using a <code>sprintf</code> like this:</p> <pre><code>sprintf(S, "%f", val); </code></pre> <p>But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision.</p> <p>How can that be achieved?</p>
<p>%[width].[precision]</p> <p>Width should include the decimal point.</p> <p>%8.2 means 8 characters wide; 5 digits before the point and 2 after. One character is reserved for the point.</p> <p>5 + 1 + 2 = 8</p>
<p>For a more complete reference, see the <a href="http://en.wikipedia.org/wiki/Printf#printf_format_placeholders" rel="nofollow noreferrer">Wikipedia <em>printf</em> article, section "printf format placeholders"</a> and <a href="http://en.wikipedia.org/wiki/Printf#1970s:_C.2C_Lisp" rel="nofollow noreferrer">a good exa...
9,513
<p>The creation date of an executable linked in VS2005 is not set to the real creation-date of the <code>.exe</code> file. Only a complete re-build will set the current date, a re-link will not do it. Obviously the file is set to some date, which is taken from one of the project-files. </p> <p>So: is there a way to fo...
<p>Delete the executable as part of a pre-link event.</p> <p>Edit: Hah, I forgot about Explorer resetting the creation date if you name a file exactly the same as a file that was recently deleted.</p> <p>Why are you keying off the creation date anyway?</p>
<p>A complete rebuild will delete that file forcing the linker to create it, hence the reason it gets a new creation date. You could try disabling incremental linking under project properties (Linker | General). If that doesn't do it you could add a build event to delete the exe file and force it to create a new file...
3,884
<p>As a huge XSL fan, I am very happy to use xsl as the view in our proprietary MVC framework on ASP.NET. Objects in the model are serialized under the hood using .NET's xml serializer, and we use quite atomic xsl templates to declare how each object or property should transform.</p> <p>For example:</p> <pre><code> ...
<p><strong>You can used the serialized (xml) form of your objects and edit it with the XML Editor of VS</strong> (I use VS2008).</p> <p>Then associate an xsd schema to this xml document. Use the schema that xsd,exe generated itself and that it uses in the serialization/deserialization.</p> <p><strong>You will see tha...
<p>This is sort of off topic but having been down the route of creating a CMS with xsl(t) and the pain that caused I'd recommend asp.net mvc for other reasons than intellisense. But that is nice.</p> <p>I originally used xsl to separate out the view from the data, which it did. But the designers found it very hard goi...
38,647
<p>How do I support redundancy on my OpenID login website?</p> <p>For instance, I have users that demand 100% uptime (yeah, right, but let's get as close as we can).</p> <p>Some of them use less available providers (ie, myphpid on their own website, or an ID on a startup which has frequent downtime). Now I can shut...
<p>An OpenID is a URL. example.com/id and example2.com/id are two different OpenIDs, regardless of which provider hosts them or what credentials the users share with those providers. The reliability of an OpenID really comes down to the reliability of hosting that URL. Yes, you can define fallback providers in your ...
<p>I recently posted <a href="https://stackoverflow.com/questions/4661/how-do-i-use-more-than-one-openid#112662">an answer to the question "How do I use more than one OpenID?"</a> which may address your concerns.</p> <p>A professional provider should have a redundant service commonly archieved by having a load balance...
15,505
<p>I create event logs for asp.net projects error logging. I do it by adding a key in regedit, and then a sub-key.<br> Sometimes, I create a new key and sub-key, and instead of getting a new, empty event log, I see in the event viewer that it's showing me the logs from a different project. I'm not able to find a patter...
<p>You probably want to use the <a href="http://msdn.microsoft.com/en-us/library/2awhba7a.aspx" rel="nofollow noreferrer">EventLog.CreateEventSource</a> API to do this - it should take care of any details for you.</p> <p>A quick read thru the docs seems to show that the 1st 8 characters are checked for uniqueness...pe...
<p>It seems that the problem was that we had already created an event log with that name, and even though we deleted it, it didn't help. The solution was to create an event log with a different name.</p>
46,335
<p>Jquery has a great language construct that looks like this:</p> <pre><code>$(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); </code></pre> <p>As you might guess this, once the document has loaded, binds a custom function to the onClick event of all <strong><em>...
<p>Prototype 1.6 provides the <a href="http://prototypejs.org/api/document/observe" rel="nofollow noreferrer">"dom:loaded"</a> event on document:</p> <pre><code>document.observe("dom:loaded", function() { $$('a').each(function(elem) { elem.observe("click", function() { alert("Hello World"); }); }); });...
<pre><code>Event.observe(window, 'load', function() { Event.observe(element, 'click', function() { alert("Hello World!"); }); }); </code></pre> <p>Of course you need to "select" the elements first in Prototype. </p>
7,222
<p>I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. </p> <p>I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way.</p> <p>Is there a way? Or atleast some editor on l...
<p>You don't even need to write your own function - sgml-mode (a gnu emacs core module) has a built-in pretty printing function called (sgml-pretty-print ...) which takes region beginning and end arguments.</p> <p>If you are cutting and pasting xml and you find your terminal is chopping the lines in arbitrary places y...
<p>I'm afraid I like Benjamin Ferrari version much better. The internal pretty print always places the end tag in a new line after the value, inserting unwanted CR in the tag values.</p>
3,351
<p>Is is possible to write MS SQL Server add-in? I'm thinking of some application integrated with database server available form SQL Server Enterprise Manager.</p>
<p>Have you looked into using extended stored procedures to provide add-in like functionality?</p> <p>The only hang up would be to see it in the Enterprise Manager, but you can probably use Martin's post as a way to do that.</p> <p><a href="http://support.microsoft.com/kb/190987" rel="nofollow noreferrer">http://supp...
<p>You can include a lot into MS SQL server 2005 and 2008 database. Including .Net code. But there is no real way to extend (create plugin for) the Management Studio. (Formerly Enterprise Manager.)</p> <p>However there are database management addins for Visual Studio (especially in Team System). Maybe there you can i...
26,861
<p>There are multiple ways to fill an NSTableView up with data through either bindings, delegates, or data sources.</p> <p>What is the best way to go about filling up the tableview with data that is changed pretty frequently from an XML-RPC server? I'm targeting Mac OS X 10.5 only and there are lots of examples on ho...
<p>If I'm understanding correctly, it's really two separate questions. How do I fetch XML-RPC data, and how to populate a tableview?</p> <p>I'm not too familiar with XML-RPC, but from doing a quick look around it seems like you can either do the parsing yourself with the NSXML* classes, or use one of several third par...
<p>I don't know what the best way is. I don't really think there's a good way, so the "best way" is really going to be "the least worse" way.</p> <p>Take a look at <a href="http://developer.apple.com/documentation/Networking/Conceptual/UsingWebservices/1_intro_folder/chapter_1_section_1.html#//apple_ref/doc/uid/TP3000...
39,032
<p>What is the best way to save enums into a database?</p> <p>I know Java provides <code>name()</code> and <code>valueOf()</code> methods to convert enum values into a String and back. But are there any other (flexible) options to store these values?</p> <p>Is there a smart way to make enums into unique numbers (<code>...
<p>We <em>never</em> store enumerations as numerical ordinal values anymore; it makes debugging and support way too difficult. We store the actual enumeration value converted to string:</p> <pre><code>public enum Suit { Spade, Heart, Diamond, Club } Suit theSuit = Suit.Heart; szQuery = &quot;INSERT INTO Customers (Na...
<p>You can use an extra value in the enum constant that can survive both name changes and resorting of the enums:</p> <pre><code>public enum MyEnum { MyFirstValue(10), MyFirstAndAHalfValue(15), MySecondValue(20); public int getId() { return id; } public static MyEnum of(int id) { ...
28,452
<p>Example: You have a shortcut <code>s</code> to <code>SomeProgram</code> in the current directory.</p> <p>In <code>cmd.exe</code>, you can type <code>s</code> and it will launch the program.</p> <p>In PowerShell, typing <code>s</code> gives:</p> <blockquote> <p><code>The term 's' is not recognized as a cmdlet, f...
<p>On my Vista system typing S won't launch a lnk file unless I have the environment variable PATHEXT set with .lnk in the list. When I do. S will work in cmd.exe and I have to do .\S in powershell.</p>
<p>You can always use tab completion to type "s[TAB]" and press ENTER and that will execute it.</p>
4,257
<p>I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server to give me a 500 internal server error.</p> <p>The error log file shows: alert] [client 127.0.0.1] /var/www/.htaccess: DocumentRoot not allowed here</p> <p>AllowOveride All is set in my conf file.</p> <p>Any idea why thi...
<p>The <a href="http://httpd.apache.org/docs/2.0/mod/core.html#documentroot" rel="noreferrer">DocumentRoot</a> directive cannot appear in a <code>.htaccess</code> file. Put it in <code>httpd.conf</code> instead.</p>
<p>You don't mention your apache version , but docs for 2.0 say that DocumentRoot is only valid for virtualhost or server config. Acording to the docs it should not be used in a .htacces</p> <p><a href="http://httpd.apache.org/docs/2.0/mod/core.html#documentroot" rel="nofollow noreferrer">http://httpd.apache.org/docs/...
17,237
<p>In Ant is there any way to do something like this:</p> <pre><code>&lt;arguments id="arg-list"&gt; &lt;arg value="arg1" /&gt; &lt;arg value="arg2" /&gt; &lt;/arguments&gt; &lt;property name="prop1" refid="arg-list" /&gt; </code></pre> <p>I'm trying to write a macro for psexec and I'm looking for a nice way...
<p>I don't know of an answer to your specific question. The documentation is clear that refid 'Only yields reasonable results for references to PATH like structures or properties.'</p> <p>Without a bit more information on what you're trying to do, it's hard to comment. At the risk of changing your design, rather than ...
<p>Did you know about Ant-Contrib Tasks For and ForEach : <a href="http://ant-contrib.sourceforge.net/tasks/tasks/for.html" rel="nofollow">http://ant-contrib.sourceforge.net/tasks/tasks/for.html</a></p> <p>There is also find task : <code>&lt;find ... delimiter=""/&gt; ... &lt;/find&gt;</code>. This allow you to create...
35,780
<p>I am using Zend Framework(MVC part of it), and need to either redirect user to SSL enabled page or to force SSL from controller somehow and don't quite see how to do that? Maybe someone can share the knowledge? </p> <p>Thanks!</p>
<p>It's easy to do at the web server level.</p> <p>In Apache, you'd do it like this:</p> <pre><code>RewriteEngine On RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </code></pre>
<p>It's easy to do at the web server level.</p> <p>In Apache, you'd do it like this:</p> <pre><code>RewriteEngine On RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </code></pre>
43,618
<p>So, I'm working on some network programming in C, and it would seem that I am missing a bunch of standard C/C++ header files. For example, <code>sys/socket.h</code> is not there. A few otheres are missing too like <code>netdb.h</code>, and <code>unistd.h</code>. Is there a pack I need to install to get these on wind...
<p>All these headers are from POSIX, not ANSI C, or ISO C++. You won't find them in Windows without installing some sort of compatibility layer, like Cygwin, or porting your application to Windows API, or use some macros and wrappers to map similar functions (i.e. <code>#define strtok_r strtok_s</code>).</p>
<p>you probably won't find it because it is a commonly used linux header file. You can find it in linux-libc-dev, if you really want it.</p>
39,639
<p>I am getting a strange error on a remote windows clients (WinForm application using C# 2.0)</p> <p>Error Message: Access to the path 'c:\ApplicationFolder' is denied.</p> <p>Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode ...
<p>It likely comes down to the <em>reason</em> that you shouldn't put the application folder there: standard users don't have write access by default. Since most people run Windows as administrator it's not often a problem, but if you try to install on a corporate environment that recently updated security policies yo...
<p>Does the app at least load the "application folder" from a config file / the registry / a database table? If so, what happens when you change that value to something in the My Documents folder?</p> <p>I saw you added the user is an admin and has full admin rights so I have to ask the obvious -- does the folder exi...
47,566
<p>I've got a couple DNN portals I manage and I need a solution to keep them "alive" during slack traffic times. After a given time of inactivity IIS will unload the DNN application from memory which will effect load time for the first client request. DNN has the "KeepAlive.aspx" file that I hit with a wget command f...
<p>A good website monitoring service will most likely provide you with a URL to check to see if the site is functioning, that is what the Keepalive URL is for. Have the service check the URL more frequently than 15 minutes and you should be good to go with keeping the site up. There's always a chance the site will go d...
<p>If you are looking for a service there are a number of them out there, some free some not</p> <ul> <li><a href="http://www.host-tracker.com" rel="nofollow noreferrer">Host-Tracker</a></li> <li><a href="http://www.pingdom.com" rel="nofollow noreferrer">Pingdom</a> </li> <li>KeepAliveForever</li> </ul> <p>I have use...
19,109
<p>At the moment I have a console application. I would like to be able to exit the application, update through svn, recompile and then relaunch. This is running under a Linux environment. At the moment I'm not sure how I would be able to relaunch the application. Is there a way to do this?</p>
<p>Well, in code you need to put the sender's name in quotes, followed by the e-mail address.</p> <pre><code>new SmtpClient(...).Send("\"John Smith\" jsmith@somewhere.com", ...); </code></pre> <p>And...it looks like you can encode it into the attribute too...</p> <pre><code>&lt;smtp from="&amp;quot;John Smith&amp;qu...
<pre><code>&lt;system.net&gt; &lt;mailSettings&gt; &lt;smtp from ="XYZ&amp;lt;xyz@xyz.com&amp;gt;"&gt; &lt;network host="smtp.gmail.com" port="25" userName="xyz@xyz.com" password="******" enableSsl="true"/&gt; &lt;/smtp&gt; &lt;/mailSettings&gt; &lt;/system.net&gt; </code></pre> <p>1)Please Use these setting in app...
31,449
<p>The following code will generate a link to the page I want to get to.</p> <pre><code>&lt;%= Html.ActionLink(image.Title, image.Id.ToString(), "Image") %&gt; </code></pre> <p>The following code will cause the correct url to be rendered on the page.</p> <pre><code>&lt;%= Url.Action("Index", "Image", new { id = imag...
<p>This should work actually. ASP.NET MVC will substitute all &lt;%= ... %&gt; or similar tags, it does not recognize whether it's a html definition or javascript. What is the output of your view? Is the "strange error" coming from Javascript or ASP.NET?</p> <p><strong>EDIT</strong>: regarding your update: make sure y...
<p>It looks like you have a HomeController with an Image method correct? Then it should be</p> <pre><code>&lt;%= Url.Action("Image", "Home", new { id = image.Id })%&gt; </code></pre>
45,101
<p>I'm getting a JS error on displaying a page: Nothing concrete is specified but the line where it seems to be thrown. When looking into the source code of the page, I see the error is thrown inside the following script, but I can't understand why! It's only about loading images!</p> <pre><code> &lt;SCRIPT languag...
<p>Have you tried loading your scripts into a JS debugger such as <a href="http://www.aptana.com/" rel="nofollow noreferrer">Aptana</a> or Firefox plugin like <a href="https://addons.mozilla.org/en-US/firefox/addon/1843" rel="nofollow noreferrer">Firebug</a>?</p>
<p>should your script block not be:</p> <pre><code>&lt;script type="text/javascript"&gt; </code></pre> <p>?</p>
13,752
<p>We have a SharePoint Team Site (WSS 3.0 not MOSS), that includes Tasks list to records every tasks related to a project. Here's the scenario.</p> <p>Users :</p> <ul> <li>List item</li> <li>Supervisor1</li> <li>TeamMember1</li> <li>TeamMember2</li> <li>TeamMember3</li> </ul> <p>How do we set the permission setting...
<p><strong>you do not need any workflow or event handlers</strong> ( still you can use them for your purpos but they will slow down the performance if you will be having a lot of items)</p> <p>go to setting --> list settings click on Advanced Settings </p> <p>in Item-level Permissions in read access select all ite...
<p>Yes, you would have to write an event handler or workflow that will run upon item creation which would look at these column values and set the item level permissions as such.</p>
17,248
<p>You write a function and, looking at the resulting assembly, you see it can be improved.</p> <p>You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship between your high-livel language functio...
<p>If you are looking at the assembly, then its fair to assume that you have a good understanding about how code gets compiled down. If you have this knowledge, then its sometimes possible to 'reverse enginer' the changes back up into the original language but its often better not to bother. </p> <p>The optimisations ...
<p>It depends on the language you wrote your function in. Some languages like C are very low-level, translating each function call or statement to specific assembly statements. If you did use C, you can replace your function with inline assembly to improve performance.</p> <p>Other high-level languages may convert e...
8,986
<p>I used to work in a place where a common practice was to use Pair Programming. I remember how many small things we could learn from each other when working together on the code. Picking up new shortcuts, code snippets etc. with time significantly improved our efficiency of writing code.</p> <p>Since I started worki...
<p>community owned wiki Answer - feel free to edit or add comments:</p> <p><strong>Keyboard Shortcuts</strong> </p> <ul> <li><kbd>F5</kbd>, <kbd>CTRL</kbd> + <kbd>E</kbd> or <kbd>ALT</kbd> + <kbd>X</kbd> - execute currently selected TSQL code</li> <li><kbd>CTRL</kbd> + <kbd>R</kbd> – show/hide Results Pane</li> <li>...
<p>I warmly recommend Red Gate's SQL Prompt. Auto-discovery (intellisense on tables, stored procedures, functions and native functions) is nothing short of awesome! :)</p> <p>It comes with a price though. There is no free-ware version of the thing.</p>
12,645
<p>My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them.</p> <p>I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to &lt; and &gt; as oppos...
<pre><code>&lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; </code></pre> <p>This is referred to as the "identity transformation" in the <a href="http://www.w3.org/TR/xslt#copying" rel="noreferrer">XSLT specification...
<p>xsl:copy-of</p>
8,094
<p>I'm in the process of testing my application with respect to security. </p> <p>Aside from <a href="http://www.fiddler2.com/fiddler2/" rel="noreferrer">Fiddler</a>, <a href="http://www.charlesproxy.com/" rel="noreferrer">Charles</a> and <a href="https://addons.mozilla.org/en-us/firefox/addon/poster/" rel="noreferrer...
<p>Achilles does work on HTTPS traffic, but they note on their site that it is not the best tool any more.</p> <p>Their suggestions are <a href="http://portswigger.net/burp/" rel="noreferrer">Burp Suite</a> and <a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project" rel="noreferrer">WebScarab</a> bot...
<p>I'd strongly recommend <a href="http://www.httpwatch.com/" rel="nofollow noreferrer">HttpWatch</a>. I believe the basic version is free and captures your HTTPS traffic to some extent. The Professional version is worth the money.</p>
25,276
<p>In C++0x I would like to write a function like this:</p> <pre><code>template &lt;typename... Types&gt; void fun(typename std::tuple&lt;Types...&gt; my_tuple) { //Put things into the tuple } </code></pre> <p>I first tried to use a for loop on <code>int i</code> and then do:</p> <pre><code>get&lt;i&gt;(my_tuple...
<p>Since the "i" in</p> <pre><code>get&lt;i&gt;(tup) </code></pre> <p>needs to be a compile-time constant, template instantiation is used to "iterate" (actually recurse) through the values. Boost tuples have the "length" and "element" meta-functions that can be helpful here -- I assume C++0x has these too.</p>
<p>Take a look at section 6.1.3.4 of TR1, <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" rel="nofollow noreferrer">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf</a></p> <p>get is defined for both const and non-const qualified tuples and returns the appropriate reference...
10,583
<p>I saw <a href="http://www.gnegg.ch/2008/09/automatic-language-detection/" rel="nofollow noreferrer">this</a> on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful...
<p>For reference, in Windows (7) I just deleted the directory <code>C:\Program Files (x86)\Vim\vim72\lang</code>. That made it fallback to en_US.</p>
<p>Had similar issue, but neither one of above solution worked: <a href="https://superuser.com/questions/552504/vim-ui-language-issue/552523">https://superuser.com/questions/552504/vim-ui-language-issue/552523</a></p> <p>I've resolved it by removing all vim packets and build vim <a href="ftp://ftp.vim.org/pub/vim/unix...
15,432
<p>At my job, I have a clutch of six Windows services that I am responsible for, written in C# 2003. Each of these services contain a timer that fires every minute or so, where the majority of their work happens.</p> <p>My problem is that, as these services run, they start to consume more and more CPU time through eac...
<p>It's obviously pretty difficult to remotely debug you're unknown application... but here are some things I'd look at:</p> <ol> <li>What happens when you only run one of the services at a time? Do you still see the slow-down? This may indicate that there is some contention between the services.</li> <li>Does the p...
<blockquote> <p>Good suggestions, but rest assured, we have tried all of the usual troubleshooting. What I'm hoping is that this is a .NET issue that someone might know about, that we can work on solving.</p> </blockquote> <p>My feeling is that no matter how bizarre the underlying cause, the usual troubleshooting st...
4,575
<p>So I have about 10 short css files that I use with mvc app. There are like error.css login.css etc... Just some really short css files that make updating and editing easy (At least for me). What I want is something that will optimize the if else branch and not incorporate it within the final bits. I want to do somet...
<p>Specifically, like this in C#:</p> <pre><code>#if (DEBUG) Debug Stuff #endif </code></pre> <p>C# has the following preprocessor directives:</p> <pre><code>#if #else #elif // Else If #endif #define #undef // Undefine #warning // Causes the preprocessor to fire warning #error // Causes the preprocessor to fire...
<p>Compiler constants. I don't remember the C# syntax, but this is how I do it in VB:</p> <pre><code>#If CONFIG = "Debug" Then 'do somtehing #Else 'do something else #EndIf </code></pre>
7,372
<p>I'm writing a basic sprite engine for my own amusement and to get better aquainted with Java's 2d API. Currently I am making use of large numbers of separate .png files with transparent backgrounds to represent the various sprites and different frames of animation that I need. Most 'real world' game development proj...
<p>I currently use XML files generated by a simple sprite editor that store the sprite as a collection of (optionally animated) poses, which are in turn a collection of frames or cells. Frames store per-frame information like the x and y offset of the frame in sheet, cell width and height, and any transformation (resiz...
<p>Well, since most of them are custom, those details are up to the implementor. You'd generally have the file start with header information that contains the details of height/width and encoding, transparency, etc. </p> <p>A lot of the time things are in one file because it is very expensive to open/read multiple fi...
38,056
<p>My automated script for starting and stopping VMWare Server virtual machines has stopped working. vmware-cmd has started raising the error: </p> <blockquote> <p>The ordinal 3288 could not be located in the dynamic link library LIBEAY32.dll.</p> </blockquote> <p>I am not aware of any specific change or update whe...
<p>Have discovered that this only occurs when the script is run on a different drive to the one where the EXE is located. As a work around for this I have simply moved the scripts execution.</p> <p>Apparently the DLL relates to SSL, which isn't relevant to what I'm doing, so this is a suitable workaround. I'm guessi...
<p>Please check your path settings and see if you have included "C:\Program Files\VMware\VMware Workstation" for VMWare management purpose. Once you delete it, you won't see the error no more.</p>
4,976
<p>I want to display dates in the format: short day of week, short month, day of month without leading zero but including "th", "st", "nd", or "rd" suffix.</p> <p>For example, the day this question was asked would display "Thu Oct 2nd".</p> <p>I'm using Ruby 1.8.7, and <a href="http://ruby-doc.org/core/Time.html#meth...
<p>Use the ordinalize method from 'active_support'.</p> <pre><code>&gt;&gt; time = Time.new =&gt; Fri Oct 03 01:24:48 +0100 2008 &gt;&gt; time.strftime("%a %b #{time.day.ordinalize}") =&gt; "Fri Oct 3rd" </code></pre> <p>Note, if you are using IRB with Ruby 2.0, you must first run:</p> <pre><code>require 'active_sup...
<p>I like Bartosz's answer, but hey, since this is Rails we're talking about, let's take it one step up in devious. (Edit: Although I was going to just monkeypatch the following method, turns out there is a cleaner way.)</p> <p><code>DateTime</code> instances have a <code>to_formatted_s</code> method supplied by Acti...
19,964
<p>Has anyone seen this type of IE display problem?</p> <p><a href="http://xs133.xs.to/xs133/08465/ie_problem910.jpg.xs.jpg" rel="nofollow noreferrer">Example http://xs133.xs.to/xs133/08465/ie_problem910.jpg.xs.jpg</a></p> <p>Note that it is doing some sort of word-wrap/duplication when it renders.</p> <p>The code f...
<p>There is a number of ways to do this. </p> <p>On jquery.com it is part of background image applied the body tag. </p> <p>You can have a header section which has background aligned to the bottom as an image and bottom padding that prevents text/content from overlaying that part. Finally you could use thick border i...
<p>Its a <a href="http://static.jquery.com/files/rocker/images/bg_home_tile_sml.jpg" rel="nofollow noreferrer">BG image</a> that's applied to the body tag.</p> <pre><code>body { background: #2a3139 url(../images/bg_home_tile_sml.jpg) repeat-x 50% 0; } </code></pre> <p>IMO it's the best way to achieve this effect....
37,013
<p>i have robot and want to control it via internet using radio wave .. but still i dont know the best language to do that . with the need to build scure site to insure not any body can use it . i expect for site asp with c# but what is the language i'll need it to control from sender device to the recipt robot . also ...
<p>I think it might be best to narrow down your choice of technologies before choosing a programming language. Robotics control can be a very complex topic, and there are many approaches to solving the same problem.</p> <p>Having said that, with the components you've listed:</p> <ul> <li>Secure internet interface</li...
<p>It might be worth taking a look at <a href="http://msdn.microsoft.com/en-us/robotics/default.aspx" rel="nofollow noreferrer">Microsoft Robotics Studio</a> to give you an exampleof a framework you can work with. Generally all the various controllers etc "talk" different languages so you use something like robotics st...
23,648
<p>There are truckloads of counters available in perfmon for ASP.NET. What are the best (I am thinking of choosing 5-10) that will be the best to monitor in our test environment so that we can feed back to developers.</p> <p>I am thinking of things like request time, request queue length, active sessions etc.</p>
<p>For a normal (not performance/stress testing) you would be OK with the following:</p> <ul> <li>Request Bytes Out Total <em>(very important especially for web (not intranet) applications)</em></li> <li>Requests Failed</li> <li>Requests/Sec</li> <li>Errors During Execution</li> <li>Errors Unhandled During Execution</...
<p>Be aware of memory counters when running more than one ASP.NET Application Pool check out the problem at <a href="http://blog.dynatrace.com/2009/02/27/can-you-trust-your-net-heap-performance-counters/" rel="nofollow noreferrer">http://blog.dynatrace.com/2009/02/27/can-you-trust-your-net-heap-performance-counters/</a...
19,554
<p>Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone?</p> <p>An app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture.</p> <p>The EXIF data for a photo taken on the iPh...
<p>I have finally found the problem, and as expected it is quite simple: user error. Explorer (which is itself a 64-bit process on Windows&nbsp;Vista 64-bit) launches 64-bit command prompts by default. If you want a 32-bit <code>CMD.EXE</code>, you must explicitly reference <code>C:\Windows\SysWoW64\CMD.EXE</code>.</p>...
<p>Instead of <code>%ProgramFiles%</code>, isn't there a <code>%Programfiles(x86)%</code> that always goes where you want, regardless of which cmd.exe is running? My Windows&nbsp;XP 64-bit systems all have that; excuse me for not taking the time to boot up a Vista system.</p>
48,828
<p>I have following situation. A main table and many other tables linked together with foreign keys. Now when I would like to delete a row in the main table a ConstraintsViolation will occur, which is intended and good.</p> <p>Now I want to be able to check if the ConstraintsViolation will occur before I trigger the d...
<pre><code>If Exists ( Select * From OtherTable Where OtherTableFKColumn = MainTablePrimaryKey) Begin Rollback Transaction RaisError('Violating FK Constraint in Table [OtherTable]', 16, 1) End </code></pre>
<p>One ugly attempt would be to try a DELETE in a transaction and then force a ROLLBACK if it is successful. But this is to dirty for my taste.</p>
46,543
<p>I am trying to learn more about regular expressions I have one below that I believe finds cases where there is a missing close paren on a number up to 999 billion. The one below it I thought should do the same but I do not get similar results</p> <pre><code> missingParenReg=re.compile(r"^\([$]*[0-9]{1,3}[,]?[0-9]...
<p>The trickier part about regular expressions isn't making them accept valid input, it's making them reject invalid input. For example, the second expression accepts input that is clearly wrong, including:</p> <ul> <li><code>(1,2,3,4</code> -- one digit between each comma</li> <li><code>(12,34,56</code> -- two digit...
<p>One difference I see at a glance is that your regex will not find strings like:</p> <pre><code>(123,,, </code></pre> <p>That's because the corrected version requires at least one digit between commas. (A reasonable requirement, I'd say.) </p>
47,167
<p>I'm using eclipse for a few months, I realy like gvim better but eclipse makes my life easier with pydev and phpeclipse. Everything is pretty nice, I have a black fluxbox and black GTK themes, I've changed the syntax colors for py and php and now everything is dark background, light foreground (including the eclipse...
<p>You need to install the <a href="http://www.eclipse.org/webtools/" rel="noreferrer">WTP</a> plugin to add all that HTML/JS/CSS support.</p> <p>I would also recommend using the <a href="http://www.eclipse.org/pdt/" rel="noreferrer">PDT</a> plugin for all your PHP needs.</p> <p>After installing these plugins.. you s...
<p>For others who may not be as familiar with the Preferences for Eclipse you can find most of these color settings (once you have the plugins mentioned here installed) at:</p> <p>Preferences > Text editors > Appearance color options</p> <p>and</p> <p>Preferences > Appearance > Colors and Fonts</p> <p>Don't forget ...
46,478
<p>The UK VAT system is changing from 17.5% to 15%. What strategies have you used in your code to store the VAT, and how will the change affect your applications. Do you store a history of vats so you can calculate old prices, or are old invoices stored in a separate table? Is it a simple config setting, or did you bod...
<h2>Don't calculate it. Store it!</h2> <p>HMRC are very fussy about getting paid the right amount of VAT. The rounding of VAT calculations is somewhat vaguely specified in the user guides, and leaving it up to future implementers to get it right is possibly asking for trouble. By storing the amount when the invoice/li...
<p>I found a table in the code last night that stored important configuration settings for the application. </p> <pre><code>Table tbl_config config_id int config_name varchar(255) config_value varchar(255) </code></pre> <p>One of these settings was our main admin username and password combination for the ser...
40,901
<p>I have an application that uses the accelerometer. Sometimes, the application will launch without the accelerometer data updating. Relaunching the app, sometimes the problem persist, sometimes it doesn't. And even weirder, sometimes I can try 10 times and everything works as expected. Is this a bug, or maybe somethi...
<p>I finally found a work around. This is a known bug. So the work around I found is to start a thread and have this thread check if the accelerometer delegate has been called, if it has, then quit the thread, if not, set the delegate again, and re-test, until the accelerometer delegate gets called. I tested this throu...
<p>I have this same problem. It happens perhaps 1/20 times with an app I made from the CrashLanding sample. After I noticed it with my app I grabbed a fresh version of Crashlanding, installed it, and finally got it to start with accelerometer failing.</p> <p>I don't know how to fix it. Honestly I hate the accelerom...
30,977
<p>What is the best way to implement the page view counter like the ones they have here on the site where each question has a "Views" counter?</p> <p>Factoring in Performance and Scalability issues.</p>
<p>The counter i optimized works like this:</p> <pre><code>UPDATE page_views SET counter = counter + 1 WHERE page_id = x if (affected_rows == 0 ) { INSERT INTO page_views (page_id, counter) VALUES (x, 1) } </code></pre> <p>This way you run 2 query for the first view, the other views require only 1 query.</p>
<p>You can implement an IHttpHandler to do that.</p>
30,660
<p>I'm looking for guidance on how to use PHP's Mailparse pecl extension. The <a href="http://us2.php.net/manual/en/book.mailparse.php" rel="noreferrer">documentation</a> on the PHP website isn't very helpful. </p> <p>Does anyone have experience with this and care to share a few pointers?</p>
<p>Use a java.lang.StringBuilder - basically a mutable String. However, it would be safer and more "Java style" to return the modified String.</p>
<p><code> public boolean doStuff(String msg) { boolean boolTest = false; msg += "Appending something to msg"; int msgLength = msg.length(); if ( msgLength > 80 ) { boolTest = true; return boolTest; } return boolTest; } </code></p> <p>Is this kind of what you're looking for? I'm assumin...
44,552
<p>Below I present three options for simplifying my database access when only a single connection is involved (this is often the case for the web apps I work on).</p> <p>The general idea is to make the DB connection transparent, such that it connects the first time my script executes a query, and then it remains conne...
<p>Doh! Someone else here at work figured this out. It was really simple and I should have been able to sort it, but hey, that's how it goes sometimes.</p> <p>Here the fix:<br> On the web server, copy the 'aspnet_client' folder from 'C:\Inetpub\wwwroot' to 'C:\Inetpub\wwwroot\your-website-name'. </p> <p>That's all ...
<p>I took over maintaining some code produced by another developer who had left and suffered this issue too. In my case the compiled report was looking for the images in the crystalreportview115 folder which existed in my local development path and therefore worked locally. The only folder on on the target server was t...
7,675
<p>I'm eager to give these a go, but I've only got my precious home machine to try it out.</p> <p>I'm in the middle of some important work that can't get inferred with, yet I can't resist the urge to give the new bits a go.</p> <p>Will installing VS10 on a Vista SP1 box with VS08 screw with the VS08 experience in any...
<p>No. The download for the CTP is in the form of a Virtual PC Image, so will have no impact.</p>
<p>I'd avoid installing anything tagged CTP, RC or beta on a machine you consider mission critical. Resist the temptation and install it in a VM or non-critical box instead. :)</p>
32,235
<p>Short version: </p> <p>Could anyone suggest or provide a sample in LINQ to XML for VB, or in an XSLT of how to change one XML element into another (without hardcoding an element-by-element copy of all the unchanged elements)?</p> <p>Background:</p> <p>I have an XML file, that I think is properly formed, that cont...
<p>Using one of the most fundamental and powerful XSLT design patterns: overriding the <a href="http://www.w3.org/TR/xslt#copying" rel="nofollow noreferrer"><strong>identity template</strong></a>, one will write this very simple transformation to replace every "Genres" element with a "Topics" element:</p> <pre> &lt;xs...
<p>Are you looking for something like this:</p> <pre><code> &lt;xsl:template match="Tag"&gt; &lt;xsl:element name="Genre"&gt; &lt;xsl:value-of select="@Name"/&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; </code></pre>
41,745
<p>I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.</p> <pre><code>TemperamentalClass tc = new TemperamentalClass(); tc.DoSomething(); // normally runs in 30 sec. Want to error at 1 min </code></pre> <p>I'm looking for a solutio...
<p>The really tricky part here was killing the long running task through passing the executor thread from the Action back to a place where it could be aborted. I accomplished this with the use of a wrapped delegate that passes out the thread to kill into a local variable in the method that created the lambda.</p> <p>...
<p>What about using Thread.Join(int timeout)?</p> <pre><code>public static void CallWithTimeout(Action act, int millisecondsTimeout) { var thread = new Thread(new ThreadStart(act)); thread.Start(); if (!thread.Join(millisecondsTimeout)) throw new Exception("Timed out"); } </code></pre>
38,319
<p>Does anyone know of any notepad++ plugin that saves a version of whatever I'm working on periodically? Ideally, it would save many versions with the automatic version number and the date in the title, and perhaps store them in a zipped archive to save space.</p> <p>Does something like this exist already, or shold I...
<p>Settings > Preferences > Backup tab > Click Verbose Backup</p> <p>This will time stamp a copy of your file every time you save.</p> <hr> <p><strong>Update:</strong> </p> <p><a href="http://fstellari.googlepages.com/npp_plugins" rel="noreferrer">AutoSave</a> allows to automatically save the currently open files b...
<p>It seems that you are a Windows user, so you have an option of using shadow copies, but copies are probably not generated often enough.</p> <p>IntelliJ Idea and some other Java IDEs have <a href="http://blogs.jetbrains.com/idea/2007/06/intellij-idea-local-history-a-life-saver/" rel="nofollow noreferrer">local histo...
26,544
<p>I'm looking for a way to redirect all the stderr streams in interactive bash (ideally to its calling parent process).</p> <p>I don't want to redirect stderr stream from each individual command, which I could do by appending <code>2&gt; a_file</code> to each command.</p> <p>By default, these stderr streams are redi...
<p>Use the <code>exec</code> builtin in bash:</p> <p><code>exec 2&gt; /tmp/myfile</code></p>
<p>Tried <code>ssh -t</code> to create a pseudo-TTY at the remote end?</p>
4,992
<p>I am trying to use WScript.Shell SendKeys method to emulate sending a key press from the Number Pad.</p> <p>I have an application that I am writing automated testing for using QTP. It is a Web Browser based application and the input is into a Java App within the web page. The input only accepts key presses from th...
<p>I would choose PowerShell over WMI for the following reasons:</p> <ol> <li>Writing a cmdlet is only adding a .NET Class.</li> <li>The PowerShell runtime provides command line parsing built in.</li> <li>Writing your management interface in PowerShell allows administrators the ability to integrate management of your ...
<p>Not sure that this can be answered with the information that you have provided so far. My gut feeling would be that you should use powershell since it sounds like you may already have some .Net code. But it really does just depend on exactly what you are trying to do.</p>
32,347
<p>I have an existing application written in Perl. Now I need to integrate this application with OBI. The plan is having a button the user can click on to open OBI in an <em>iframe</em>. OBI resides on a different server from the running application.</p> <p>Has anyone done this before, know what is the best practice f...
<p>There are two ways to address the problem that I know of and tried out. According to your needs, one or the other might be more appropriate (or both, they're not mutually exclusive). In both cases, the documentation is good and readily available.</p> <h1>The "Go URL"</h1> <p>The Go URL is documented more thoroug...
<p>Embedding OBIEE reports inside a non-ADF web app is tough. If you have an option to re-write your web application in ADF, your life will be a lot easier. Just drag and drop reports and visualizations into your web application. Oracle's own Fusion Applications also follow this approach. If your app is analytics heavy...
38,417
<p>When trying to print parts that should contain certain sized holes, e.g. for screws, how to achieve that they are sized correctly?</p> <p>Is it possible to calibrate the printer perfectly, so it prints holes correctly sizes in all common sizes (e.g. starting at 2mm diameter)? Or is it better to design the holes lar...
<p><a href="http://hydraraptor.blogspot.nl/2014/06/why-slicers-get-dimensions-wrong.html" rel="nofollow noreferrer">The reason holes come out undersized is generally the slicer</a>, so calibrating the printer itself cannot solve the issue (without making other things worse). The output of the printer is exactly what it...
<p>Make sure you know what purpose the holes are to serve. If they are <em>clearance</em> holes , i.e. designed so that the screw or bolt slides thru easily, then there's nothing wrong with a slight oversize.<br> If you want a <em>tappable</em> hole, i.e. either drive threads for a machine screw or self-tap with wood/...
458
<p>How can I access options that I set in a jQuery Datepicker?</p> <pre><code>$("#testDatePicker").datepicker({ minDate: new Date(2005, 0, 26), showOn: 'button', buttonImage: 'js/themes/default/images/calendar.gif', buttonImageOnly: true }); var minDate = $("#testDatePicker").?????; </code></pre>
<p>What about storing the options in a named var instead of an anonymous object?</p> <pre><code>var dpOptions = {minDate: new Date(2005, 0, 26), ...}; $('#testDatePicker').datepicker(dpOptions); . . . var minDate = dpOptions.minDate; </code></pre>
<p>I'd take a look at the code. Most plugins I've looked at have either a option or config var that they extend with what you pass in.</p> <p>You could check real quick and try to do something like $.datepicker.buttonImageOnly = false; and then see if that actually changed anything. </p> <p>Of course this may not w...
36,195
<p>Here is my problem. I am hitting a web service (hosted on a Java based server) that will only accept text encoded Requests, but it returns MTOM Responses. What I've found is that if I set the web service to RequireMtom, it sends an Mtom request! Unfortunately, the server chokes on an Mtom request and returns a 500 e...
<p>Yes you can send a text message and get an mtom reply(or vise versa)with WCF.</p> <p>see...</p> <p><a href="http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/480f1bc4-1fc4-40e9-a2ed-efcf3009d6ef" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/480f1bc4-1fc4-40e9-a2ed-efcf3...
<p>[WSE 3.0] You can define a new class that inherits from your WSE3 proxy object with a single override method GetWebResponse.</p> <p>In GetWebResponse method, you can simply choose if you want to use the mtom encoding according to the response's content-type.</p> <p>After that, you have to use this proxy class inst...
36,047
<p>I couldn't figure out why NHibernate is doing this. </p> <p>Here's part of my table in MS SQL</p> <pre><code>CREATE TABLE Person ( nameFamily text, nameGiven text ) </code></pre> <p>Here's Person.hbm.xml</p> <pre><code>&lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt; &lt;class name="Infosci.Dpd....
<p>That's a "feature" of SetNamingStrategy(ImprovedNamingStrategy.Instance)</p> <p>It will add underscores before each uppercase letter in mixed-cased names.</p> <p>Not sure how you disable it (me not being a nhibernate user) </p>
<p>What I end up doing is just use the default naming strategy or SetNamingStrategy(DefaultNamingStrategy.Instance)</p> <p>the default naming strategy will leave mix-cased name untouched</p>
28,982
<p>I am migrating web apps to new hosting servers, but when I try to access them to test on the new server, I get all these assemblies not found errors like:</p> <pre><code>Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review t...
<p>That's part of the ASP.Net AJAX kit.</p>
<p>You will have to either install the ASP.AJAX kit on the server, or include the assemblies in your project. <a href="https://stackoverflow.com/questions/273418/any-way-to-use-aspnet-ajax-when-my-server-does-not-and-can-not-have-the-aspnet">This question</a> and <a href="https://stackoverflow.com/questions/221761/how-...
35,144
<p>I have a table structure that looks like:</p> <pre><code>&lt;table&gt; &lt;tr id="row1"&gt; &lt;td&gt; &lt;div&gt;row 1 content1&lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div&gt;row 1 content2&lt;/div&gt; &lt;/td&gt; &lt;td&gt; &lt;div&gt;row 1 content3&lt;/div&gt; &lt;/td&gt; &lt;/t...
<p>jQuery always returns a set of elements. Sometimes, the set is empty. Sometimes, it contains only one element. The beauty of this is that you can write code to work the same way regardless of how many elements are matched:</p> <pre><code>$("selector").each(function() { this.style.backgroundColor = "red"; }); </c...
<p>To get div directly, try this</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$divElement = $('#row3 td div');</code></pre> </div> </div> </p>
39,578
<p>I am writing an XML document in C#.</p> <p>I have something like this...</p> <pre><code>string output = "REAPP DUE NO OF M CASE NBR APPL NBR DATE GRPS M CASE NBR APPL NBR DATE GRPS _ _ _"; </code></pre> <p>and I do t...
<p>GridView has a DataKeyNames property. When you bind a data source to the grid, you set the DataKeyNames (usually with just one name, your PK field). You don't show the PK, but you can get to it from code-behind.</p>
<p>Visible=false means don't render on the page. What you want is either to make it a template field and use a HiddenField to hold the value or set the style on the control to "display: none;". This would be the case if the client side code needed access to the value for an Ajax call or something.</p> <p>Otherwise u...
25,152
<p>I currently have an application that gets hit with over 20,000 users daily and they mostly look at one data table. This data table is filled with about 20 rows but is pulled from a "datatable" in a db with 200,000-600,000 records of information in the table. <strong>Edit:</strong> These 20 rows are "dynamic" and do...
<p>Technically, I believe what you want to do is possible, but I wouldn't reccomend it. There are several factors you have to consider before going down this path.</p> <ol> <li><p>Do you have the hardware to support it? If you don't have the memory for such a configuration and you have to page swap, then you'll prob...
<p>You say they mostly look at one table, and that table is pulled from 200 to 600K rows. How often is that table pulled? Is this a "homepage" type scenario where users are mostly looking at the first page of data? Why cache all 200K rows, why not cache the first 20? </p>
18,173
<p>I'm looking for turn-key <a href="http://www.antlr.org/" rel="nofollow noreferrer">ANTLR</a> grammar for C# that generates a usable Abstract Syntax Tree (AST) and is either back-end language agnostic or targets C#, C, C++ or D.</p> <p>It doesn't need to support error reporting.</p> <p>P.S. I'm not willing to do ha...
<p>This may be waaaay too late, but you can get a <a href="http://www.antlr3.org/grammar/list.html" rel="nofollow noreferrer">C# 4 grammar</a>.</p>
<p>You can find C# 6 ANTLR grammar at official <a href="https://github.com/antlr/grammars-v4/tree/master/csharp" rel="nofollow noreferrer">grammars repository</a>.</p>
46,690
<p>Is a home 3D printer capable of printing a good bicycle air pump?</p> <p>I've searched the Internet and there is very limited info on it. Things need to be rigid and very minutious in the valve part of the pump. I could give an example of what I thought in the image <a href="https://i.stack.imgur.com/cFuku.jpg" rel...
<h1>depends</h1> <p>You certainly can print <em>parts</em> of <strong>a</strong> bicycle pump, for example, the outer case and maybe the inner piston, maybe even the housing for the connection valves.</p> <p>However, you cant print the buffer spring or the valves itself. You will have trouble printing the adapters. And...
<p>It should be possible to print such a product. You should be printing this in a tough material at a fine layer resolution and probably need to machine the inside of the cylinder or use grease and use a rubber valve. </p>
1,124
<p>I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have you ever used this? I'm trying to determine how/when one might use this and what problem it solves. I'd be very interested in hearing how ...
<p>Typically, I see this used in cases where you are currently using Reflection and need to optimize for performance.</p> <p>For example, instead of using reflection to call method X, you generate a Dynamic Method at runtime to do this for you.</p>
<p>At least one case you might use it is when generating dynamic code. For example, the framework is using this internally to generate XML serializers on the fly. After looking into a class at runtime, it can generate the code to serialize / deserialize the class. It then compiles that code and users it as needed. In t...
17,369
<p>I'm currently looking at the Python framework Django for future db-based web apps as well as for a port of some apps currently written in PHP. One of the nastier issues during my last years was keeping track of database schema changes and deploying these changes to productive systems. I haven't dared asking for bein...
<p>There are at least two third party utilities to handle DB schema migrations, <a href="http://aeracode.org/projects/south/" rel="noreferrer">South</a> and <a href="http://code.google.com/p/django-evolution/" rel="noreferrer">Django Evolution</a>. I haven't tried either one, but I have heard some good things about Sou...
<p>And now there's also <a href="http://code.google.com/p/dmigrations/" rel="nofollow noreferrer">dmigrations</a>. From <a href="http://simonwillison.net/2008/Sep/3/dmigrations/" rel="nofollow noreferrer">announcement</a>:</p> <blockquote> <p>django-evolution attempts to address this problem the clever way, by detectin...
4,035
<p>I am going to work on a project where a fairly large web app needs to tweaked to handle several languages. The thing runs with a hand crafted PHP code but it's pretty clean.</p> <p>I was wondering what would be the best way to do that?</p> <ol> <li><p>Making something on my own, trying to fit the actual architectu...
<p>There are a number of ways of tackling this. None of them "the best way" and all of them with problems in the short term or the long term. The very first thing to say is that multi lingual sites are not easy, translators and lovely people but hard to work with and most programmers see the problem as a technical one...
<p>I use hl parameter and gettext combining engine translations already there with own .po which makes new translations and languages appear when engine or my django/gae <a href="http://classifiedsmarket.appspot.com" rel="nofollow noreferrer">example</a> adds:</p> <pre><code>{% get_current_language as LANGUAGE_CODE %}...
18,988
<p>Looking at the C# project templates in VS2008 and the offerings are WPF User Control Library, WPF Custom Control Library and Windows Forms Control Library. Which of these would you use if you wanted to move a legacy active control written in c++ into the world of C# and .NET?</p>
<p>It sounds like you are trying to do several different things all at once:</p> <ol> <li>Migrate your code to building in a newer version of visual studio.</li> <li>Migrate your use of technology to a newer technology (ActiveX to .net)</li> <li>Migrate your language (c++ to c#).</li> </ol> <p>If you have a small cod...
<p>There is no project template that will do this for you. You might as well read up and start with a usercontrol.</p>
7,924
<p>I have started on a personal python application that runs on the desktop. I am using wxPython as a GUI toolkit. Should there be a demand for this type of application, I would possibly like to commercialize it.</p> <p>I have no knowledge of deploying "real-life" Python applications, though I have used <a href="http:...
<p>You can distribute the compiled Python bytecode (.pyc files) instead of the source. You can't prevent decompilation in Python (or any other language, really). You could use an obfuscator like <a href="http://www.lysator.liu.se/~astrand/projects/pyobfuscate/" rel="noreferrer">pyobfuscate</a> to make it more annoying ...
<p>I have been using py2exe with good success on Windows. The code needs to be modified a bit so that the code analysis picks up all modules needed, but apart from that, it works.</p> <p>As for Linux, there are several important distribution formats:</p> <ul> <li>DEB (Debian, Ubuntu and other derivatives)</li> <li>RP...
19,839
<p>I'm trying to convert some Xaml to HTML using the .NET XslCompiledTransform and am running into difficulties getting the xslt to match Xaml tags. For instance with this Xaml input:</p> <pre><code>&lt;FlowDocument PagePadding="5,0,5,0" AllowDrop="True" NumberSubstitution.CultureSource="User" xmlns="http://schemas.m...
<p>Yes, it's a problem with the namespace. All of the elements in your input document are in the namespace <code>http://schemas.microsoft.com/winfx/2006/xaml/presentation</code>. Your template is trying to match elements that are in the default namespace, and it's not finding any.</p> <p>You need to declare this nam...
<p>It works when I remove this from your source document:</p> <pre><code>xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" </code></pre> <p>I don't believe your last two templates are matching at all. (You can test by putting something like a wrapping &lt;div&gt; in your FlowDocument template.)</p>
34,409
<p>In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc. Unfortunately, when clicking these links, the default behavior is for the page to open in the current browser window. That is, it does NOT open the page in a new instance of the browser. This has proven...
<p>It is not possible with the default Link List web part, but there are resources describing how to extend Sharepoint server-side to add this functionality.</p> <p><a href="http://www.andrewconnell.com/blog/articles/SharepointLinksListOpenInNewWindow.aspx" rel="noreferrer">Share Point Links Open in New Window</a><br/...
<p>Under the Links Tab ==> Edit the URL Item ==> Under the URL (Type the Web address)- format the value as follows:</p> <p>Example: if the URL = <a href="http://www.abc.com" rel="nofollow">http://www.abc.com</a> ==> then suffix the value with ==></p> <ul> <li>#openinnewwindow/,'" target="http://www.abc.com'</li> </ul...
12,895
<p>I'm currently creating an application for a customer that will allow them to automatically bill their customers credit cards. </p> <p>I'm curious as to what are some <strong>best practices</strong> to safely store and access the credit card information, and for that matter, any other sensitive information, like so...
<p>Read the <a href="http://pcistandard.com/requirements.html" rel="nofollow noreferrer">PCI requirements</a>. Everything will be there.</p> <p>Actually, you <em>must</em> follow them.</p>
<p>Be intimate with the <a href="http://www.owasp.org/index.php/Main_Page" rel="nofollow noreferrer">OWASP</a> threats and know precisely how to counter them in your application and framework. It's hard to believe how many people embrace goofy half-solutions to SQL Injection and cross-site Scripting attacks.</p>
22,398
<p>I'm designing a mount for a cylindrical speaker to attach to my bicycle. It will mount on the bottle cages. I've printed a few iterations with various infill settings (using PLA) and the weak point is always the bolts holding the entire mount to the bike. They can't handle the compression needed to secure it properl...
<ol> <li><p>Infill has minimal effect on the strength of printed parts, so I would expect the part to break in the same spot regardless of what infill percentage you used. </p></li> <li><p>PLA is especially poor in this exact application, and it undergoes significant creep/cold flow under mechanical compression over t...
<p>Try heating op your PLA while mounting it. The PLA wil temporarily weaken and will become a bit moldable. PETG is a bit more brittle than PLA is my experience so I'd say stick to PLA. Otherwise you might try Arnitel ECO. I can try to find an amazon purchase link for you if you want. Anyway, it is more rubber like an...
1,526
<p>I put "better" in quotes because it's a qualitative question. I've been writing COM DLLs for a couple of years now and have only recently come upon, and successfully used, the standard DLL with Typelib concept. </p> <p>Are there any compelling reasons to use COM DLLs instead of DLL+Typelib? Granted, you can't do DC...
<p>TypeLib's are also important if you ever wish to migrate COM components to managed code in the future. Or have managed code interact with the COM components. </p> <p>With a typelib there are lots of tools which will automagically translate your COM signatures into .Net interfaces and types. This can be done by h...
<p>It really depends on the clients of the component I would think.</p>
23,596
<p>Is there a quick way to find every match of a regular expression in Ruby? I've looked through the Regex object in the Ruby STL and searched on Google to no avail.</p>
<p>Using <a href="http://ruby-doc.org/core-1.9.3/String.html#method-i-scan" rel="noreferrer"><code>scan</code></a> should do the trick:</p> <pre><code>string.scan(/regex/) </code></pre>
<h1>Return an array of <code>MatchData</code> objects</h1> <p><code>#scan</code> is very limited--only returns a simple array of strings!</p> <p>Far more powerful/flexible for us to get an array of <code>MatchData</code> objects.</p> <p>I'll provide two approaches (using same logic), one using a PORO and one using a mo...
10,585
<p>My current code is this:</p> <pre><code>int volume = Alert.getVolume(); // reads 100 Alert.setVolume(0); </code></pre> <p>It DOESN'T change the volume setting, like it would be supposed to do Even calling <code>Alert.mute(true);</code> doesn't produce any good effect. <code>Audio.setVolume(0);</code> also doesn't...
<p>If you want to play sound with <a href="http://www.blackberry.com/developers/docs/4.5.0api/net/rim/device/api/system/Alert.html" rel="nofollow noreferrer">Alert</a>: </p> <pre><code>class Scr extends MainScreen implements FieldChangeListener { ButtonField mVolumeUp; ButtonField mVolumeDown; ButtonField mPla...
<p>Certain functions on the blackberry (but not the emulator) only work with signed code. I'm not sure if it is the case for volume, but I wouldn't be surprised when it was.</p>
42,590
<p>When adding a DLL as a reference to an ASP.Net project, VS2008 adds several files to the bin directory. If the DLL is called foo.dll, VS2008 adds foo.dll.refresh, foo.pdb and foo.xml. I know what foo.dll is :-), why does VS2008 add the other three files? What do those three files do? Can I delete them? Do they ...
<p><strong>Source Control:</strong></p> <p>Ben Straub said in a comment to this post: The <code>.dll.refresh</code> files should be added to the source control if required, while the <code>.xml</code>, <code>.pdb</code> and of course the <code>.dll</code> files should not be added.</p> <p>John Rudy explained when to ...
<p>foo.pdb is the debugger symbols file for foo.dll, you'll want it or you won't be able to set a breakpoint in that code.</p>
19,619
<p>Does anyone know how to stop jQuery fromparsing html you insert through before() and after()? Say I have an element:</p> <pre><code>&lt;div id='contentdiv'&gt;bla content bla&lt;/div&gt; </code></pre> <p>and I want to wrap it in the following way: </p> <pre><code>&lt;div id='wrapperDiv'&gt; &lt;div id='befor...
<pre><code>$('#contentDiv').each(function() { $(this).wrap('&lt;div id="wrapperDiv"&gt;'); $(this).before('&lt;div id="beforeDiv"&gt;'); $(this).after('&lt;div id="afterDiv"&gt;'); }); </code></pre> <p>produces:</p> <pre><code>&lt;div id='wrapperDiv'&gt; &lt;div id='beforeDiv'&gt;&lt;/div&gt; &lt;...
<p>I'm sorry, but this one should be obvious. In your case, you can't use wrap because it sticks the original node into the deepest node it finds in the wrapping HTML. You don't want that. Instead, read out the HTML from your object and combine it with what you have:</p> <pre><code>$('#contentDiv').each( function()...
33,925
<p>trying to mount an smb share on OS X so that the 'www' user can read files from there.</p> <p>the SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)</p> <p>my basic approach is</p> <pre><code># 1) create mountpoint sudo mkdir /Volumes/www_mdisk # 2) per...
<p>Sorry this answer is two years late, but I had a similar problem and was able to solve it using your steps, more or less. I followed steps 1-3, and then for step 4, I sudo'd as _www instead of using the -O option (since it doesn't exist any longer.)</p> <pre><code>sudo -u _www mount_smbfs //User:Password@Host/Shar...
<p>ok, I can do this now on Mac OS X 10.4</p> <pre><code># 4) mount the SMB share using the Active Directory user 'ad_user' sudo mount_smbfs -O www/www -u 70 -g 70 '//DOMAIN;ad_user@smbshare_host/sharepath' www_mdisk # 5) make sure http.conf has 'Options Indexes' enabled for Docroot duh. </code></pre> <p>So everythi...
41,977
<p>I am working with Ender 3 Pro and in menu it has an option to cooldown. Is there any need to cooldown 3D printer before shutdown or can I just shutdown without cooldown? </p>
<p>Depending on what material you print it it most likely a good idea to let the hotend cool down before shutting off the printer (fan). </p> <p>For example if you shut down the printer right after you print a PLA part, at 190 - 220 degrees Celsius, your hot end will still be that hot and will suffer heat creep withou...
<p>That option you are referring to, is meant to manually shut down power to the heated bed and hotend, there is no timed cool down period other than you timing it. This is a handy option if you fiddled with either the bed or the hotend; e.g. to insert new filament.</p> <p>A cool down period can be very useful dependi...
1,356
<p>Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv).</p> <p>Problem: Many records are missing field delimiters.</p> <p>Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections?</p> <p><strong>ETA:</strong> I'm attempting...
<p>Been there, done that. Wrote my own tool.</p> <p>It's remarkable how many programs that allegedly output CSV don't actually do so correctly.</p> <p>A commercial tool would be nice, but given the variety of problems that I've encountered in CSV files (missing delimiters, bad separator values, embedded CR/LF in the...
<p>Such kind of message pops out when you try to access the data and shows that records are missing.Stellar File Repair can get you out of this corruption where you will find all kinda softwares.</p>
22,218
<p>I have a new project that needs a good binary protocol.</p> <p>I was thinking of using <a href="http://hessian.caucho.com/" rel="nofollow noreferrer">Hessian</a>, unless anyone has any better ideas.</p> <p>I was reading through some of their documentation and it's not as straightforward as I thought, so I have a c...
<p>Yes, Hessian 2.0 is the one to use. The protocol specifies how a data structure is represented binary, the spec is simple.</p> <p>The Hessian web service builds on the Hessian protocol, it specifies a number of headers in the Hessian format to describe e.g. the request/response format in the Hessian protocol. It de...
<p>I have not used Hessian in the past and I don't plan on using it in the future either, and my arguments are these:</p> <p>For a web service, I would try really hard to keep it in plain old XML. In the event that I would choose a binary XML representation, I would probably use <a href="http://en.wikipedia.org/wiki/F...
22,278
<p>This <a href="http://www2007.org/papers/paper801.pdf" rel="nofollow noreferrer">pdf paper</a> describes a way to manage cross-domain communication using JavaScript with a bit of help from the server.</p> <p>Does anyone have experience with this approach? I know <a href="http://groups.google.com/group/crosssafe" re...
<p>That link did not point to a pdf paper. It linked to some guys profile with a bunch of links. </p> <p>If you want to do cross domain communication you have two main choices: Serverside proxy or a JSON call. </p> <p>Eric</p>
<p>Why dont you check out easyXDM (<a href="http://easyxdm.net" rel="nofollow noreferrer">http://easyxdm.net</a>). Its extremely easy to use and has some nifty features, for example, check out <a href="http://consumer.easyxdm.net/example/methods.html" rel="nofollow noreferrer">http://consumer.easyxdm.net/example/method...
49,788
<p>Some web applications, like Google Docs, store data generated by the users. Data that can only be read by its owner. Or maybe not?</p> <p>As far as I know, this data is stored as is in a remote database. So, if anybody with enough privileges in the remote system (a sysadmin, for instance) can lurk my data, my priva...
<p>If encryption/decryption is performed on the server, there is no way you can make sure that the cleartext is not dumped somewhere in some log file or the like.</p> <p>You need to do the encryption/decryption inside the browser using JavaScript/Java/ActiveX or whatever. As a user, you need to trust the client-side o...
<p>No, you can't use passwords, but you could use password hashes. However, Google Docs are all about sharing, so such a method would require storing a copy of the document for each user.</p>
6,094
<p>How do I convert a string to DateTime format? For example, if I had a string like:</p> <p><code>"24/10/2008"</code></p> <p>How do I get that into DateTime format ?</p>
<p>Use <a href="http://msdn.microsoft.com/en-us/library/system.datetime.parseexact.aspx" rel="noreferrer">DateTime.ParseExact</a>:</p> <pre><code>string str = "24/10/2008"; DateTime dt = DateTime.ParseExact(str, "dd/MM/yyyy", Thread.CurrentThread.CurrentCulture); </code></pre> <p>(Y...
<p>Try something like</p> <pre><code>DateTime date = System.DateTime.ParseExact(str, "dd/MM/yyyy", null); </code></pre> <p>For time this might work </p> <pre><code>DateTime date = System.DateTime.ParseExact(str, "HH:mm:ss", null); </code></pre>
28,802
<p>I have a site that connects using cURL (latest version) to a secure gateway for payment.</p> <p>The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.</p> <pre><code>curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); ...
<p>I had the same problem today. Curl comes with an outdated file to authenticate HTTPS certificates from.</p> <p>get the new one from:</p> <p><a href="http://curl.haxx.se/ca/cacert.pem" rel="nofollow noreferrer">http://curl.haxx.se/ca/cacert.pem</a></p> <p>save it into some dir on your site </p> <p>and add </p> <...
<p>You are using POST method, but are you providing an array of data? E.g.</p> <pre><code>curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); </code></pre>
40,810
<p>Does anyone know the keyboard shortcut in Visual Studio to open the context menu? i.e The equivalent of right clicking. Thanks.</p>
<p><kbd>Shift</kbd> + <kbd>F10</kbd> works in most Windows applications, but I don't have Visual Studio.</p>
<p>You could also press the shortcut on your keyboard, if you have that key of course. <kbd>Shift</kbd> + <kbd>F10</kbd> works as well.</p>
15,303
<p>I've got a PHPUnit mock object that returns <code>'return value'</code> no matter what its arguments:</p> <pre><code>// From inside a test... $mock = $this-&gt;getMock('myObject', 'methodToMock'); $mock-&gt;expects($this-&gt;any)) -&gt;method('methodToMock') -&gt;will($this-&gt;returnValue('return value')...
<p>Use a callback. e.g. (straight from PHPUnit documentation):</p> <pre><code>&lt;?php class StubTest extends PHPUnit_Framework_TestCase { public function testReturnCallbackStub() { $stub = $this-&gt;getMock( 'SomeClass', array('doSomething') ); $stub-&gt;expects($this-&gt;a...
<p>Try :</p> <pre><code>-&gt;with($this-&gt;equalTo('one'),$this-&gt;equalTo('two))-&gt;will($this-&gt;returnValue('return value')); </code></pre>
35,074
<p>Every time I have to add a handler or module for ASP.NET with IIS7, the instructions always tell me to incorporate it into two sections: <code>system.web</code> and <code>system.webserver</code>.</p> <pre><code>&lt;system.web&gt; &lt;httpHandlers&gt; &lt;/httpHandlers&gt; &lt;httpModules&gt; &lt;/ht...
<p>The system.web section is for configuring IIS 6.0, while the system.webserver version is used to configure IIS 7.0. IIS 7.0 includes a new ASP.NET pipeline and some configuration differences, hence the extra config sections. </p> <p>However... </p> <p>If you're running IIS 7.0 in integrated mode only, you shouldn'...
<p>The former is for Classic Mode.</p> <p>The latter is for Integrated Pipeline Mode (available in IIS7+).</p>
46,302
<p>I think this is a multi-part question, so bear with me.</p> <p>Currently all of our developers use the version of Tortise built for SVN 1.4 and our SVN server is running 1.4. Our build server is running CC.Net and is using SVN 1.4.</p> <p>We want to upgrade. </p> <p>I've established that upgrading our clients to ...
<p>Hard to answer as it seems you're asking for a plan for your environment, which I'm not in.</p> <p>However, here's what I'd do:</p> <ul> <li>Upgrade cc.net (you have a known good starting point, and this is the most likely breaking step. do it without any other variables so it is easier to roll back)</li> <li>Tes...
<p>A little tip that may help you: SVN 1.4 clients can connect to a SVN 1.5 server, and SVN 1.5 clients can connect to a SVN 1.4 server, no problems -- just when you have a version mismatch, some of the newly added SVN features will not be available (but all the normal stuff will still work fine).</p>
19,118
<p>When coding web services, how do you structure your return values? How do you handle error conditions (expected ones and unexpected ones)? If you are returning something simple like an int, do you just return it, or embed it in a more complex object? Do all of the web methods within one service return an instance...
<p>I like the Request/Response object pattern, where you encapsulate your arguments into a single [Operation]Request class, which has simple public properties on it.</p> <p>Something like AddCustomerRequest, which would return AddCustomerResponse.</p> <p>The response can include information on the success/failure of ...
<p>Soap faults are a standard practice where the calling application is a Soap client. There are cases, such as a COM client using XMLHTTP, where the Soap is parsed as XML and Soap faults cannot be easily handled. Can't vote yet but another +1 for @Ben Scheirman.</p>
6,070
<p>I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the...
<p>I was able to get my maven build working correctly by adding the following plugin to the ws-war pom file:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;executions&gt; ...
<p>Have you tried using the "type" element in your dependencies? For example:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;group-a&lt;/groupId&gt; &lt;artifactId&gt;artifact-b&lt;/artifactId&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;type&gt;aar&lt;/type&gt; &lt;/dependency&gt; </code></pre> <p>Its hard ...
9,918
<p>Hi I have a JSON object that is a 2-dimentional array and I need to pass it to PHP using Ajax.Request (only way I know how). ...Right now I manually serialized my array using a js function...and get the data in this format: s[]=1&amp;d[]=3&amp;[]=4 etc. ....</p> <p>my question is: Is there a way to pass the JSON ob...
<p>You can also use Prototype's function <a href="http://www.prototypejs.org/api/array/tojson" rel="nofollow noreferrer">toJSON()</a> to convert an array into a JSON object. After passing it to server via Ajax call, simply use PHP's function <a href="http://us.php.net/json_decode" rel="nofollow noreferrer">json_decode(...
<p>Check <a href="http://www.openjs.com/scripts/data/ued_url_encoded_data/" rel="nofollow noreferrer">http://www.openjs.com/scripts/data/ued_url_encoded_data/</a> to encode nested data directly correct, since Object.toQueryString() doesn't accept nested data...</p>
40,204
<p>I have a Windows Workflow application that uses classes I've written for COM automation. I'm opening Word and Excel from my classes using COM.</p> <p>I'm currently implementing IDisposable in my COM helper and using Marshal.ReleaseComObject(). However, if my Workflow fails, the Dispose() method isn't being called a...
<p>I can not see what failure you have that does not calls the Dispose() method. I made a test with a sequential workflow that contains only a code activity which just throws an exception and the Dispose() method of my workflow is called twice (this is because of the standard WorkflowTerminated event handler). Check th...
<p>Basically, you should not rely on hand code to call Dispose() on your object at the end of the work. You probably have something like this right now:</p> <pre><code>MyComHelper helper = new MyComHelper(); helper.DoStuffWithExcel(); helper.Dispose(); ... </code></pre> <p>Instead, you need to use try blocks to catch...
12,135
<p>I have been thinking a lot about unit testing and how to improve the readability of the unit tests. I thought why not give a character to the classes in the unit test to clarify what they do. </p> <p>Here is a simple unit test that I wrote: </p> <pre><code>[TestFixture] public class when_dave_transfers_money_f...
<p>How about a private helper method in the test fixture</p> <pre><code>private Dave GetDave_With_Wamu_And_Woodforest_AccountsHookedUp() </code></pre>
<p>I can add Dave to the Wamu and the Woodforest account when Dave is created like this: </p> <pre><code> public Dave() { FirstName = "Dave"; LastName = "Allen"; // add accounts for Dave Wamu wamu = new Wamu(); wamu.AddUser(this); Woo...
19,427
<p>Which Oracle database role will allow a user to select from a table in another schema without specifying the schema identifier? i.e., as user A- Grant select on A.table to user B; B can then- "Select * from table" without specifying the 'A'. One of our databases allows this, the other returns a 'table or view doe...
<p>You can create a synonym for this. Create a synonym named "CoffeeTable" on object "A.CoffeeTable". You can create a public synonym so everyone sees it like this, or just a synonym under user B.</p>
<p>Brett is right. Synonyms are used for this. In fact there are cases where you do not know what will be the schema name in production. Maybe you use A for some schema name and A is already taken in some Oracle instance.</p>
27,555
<p>Are there any Platform agnostic (not CLI) movements to get LINQ going for C++ in some fashion? </p> <p>I mean a great part of server frameworks around the world run on flavors of UNIX and having access to LINQ for C++ on UNIX would probably make lots of people happy!</p>
<p><a href="https://github.com/hjiang/linqxx/wiki" rel="noreferrer">Linq++</a> by Hong Jiang looks like a good start. Its syntax is much closer to Linq than CLinq's. <a href="http://pfultz2.github.com/Linq/" rel="noreferrer">Linq</a> by pfultz2 looks interesting, as well, but it needs a C++11 compiler.</p>
<p>I don't think C++ has the compiler sugar to handle things such as lambda expressions, so no, that's not going to happen.</p>
28,741
<p>I am trying to build an website for my college's magazine. I used the "views" module to show a block of static content I created on the front page.</p> <p>My question is: how can I edit the theme's css so it changes the way that block of static content is displayed?</p> <p>For reference, <a href="http://www.histor...
<p>The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file: /aroda/roda/files/color/garland-d3985506/s...
<p>It looks like most of your CSS info is in some *.css files. There is also some inline Style info on the page. Your style for the static info comes from the in-line stuff. I am not sure how Drupal generates the page but the place to start looking is for any properties for "ultima-edicao". That is what the surroun...
5,584
<p>I'd like to build an own control, but therefore I need to know if its possible to combine a Textbox event with a Popup more or less like the Datepicker Control. Or is there a better way to do this than with a Popup?</p> <p>Greets</p> <p>Patrick</p>
<p>Sure you could do this. In fact look at the DatePicker as an example of how you might do that. I'd imagine your control would be a composite of TextBox, Button and Popup controls.</p>
<p>You can download the complete source to the Silverlight Toolkit from the <a href="http://www.codeplex.com/Silverlight/Release/ProjectReleases.aspx?ReleaseId=18804" rel="nofollow noreferrer">CodePlex Silverlight Toolkit project site</a>.</p> <p>And you can get the source and unit tests for the Beta 2 Release 1 contr...
43,840