instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I need to write some code to analyze whether or not a given user on our site is a bot. If it's a bot, we'll take some specific action. Looking at the User Agent is not something that is successful for anything but friendly bots, as you can specify any user agent you want in a bot. I'm after behaviors of unfriendl... | <p>Clarify why you want to exclude bots, and how tolerant you are of mis-classification. </p>
<p>That is, do you have to exclude every single bot at the expense of treating real users like bots? Or is it okay if bots crawl your site as long as they don't have a performance impact?</p>
<p>The only way to exclude all b... | <p>Well, this is really for a particular page of the site. We don't want a bot submitting the form b/c it messes up tracking. Honestly, the friendly bots, Google, Yahoo, etc aren't a problem as they don't typically fill out the form to begin with. If we suspected someone of being a bot, we might show them a captcha ... | 44,415 |
<p>We are moving from regular 2.0 webforms with no testing to TDD MVC </p>
<p>I'm looking to find out all the requirements for making the jump from 2.0 to 3.5 MVC. </p>
<ul>
<li>Does SQL Server 2000 work with .net 3.5? </li>
<li>Does the MVC Framework come with .net 3.5?</li>
<li>How does AJAX work with all this stu... | <p>ASP.NET MVC is an extension of ASP.NET 3.5, it is still in beta and voices says that it will be available before the end of the year.</p>
<p>For your other questions:
- .NET 3.5 works well on SQL Server 2000
- The MVC framework is not part of .NET 3.5
- For using AJAX with ASP.NET MVC it's better if you take a look... | <p>Anybody aware of a best practices or example project out there that uses ASP.NET MVC and LLBLGEN (selfservicing or adaptor)? Possibly something similar to S#arp Architecture. </p>
<p>I'm new to MVC and I'm constrained to using LLBLGEN. </p>
| 28,485 |
<p>Before moving on to use SVN, I used to manage my project by simply keeping a <code>/develop/</code> directory and editing and testing files there, then moving them to the <code>/main/</code> directory. When I decided to move to SVN, I needed to be sure that the directories were indeed in sync.</p>
<p>So, what is a ... | <p>The diff command has a -r option to recursively compare directories:</p>
<pre><code>diff -r /develop /main
</code></pre>
| <p>The classic (System V Unix) answer would be <code>dircmp dir1 dir2</code>, which was a shell script that would list files found in either dir1 but not dir2 or in dir2 but not dir1 at the start (first page of output, from the <code>pr</code> command, so paginated with headings), followed by a comparison of each commo... | 14,567 |
<p>I am trying to create a control that implements the per-pixel alpha blend while painting a 32-bit bitmap.</p>
<p>I extended a CWnd and use static control in the resource editor. I managed to paint the alpha channel correctly but still the static control keep painting the gray background.</p>
<p>I overwrote the OnE... | <p>I would have though that if you are processing both the <strong>WM_ERASEBKGND</strong> and the <strong>WM_PAINT</strong> messages then you should have cover all the painting options, without having to resort to using the <strong>WS_EX_TRANSPARENT</strong> style.</p>
<p>Are you sure your code <strong>is not passing<... | <pre><code>BEGIN_MESSAGE_MAP(CTransparentStatic, CStatic)
ON_WM_ERASEBKGND()
ON_WM_CTLCOLOR_REFLECT()
END_MESSAGE_MAP()
BOOL CTransparentStatic::OnEraseBkgnd(CDC* /*pDC*/)
{
// Prevent from default background erasing.
return FALSE;
}
BOOL CTransparentStatic::PreCreateWindow(CREATESTRUCT& cs)
{
... | 41,293 |
<p>HI I got this coursework question to solve. </p>
<p>This is the question:</p>
<p>Design a program to simulate vehicles at an intersection.</p>
<p>Assume that there is one lane going in each of four directions, with stoplights facing each direction. Vary the arrival time of vehicles randomly in each direction and ... | <p>Read <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Queue.html" rel="nofollow noreferrer">about</a> <a href="http://en.wikipedia.org/wiki/Queue_(data_structure)" rel="nofollow noreferrer">queues</a> you have to use to simulate each traffic light. </p>
<p>Each randomly generated car going in each lane wi... | <p>If you have access to IEEE there is a journal about this topic here is the <a href="http://ieeexplore.ieee.org/iel5/8866/28034/01252658.pdf?arnumber=1252658" rel="nofollow noreferrer">link</a></p>
| 37,513 |
<p>I am starting a new job on Monday. The company has a home grown enterprise case management application written in <code>ASP.NET/VB.NET</code>. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile coach. They are currently f... | <p>Great question!</p>
<p>I would say the first thing to do is get the daily scrums going. Your part in the scrum will be learning the code. It will provide you a way to ask questions and get a feel for who can help you learn the code.</p>
<p>Once you have that guy (or guys) picked out start pair programming with t... | <p>Congratulations on the new job!</p>
<p>Relax and keep your cool. Read something on <a href="http://www.refactoring.com/sources.html" rel="nofollow noreferrer">here</a>.</p>
<p>I guess, the process itself will make sure you are productive as long as you apply common sense :)</p>
| 8,084 |
<p>What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?</p>
| <p>SysInternals stopped updating RootKit Revealer a couple of years ago.</p>
<p>The only sure way to detect a rootkit is to do an offline compare of installed files and filesystem metadata from a trusted list of known files and their parameters. Obviously, you need to trust the machine you are running the comparison ... | <p><a href="http://live.sysinternals.com/" rel="nofollow noreferrer">Rootkit revealer</a> from SysInternals</p>
| 13,257 |
<p>I recently saw an announcement and <a href="http://www.linux.com/feature/150399" rel="nofollow noreferrer">article</a> outlining the release of the first <a href="http://www.python.org/download/releases/3.0/" rel="nofollow noreferrer">Python 3.0</a> release candidate. I was wondering whether there were any commercia... | <p>Python 3 is just <strong>not that different</strong> from Python 2.x. In terms of syntax <em>per se</em>, things that will actually need to be handled differently by the parser, the only major change is in the replacement of the <code>print</code> statement with the <code>print</code> function.</p>
<p>Most of the ... | <p>I can say that at the time of posting this (Apr. 28 2009, version 0.8.4h) that <a href="http://pythonide.blogspot.com/" rel="nofollow noreferrer" title="SPE">SPE</a> does <em>not</em> correctly handle some python3 syntax - specifically exception handling. For example, the follow code is flagged as an error (and irri... | 25,460 |
<p>I have a table, we'll call <code>Users</code>. This table has a single primary key defined in SQL Server - an autoincrement <code>int ID</code>.</p>
<p>Sometimes, my LINQ queries against this table fail with an <code>"Index was outside the range"</code> error - even the most simplest of queries. The query itself do... | <p>This almost certainly won't be everyone's root cause, but I encountered this exact same exception in my project - and found that the root cause was that an exception was being thrown during construction of an entity class. Oddly, the true exception is "lost" and instead manifests as an ArgumentOutOfRange exception o... | <p>The exception occurs in a System library and your story makes me think the problem isn't in your code. Has the schema changed recently? Is your mapping correct?</p>
| 23,279 |
<p>I was looking into scripting to be incorporated into my apps. Then I bumped into <a href="http://www.protsyk.com/scriptdotnet/" rel="nofollow noreferrer">Script.Net</a> and <a href="http://nemerle.org/Main_Page" rel="nofollow noreferrer">Nemerle</a>. I do know that they have different syntax and Nemerle supports mac... | <p>Nemerle is a statically-typed language, and the word scripting can be found nowhere on the nemerle website.</p>
<p>If I were adding scripting to an app, I would consider using IronPython.</p>
| <p>You might want to consider other choice than the 2 you have posted. The best I have found so far for .Net is : <a href="http://www.csscript.net/" rel="nofollow noreferrer">CSScript</a>. It takes me some time to get used to installed it but once it's install, it works great and you scripting use C# so no need to have... | 49,002 |
<p>Is there an open source or public domain framework that can document shell scripts similar to what JavaDoc produces? I don't need to limit this just to a specific flavor of shell script, ideally I would like a generic framework for documenting API or command line type commands on a web page that is easy to extend or... | <p>If you have Perl, <a href="http://bahut.alma.ch/2007_08_01_archive.html" rel="nofollow noreferrer">here</a> is an example of someone who used Perl's POD system for documentation of a shell script.</p>
<blockquote>
<p>The trick is to have the Perl POD section in a bash "Here-Document", right after the null ... | <p>You might consider <a href="http://www.doxygen.org/" rel="nofollow noreferrer">Doxygen</a>. While it's mostly used to document C-ish languages like JavaDoc, you can probably come up with a setup that will work for shell scripts with a bit of wrangling.</p>
| 27,433 |
<p>Can anyone recommend a good server-side PDF generation tool that would work in a Linux environment. I want easy as possible, pass it a XHTML file (with images) and have it generate a PDF from the <strong>rendered</strong> source.</p>
<p>I don't have a massive budget, but anything under $1000 should be alright.</p>
... | <p>I used <a href="http://www.easysw.com/htmldoc/" rel="nofollow noreferrer">HTMLDoc</a> about 8 years ago and it did a good job of turning HTML tables with some basic formatting into a decent PDF report. There also seems to be an <a href="https://www.msweet.org/projects.php?Z1" rel="nofollow noreferrer">open source ve... | <p>I did some searching, what about <a href="http://tbookdtd.sourceforge.net/" rel="nofollow noreferrer">tbookdtd</a>?
It's downloadable <a href="http://sourceforge.net/project/showfiles.php?group_id=48834" rel="nofollow noreferrer">here</a> but it hasn't been active since 2005. It appears to convert the xml to Latex,... | 3,570 |
<p>How do you change the CLASSPATH of a Java process from within the Java process?</p>
<hr>
<p>Before you ask me "Why would you want to do that?" I'll explain it shortly. </p>
<blockquote>
<p>When you have a Clojure REPL running it is common to need more jars in your CLASSPATH to load a <a href="http://clojure.org... | <p>Update Q4 2017: as <a href="https://stackoverflow.com/questions/252893/how-do-you-change-the-classpath-within-java/252967#comment82290481_252967">commented</a> below by <a href="https://stackoverflow.com/users/1974520/vda8888">vda8888</a>, in Java 9, the System <a href="https://docs.oracle.com/javase/9/docs/api/java... | <pre><code>String s="java -classpath abcd/ "+pgmname+" "+filename;
Process pro2 = Runtime.getRuntime().exec(s);
BufferedReader in = new BufferedReader(new InputStreamReader(pro2.getInputStream()));
</code></pre>
<p>is an example of changin the classpath in java program</p>
| 31,511 |
<p>What's the best way to break from nested loops in Javascript?</p>
<pre><code>//Write the links to the page.
for (var x = 0; x < Args.length; x++)
{
for (var Heading in Navigation.Headings)
{
for (var Item in Navigation.Headings[Heading])
{
if (Args[x] == Navigation.Headings[Heading][It... | <p>Just like Perl,</p>
<pre><code>loop1:
for (var i in set1) {
loop2:
for (var j in set2) {
loop3:
for (var k in set3) {
break loop2; // breaks out of loop3 and loop2
}
}
}
</code></pre>
<p>as defined in EMCA-262 section 12.12. <a href="https://developer.... | <pre><code>XXX.Validation = function() {
var ok = false;
loop:
do {
for (...) {
while (...) {
if (...) {
break loop; // Exist the outermost do-while loop
}
if (...) {
continue; // skips current iteration ... | 22,144 |
<p>I am trying to find a way to load a JSON page to display my content, which I currently have. But I am trying to fade in each element one after another? Is anyone familiar with a way to do that?</p>
<p>Fade in each element with a slight delay?</p>
<p>Here is an example of my code, I am using the jquery framework.</... | <p>Let's say you have an array of span elements:</p>
<pre><code>$("span").each(function(index) {
$(this).delay(400*index).fadeIn(300);
});
</code></pre>
<p><em>(quick note: I think you need jQuery 1.4 or higher to use the .delay method)</em></p>
<p>This would basically wait a set amount of time and fade each ele... | <p>From answers above I came up with something like this which worked well for me.</p>
<p><strong>HTML</strong></p>
<pre><code><div id="errorMessage" class="d-none" ></div>
</code></pre>
<p><strong>Javascript</strong></p>
<pre><code>var vehicle = {
error: (error, message) => {
if(error){
... | 49,779 |
<p>This is a somewhat low-level question. In x86 assembly there are two SSE instructions: </p>
<blockquote>
<p><code>MOVDQA <i><em>xmmi, m128</em></i></code></p>
</blockquote>
<p>and </p>
<blockquote>
<p><code>MOVNTDQA <i><em>xmmi, m128</em></i></code></p>
</blockquote>
<p>The IA-32 Software Developer's Manua... | <p>Non-Temporal SSE instructions (MOVNTI, MOVNTQ, etc.), don't follow the normal cache-coherency rules. Therefore non-temporal stores must be followed by an SFENCE instruction in order for their results to be seen by other processors in a timely fashion.</p>
<p>When data is produced and not (immediately) consumed agai... | <p>According to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1: Basic Architecture,
"Programming with Intel Streaming SIMD Extensions (Intel SSE)" chapter:</p>
<p><strong>Caching of Temporal vs. Non-Temporal Data</strong></p>
<blockquote>
<p>Data referenced by a program can be tem... | 5,775 |
<p>I equipped my Makerbot Replicator 2x with <a href="https://www.aliexpress.com/item/Makerbot-Replicator-2-3D-Printer-Part-Makerbot-TMC2100-V1-0-Stepper-Motor-Driver-Module-With-Heatsink/32870918354.html" rel="nofollow noreferrer">silent stepper drivers TMC2100</a>. According to the product page I reduced V<sub>ref</s... | <p>Most Stepper drivers will have lots of energy passing through them so it is crucial to having a moderately sized heatsink to cool them off otherwise they will get too hot. Most stepper drivers found online come with heatsinks but you could search online for mini heatsinks.</p>
| <p>What constitutes too hot? A Hybrid stepper motor operating at 80 degrees is normal. They dissipate heat via their mounting plate (which should not be plastic), otherwise you may need to use active cooling. Now if the motors are dying from the heat then you have a problem.</p>
| 1,255 |
<p>When I try to compile the newest version of Clisp on Ubuntu 8.04 I always get this error after running configure:</p>
<pre><code>Configure findings:
FFI: no (user requested: default)
readline: yes (user requested: yes)
libsigsegv: no, consider installing GNU libsigsegv
./configure: libsigsegv was not detec... | <p>Here are my notes from compiling CLISP on Ubuntu in the past, hope this helps:</p>
<pre><code>sudo apt-get install libsigsegv-dev libreadline5-dev
# as of 7.10, Ubuntu's libffcall1-dev is broken and I had to get it from CVS
# and make sure CLISP didn't use Ubuntu's version.
sudo apt-get remove libffcall1-dev libff... | <p>If you look at 'config.log' it might tell you why configure is not finding libsigsegv</p>
| 15,867 |
<p>In SQL, how do update a table, setting a column to a different value for each row?</p>
<p>I want to update some rows in a PostgreSQL database, setting one column to a number from a sequence, where that column has a unique constraint. I hoped that I could just use:</p>
<pre><code>update person set unique_number = (... | <p>Don't use a subselect, rather use the nextval function directly, like this:</p>
<pre><code>update person set unique_number = nextval('number_sequence');
</code></pre>
| <p>I consider pg's sequences a hack and signs that incremental integers aren't the best way to key rows. Although pgsql didn't get native support for UUIDs until 8.3 </p>
<p><a href="http://www.postgresql.org/docs/8.3/interactive/datatype-uuid.html" rel="nofollow noreferrer">http://www.postgresql.org/docs/8.3/interac... | 17,831 |
<p>How does AOP (<em>Aspect Oriented Programming</em>) work in Drupal?</p>
<p>I have learned about AOP in terms of using it for logging and security, but how does it apply to Drupal?</p>
| <p>Drupal mimics AOP paradigms through hooks, which basically allow developers to weave in bits of code during the flow of execution. You can take a look at the hooks a developer can implement on the <a href="http://api.drupal.org/api/group/hooks/4.7" rel="nofollow noreferrer">list of Drupal hooks</a> shown in the Drup... | <p>Drupal mimics AOP paradigms through hooks, which basically allow developers to weave in bits of code during the flow of execution. You can take a look at the hooks a developer can implement on the <a href="http://api.drupal.org/api/group/hooks/4.7" rel="nofollow noreferrer">list of Drupal hooks</a> shown in the Drup... | 15,839 |
<p>How do I find out which directories are responsible for chewing up all my inodes?</p>
<p>Ultimately the root directory will be responsible for the largest number of inodes, so I'm not sure exactly what sort of answer I want..</p>
<p>Basically, I'm running out of available inodes and need to find a unneeded directo... | <p>If you don't want to make a new file (or can't because you ran out of inodes) you can run this query: </p>
<pre><code>for i in `find . -type d `; do echo `ls -a $i | wc -l` $i; done | sort -n
</code></pre>
<p>as insider mentioned in another answer, using a solution with find will be much quicker since recursive ls... | <p>This command works in highly unlikely cases where your directory structure is identical to mine:</p>
<p><code>find / -type f | grep -oP '^/([^/]+/){3}' | sort | uniq -c | sort -n</code></p>
| 45,239 |
<p>I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:</p>
<pre><code>String s = new String("silly");
</code></pre>
<p>Because it creates unnecessary <code>String</code> objects. But instead it should be written like this:</p>
<pre><code>String s ... | <p><code>String</code> is a special built-in class of the language. It is for the <code>String</code> class <strong>only</strong> in which you should avoid saying</p>
<pre><code>String s = new String("Polish");
</code></pre>
<p>Because the literal <code>"Polish"</code> is already of type <code>String</code>, and you... | <p>In most versions of the JDK the two versions will be the same:</p>
<p>String s = new String("silly");</p>
<p>String s = "No longer silly";</p>
<p>Because strings are immutable the compiler maintains a list of string constants and if you try to make a new one will first check to see if the string ... | 43,376 |
<p>What is the best way to find the total number of words in a text file in Java? I'm thinking Perl is the best on finding things such as this. If this is true then calling a Perl function from within Java would be the best? What would you have done in condition such as this? Any better ideas?</p>
| <pre><code>int count = 0;
Scanner sc = new Scanner(new File("my-text-file.txt"));
while (sc.hasNext()) {
++count;
sc.next();
}
</code></pre>
| <p>I'd initialize a <code>word_count</code> int to 1, then loop through each character in the file and increment <code>word_count</code> for every whitespace character <em>unless</em> the previous character was a whitespace character. (A space, tab, or newline.)</p>
| 34,965 |
<p>Is there any way to get code level access to a bluetooth mapped drive? The simple use case is I have a bluetooth folder in Explorer that looks something like:</p>
<p>"My Bluetooth Places\Entire Bluetooth Neighborhood\DEV1\OBEX File Transfer\E:\" </p>
<p>which maps to a device root, and I want to be able to read/w... | <p>This is not possible. The way to achieve this is to open a Bluetooth serial connection to the device in question, and traverse its file system using the <a href="https://obex4j.dev.java.net/files/documents/2519/9269/OBEX13.pdf" rel="nofollow noreferrer">OBEX File Transfer profile</a>.</p>
| <p>Yes, it is.</p>
<p>What you see in the explorer is the string representation of PIDL — a list of identifiers.</p>
<p>You should study COM as technology, then Shell extensions. </p>
<p>For what you see in the Explorer, is a virtual 'file' system. The bluetooth software extends it.</p>
<p>Here is a door: <a href="... | 46,938 |
<p>My anet A8 stepper drivers get very hot after some time printing, so I decided to install a 5V fan to cool them down. I had the idea to get a 12V to 5V regulator to connect a 5V fan, but then i found this image:</p>
<p><a href="https://i.stack.imgur.com/Ryeyj.jpg" rel="noreferrer"><img src="https://i.stack.imgur.co... | <p>The 5V is derived from the 12V supply by a linear regulator (L7805CD, DPAK package with 100 C/W thermal resistance). The maximum you can draw from it (without overheating the regulator) is around 200mA. Considering the electronics on the board are already using some power, the maximum would be around a 150mA fan but... | <p>5 V and 3.3 V are both <a href="https://learn.sparkfun.com/tutorials/logic-levels/33-v-cmos-logic-levels" rel="nofollow noreferrer">logic "highs"</a> in computing and measured against GND. If the fan simply has to know the on stance and nothing more, then you could run a fan with the logic 5 V (and probably 3.3 V fo... | 1,379 |
<p>We have a lot of unit tests but they aren't run every night. I have setup some batch files that compile all the code from the SVN repository and I would like to run NUnit. This is not a big problem because I can call it from the batch file after the compilation BUT the output is stored in the network drive and I nee... | <p>Sounds like you need a build server. See <a href="http://sourceforge.net/projects/ccnet/" rel="nofollow noreferrer">Cruise Control .Net</a></p>
| <p>Check out <a href="https://stackoverflow.com/questions/337918/what-is-the-best-way-to-send-an-email-from-a-batch-file">What is the best way to send an email from a batch file?</a></p>
<p>All you need to do is extend this to type the log file into the tempory email file.</p>
<pre><code>type NUnitLogFile.txt>>... | 43,847 |
<p>I have a couple of mdb files with the exact table structure. I have to change the primary key of the main table from autonumber to number in all of them, which means I have to:</p>
<ol>
<li>Drop the all the relationships the main table has</li>
<li>Change the main table</li>
<li>Create the relationships again,... ... | <p>Not a complete solution, but this may get you going...</p>
<p>The following function will print out the metadata for all relationships. Change this to save to a file in whatever format you prefer (CSV, tab delimited, XML, etc.):</p>
<pre><code>Function PrintRelationships()
For Each rel In CurrentDb.Relations
... | <p>Thanks for code snippet.
to get rid of your 3284 error I have changed a few things.
If you copy all indexes from sample mdb and then try to put relationships it throws an exception as it expects no idexes for relationshisps when you put relationships it puts its own indexes.
Steps I followed are (assume target.mdb ... | 46,201 |
<p>I need to copy a set of DLL and PDB files from a set of folders recursively into another folder. I don't want to recreate the folder hierarchy in the target folder.
I want to use built in Windows tools, e.g. DOS commands. </p>
| <pre><code>mkdir targetDir
for /r %x in (*.dll, *pdb) do copy "%x" targetDir\
</code></pre>
<p>Use /Y at the end of the above command if you are copying multiple files and don't want to keep answering "Yes". </p>
| <p>I'm not aware of any command line tools that do this directly, but you could create a batch script to loop through sub folders, and copy the files you need.</p>
<p>However you may end up with files with duplicate filenames if you place them all in the same folder.</p>
| 30,607 |
<p>The default shell in Mac OS X is <code>bash</code>, which I'm generally happy to be using. I just take it for granted. It would be really nice if it auto-completed <em>more stuff</em>, though, and I've heard good things about <code>zsh</code> in this regard. But I don't really have the inclination to spend hours fid... | <p>For casual use you are probably better off sticking with bash and just installing bash completion. </p>
<p>Installing it is pretty easy, grab the bash-completion-20060301.tar.gz from <a href="http://www.caliban.org/bash/index.shtml#completion" rel="noreferrer">http://www.caliban.org/bash/index.shtml#completion</a> ... | <p>Staale is talking about a wizard like program (CUI) which autoruns the first time you run zsh. Just answer some questions, view/change the defaults and its configured for you.</p>
<p>IBM developerWorks has great resources on zsh.</p>
<p>I have not used very advanced features and so far I have not come across serio... | 6,493 |
<p>I'm building a new app that is using NHibernate to generate the database schema but i can see a possible problem in the future.</p>
<p>Obviously you use all the data from your database is cleared when you update the schema but what stratagies do people use to restore any data to the new database. I am aware that ma... | <p>When testing, we use NHibernate to create the database, then a series of <a href="http://en.wikipedia.org/wiki/Builder_pattern" rel="nofollow noreferrer">builders</a> to create the data for each test fixture. We also use Sqlite for these tests, so they are lightening fast.</p>
<p>Our builders look a something like... | <p>We don't update the schema from NHibernate. We use SQLCompare to move database schemas across environments. SQLCompare does this non-destructively.</p>
<p>If you're already using NHibernate I would recommend creating the test data with code.</p>
| 41,237 |
<p>ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarize how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of u... | <p>I'm just getting into ASP.NET MVC, so these are some early thoughts comparing it to Rails:</p>
<p><strong>Mostly manages to stick with static typing, at the expense of a little extra code.</strong><br>
This will either give you the warm fuzzies or make you feel slightly shackled depending on how you feel about dyna... | <p>If you're already programming in the .NET idiom, it's pretty easy to pick up on a lot of what's going on in the MVC Framework. Rails, on the other hand, can be pretty easy to pick up (granted, at a basic level) if you've never set eyes on Ruby before you start.</p>
<p>It seems like you're talking about quality-as-M... | 7,917 |
<p>I guess the question is self-explanatory, but I'm wondering whether HTML qualifies as a programming language (obviously the "L" stands for language). </p>
<p>The reason for asking is more pragmatic—I'm putting together a resume and don't want to look like a fool for listing things like HTML and XML under lan... | <p>No, HTML is not a programming language. The "M" stands for "Markup". Generally, a programming language allows you to describe some sort of process of doing something, whereas HTML is a way of adding context and structure to text.</p>
<p>If you're looking to add more alphabet soup to your CV, don't classify them at ... | <p>List it under technologies or something. I'd just leave it off if I were you as it's pretty much expected that you know HTML and XML at this point.</p>
| 17,504 |
<p>I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would enable this setting.</p>
<p>Thanks fo... | <p>Unfortunately it doesn't appear that that CodeGear implementation of the Ribbon control is compatible with the glass frame. Something about the way it draws disables it.</p>
| <p>You can try this <a href="http://www.bilsen.com/windowsribbon/index.shtml" rel="nofollow">http://www.bilsen.com/windowsribbon/index.shtml</a></p>
<p>It interfaces the Native Ribbon Framework and works beautifully.</p>
| 20,547 |
<p>I am wondering whether it is safe to mix jdk 1.5 and 1.6 (Java 6) object serialization (biderctional communication). I searched for an explicit statement from sun concerning this question but did not succeed. So, besides the technical feasability I am searching for an "official" statement concerning the problem.</p>... | <p>The serialization mechanism itself has not changed. For individual classes it will depend on the specific class. If a class has a serialVersionUID field, this is supposed to indicate serialization compatiblity. </p>
<p>Something like:</p>
<pre><code>private static final long serialVersionUID = 8683452581122892189L... | <p>Note that the Java Beans specification details a version-independent serialization method which allows for strong backwards-compatibility. It also results in readable "serialized" forms. In fact a serialized object can be created pretty easily using the mechanism.</p>
<p>Look up the documentation to the <code>XMLEn... | 18,431 |
<p>I added the columns in the select list to the order by list, but it is still giving me the error:</p>
<p>ORDER BY items must appear in the select list if SELECT DISTINCT is specified.</p>
<p>Here is the stored proc:</p>
<pre><code>CREATE PROCEDURE [dbo].[GetRadioServiceCodesINGroup]
@RadioServiceGroup nvarchar(1... | <p>Try this:</p>
<pre><code>ORDER BY 1, 2
</code></pre>
<p>OR</p>
<pre><code>ORDER BY rsc.RadioServiceCodeId, rsc.RadioServiceCode + ' - ' + rsc.RadioService
</code></pre>
| <p>You could try a subquery:</p>
<pre><code>SELECT DISTINCT TEST.* FROM (
SELECT rsc.RadioServiceCodeId,
rsc.RadioServiceCode + ' - ' + rsc.RadioService as RadioService
FROM sbi_l_radioservicecodes rsc
INNER JOIN sbi_l_radioservicecodegroups rscg ON rsc.radioservicecodeid = rscg.radioservicecod... | 33,302 |
<p>We've occasionally been getting problems whereby our long-running server processes (running on Windows Server 2003) have thrown an exception due to a memory allocation failure. Our suspicion is these allocations are failing due to memory fragmentation.</p>
<p>Therefore, we've been looking at some alternative memor... | <p>First, I agree with the other posters who suggested a resource leak. You really want to rule that out first.</p>
<p>Hopefully, the heap manager you are currently using has a way to dump out the actual total free space available in the heap (across all <strong>free</strong> blocks) and also the total number of block... | <p>if you talking about Win32 - you can try to squeeze something by using LARGEADDRESSAWARE. You'll have ~1Gb extra defragmented memory so your application will fragment it longer.</p>
| 8,591 |
<p>Checking the HTML source of a question I see for instance:</p>
<pre><code><a id="comments-link-xxxxx" class="comments-link">add comment</a><noscript>&nbsp;JavaScript is needed to access comments.</noscript>
</code></pre>
<p>And then in the javascript source:</p>
<pre><code>// Setup our... | <ul>
<li>You don't have to type the same string over and over again in the HTML (which if nothing else would increase the number of typos to debug)</li>
<li>You can hand over the HTML/CSS to a designer who need not have any javascript skills</li>
<li>You have programmatic control over what callbacks are called and when... | <p>The only advantage I see is a reduction of the page size, and thus a lower bandwith need.</p>
<p>Edit: As I'm being downvoted, let met explain a more my answer.</p>
<p>My point is that, using a link as an empty anchor is just a bad practice, nothing else! Of course separation of JavaScript <strong>logic</strong> f... | 17,539 |
<p>What are the steps to get Team Foundation Server running unit tests when a given build runs? </p>
<p>What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time? </p>
<p>What are common troubleshooting steps for unit test problems ... | <p>it depends on which version of TFS you are running, so I will assume it is 2008.</p>
<p>Firstly, you must have Team Edition for Testers installed on the computer that will act as your build agent, as stated in <a href="http://msdn.microsoft.com/en-us/library/ms181716.aspx" rel="nofollow noreferrer">How To: Create a... | <p><a href="http://msdn.microsoft.com/en-us/library/cc981972%28v=vs.90%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/cc981972(v=vs.90).aspx</a></p>
<p>I like this defination as it gives you a complete 'walkthrough' from
Creating the Project
Creating the Unit Test Project
To configuring Team build to ... | 36,539 |
<p>Ok, my web application is at <strong>C:\inetpub\wwwroot\website</strong></p>
<p>The files I want to link to are in <strong>S:\someFolder</strong></p>
<p>Can I make a link in the webapp that will direct to the file in <strong>someFolder</strong>?</p>
| <p>If its on a different drive on the server, you will need to make a <a href="http://www.zerog.com/ianetmanual/IISVDirs_O.html" rel="nofollow noreferrer">virtual directory</a> in IIS. You would then link to "<code>/virtdirect/somefolder/</code>"</p>
| <p>That depends on the configuration of your web server. Probably not. You don't want the web server to be able to access any file on the hard drive (ie your passwords file), so only those files configured to be accessible in the web server's configuration files are accessible and can be linked to. Usually these are al... | 15,269 |
<p>I've been using Pydev/Eclipse to develop Google App Engine (GAE) applications but I've been unable to get the response/request objects from WebOb to have auto-completion. I used a <a href="http://code.google.com/appengine/articles/eclipse.html" rel="nofollow noreferrer">widely recommended tutorial</a> to get everyth... | <p>I have tried on my installation, and it works.
However, bear in mind that PyDev's analysis stops whenever it encounters an error, and this could be a reason why autocompletion is not working in your case.</p>
<p>I would suggest you getting in contact with the main developer, Fabio Zadrozny; he is very friendly and ... | <p>Apparently this is a known issue with various Python IDEs - and no one seems to have a singular solution. Google changed some internal pathing such that it can only really be determined by executing the python scripts. I haven't been able to come up with a satisfactory solution for Pydev, though there is a decent wo... | 26,157 |
<p>I am using GWT (Google Web Toolkit) 1.5.3 et GXT (ExtJS) 1.2
I just want to create a simple form with some radio buttons generated after a RPC call, to get some values</p>
<p>Code:</p>
<pre><code>final FormPanel simple = new FormPanel();
simple.setFrame(true);
simple.setWidth(350);
simple.s... | <p>Create radio</p>
<pre><code>Radio radio = new Radio();
radio.setBoxLabel("Si");
radio.setValue(true);
radio.setValueAttribute("true");
Radio radio2 = new Radio();
radio2.setBoxLabel("No");
radio2.setValueAttribute("false");
RadioGroup radioGroup = new RadioGroup();
radioGroup.setFieldLabel("Afecto");
ra... | <p>Using radioButton.setItemId() and getItemId() resolve it.</p>
| 46,452 |
<p>What is the best practice for writing a rather large wcf service, containing a lot of OperationContracts and DataContracts?</p>
<p>How would I separate functional areas into several contracts, would it be best to create an endpoint for each functional area? </p>
<p>Is there any way to keep the source for the diffe... | <p>That's been a big question surrounding services since their inception. SOA done successfully is SOA planned to the extent you're talking about. Having said that, I've always leaned more toward splitting services out, but using them in a composite manner. That is, several endpoints when you have several contracts, bu... | <p>I know this is an old post but I am thinking of services in the same way as I think of objects in programming. </p>
<p>Keep them to their bare minimum for what they must do. Of course not to go to the extreme, but I am making my decisions based on data entities.</p>
<p>One service for Account, one for Product etc.... | 28,912 |
<p>Myself and a colleague have a dispute about which of the following is more elegant. I won't say who's who, so it is impartial. Which is more elegant?</p>
<pre><code>public function set hitZone(target:DisplayObject):void
{
if(_hitZone != target)
{
_hitZone.removeEventL... | <p>This is one of those cases where it's ok to break the rules (i.e. best practices). In general you want to have as few return points in a function as possible. The practical reason for this is that it simplifies your reading of the code, since you can just always assume that each and every function will take its argu... | <p>In this case (one test, no else clause) I like the test-and-return. It makes it clear that in that case, there's nothing to do, without having to read the rest of the function.</p>
<p>However, this is splitting the finest of hairs. I'm sure you must have bigger issues to worry about :)</p>
| 46,359 |
<p>By default when using a webapp server in Eclipse Web Tools, the server startup will fail after a timeout of 45 seconds. I can increase this timeout in the server instance properties, but I don't see a way to disable the timeout entirely (useful when debugging application startup). Is there a way to do this?</p>
| <p><img src="https://i.stack.imgur.com/SmwTY.png" alt="enter image description here"> In Eclipse Indigo, you can edit the default timeout by double-clicking on the server in the "servers" view and changing the timeout for start (see graphic). Save your changes, and you're good to go!</p>
| <p>yes this works, but the maximum limit is 1800, which is 30mins. </p>
<p>Sometimes when rebuilding our entire database (on server initial start) this can go for longer than 30mins and causes problems. </p>
| 13,028 |
<p>I have an XML document something like :::</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microso... | <p>Declare a namespace prefix for the namespace in your XSLT and then <code>select</code> using that prefix:</p>
<pre><code><xsl:stylesheet ... xmlns:os="urn:schemas-microsoft-com:office:spreadsheet">
...
<xsl:for-each select="//os:Row">
...
</xsl:for-each>
...
</xsl:stylesheet>
... | <p>If you don't care about the namespace, you can use the XPath `local-name()' function:</p>
<pre><code><xsl:for-each select="//*[local-name() = 'Row']">
<xsl:copy-of select="."/>
</xsl:for-each>
</code></pre>
<p>Alternatively the same same thing can be expressed like this. I'm not certain if this... | 36,042 |
<p>I'm using Visual Studio 2008 and I want to automate the process of building the installer by running a batch file.</p>
<p>The batch file should first sign the assemblies and than start the building of the installer. After the installer is created the batch file should sign the <code>.msi</code> file too.</p>
<p>Is... | <p>What version of Visual Studio are you using?</p>
<p>VS2008 incorporates the functionality of the svcutil tool. To generate the proxy, click on the Solution Explorer and select 'Add Service Reference', you can then enter the URL of the server, give the namespace a name and off you go.</p>
<p>You may want to expand... | <p>The svcutil.exe tool (and the equivalent functionality in VS2008) are normally used like this: -</p>
<p>You point it at a service description (a WSDL document) and it generates client-side code and config to help you make a client that can communicate with the services described in the WSDL. The tools can do other... | 38,707 |
<p>We are just starting on a pretty big project with lots of sub projects. we don't currently use any kind of named process but I am hoping to get some kind of agile/scrumlike process in by the back door.</p>
<p>The area I will be focusing on most is having a good backlog for the whole project and, at least in my head... | <p>I would counsel you to think carefully before adopting a tool, especially since it sounds like your process is likely to be fluid at first as you find your feet. My feeling is that a tool may be more likely to constrain you than enable you at this stage, and you will find it no substitute for a <a href="http://www.i... | <p>I'd start off by saying Keep it Simple.. use a shared spreadsheet with tracking (and backup). If you see scaling or synchronization problems such that maintaining the backlog in a consistent state is getting more and more time-consuming, trade up. This will automatically validate and justify the expenditure/retraini... | 14,370 |
<p>The <a href="http://flot.googlecode.com/svn/trunk/API.txt" rel="nofollow noreferrer">Flot API documentation</a> describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to prevent Flot f... | <p>As Laurimann noted, Flot continues to evolve. The ability to control this has been added to the API (as noted in the flot issue Nelson linked to).</p>
<p>If you download the latest version (which is still labeled 0.6), you can disable lines on an axis with "tickLength", like so:</p>
<pre><code>xaxis: {
tickLengt... | <p>Starting June 2009 there's <a href="http://code.google.com/p/flot/issues/detail?id=167" rel="nofollow noreferrer">flot issue 167</a> which is a request for this exact feature. Includes two implementations and some agreement from the flot author that it's a good idea.</p>
| 20,504 |
<p>A table exists that someone else loaded. I need to query against the table, but the lack of indexes makes the query plan abysmal. What I would like to do is detect if there is an index for a particular column, so that I can created it if it does not exist, and not create it if it is already there.</p>
<p>Thanks.<... | <p>You can query <code>DBA_/ALL_/USER_IND_COLUMNS</code>, i.e.</p>
<pre><code>SQL> SELECT index_name
2 FROM dba_ind_columns
3 WHERE table_owner = 'SCOTT'
4 AND table_name = 'EMP'
5 AND column_name = 'EMPNO';
INDEX_NAME
------------------------------
PK_EMP
</code></pre>
<p>Of course, you may... | <p>Become familiar with querying the SYS schema:</p>
<pre><code>Select * from sys.all_ind_columns where table_name=:TabName and table_owner=:TabOwner;
</code></pre>
| 39,477 |
<p>I have <strong>1 red polygon</strong> say and <strong>50 randomly placed blue polygons</strong> - they are situated in geographical <strong>2D space</strong>. What is the quickest/speediest algorithim to find the the shortest distance between a red polygon and its nearest blue polygon?</p>
<p>Bear in mind that it ... | <p>I doubt there is better solution than calculating the distance between the red one and every blue one and sorting these by length.</p>
<p>Regarding sorting, usually QuickSort is hard to beat in performance (an optimized one, that cuts off recursion if size goes below 7 items and switches to something like Insertion... | <p>The naive approach is to find the distance between the red and 50 blue objects -- so you're looking at 50 3d Pythagorean calculations + sorting to find the answer. That would only really work for finding the distance between center points though.</p>
<p>If you want arbitrary polygons, maybe your best best is a rayt... | 10,958 |
<p>We've got two developers on the same closed (ugh, stupid gov) network, Another developer a couple minutes drive down the road, and a fourth developer half-way across the country. E-Mail, ftp, and removal media are all possible methods of transfer for the people not on the same network.</p>
<p>I am one of the two cl... | <p>The users outside the network can make <a href="http://hgbook.red-bean.com/hgbookch12.html#x16-26800012.1" rel="nofollow noreferrer">patches</a>, and/or use <a href="http://hgbook.red-bean.com/hgbookch14.html#x18-32100014.4" rel="nofollow noreferrer">email</a> to send the updates to the main repo or someone, like yo... | <p>Correct. The only way anything makes it onto the closed network is via flash drive.</p>
| 2,660 |
<p>I'm writing a small page to show the employees in our company. I've written a query to pull the info from our database. Then I'm binding that to a GridView to do the dirty work. Here is the query.</p>
<pre><code>"SELECT tblEmpID.empid AS [Empl ID], tblEmpID.posno AS [Pos #], [name] & ""<br />"" & [... | <p>Try setting HtmlEncode="False" on the column in the GridView. That should stop it from encoding your markup.</p>
| <p>If you are doing this for read-only purposes, you may want to consider using the repeater control. Then, you can return those as separate fields, thereby eliminating the HTML from the SQL result set. Then, you can use the ItemTemplate in the control to specify the HTML and exactly how you want the results to appea... | 37,114 |
<p>[Meta-note:] I was browsing the question page, getting really tired of "DIVS vs Tables" "When to use tables vs DIVS" "Are Divs better than Tables" "Tables versus CSS" and all the questions that ask <em>THE SAME THING OMG PEOPLE</em> but I would like to see all the ways people tackle the translation of the canonical ... | <p>What I usually do is :</p>
<pre><code><form>
<label for="param_1">Param 1</label>
<input id="param_1" name="param_1"><br />
<label for="param_2">Param 2</label>
<input id="param_2" name="param_2"><br />
</form>
</code></pre>
<p>and in a CSS :</p>
<pr... | <p>I was thinking of something like: </p>
<pre><code><div style="text-align:right; float:left;">
Name: <input /> <br />
Social Security Number: <input /> <br />
</div>
</code></pre>
<p>which, if the right column is fixed-length, aligns OK with variable text length, but I wo... | 44,049 |
<p>I am using drupal for the first time. I have successfully developed my first drupal website to a certain extent. I have used my own custom theme for the front-end and blue marine theme for administrator. Now my client's requirement is that when he clicks on preview button before submitting the page in admin panel, h... | <p>When you set the administration theme, leave the "Use administration theme for content editing" unchecked. This should allow content creation / previewing in the "front-end" theme.</p>
<p>EDIT: Assuming you are using Drupal 6.x</p>
| <p>As far as I know Themeing is a complicated process in Drupal, it involves many modules and hooks, so I don't think it's an easy task for a module (maybe) to do that, or in core like Wordpress.</p>
| 25,571 |
<p>How can I accomplish this?</p>
<pre><code><% for agent in @broker.agents %>
...
<% if agent.cell %><span class="cell-number">Cell: <%= agent.cell %></span><% end %>
...
<% end %>
</code></pre>
<p>I want to test to see if the agent has a cell number, and if so, displa... | <p>This is what you asked for:</p>
<pre><code><% for agent in @broker.agents %>
<% unless agent.cell.blank? %>
<span class="cell-number">Cell: <%= agent.cell %></span>
<% end %>
<% end %>
</code></pre>
<p>The cell? method works whether cell is nil or an empty string. ... | <pre><code><% @broker.agents.each do |agent| %>
...
<% unless agent.cell.empty? %>
<span class="cell-number">Cell: <%= agent.cell %></span>
<% end %>
...
<% end %>
</code></pre>
<p>I find the use of #each, <code>unless</code>, and <code>cell.empty?</code> to be mor... | 38,895 |
<p>I am currently building an application using ASP.NET MVC. The data entry pages are fairly easy to code, I just make the Model for the page of the type of my business object:</p>
<pre><code>namespace MyNameSpace.Web.Views.ProjectEdit
{
public partial class MyView : ViewPage<Project>
{
}
}
</code><... | <p>I think that user controls is probably the way to go. I'm not sure what the concern is about testability. You should be able to test that your controller is providing the right view data -- since you'll have several models each of these will probably be stored in a separate view data item, rather than aggregating ... | <p>Check out the notion is sub-controllers in MVC-Contrib <a href="http://www.codeplex.com/MVCContrib" rel="nofollow noreferrer">http://www.codeplex.com/MVCContrib</a>. Basically you run a full request to a partial then display that partial where you want in your existing code.</p>
<p>Alternatively you can check out t... | 37,509 |
<p>Say I have the following interface that I want to share between my server (a regular web service) and my client (a silverlight 2.0 application):</p>
<pre><code>public interface ICustomerService
{
Customer GetCustomer(string name);
}
</code></pre>
<p>My web service implements this interface, and references a cl... | <p>I think you will find this <a href="http://silverlight.net/forums/t/34368.aspx" rel="nofollow noreferrer">thread</a> interesting. You can share code files between separate projects or compile a single project against multiple targets.</p>
| <p>I could be wrong, but I think if you decorate objects being returned by your WCF Service with the DataContract and DataMember attributes, you should be able to share objects between your Silverlight application and WCF service without creating the class in your client (should be handled by the proxy.</p>
| 34,647 |
<p>I've got a Java application that I'm writing an installer for. We're using the AdvancedInstaller program to create our installer (well, we're evaluating it currently, but will definitely purchase a license soon), and although it has special support for Java applications, it is geared more towards repackaging them a... | <p>I agree with <a href="https://stackoverflow.com/questions/271596/how-do-i-properly-repackage-the-jre-installer-in-my-installer#271622">bdumitriu's answer</a>:</p>
<p>a simple zip of a jre is enough, unless you want to link that jre to:</p>
<ul>
<li>default java (meaning you must add java.exe of the unzipped jre to... | <p><a href="http://www.syswow64.co.uk/2013/05/java-7-update-21-1721-enterprise.html" rel="nofollow">http://www.syswow64.co.uk/2013/05/java-7-update-21-1721-enterprise.html</a></p>
<p>The issue on many blogs and articles is around creating the 'deployment.config' and 'deployment.properties' files for an enterprise depl... | 34,160 |
<p>I have a class that I wish to expose as a remote service using pythons SimpleXMLRPCServer. The server startup looks like this:</p>
<pre><code>server = SimpleXMLRPCServer((serverSettings.LISTEN_IP,serverSettings.LISTEN_PORT))
service = Service()
server.register_instance(service)
server.serve_forever()
</code></pre... | <p>You can't do this with plain xmlrpc since it has no notion of keyword arguments. However, you can superimpose this as a protocol on top of xmlrpc that would always pass a list as first argument, and a dictionary as a second, and then provide the proper support code so this becomes transparent for your usage, example... | <p>As Thomas Wouters said, XML-RPC does not have keyword arguments. Only the order of arguments matters as far as the protocol is concerned and they can be called anything in XML: arg0, arg1, arg2 is perfectly fine, as is cheese, candy and bacon for the same arguments.</p>
<p>Perhaps you should simply rethink your use... | 14,569 |
<p>I'm getting a totally bizzare error trying to compile a C program using GCC. Here is the batch file I am using:</p>
<pre><code>echo Now compiling, assembling, and linking the core:
nasm -f aout -o start.o start.asm
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./in... | <p>The line that works is 126 characters long, the others are 130 and 136 characters long. The problem is that there is a 127-character limit. I'm not sure how to get around this, but maybe <strong>make</strong> would get around it for you?...</p>
| <p>Add -v to the gcc command line. gcc is in fact a driver, which runs several other auxiliary programs (tradicionally, the preprocessor, compiler, and assembler); -v makes it show their command lines as they are being executed, and also enables verbose mode. With this, you can see where it is failing.</p>
| 26,542 |
<p>I need to let end users specify a time range, to be stored and used internally as a starting date/time and ending date/time. The range could be minutes or it could be days.</p>
<p><strong>Has anyone discovered an interactive control that can handle this elegantly?</strong></p>
<p>Most GUI toolkits have a calendar... | <p>I tend to look at common design patterns for inspiration when I'm pondering problems such as this.</p>
<p>The <a href="http://developer.yahoo.com/ypatterns/" rel="noreferrer">Yahoo Pattern Library</a> offers <a href="http://developer.yahoo.com/ypatterns/pattern.php?pattern=calendar" rel="noreferrer">some potential ... | <p>Unless there is a more advanced time control in your GUI toolkit of choice, two calendar controls representing start and end is the most straightforward. Also, you need to decide how you want to use the information. For example, if you used a start date and an interval to increment that date, changing the start date... | 25,246 |
<p>Is there any research into use of thermoelectric cooler along with part cooling fan to get quicker cooling without strong air currents that apply pressure to the still-soft material? I experimented with custom fan ducts in the past trying to get better cooling and avoid warping for printing thin layers of PLA at hig... | <h1>On the printhead?</h1>
<p>TECs or Peltier Elements are incredibly inefficient compared to airstream coolers. Their only benefit is perfect temperature control, from which you will have nothing because there is no firmware that cares for the temperature of cooling air or the cooling body of a Hotend. Also, a TEC cre... | <p>It is true that if you try to do bridges with a very hot filament the cooling air will deform or push away the hot filament if it's set at high speed, or it won't cool it enough if you run the fan slower.</p>
<p>I experienced it with PETG at 245 °C while performing a parametric optimisation as described in:</p>
<p><... | 1,797 |
<p>I have a real-time embedded app with the major cycle running at 10KHz. It runs on a TI TMS320C configured to boot from flash. I recently added an initialized array to a source file, and all of a sudden the timing is screwed up (in a way too complex to explain well - essentially a serial port write is no longer c... | <p>After more than a day staring at traces and generated assembly, I think I figured it out.
The root cause problem turned out to be an design issue that caused glitches only if the ISR that kicked off the serial port write collided with a higher priority one. The timing just happened to work out that it only took add... | <p>Could the initialization be overwriting another adjacent piece of code?
Are there any structs or variables that use the array, that are now bigger and could cause a stackoverflow?</p>
| 15,777 |
<p>I'm trying to do project Euler number <a href="http://projecteuler.net/index.php?section=problems&id=219" rel="nofollow noreferrer">219</a> but am failing to get a grasp of it. I'm trying to use Python which according to project Euler should be able to do it within a minute! This leads me to think that they can'... | <p>Brute-force is not the right way to do it. This is one of those problems where, if you know a certain thing, it's not that hard, but if you've never heard of that thing, it's practically impossible. That thing is <a href="http://en.wikipedia.org/wiki/Huffman_tree" rel="noreferrer">Huffman trees</a>.</p>
<p>[Edit]... | <p>How I solved it, was computing Cost(n) up to n=1000, and then just guessing how it proceeds from there. If you look at the differences of consecutive values, and use <a href="http://www.research.att.com/~njas/sequences/" rel="nofollow noreferrer">The encyclopedia of integer sequences</a> (and some imagination), you ... | 45,108 |
<p>I have a non-visual component which manages other visual controls. </p>
<p>I need to have a reference to the form that the component is operating on, but i don't know how to get it.</p>
<p>I am unsure of adding a constructor with the parent specified as control, as i want the component to work by just being dropp... | <p>[It is important to understand that the ISite technique below only works at design time. Because ContainerControl is public and gets assigned a value VisualStudio will write initialization code that sets it at run-time. Site is set at run-time, but you can't get ContainerControl from it]</p>
<p><a href="http://ww... | <p>A improvement of above is:</p>
<pre><code>public static Form ParentForm(this Control ctrl) => ctrl as Form ?? ctrl.FindForm();
</code></pre>
| 48,545 |
<p>I'm working on a static analysis tool for .NET assembly.
In Java, there is a <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#1169" rel="nofollow noreferrer">Descriptor</a> which can be used to represent method or field in a string with specified grammar. </p>
<p>for field:</p>
... | <p>I've done a lot of static analysis in .NET CIL last year and the best way to go is to use ildasm.exe or any disassembler that will give you some quite easy to parse IL language text file. You will find, there is no need to reverse-engineer anything and you will find that .NET is not that compiled.</p>
<p>Here is a ... | <p>Hey, thanks Vincent. I'm now using a class to represent "return type+parameters list" info instead of a descriptor in string. Thanks for the book you recommended. Yes, I use ildasm.exe and to read the internal of an assembly. And in my project I use Cecil to digg everything out. </p>
| 49,556 |
<p>This works:</p>
<pre><code>constructor TMyObj.Create;
begin
inherited;
end;
</code></pre>
<p>Why this is not working also?</p>
<pre><code>function TMyObjEx.Import(CONST FileName: string; CONST x, y, z: Integer): string;
begin
result:= inherited; // Import(FileName, x, y, z); <--- Compiler says: "incompatibl... | <p>The automatic parameters passing just does not work when you need the result of the method. You need to fill in the name of the method and the parameters, sorry.</p>
| <p>Seems the Delphi documentations have another black hole... (Oooooh, what's the great news on it?)</p>
<p>My tests indicate that the use <strong>inherited</strong> keyword without anything after it works only on <strong>constructor, destructor and procedure</strong> methods. On <strong>Function</strong> methods it d... | 44,283 |
<p>I'd like to remove all "unchecked" warnings from this general utility method (part of a larger class with a number of similar methods). In a pinch, I can use @SuppressWarnings("unchecked") but I'm wondering if I can use generics properly to avoid the warning.</p>
<p>The method is intended to be allow callers to c... | <p>I just tried this:</p>
<pre><code>public static <T extends Comparable> int compareObject(T o1, T o2) {
if ((o1 instanceof String) && (o2 instanceof String))
return ((String) o1).toUpperCase().compareTo(((String) o2).toUpperCase());
else
return o1.compareTo(o2);
}
</code></pre>
... | <p>Did you test the following?</p>
<pre><code>public static <T> int compareObject(Comparable<T> o1, Comparable<T> o2)
{
if ((o1 instanceof String) && (o2 instanceof String))
return ((String) o1).toUpperCase().compareTo(((String) o2).toUpperCase());
else
return o1.compa... | 33,434 |
<p>I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only basic mathematical knowledge from high school or fresh year college math, no more no less, and that almost all of pro... | <p>To answer your question as it was posed I would have to say, "No, mathematics is not necessary for programming". However, as other people have suggested in this thread, I believe there is a correlation between understanding mathematics and being able to "think algorithmically". That is, to be able to think abstractl... | <p>See also <a href="https://stackoverflow.com/questions/137550/is-programming-math">Is Programmng == Math?</a> from stackoverflow. </p>
<p>While I don't think it's required for programming, I can't tell you how many times I've been able to use <a href="http://en.wikipedia.org/wiki/Linear_algebra" rel="nofollow norefe... | 19,039 |
<p>I'm working on building a Silverlight application whereas we want to be able to have a client hit a url like:</p>
<p>http://{client}.domain.com/</p>
<p>and login, where the {client} part is their business name. so for example, google's would be:</p>
<p><a href="http://google.domain.com/" rel="nofollow noreferrer... | <p>It's not exactly Open Source, but Aspose has a couple products which can do that,</p>
<p><a href="http://www.aspose.com/categories/file-format-components/aspose.pdf.kit-for-.net-and-java/default.aspx" rel="noreferrer">Aspose.Pdf.Kit</a></p>
<blockquote>
<p>Aspose.Pdf.Kit is a non-graphical PDF® document manipula... | <p>Microsoft PDF add-in for word seems to be the best solution for now but you should take into consideration that it does not convert all word documents correctly to pdf and in some cases you will see huge difference between the word and the output pdf. Unfortunately I couldn't find any api that would convert all word... | 19,320 |
<p>Hypothetically, you have two products, one written in Java, the other in C#. You like the Java based backend (non-user visible portion), but would like to use the C# (WPF) frontend. What is the best way to go about interfacing them? </p>
<p>Note that the backend must be able to run on either a server or on the loca... | <p>Expose a web service on the java backend and have the C# front end talk to the java web service. Look into WCF (windows communication foundation) it might make talking to a java web service alot easier.</p>
| <p>I've worked on the java back-end to a C# rich-client. They communicated via web-services alright. The only problem we really had was with inheritance hierarchies, which web-services WSDLs erase. </p>
| 36,189 |
<p>I'm in the process of refactoring some code which includes moving folders around, and I would like to regularly merge to keep things current. What is the best way to merge after I've moved folders around in my working copy?</p>
| <p>You can move the files around in StarTeam also. Then merge after that. </p>
<p>Whatever you do, make sure you don't delete the files and re-add in StarTeam. You'll lose the file history if you do that.</p>
| <p>The problem is I'm worried about breaking the build in the meantime while I'm moving folders in StarTeam. I suppose the only way to avoid that is to be ready to upload updated project files as soon as I move things around in StarTeam and do it as quickly as possible.</p>
| 4,819 |
<p>There are several people about (myself being one of them) who have been developing RIA for a while now using Flex and AJAX. However Silverlight is now on the scene and worth picking up.</p>
<p>Question is, as someone who has never looked at .NET before, should I just dive in Silverlight and try and make up the bit... | <p>I firmly believe in learning foundations first. I would start off by writing console apps - get the hang of collections, IO, the language itself (whether that's VB or C#, or even something else).</p>
<p>It's probably worth learning a bit of "normal" WPF after that, on the grounds that it may well be easier to exper... | <p>I would suggest you to keep watch on <a href="http://www.technobits.net" rel="nofollow">Technobits.net's</a> Silverlight page. That will give you daily updates in Silverlight. See following link.</p>
<ul>
<li><a href="http://www.technobits.net/technologies/silverlight/" rel="nofollow">http://www.technobits.net/tech... | 40,353 |
<p>The project is poorly defined: we are to write educational software for CS 111 Computer Programming I students focusing on functions. We have 6 student developers with various backgrounds working in Flex. The project has a duration of about 7 weeks. We have very limited face time (30 min per week) and very limited w... | <p>What makes you think any methodology would be successful under these circumstances -- little communication, more requirements than time, and lack of access to customers?</p>
<p>That being said, I would focus on incremental delivery (each iteration should have some few working features), unit testing (all tests pass... | <p>You could use Agile methodology here but obviously you'll have to adopt it to suit your needs.</p>
<p>For example if you don't have enough access to the real customers that someone with the best understanding of your goals will have to act as a customer proxy. I would also suggest trying to get more access to the c... | 24,663 |
<p>I'm trying to achieve the equivalent of a WinForms <code>ListView</code> with its <code>View</code> property set to <code>View.List</code>. Visually, the following works fine. The file names in my <code>Listbox</code> go from top to bottom, and then wrap to a new column.</p>
<p>Here's the basic XAML I'm working wit... | <p>It turns out that when it wraps around in my handling of the <code>KeyDown</code> event, selection changes to the correct item, but focus is on the old item.</p>
<p>Here is the updated <code>KeyDown</code> eventhandler. Because of Binding, the <code>Items</code> collection returns my actual items rather than <code>... | <p>You should be able to do it without the event listener using KeyboardNavigation.DirectionalNavigation, e.g.</p>
<pre><code><ListBox Name="thelist"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
KeyboardNavigatio... | 16,231 |
<p>I'm creating an application that will store a hierarchical collection of items in an XML file and I'm wondering about the industry standard for storing collections in XML. Which of the following two formats is preferred? (If there is another option I'm not seeing, please advise.)</p>
<p><strong>Option A</strong></p... | <p>I'm no XML expert, but I find Option B to be more human readable, and I think it's just as machine readable as Option A. I believe that XML is designed to be both human and machine readable, so I would go for Option B myself.</p>
<hr>
<p>I just realized something else after Ryan Farley's post. If the Students or C... | <p><strong>Definitely - Option B.</strong> </p>
<p>I wouldn't mix students and classes in the XML just the same way that I wouldn't mix students and classes in the same table in a database. </p>
| 4,304 |
<p>I was wondering if anyone knows of a quick way or if anyone has written a reflection tool to tell which objects in a solution are not marked as serializable. I'm switching a site over to a StateServer and i need to have all objects marked as serializable. I don't want to miss any.</p>
<p>Also, second part do enum... | <p>Currently there is no other way. As a long time Apple Fanboy I've learnt one thing time and time again "It's Steve's way or the highway". If Steve says no Flash then you can bet your sweet little bippy that there will be no Flash. So either develop a web app, or learn Objective-C. I'm a JAVA head and I learnt all I ... | <p>Flash is a proprietary runtime. Why would apple want this on their device?</p>
<p>Not to mention the fact that Flash developers routinely hog CPU cycles on the web. Ever have your fan spin up while on a web page with heavy flash objects hogging your cpu?</p>
<p>I don't see Apple ever supporting Flash and I am glad... | 47,691 |
<p>I'm reading some MPEG Transport Stream protocol over UDP and it has some funky bitfields in it (length 13 for example). I'm using the "struct" library to do the broad unpacking, but is there a simple way to say "Grab the next 13 bits" rather than have to hand-tweak the bit manipulation? I'd like something like the w... | <p>The <a href="https://github.com/scott-griffiths/bitstring" rel="nofollow noreferrer">bitstring</a> module is designed to address just this problem. It will let you read, modify and construct data using bits as the basic building blocks. The latest versions are for Python 2.6 or later (including Python 3) but version... | <p>It's an often-asked question. There's an <a href="http://code.activestate.com/recipes/113799/" rel="noreferrer">ASPN Cookbook</a> entry on it that has served me in the past.</p>
<p>And there is an <a href="http://wiki.python.org/moin/BitManipulation" rel="noreferrer">extensive page of requirements one person would... | 6,078 |
<p>I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but I'm stuck. Spring.NET seems to depend on different versions of the NHibernate assemblies (maybe it needs 1.2.1.4000 and my NHibernate version is 1.2.0.4000).</p>
<p>I had originally solved similar problems using the "bindingRedirect&... | <p>I too ran into this, frustrated I just grabbed the Spring source and compiled it against the latest NHibernate to make it go away forever. Not sure if that's an option for you but the 10 minutes that took seems to have saved me a lot of time overall.</p>
<p>Here's the SourceForge link for the Spring Source for all... | <p>Spring.Net is open source isn't it? Why don't you just download the source, update the reference to the same version of NHibernate you are using and recompile?</p>
| 12,747 |
<p>I like the simplistic look and design of some of the Microsoft blogs. Alas, I can't join the Microsoft dev party and create my own development blog on the blogs.msdn.com page because I don't work at Microsoft, and I already have my own wordpress blog.</p>
<p>I was looking to have my blog styled to one of the defaul... | <blockquote>
<p>Could Microsoft take legal action against me if I used a stylesheet from their page?</p>
</blockquote>
<p>Absolutely, since you infringed their copyright. On the other hand, it's debatable whether the stylesheet alone constitues a sufficient threshold of originality to justify legal actions<sup>1</su... | <p>I think Microsoft uses one of the templates that come out of the box with community server. But even if they didn't, I haven't heard of a case of someone having a cease and desist based on leveraging someone else's css.</p>
| 18,426 |
<p>I have a 2 variable 100x100 data table in excel.</p>
<p>I need to have a function that returns all the possible sets of variables that yield a given target value.
What I am looking at is some kind of a reursive 2 dimensional lookup function. Can someone point me in the right direction?</p>
| <p>It can be done without VBA, fairly compactly, like so.</p>
<p>Suppose your 100x100 table is in B2:CW101, and we put a list of numbers 1 to 100 down the left from A2 to A101, and again 1 to 100 across the top from B1 to CW1</p>
<p>Create a column of cells underneath, starting (say) in B104</p>
<pre><code> B104=MAX(($... | <p>Would the Solver suit?</p>
<p><a href="http://office.microsoft.com/en-us/excel/HA011118641033.aspx" rel="nofollow noreferrer">http://office.microsoft.com/en-us/excel/HA011118641033.aspx</a></p>
| 27,223 |
<p>I'm looking for resources that can help me determine which approach to use in creating a 2d data structure with C#.</p>
| <p>Do you mean multidimensional array? It's simple:</p>
<pre><code><type>[,] <name> = new <type>[<first dimenison>,<second dimension>];
</code></pre>
<p>Here is MSDN reference:</p>
<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arra... | <p><a href="https://rads.stackoverflow.com/amzn/click/com/0521670152" rel="nofollow noreferrer" rel="nofollow noreferrer">Data Structures in C#</a></p>
<p>Seriously, I'm not trying to be critical of the question, but I got tons of useful results right at the top of my search when I Googled for:</p>
<pre><code>data st... | 15,939 |
<p>I want to link to a specific slide in an online PowerPoint file, (e.g. <code>http://www.example.com/hello.ppt</code>) but what I want is that when people click on my link, it goes straight to the nth slide.</p>
<p>Is this possible?</p>
| <p>Link to </p>
<p><a href="http://www.whatever.com/hello.ppt" rel="nofollow noreferrer">http://www.whatever.com/hello.ppt</a><strong>#4</strong> </p>
<p>for slide 4 to be opened initially.</p>
<p>Take a look at this site:
<a href="http://www.tinyempire.com/shortnotes/files/specific_slide_in_ppt.htm" rel="nofollow n... | <p>The following method applies to any online version of PowerPoint (e.g. Office 365).</p>
<ol>
<li>Open the powerpoint file in your browser (the link could look like this: <a href="http://YourCompany.sharepoint.com/:p:/r/sites/SiteName/.." rel="nofollow noreferrer">http://YourCompany.sharepoint.com/:p:/r/sites/SiteNa... | 2,362 |
<p>I am trying to add an unhandled exception handler in .net (c#) that should be as helpfull for the 'user' as possible. The end users are mostly programers so they just need a hint of what object are they manipulating wrong.</p>
<p>I'm developing a windows similar to the windows XP error report when an application cr... | <p>I don't think System.Diagnostics.StackFrame supplies argument information (other than the method signature). </p>
<p>You could instrument the troublesome calls with trace logging via AOP, or even use its exception interception features to conditionally log without having to litter your code. Have a look around <a h... | <p>I'm not aware of anything like that, but have wanted it myself. I usually do it myself when throwing exceptions, but if it's not yours to throw, then you may be out with the rest of us.</p>
| 19,094 |
<p>As an example, lets say I wanted to list the frequency of each letter of the alphabet in a string. What would be the easiest way to do it?</p>
<p>This is an example of what I'm thinking of... the question is how to make allTheLetters equal to said letters without something like allTheLetters = "abcdefg...xyz". In m... | <p>The question you've asked (how to iterate through the alphabet) is not the same question as the problem you're trying to solve (how to count the frequency of letters in a string).</p>
<p>You can use string.lowercase, as other posters have suggested:</p>
<pre><code>import string
allTheLetters = string.lowercase
</c... | <p>This is what I do:</p>
<pre><code>import string
for x in list(string.lowercase):
print x
</code></pre>
| 28,310 |
<p>I'm integrating .NET support into our C++ application.<br />
It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl.</p>
<p>I'm not allowed to remove the linker flag "/NODEFAULTLIB".<br />
(We have our own build management system, not Visual Studio's... | <p>I would also suggest checking out the SharePoint Content Deployment Wizard by Chris O'Brien.
<a href="http://www.codeplex.com/SPDeploymentWizard" rel="nofollow noreferrer">http://www.codeplex.com/SPDeploymentWizard</a> </p>
<p>Should help smooth the process you describe, and it's a nice tool for your kitbag regardl... | <p>We have a BizTalk 2006 with Web Application and Several WebServices that need to go from Dev to UAT to Live.</p>
<p>We use MSBuild right from within VS to build, run tests, dependent on test result, complie, zip and ship to servers.</p>
<p>Small MSBuild script on server to unzip, move the files, install clean web ... | 3,094 |
<p>I am trying to use directory services to add a directory entry to an openldap server. The examples I have seen look pretty simple, but I keep getting the error "There is an naming violation". What does this message mean? How do I resolve it?</p>
<p>I have included the code, ldif file used to create the person cont... | <p>Maybe you need to include this?</p>
<pre><code>SetADProperty(newUser, "objectClass", "top")
</code></pre>
<p>Also, check what the required fields for <code>organizationalPerson</code> and <code>person</code> are...you might be missing one.</p>
| <p>Try:</p>
<pre><code>Dim entry As New DirectoryEntry("LDAP://ou=alumni", etc.)
newUser = entry.Children.Add("cn=" + userName, "user")
</code></pre>
| 12,512 |
<p>There are two weird operators in C#:</p>
<ul>
<li>the <a href="http://msdn.microsoft.com/en-us/library/6x6y6z4d.aspx" rel="noreferrer">true operator</a></li>
<li>the <a href="http://msdn.microsoft.com/en-us/library/6292hy1k.aspx" rel="noreferrer">false operator</a></li>
</ul>
<p>If I understand this right these op... | <p>You can use it to override the <code>&&</code> and <code>||</code> operators.</p>
<p>The <code>&&</code> and <code>||</code> operators can't be overridden, but if you override <code>|</code>, <code>&</code>, <code>true</code> and <code>false</code> in exactly the right way the compiler will call... | <p>It appears from the MSDN article you linked to it was provided to allow for nullable boolean types prior to the Nullable (i.e. int?, bool?, etc.) type being introducted into the language in C#2. Thus you would store an internal value indicating whether the value is true or false or null, i.e. in your example >0 for ... | 5,331 |
<p>I'm a developer who works on both individual and group projects using Microsoft Visual Studio. I could setup one of several different source control packages, such as VSS, SourceGear Vault or SVN on a server of my own and access them remotely; however, I don't want to deal with the hassle of setting it up, configur... | <p>For Git, check out <a href="http://github.com" rel="noreferrer">GitHub</a>. Good packages, used by an awful lot of opensource projects. Considered to be one of the best hosting experiences for git.</p>
| <p>Visual Studio Online, based on the capabilities of Team Foundation Server with additional cloud services, is the home for your project data in the cloud. Get up and running in minutes on our cloud infrastructure without having to install or configure a single server. Connect to your project in the cloud using your f... | 25,028 |
<p>We are setting up a new SharePoint for which we don't have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about the setup. However, when I try to do this, I get the exception:</p>
<blockquote>
<p>The underlying connection was closed: Could not establish tr... | <p>Alternatively you can register a call back delegate which ignores the certification error:</p>
<pre><code>...
ServicePointManager.ServerCertificateValidationCallback = MyCertHandler;
...
static bool MyCertHandler(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors error)
{
// Ignore errors... | <p>For newbies,
you can extend your partial service class in a separate cs file and add the code the code provided by "imanabidi" to get it integrated</p>
| 13,445 |
<p>I understand the principle of why a heater block is used. Helping to reduce temperature variation as the filament is extruded using the heat capacity of the block.</p>
<p>But I’m wondering why it takes the form it does? I imagine it is cuboid in shape just for convenience as it’s easy to machine?</p>
<p>From a sur... | <p>Changing the <strong>flow rate</strong> during a print can <strong>not</strong> be saved. There simply is no way. It is usually meant to be a fix with filament inconsistencies or to look for the right extrusion factor for a new filament batch.</p>
<h2>Slicer</h2>
<p>The only way to consistently increase the flow rat... | <p>You should be able to add a global override to the flow percentage on Marlin firmware printers.</p>
<p>Add this line somewhere in your start code:</p>
<p><code>M221 S97 ; Flow Percentage hard set.</code></p>
<p>In Cura, edit the printer's machine settings. The <code>S</code> is the percentage. In my case, 97 % works... | 1,507 |
<p>Assume the following:</p>
<p><em>models.py</em></p>
<pre><code>class Entry(models.Model):
title = models.CharField(max_length=50)
slug = models.CharField(max_length=50, unique=True)
body = models.CharField(max_length=200)
</code></pre>
<p><em>admin.py</em></p>
<pre><code>class EntryAdmin(admin.ModelA... | <p>For this particular case you can override your save method to slugify (it's built-in method, look at django source) the title and store it in slug field. Also from there you can easily check if this slug is indeed unique and change it somehow if it's not.</p>
<p>Consider this example:</p>
<pre><code>def save(self)... | <p>I'm not sure what you're asking for IS possible. Your best bet is probably to hide the slug from the admin interface completely by specifying your fieldsets, and than overriding the save method to copy the slug from the tile, and potentially slugifying it...</p>
| 17,961 |
<p>I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use?</p>
<p>I can't use a ListView because you can only edit the first column (the label) and that's no good to me.</p>
<p>Is the DataGridView the way to go, or are there third party alternative compon... | <p>DataGridView is the best choice as it is free and comes with .NET WinForms 2.0. You can define editable columns or read-only. Plus you can customize the appearance if required.</p>
| <p>DataGridView is good. </p>
<p>If you prefer a prettier interface, <a href="http://www.telerik.com/products/winforms/overview.aspx" rel="nofollow noreferrer">Telerik controls</a> are better.</p>
| 14,000 |
<p>Using assorted matrix math, I've solved a system of equations resulting in coefficients for a polynomial of degree 'n'</p>
<pre><code>Ax^(n-1) + Bx^(n-2) + ... + Z
</code></pre>
<p>I then evaulate the polynomial over a given x range, essentially I'm rendering the polynomial curve. Now here's the catch. I've done t... | <p>The problem statement is slightly unclear, so first I will clarify my own interpretation of it:</p>
<p>You have a polynomial function</p>
<p><strong>f(x) = C<sub>n</sub>x<sup>n</sup> + C<sub>n-1</sub>x<sup>n-1</sup> + ... + C<sub>0</sub></strong></p>
<p>[I changed A, B, ... Z into C<sub>n</sub>, C<sub>n-1</sub>, ... | <p>You have the equation:</p>
<pre><code>y = Ax^(n-1) + Bx^(n-2) + ... + Z
</code></pre>
<p>In xy space, and you want it in some x'y' space. What you need is transformation functions f(x) = x' and g(y) = y' (or h(x') = x and j(y') = y). In the first case you need to solve for x and solve for y. Once you have x and... | 17,086 |
<p>I'm looking to grab cookie values for the same domain within a Flash movie. Is this possible?</p>
<p>Let's see I let a user set a variable foo and I store it using any web programming language. I can access it easily via that language, but I would like to access it via the Flash movie without passing it in via pr... | <p>If you just want to store and retrieve data, you probably want to use the SharedObject class. See <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/SharedObject.html" rel="noreferrer">Adobe's SharedObject reference</a> for more details of that.</p>
<p>If you want to access the HTTP cooki... | <p>I believe flash objects have functions accessible through javascript, so if there's no easier way, you could at least use a javascript onload handler and pass document.cookie into your flash app from the outside. </p>
<p>More info here: <a href="http://www.permadi.com/tutorial/flashjscommand/" rel="nofollow norefer... | 13,481 |
<p>I'd like to use POSIX semaphores to manage atomic get and put from a file representing a queue. I want the flexibility of having something named in the filesystem, so that completely unrelated processes can share a queue. I think this plan rules out pthreads. The named posix semaphores are great for putting somet... | <p>Since there are no other answers I will follow up with what I've learned:</p>
<ul>
<li>Pthreads will not work with my application because I have processes without a common ancestor which need to share an atomic queue.</li>
<li>Posix semaphores <em>are</em> subject to the wakeup-waiting race, but because unlike clas... | <p>You are looking for: pthread_cond_wait, pthread_cond_signal, I think.<br>
That's if you are using posix threads, then the pthread methods would supply the functionality of CondWait and Signal.<br>
Look here for source code on multiprocess pthreads via shared memory.<br>
<a href="http://linux.die.net/man/3/pthread_mu... | 46,266 |
<p>After using AS2 for several years, I'm getting started with writing applications in AS3 (Flash9/Flash10). I've come to the point where I need some full sets of GUI components, and I need to decide which set I'm going to use. Back in the AS2 days, the built in components included with flash were pretty crappy - bloat... | <p>I'm actually a fan of the CS3 ones mainly because it is so easy to just double click on those bad boys and edit right in the Flash IDE using the drawing tools. Very helpful for those times where you have to rapidly push a skinned video player to production...</p>
<p>On the open source side there's also Thimbault I... | <p>Try out <a href="http://sibirjak.com/osflash/projects/as-dataprovider-controls/" rel="nofollow">AS DataProvider Controls</a></p>
| 17,034 |
<p>I checked out a copy of a C++ application from SourceForge (HoboCopy, if you're curious) and tried to compile it.</p>
<p>Visual Studio tells me that it can't find a particular header file. I found the file in the source tree, but where do I need to put it, so that it will be found when compiling? </p>
<p>Are ther... | <p>Visual Studio looks for headers in this order:</p>
<ul>
<li>In the current source directory.</li>
<li>In the Additional Include Directories in the project properties (<em>Project</em> -> <em>[project name] Properties</em>, under C/C++ | General).</li>
<li>In the Visual Studio C++ <em>Include directories</em> under ... | <p>It looks for files in the directory mentioned in options" cwd, you can include all sub directory under a path as shown below.</p>
<ul>
<li>it will create a single output file.</li>
<li>it will compile all files together in the directory specified in <strong>cwd</strong></li>
</ul>
<p>project Structure:</p>
<p>m... | 43,501 |
<p>What is the difference between the <code>search()</code> and <code>match()</code> functions in the Python <code>re</code> module?</p>
<p>I've read the <a href="https://docs.python.org/2/library/re.html?highlight=matching%20searching#search-vs-match" rel="nofollow noreferrer">Python 2 documentation</a> (<a href="http... | <p><code>re.match</code> is anchored at the beginning of the string. That has nothing to do with newlines, so it is not the same as using <code>^</code> in the pattern.</p>
<p>As the <a href="http://docs.python.org/2/library/re.html#re.match" rel="noreferrer">re.match documentation</a> says:</p>
<blockquote>
<p>If ... | <p><strong>Quick answer</strong></p>
<pre><code>re.search('test', ' test') # returns a Truthy match object (because the search starts from any index)
re.match('test', ' test') # returns None (because the search start from 0 index)
re.match('test', 'test') # returns a Truthy match object (match at 0 ... | 21,836 |
<p>I have read an example and tried to duplicate it's methods but with weird results. This is a 1 shot deal so I do not want to buy a package to do this. Also, it will be executed on a Multi-Valued database in a Basic that not many programmers write in anymore.
If anyone can post a small example of this It would be mos... | <p>The simplest way is to draw 3 boxes. You'll have to position each one on your own doing your own math to determine where to start the first one to make it centered etc. </p>
<p>First position your cursor at the top left of the first box, draw it, move to the top left of the next box, draw it, and do the same for ... | <p>The simplest way is to draw 3 boxes. You'll have to position each one on your own doing your own math to determine where to start the first one to make it centered etc. </p>
<p>First position your cursor at the top left of the first box, draw it, move to the top left of the next box, draw it, and do the same for ... | 41,687 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.