instruction
stringlengths
21
27.8k
chosen
stringlengths
18
28.2k
rejected
stringlengths
18
33.6k
__index_level_0__
int64
0
50k
<p>I'm trying to write a parser to get the data out of a typical html table day/time schedule (like <a href="http://kut.org/about/schedule" rel="nofollow noreferrer">this</a>). </p> <p>I'd like to give this parser a page and a table class/id, and have it return a list of events, along with days &amp; times they occur....
<p>The best thing to do here is to use a HTML parser. With a HTML parser you can look at the table rows programmatically, without having to resort to fragile regular expressions and doing the parsing yourself.</p> <p>Then you can run some logic along the lines of (this is not runnable code, just a sketch that you shou...
<p>This is what the program will need to do:</p> <ol> <li>Read the tags in (detect attributes and open/close tags)</li> <li>Build an internal representation of the table (how will you handle malformed tables?)</li> <li>Calculate the day, start time, and end time of each event</li> <li>Merge repeated events into an eve...
14,469
<p>I trying to implement a typical languages menu where users can select the language they want to view the site in through a menu that appears throughout all pages in the site.</p> <p>The menu will appear on multiple master pages (currently one for pages where users are logged in and one for pages where users are not...
<p>How about <a href="http://www.ericmmartin.com/projects/simplemodal/" rel="nofollow noreferrer">SimpleModal</a> for jQuery?</p>
<p>I've found <a href="http://dev.iceburg.net/jquery/jqModal/" rel="nofollow noreferrer">jqModal</a> [for jQuery] to be very easy to work with.</p>
34,710
<p>How does one execute some VBA code periodically, completely automated?</p>
<p>You can use Application.OnTime to schedule a macro to be executed periodically. For example create a module with the code below. Call "Enable" to start the timer running. </p> <p>It is important to stop the timer running when you close your workbook: to do so handle Workbook_BeforeClose and call "Disable"</p> <...
<p>You could consider the Windows Task Scheduler and VBScript.</p>
26,023
<p>When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default?</p>
<p>I believe it defaults to <code>%HOMEDRIVE%\%HOMEPATH%</code> so if you can muck about with those environment variables that might be an option. I can't edit these environment variables on my company's network, so I had to use the <a href="http://technet.microsoft.com/en-us/library/cc756720.aspx" rel="nofollow noref...
<p>If you are opening it from a shortcut change the working dir for the shortcut.</p>
6,598
<p>Let's say that I want to merge from a release branch to the master branch and there are some commits in the release branch that I don't want to include in the master branch. Is there a way to do the merge so that one or more of those commits will not be merged?</p> <p>My strategy so far is to do the following (in ...
<p>Create a new branch, rebase the branch interactively and drop commits you don't want, and then merge that.</p> <p>You can't take changes out of the middle of a branch without rehashing, but the right thing will happen when it sees the same changes in a later merge (e.g. from cherry-picking and what-not).</p>
<p>To avoid overwriting problem encountered with <a href="https://stackoverflow.com/a/3970442/5784834">@fcurella</a>'s answer, start by defining a merge driver that would always favor our current version of the file, by making use of the existing true command. We’ll call this driver ours, to keep in line with similar m...
43,078
<p>What would the purpose of this construct in a c file be?: </p> <pre><code>#define _TIMERC #include "timer.h" #undef _TIMERC </code></pre> <p>I am aware of the guard for preventing multiple inclusion of a header file. This doesn't appear to be whats happening though.</p> <p>thanks!</p>
<p>Often times a library header file will have multiple options, that are enabled and disabled by macro defines. This will enable such an option.</p> <p>More typically these are set at a global scope by configuring your build system to add (for eg with gcc) <strong>-D_TIMERC</strong> to the compilers command line.</p>...
<p>At the risk of stating the obvious, "timer.h" expects to have _TIMERC and the rest of your code does not.</p> <p>Clearly not good practice in the general case, but I have seen similar when including third party code. Can get nasty when you have #defs that clash...</p>
43,354
<p>We are currently using the <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;118623" rel="noreferrer">NetBios method</a>, and it works ok under XP. Preliminary tests under Vista show that it also works, but there are caveats - NetBIOS has to be present, for instance, and from what I've been reading, t...
<p>This will give you a list of all MAC addresses on your computer. It will work with all versions of Windows as well:</p> <pre><code>void getdMacAddresses(std::vector&lt;std::string&gt; &amp;vMacAddresses;) { vMacAddresses.clear(); IP_ADAPTER_INFO AdapterInfo[32]; // Allocate information for up to 32 N...
<p>You can use WMI on both XP and Vista, there are a number of examples online. e.g: <a href="http://www.thescarms.com/dotnet/WMI.aspx" rel="nofollow noreferrer">Use Windows Management Instrumentation (WMI) to get a MAC Address</a></p>
27,358
<p>So I bought this printer three days ago as a way to dip my toes into the 3D printing world, and it was working great at first. But at some point, the ABL procedure started behaving oddly: Instead of moving down to touch each corner of the printing bed, it's now only doing so for one corner, then moving to the next, ...
<p>This is a community wiki answer from <a href="https://www.reddit.com/r/3Dprinting/comments/lz4c9l/comment/gr9v9pb/?utm_source=reddit&amp;utm_medium=web2x&amp;context=3" rel="nofollow noreferrer">an answer</a> on <a href="https://www.reddit.com/r/3Dprinting/comments/lz4c9l/monoprice_cadet_autoleveling_question/" rel=...
<p>According to the <a href="http://www.weedo.ltd/product-detail/tina2/" rel="nofollow noreferrer">manufacturer's page for the Weedo Tina 2</a>, the bed sensor for the ABL is magnetic -- which means that if you've removed the magnetic build surface you likely have removed the printer's ability to sense the bed height. ...
1,953
<p>I'm customizing the 404 page for my website. I'd like it to include a "Did you mean...?" I need to figure out how to do this.</p> <p>Here's what I'm doing so far: I come up with a broad list of files that the user might be looking for, then use levenshtein() to compare each possible filename to the mistyped filen...
<p>One thing you might want to consider is Google's 404 script for doing just what you mentioned. It probably wouldn't be as good as a custom solution, but it may be worth trying out to be sure.</p> <p><a href="http://googlewebmastercentral.blogspot.com/2008/08/make-your-404-pages-more-useful.html" rel="nofollow nore...
<p>One thing you might want to consider is Google's 404 script for doing just what you mentioned. It probably wouldn't be as good as a custom solution, but it may be worth trying out to be sure.</p> <p><a href="http://googlewebmastercentral.blogspot.com/2008/08/make-your-404-pages-more-useful.html" rel="nofollow nore...
42,720
<p>I have intermittent crashes occurring in my ActiveMQ libraries due to the way I'm using the activemq-cpp API. It'd be much easier to debug the issue if I could observe every function being called leading up to the crash. Are there any quick ways to trace the entry and exit of functions in a Visual Studio 2005 c++ ...
<p>Use a Tracer object. Something like this:</p> <pre><code> class Tracer { public: Tracer(const char *functionName) : functionName_(functionName) { cout &lt&lt "Entering function " &lt&lt functionName_ &lt&lt endl; } ~Tracer() { cout &lt&lt "Exiting function " &lt&lt functionName_ &lt&lt endl; }...
<p>While the debugger is attached to a process, you can rightclick in the source code and select "breakpoint->add TracePoint", with the text you want (even some macro's are supplied).</p> <p>The Tracepoint is in fact a BreakPoint with the "When Hit" field on some message printer functionality, and it doesn't actually ...
29,499
<p>I'm using TortoiseSVN against the SourceForge SVN repository. I'd like to move a file from one folder to another in order to maintain its revision history. Is this possible? If so, how do you do it?</p> <p>(My current strategy has been to copy the file into the new folder and check it in and then delete the file fr...
<p>Subversion has native support for moving files.</p> <pre><code>svn move SOURCE DESTINATION </code></pre> <p>See the online help (svn help move) for more information.</p>
<p>If you are moving folders via Repository Browser, then there is no Move option on right-click; the only way is to drag and drop. </p>
6,811
<p>Real UID, effective UID, and some systems even have a "saved UID". What's the purpose of all these, especially the last one?</p>
<p>Each UNIX process has 3 UIDs associated to it. Superuser privilege is UID=0.</p> <p><strong>Real UID</strong></p> <p>This is the UID of the user/process that created THIS process. It can be changed only if the running process has EUID=0.</p> <p><strong>Effective UID</strong></p> <p>This UID is used to evaluate p...
<p>The accepted answer is not correct regarding that real UD's can not be changed by anyone except root. From the man page for setuid: (I could not make a comment)</p> <blockquote> <p>The setuid() function sets the real and effective user IDs and the saved set-user-ID of the current process to the specified...
25,119
<p>My source code needs to support both .NET version 1.1 and 2.0 ... how do I test for the different versions &amp; what is the best way to deal with this situation.</p> <p>I'm wondering if I should have the two sections of code inline, in separate classes, methods etc. What do you think?</p>
<p>There are a lot of different options here. Where I work we use #if pragmas but it could also be done with separate assemblies for the separate versions. </p> <p>Ideally you would at least keep the version dependant code in separate partial class files and make the correct version available at compile time. I would ...
<p>I would be asking the question of WHY you have to maintain two code bases, I would pick one and go with it if there is any chance of it.</p> <p>Trying to keep two code bases in sync with the number of changes, and types of changes would be very complex, and a build process to build for either version would be very ...
11,129
<p>I've worked with a couple of Visual C++ compilers (VC97, VC2005, VC2008) and I haven't really found a clearcut way of adding external libraries to my builds. I come from a Java background, and in Java libraries are everything! </p> <p>I understand from compiling open-source projects on my Linux box that all the s...
<p>In I think you might be asking the mechanics of how to add a lib to a project/solution in the IDEs...</p> <p>In 2003, 2005 and 2008 it is something similar to:</p> <p>from the solution explorer - right click on the project select properties (typically last one) I usually select all configurations at the top... Lin...
<p>What do you mean "add them to a build"?</p> <p>In VC, within a solution, you can have a project whose output is a library (static or dynamic) and then another project that depends upon the output and uses it (ie, links to it).</p> <p>In our code base, we typically have a separate solution for each library or set o...
26,116
<p>I'm generating a self-signed SSL certificate to protect my server's admin section, and I keep getting this message from OpenSSL:</p> <blockquote> <p>unable to write 'random state'</p> </blockquote> <p>What does this mean?</p> <p>This is on an Ubuntu server. I have upgraded libssl to fix <a href="http://www.ubun...
<p>In practice, the most common reason for this happening seems to be that the .rnd file in your home directory is owned by root rather than your account. The quick fix:</p> <pre><code>sudo rm ~/.rnd </code></pre> <p>For more information, here's the entry from the <a href="http://www.openssl.org/support/faq.html#USE...
<p>The problem for me was that I had .rnd in my home directory but it was owned by root. Deleting it and reissuing the openssl command fixed this.</p>
12,005
<p>What is BPEL? I'm looking for some nice simple examples of BPEL usage. The wikipedia page isn't too enlightening. How about a "Hello world" in BPEL? A BPEL shell? A BPEL IDE?</p>
<p>BPEL is just a way to build centralized control of disparate but interdependent systems from a centralized place. </p> <p>Users can create rules, workflows and other control structures to make sure everything plays nice. </p> <p>For example, say you run a school district; in particular, a school districts informa...
<p><strong>Background</strong></p> <p>I'll add a little bit to what has been said. BPEL is a procces orchestrator. You can use it to do any kind of serialised of parallel process automation. For example: A customer buys something on the website of company 'AAA', this instigates a BPEL process in that companies servic...
39,165
<p>I need to be able to store a date (year/month/day) with no time component. It's an abstract concept of a date, such as a birthday - I need to represent a date in the year and not a particular instant in time.</p> <p>I am using Java to parse the date from some input text, and need to store in a MySQL database. No ma...
<p>I concluded that the best way in my current application (a simple utility using jdbc directly) was to insert directly as a string. For a bigger Hibernate app I might bother to write my own user type. Can't believe someone hasn't already solved this problem in some publicly available code though...</p>
<p>Couldn't you just use the MySQL <code>DATE</code> type in your table and then essentially use the formatted string in your insert statement? I'd think something like this would avoid any time zone adjustments.</p> <pre><code>INSERT INTO time_table(dt) VALUES('2008-12-31') </code></pre>
36,258
<p>We're getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go.</p> <p>All the tutorials I see recommend using the english text as the message ID, i.e.</p> <p>gettext("Hi there!")</p> <p>But is that really a good idea? Let's say someone in marketi...
<p>Wow, I'm surprised that no one is advocating using the English as a key. I used this style in a couple of software projects, and IMHO it worked out pretty well. The code readability is great, and if you change an English string it becomes obvious that the message needs to be considered for re-translation (which is...
<p>In addition to the considerations above, there are many cases where you'd want the "key" (msgid) to be different from the source text (English). For example, in the HTML view, I might want to say [yyyy] where the destination and label of that anchor tag depend on the locale of the user. E.g. it might be a link to a ...
26,612
<p>I am studying how two-phase commit works across a distributed transaction. It is my understanding that in the last part of the phase the transaction coordinator asks each node whether it is ready to commit. If everyone agreed, then it tells them to go ahead and commit.</p> <p>What prevents the following failure?</p...
<p>No, they are not instructed to roll back because in the original poster's scenario, some of the nodes have already committed. What happens is when the crashed node becomes available, the transaction coordinator tells it to commit again.</p> <p>Because the node responded positively in the "prepare" phase, it is requ...
<p>There are many ways to attack the problems with two-phase commit. Almost all of them wind up as some variant of the Paxos three-phase commit algorithm. Mike Burrows, who designed the Chubby lock service at Google which is based on Paxos, said that there are two types of distributed commit algorithms - "Paxos, and in...
20,723
<p>How can I exclude the bin folder from SourceSafe in a Visual Studio 2008 web application? I want to be able to check in everything recursively from the solution node without picking up anything in the bin folder.</p>
<ul> <li>Right-click the folder in your project</li> <li>select "Exclude from project"</li> </ul>
<p>You can hide the folder through Windows explorer, although it'll disappear from your Visual Studio Solution Exporer, I don't think that'll affect the website.</p>
9,890
<p>I have a database that I would like class files generated from, and also a .aspx page generated which contains a listview to interface with the classfile for create/read/update/delete. I have started to use Subsonic but am not sure how flexible the scaffold control is. Also, LINQ seems like an option, but it would...
<p><strong><a href="http://en.wikipedia.org/wiki/ASP.NET_Dynamic_Data" rel="nofollow noreferrer">ASP.NET Dynamic Data</a></strong> is supergreat! Saw a really cool demo on MSDN Live about a month ago. Create a full .net 3.5 web site from a database in 1 minute!!! Same idea as Ruby on Rails, kind of.</p> <p>And then yo...
<p>You should check out <a href="http://www.llblgen.com" rel="nofollow noreferrer">LLBLGen</a> - it's a great product! Not sure how well it does the ASPX side of things, but I'm aware that it does contain that functionality and at the very least does a bloody good job at generating a DAL as a .net project you can inclu...
26,863
<p>Here is the situation:</p> <p>I have been called upon to work with InstallAnywhere 8, a Java-based installer IDE, of sorts, that allows starting and stopping of windows services, but has no built-in method to query their states. Fortunately, it allows you to create custom actions in Java which can be called at any...
<p>here's what I had to do. It's ugly, but it works beautifully.</p> <pre><code>String STATE_PREFIX = "STATE : "; String s = runProcess("sc query \""+serviceName+"\""); // check that the temp string contains the status prefix int ix = s.indexOf(STATE_PREFIX); if (ix &gt;= 0) { // compare status number ...
<p>During startup, create a file with <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#deleteOnExit()" rel="nofollow noreferrer">File.deleteOnExit()</a>.</p> <p>Check for the existence of the file in your scripts.</p>
43,369
<p>I have a bit of an unusual question. I'm running an old DOS game in dosbox under windows xp and i'm trying to determine when and where it access it's data file.</p> <p>what can i use that will give me a log of all read requests made to a file? I want to know the "when", "from" and "size" of each file read.</p> <p>...
<p>You could try using <a href="http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx" rel="nofollow noreferrer">FileMon for Windows</a> and see what dosbox is accessing via the windows file system.</p>
<p>You could patch the DOSBOX source code :) Just get it to write some debug messages when the reads occur. If you set the debug level high enough it might happen anyway!</p> <p>Most DOS programs use DOS interrupts. Some however use BIOS interrupts or worse.</p> <p>Anyway, in case it helps, here are the file-reading ...
34,639
<p>I have been trying to figure out how to programmatically identify the process that has a lock on a particular file. I've searched through the Win32 API and WMI, but so far I can't find anything. I know it's possible - Sysinternals is able to list every resource accessed/locked by every process on the system.</p> ...
<p>You can use <a href="http://technet.microsoft.com/en-us/sysinternals/bb896655" rel="noreferrer">handle.exe from Sysinternals</a>.</p> <p>Something like:</p> <pre><code>&gt; handle /accepteula C:\path\to\directory ... program.exe pid: 1234 type: File 2E4: C:\path\to\directory ... </code></pre>...
<p>I don't know in Windows, but somebody might find useful to know that, in Linux, you can use the <em>lsof</em> command, or just search through the folders /proc/PROCESS_ID/fd and see what process has opened the file.</p>
49,753
<p>I have the following tables, the <code>groups</code> table which contains hierarchically ordered groups and <code>group_member</code> which stores which groups a user belongs to. </p> <pre><code>groups --------- id parent_id name group_member --------- id group_id user_id ID PARENT_ID NAME -------------------...
<p>Two things come to mind:</p> <p><strong>1 -</strong> You can repeatedly outer-join the table to itself to recursively walk up your tree, as in:</p> <pre><code>SELECT * FROM MY_GROUPS MG1 ,MY_GROUPS MG2 ,MY_GROUPS MG3 ,MY_GROUPS MG4 ,MY_GROUPS MG5 ,MY_GROUP_MEMBERS MGM WHERE MG1.PARENT_ID = MG2.UNIQID (+) ...
<p><del>There's no way to do this in the SQL standard, but you can usually find vendor-specific extensions, e.g., <code>CONNECT BY</code> in Oracle.</del></p> <p>UPDATE: As the comments point out, this was added in SQL 99.</p>
8,417
<p>I'm having some problems with a datagridview element I'm using in VS2008. This DataGridView is actually a tab in a TabControl element.</p> <p>I gave it 5 colums which need to be filled up with elements from a costum Object i made.</p> <p>It's basically a small library application which contains a main class and se...
<p>I'm a little confused by the question, but here are some thoughts:</p> <ol> <li><code>DataGridView</code> has an <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.autogeneratecolumns.aspx" rel="nofollow noreferrer"><code>AutoGenerateColumn</code>s</a> property; if you don't want it ...
<p>I can only give a partial answer but I think the reason that </p> <pre><code>public void tabControl1_SelectedIndexChanged(object sender, EventArgs e) { libDataGrid.DataSource = this.manager.Lib.LibList; libDataGrid.Refresh(); } </code></pre> <p>isn't working, is beca...
41,228
<p>I've been trying to call Page Methods from my own JavaScript code but it doesn't work. If I use jQuery AJAX I can sucessfully call the Page Methods, but I need to do this from my own JavaScript code because we can't use third-party libraries (we are building our own library).</p> <p>Whenever I use jQuery AJAX metho...
<p>You're requesting the URL with a GET, while the jQuery code uses a POST. I expect that a Page Method can only be called through a POST, to allow you to include any parameters in the body of your request. You may also need to set the Content-Type of your request to application/json, as the jQuery code does - I don't ...
<p>If you are using ASP.NET AJAX you don't need to do any of this. There is a well defined way of using PageMethods that is a whole lot less complex.</p> <p>Codebehind</p> <pre><code> [WebMethod] public static Whatever GetWhatever( int someParameter, string somethingElse ) { ... make a Whatever ......
24,518
<p>I am parsing an input text file. If I grab the input one line at a time using getline(), is there a way that I can search through the string to get an integer? I was thinking something similar to getNextInt() in Java. </p> <p>I know there has to be 2 numbers in that input line; however, these values will be separ...
<p>If the only thing in there is whitespace and integers, just try something like this:</p> <pre><code>int i1, i2; stringstream ss(lineFromGetLine); ss &gt;&gt; i1 &gt;&gt; i2; </code></pre> <p>or easier:</p> <pre><code>int i1, i2; theFileStream &gt;&gt; i1 &gt;&gt; i2; </code></pre>
<p>It's more than a little bit C-ish, but you could use sscanf() on the C string representation. Or you could use strtol() or relatives - also on the C string representation.</p> <p>A more C++-ish way would probably use a string stream and an extractor.</p>
26,561
<p>I need to find out how to format numbers as strings. My code is here:</p> <pre><code>return str(hours)+":"+str(minutes)+":"+str(seconds)+" "+ampm </code></pre> <p>Hours and minutes are integers, and seconds is a float. the str() function will convert all of these numbers to the tenths (0.1) place. So instead of ...
<p>Starting with Python 3.6, formatting in Python can be done using <a href="https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep498" rel="noreferrer">formatted string literals</a> or <em>f-strings</em>:</p> <pre><code>hours, minutes, seconds = 6, 56, 33 f'{hours:02}:{minutes:02}:{seconds:02} {"pm" if hours &gt;...
<p><em>str()</em> in python on an integer will <strong>not</strong> print any decimal places.</p> <p>If you have a float that you want to ignore the decimal part, then you can use str(int(floatValue)).</p> <p>Perhaps the following code will demonstrate:</p> <pre><code>&gt;&gt;&gt; str(5) '5' &gt;&gt;&gt; int(8.7) 8 ...
4,266
<p>I'm working with a existing database and trying to write a sql query to get out all the account information including permission levels. This is for a security audit. We want to dump all of this information out in a readible fashion to make it easy to compare. My problem is that there is a bridge/link table for the ...
<p>You could do something like this:</p> <pre><code>select userid, username , max(case when permissionid=10 then rights end) as permission10_rights , max(case when permissionid=11 then rights end) as permission11_rights , max(case when permissionid=12 then rights end) as permission12_rights from userp...
<p>You could create a temporary table_flatuserpermissions of:</p> <pre>UserID PermissionID1 Rights1 PermissionID2 Rights2 ...etc to as many permission/right combinations as you need</pre> <p>Insert records to this table from Table_user with all permission &amp; rights fields null. </p> <p>Update records on this tab...
38,357
<p>I am working on a small team of web application developers. We edit JSPs in Eclipse on our own machines and then move them over to a shared application server to test the changes. I have an Ant script that will take ALL the JSPs on my machine and move them over to the application server, but will only overwrite JS...
<p>Add a target to your <a href="http://ant.apache.org" rel="nofollow noreferrer">ant</a> build file to copy a single jsp using a command line property definition as @matt b described.</p> <p>Create a new external tool launch profile and use the "String Substitution Preferences" to pass in the reference to the active ...
<p>I suggest you to use source control. I prefer Subversion. You can use <a href="http://cruisecontrol.sourceforge.net/" rel="nofollow noreferrer">CruiseControl</a> to make the build automatically whenever someone commits new code.</p>
38,416
<p>I would like to be able to cast a value dynamically where the type is known only at runtime. Something like this:</p> <pre><code>myvalue = CType(value, "String, Integer or Boolean") </code></pre> <p>The string that contains the type value is passed as an argument and is also read from a database, and the value is ...
<p>Sure, but <code>myvalue</code> will have to be defined as of type <code>Object</code>, and you don't necessarily want that. Perhaps this is a case better served by generics.</p> <p>What determines what type will be used?</p>
<p>Well, how do you determine which type is required? As Joel said, this is probably a case for generics. The thing is: since you don't know the type at compile time, you can't treat the value returned anyway so casting doesn't really make sense here.</p>
31,324
<p>What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that works over http, through the browser. Uploading multiple files through a normal HTML 4.x form is a ...
<p><a href="http://www.uploadify.com/" rel="nofollow noreferrer">Uploadify</a> is also another great multiple file uploader. It was built off of SWFUpload and they added new features to it. </p> <p>Some of the features that I have found most helpful are: </p> <blockquote> <p>The user can upload all the files at on...
<p>Another option that I have used before is uploading and then extracting ZIP files. I have used <a href="http://pear.php.net/package/Archive_Zip" rel="nofollow noreferrer">PEAR::Archive_Zip</a> to extract. Requires more knowledge on the user's side, but supports directories and unlimited files (depending on the memor...
19,309
<p>What languages and tools do you consider a youngster starting out in programming should use in the modern era?</p> <p>Lots of us started with proprietary Basics and they didn't do all of us long term harm :) but given the experiences you have had since then and your knowledge of the domain now are there better opti...
<p>I would suggest <a href="http://mindstorms.lego.com/Products/Default.aspx" rel="nofollow noreferrer">LEGO Mindstorm</a>, it provides an intuitive drag and drop interface for programming and because it comes with hardware it provides something tangible for a child to grasp. Also, because it is "LEGO" they might think...
<p>Wasn't Smalltalk designed for such a purpose? I think Ruby would be a good choice, as a descendant of Smalltalk.</p>
4,040
<p>What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?</p>
<p>I also once worked on an app which used PHP4's XML support quite heavily, and would have required quite a bit of work to move to PHP5.</p> <p>One of the other significant changes I was looking at at the time was the change of the default handling of function parameters. In PHP4 if I remember, they were pass-by-copy...
<p>We had an app that relied heavily on the PHP 4 XML DOM functions and it required a lot of retooling to change over PHP 5.</p> <p>Beyond that most changes were improvements to things like error handling (to take advantage of exceptions) and PHP Classes.</p>
2,830
<p>I am trying to set up apache instead of IIS because <a href="https://stackoverflow.com/questions/188896/why-does-iis-crash-when-i-print-to-stderr-in-perl">IIS needlessly crashes</a> all the time, and it would be nice to be able to have my own checkout of the source instead of all of us editing a common checkout.</p>...
<p>HTTP and CGI are different things. The Perl CGI module calls what it does an "HTTP header", but it's really just a CGI header for the server to fix up before it goes back to the client. They look a lot alike which is why people get confused and why the CGI.pm docs don't help by calling them the wrong thing.</p> <p>...
<p>I'm still experiencing this problem with ActivePerl 5.14 running under IIS 7 via ISAPI. The <a href="http://docs.activestate.com/activeperl/5.10/faq/Windows/ActivePerl-Winfaq7.html#My_CGI_scripts_don_t_seem_to_run" rel="nofollow">ActivePerl 5.10 FAQ</a> claims the problem is fixed (the 5.14 FAQ doesn't even address...
39,666
<p>I was curious as to what other shops are doing regarding base application frameworks? I look at an application framework as being able to provide additional or extended functionality to improve the quality of applications built from it.</p> <p>There are a variety of out of the box frameworks, such as Spring (or Sp...
<p>You could use a TBytesField or a TBlobField</p> <p>ClientDataSet1MySet: TBytesField, Size=32</p> <pre><code>var MySet: set of Byte; Bytes: array of Byte; begin MySet := [1, 2, 4, 8, 16]; // Write Assert(ClientDataSet1MySet.DataSize &gt;= SizeOf(MySet), 'Data field is too small'); SetLength(Bytes, Cli...
<blockquote> <blockquote> <p>Based on the example of Andreas, but made somewhat simpler and clearer IMHO.</p> </blockquote> </blockquote> <p>Tested on XE2</p> <p>You could use a TBytesField or a TBlobField</p> <p>ClientDataSet1MySet: TBytesField, Size=32</p> <p>1) Writing </p> <pre><code>var MySet: set o...
45,236
<p>C++ preprocessor <code>#define</code> is totally different.</p> <p>Is the PHP <code>define()</code> any different than just creating a var?</p> <pre><code>define("SETTING", 0); $something = SETTING; </code></pre> <p>vs</p> <pre><code>$setting = 0; $something = $setting; </code></pre>
<p>'define' operation itself is rather slow - confirmed by xdebug profiler.</p> <p>Here is benchmarks from <a href="http://t3.dotgnu.info/blog/php/my-first-php-extension.html" rel="noreferrer">http://t3.dotgnu.info/blog/php/my-first-php-extension.html</a>: </p> <ul> <li><p>pure 'define'<br> 380.785 fetches/sec<br> 1...
<p>Main differences:</p> <ul> <li>define is constant, variable is variable </li> <li>they different scope/visibility</li> </ul>
17,856
<p>How do you specify the Fill Factor when creating an index in MySql?</p>
<p>You don't.</p> <p><a href="http://dev.mysql.com/doc/refman/5.0/en/create-index.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/create-index.html</a></p> <p>However, it is an 'accepted' feature request for version 6.x: <a href="http://bugs.mysql.com/bug.php?id=18178" rel="noreferrer">http://bugs.mysql...
<p>Assuming that you are using InnoDB, it seems like this is only supported at database level, not index level.</p> <p>The setting is called <code>innodb_fill_factor</code> and defaults to <code>100</code> see <a href="https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_fill_factor" rel="nofol...
42,888
<p>I have a solid of revolution defined by two equations, and I want to generate a STL file for printing from the <a href="https://www.desmos.com/calculator/eh18uwasw9" rel="nofollow noreferrer">difference of the two equations</a>, revolved around x=0. I can get a good visualization when I <a href="https://www.wolframa...
<p>If you properly define your own machine with a <code>delta_wasp.def.json</code> file you can fill in the acceleration and jerk settings of your printer, so that Cura will use the correct values for print time estimation.</p> <p>For example, take a look at <a href="https://github.com/Ultimaker/Cura/blob/master/resou...
<p>Estimating time for any CNC based machines are measured in this formula:</p> <p><em>The length of pulses that machine travels x The feedrate of the pulse itself</em></p> <p>It gives you the time for whole movements. If you're familiar with NC codes, information of any movement is listed in a single line, having it...
600
<p>I have a C# WinForms borderless window, for which I override WndProc and handle the WM_NCHITTEST message. For an area of that form, my hit test function returns HTSYSMENU. Double-clicking that area successfully closes the form, but right-clicking it does not show the window's system menu, nor does it show up when ri...
<p>A borderless window, if I am not mistaken, is flagged such that it offers no system menu, and that it does not appear in the taskbar. </p> <p>The fact that any given window does not have a border and does not appear in the taskbar is the result of the style flags set on the window. These particular Style flags can ...
<p>I have the same properties in my application and Right click doesn't work either, so this is not <em>your problem</em>, it appears to be the way windows forms respond when they have no border.</p> <p>If you set your border to the normal value, you will be able to have right click in the taskbar and such. </p> <p>F...
16,913
<p>I'm writing an asp.net application that will need to be localized to several regions other than North America. What do I need to do to prepare for this globalization? What are your top 1 to 2 resources for learning how to write a world ready application.</p>
<p>A couple of things that I've learned:</p> <ul> <li><p>Absolutely and brutally minimize the number of images you have that contain text. Doing so will make your life a billion percent easier since you won't have to get a new set of images for every friggin' language.</p></li> <li><p>Be very wary of css positioning t...
<p>I would suggest:</p> <ol> <li>Put all strings in either the database or resource files. </li> <li>Allow extra space for translated text, as some (e.g. German) are wordier.</li> </ol>
8,362
<p>I have been working on a printer project that basically is a 2D printer (dot matrix type). We are using solenoids as actuators to make impressions on the paper. We are now in the process of designing custom software. But a problem that we have encountered is that we have no idea how to design software as we are a bu...
<p>3D printer firmware use gcode that is derived from CNC and no acknowledgment. They send movement commands to the stepper motors like <code>G1 X10 Y10</code> to move the printhead 10 mm along the X and Y.</p> <p>You could use a ready 3D printer firmware like Marlin on a 3d printer board and use the X-axis or extrude...
<p>The CNC system, and simplifying intentionally, is divided into several steps:</p> <ol> <li><strong>Acquisition of the g-code</strong>: This depends on the platform, whether is a file from an USB flash-memory, network or direct input from the operator. G-code operations needs to be buffered in a quantity enough to a...
1,176
<p>As I started to learn about 3D printing, the gist I learned was &quot;it's better to store the filaments in a drybox.&quot; As I rechecked these notes, they were to a good degree from an era when PLA was rather new to the market and ABS was the goTo.</p> <p>Then I learned &quot;PLA is not really hygroscopic and can ...
<h1><a href="https://ultimaker.com/en/products/materials/pva" rel="nofollow noreferrer">PVA</a></h1> <p>From experience I can tell that PVA filaments need to be stored with silica beads in a plastic bag or in a specific dry-box. PVA is soluble in water and is very hygroscopic. With moisture it gets soft and swells. My ...
<p>Some brands of PLA+ and colors of filament seem to have issues if left in the open air for too long a period. These then need to be dried back out in a dry box. The filament seems to be softer and the hobb seems to strip it out more easily causing print failures. The colors I have had the most troubles with are t...
1,046
<p>I have a Rails app that I need to deploy. Here are the facts:</p> <ul> <li>The app was developed on Windows and requires Windows binary gems</li> <li>The app is to be deployed onto an Open Solaris shared server (Joyent)</li> <li>I do not have permissions to install gems on the server</li> <li>For the non-binary gem...
<blockquote> <ul> <li>The app was developed on Windows and requires Windows binary gems</li> <li>The app is to be deployed onto an Open Solaris shared server (Joyent)</li> </ul> </blockquote> <p>You do realise that you can't run windows binaries on open solaris. Windows is in fact entirely different from solar...
<p>The binary gems are the real problem. For all other gems you can use the <code>vendor/gems</code> directory (only possible with Rails 2.1+).</p>
23,130
<p>I want to be able to change the status message for Live Messenger, but everything I've found only works for the music message (see <a href="http://coldacid.net/images/screenshots/live-messenger-status-and-music-messages" rel="nofollow noreferrer">this screenshot</a> to see the difference between the two).</p> <p>It...
<p>There is no programmatic way of setting the Live Messenger status message that works with versions inclusive of Live Wave 3.</p>
<p>You could possibly go for the messy work-around, using windows API functions to simulate user input.</p>
34,605
<p>OpenID is all good... UNTIL the provider goes down. At that point you're potentially locked out of EVERYTHING (since you jumped on the bandwagon and applied OpenID everywhere you could).</p> <p><em>This question came up because I can't, for the life of me, login with my <strong>myopenid.com</strong> provider. :-(<...
<p>The fix is for your OpenID site to accept multiple OpenIDs per user account. Something that the spec recommends.</p>
<p>The answer is simple. Store an email for the user. Have your own login mechanism. Making OpenId optional is the straight forward answer to this. </p> <p>Unfortunately some sites are closed minded about OpenId.</p>
16,996
<p>I'm doing some optimising for my site and am trying to figure out just how big some inline code can be before it can justify having it's own file instead of being written inline.</p> <p>My guess on how to measure it would be that the amount of code (CSS or JS in this case) would need to be bigger than the HTTP pack...
<p>Honestly, in terms of browser performance, separating your CSS &amp; JS files out and properly setting expires headers so they are cached will <em>increase</em> performance, not degrade it. The browser will cache it and never request it again, which reduces the amount of data transferred during multiple page views.<...
<p>I'd also like to add that you should combine your JS/CSS into one download (each) if possible, to save on HTTP connections to the web server. I believe Yahoo suggest this in their URL that Ryan posted. I ended up writing my own .NET component that can combine scripts and CSS, and also minimize them if needed and cac...
25,907
<p>I am new to MVC and I notice that the view pages can look pretty nasty with all the intermixed script tags. Does it make sense to generate the HTML in a method in the view code-behind and then just insert the string result of the method as a single bit of script?</p> <p>For example: <code>&lt;div&gt;&lt;%= Generate...
<p>It's a matter of practice.</p> <p>Here's an interesting read.</p> <ol> <li><p><a href="http://stevesmithblog.com/blog/codebehind-files-in-asp-net-mvc-are-evil/" rel="nofollow noreferrer">Codebehind files are evil</a></p></li> <li><p><a href="http://msmvps.com/blogs/luisabreu/archive/2008/09/19/codebehind-files-in-...
<p>You can use code behind as well. It is only a matter of style preference.</p>
46,283
<p>I'm implementing an SOA at a large company, and I'm not sure which web service specifications (WS-*) actually make sense to implement. At a minimum, I'm looking at WS-Addressing, WS-Security, WS-Eventing, and WS-ReliableMessaging. However, there are <a href="http://www-128.ibm.com/developerworks/webservices/standard...
<p>WS-Adressing is widely used, and quite useful. For WS-Security, consider the set of mechanisms you'll need (based on your usage scenarios).</p>
<p>There are two types of web services : REST and SOAP. They represent different protocols of sending data over the internet.</p> <p>SOA is an acronym standing for Service Oriented Architecture. It is a way of architecturing your system using multiplet tiers (applications) one atop the other. Web services, mostly soap...
33,372
<p>What is the single most effective practice to prevent <a href="http://en.wikipedia.org/wiki/Arithmetic_overflow" rel="nofollow noreferrer">arithmetic overflow</a> and <a href="http://en.wikipedia.org/wiki/Arithmetic_underflow" rel="nofollow noreferrer">underflow</a>?</p> <p>Some examples that come to mind are:</p> ...
<p>One possibility is to use a language that has arbitrarily sized integers that never overflow / underflow.</p> <p>Otherwise, if this is something you're really concerned about, and if your language allows it, write a wrapper class that acts like an integer, but checks every operation for overflow. You could even ha...
<p>There are more important considerations when choosing which language you use than the size of the integer. Simply check your input if you don't know if the value is in bounds, or use exception handling if the case is extremely rare.</p>
10,436
<p>Being vaguely familiar with the Java world I was googling for a static analysis tool that would also was intelligent enough to fix the issues it finds. I ran at CodePro tool but, again, I'm new to the Java community and don't know the vendors. </p> <p>What tool can you recommend based on the criteria above?</p>
<ul> <li><a href="http://findbugs.sourceforge.net/" rel="noreferrer">Findbugs</a></li> <li><a href="http://pmd.sourceforge.net" rel="noreferrer">PMD</a></li> <li><a href="http://checkstyle.sourceforge.net" rel="noreferrer">Checkstyle</a></li> <li><a href="http://www.jutils.com" rel="noreferrer">Lint4J</a></li> <li><a h...
<p>All the above are great tools. PMD is probably the most common. </p> <p>Another tool is <a href="http://www.enerjy.com/" rel="nofollow noreferrer">Enerjy</a>. It recently became free, so you can download it and try for yourself. Enerjy is somewhat more organized and a better fit to larger teams. It makes it easier ...
12,312
<p>From what I understand, the parent attribute of a db.Model (typically defined/passed in the constructor call) allows you to define hierarchies in your data models. As a result, this increases the size of the entity group. However, it's not very clear to me why we would want to do that. Is this strictly for ACID comp...
<p>There are several differences:</p> <ul> <li>All entities with the same ancestor are in the same entity group. Transactions can only affect entities inside a single entity group.</li> <li>All writes to a single entity group are serialized, so throughput is limited.</li> <li>The parent entity is set on creation and i...
<p>The only purpose of entity groups (defined by the parent attribute) is to enable transactions among different entities. If you don't need the transactions, don't use the entity group relationships.</p> <p>I suggest you re-reading the <a href="http://code.google.com/appengine/docs/datastore/keysandentitygroups.html"...
26,495
<p>I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. If I use:</p> <pre><code>printf("%1.3f", 359.01335); printf("%1.3f", 359.00999); </code></pre> <p>I get</p> <pre><...
<p>This can't be done with the normal <code>printf</code> format specifiers. The closest you could get would be:</p> <pre><code>printf("%.6g", 359.013); // 359.013 printf("%.6g", 359.01); // 359.01 </code></pre> <p>but the ".6" is the <em>total</em> numeric width so</p> <pre><code>printf("%.6g", 3.01357); // 3.013...
<p>Your code rounds to three decimal places due to the ".3" before the f</p> <pre><code>printf("%1.3f", 359.01335); printf("%1.3f", 359.00999); </code></pre> <p>Thus if you the second line rounded to two decimal places, you should change it to this:</p> <pre><code>printf("%1.3f", 359.01335); printf("%1.2f", 359.0099...
35,056
<p>I'm playing around with the <a href="http://developer.mozilla.org/en/HTML/Canvas" rel="noreferrer"><code>&lt;canvas&gt;</code></a> element, drawing lines and such.</p> <p>I've noticed that my diagonal lines are antialiased. I'd prefer the jaggy look for what I'm doing - is there any way of turning this feature off?...
<p>For images there's now <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-imagesmoothingenabled" rel="noreferrer"><code>context.imageSmoothingEnabled</code></a><code>= false</code>.</p> <p>However, there's nothing that explicitly controls line drawing. You ma...
<p><strong>Just two notes on StashOfCode's answer:</strong></p> <ol> <li>It only works for a grayscale, opaque canvas (fillRect with white then draw with black, or viceversa)</li> <li>It may fail when lines are thin (~1px line width)</li> </ol> <p><strong>It's better to do this instead:</strong></p> <p>Stroke and fi...
23,716
<p>I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in &lt;span style="background-color:yellow"&gt;highlighted text&lt;/span&gt;). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to wor...
<p>This answer is probably a few years too late for you, but I faced a similar problem and wanted to document it here, since it is the first hit on google.</p> <p>To reiterate, the <strong>problem</strong> is that you would like to just capture the Range object from the User Selection and surround it with a styled div...
<p>since HTML use <code>&lt;mark&gt;</code> element as highlighted text, maybe it's easy to use this node, instead of using your own css, much more clean code:</p> <pre><code>function highlightRange(range) { var newNode = document.createElement('mark'); range.surroundContents(newNode); } // original select range ...
39,192
<p>I've got two tables that need to be joined via LINQ, but they live in different databases. Right now I'm returning the results of one table, then looping through and retrieving the results of the other, which as you can guess isn't terribly efficient. Is there any way to get them into a single LINQ statement? Is the...
<p>You <em>can</em> do this, even across servers, as long as you can access one database from the other. That is, if it's possible to write a SQL statement against <em>ServerA</em>.<em>DatabaseA</em> that accesses <em>ServerB</em>.<em>DatabaseB</em>.<em>schema</em>.<em>TableWhatever</em>, then you can do the same thin...
<p>Given your conditions, I don't think you can do this in one Linq statement. But you can join the results of your L2S queries into a Linq to Objects query.</p>
45,967
<p>I'm thinking about learning CAS, but I need to quickly grasp basic architecture, performance implications and if it at all suits my needs. What should I read?</p>
<p>MSDN itself provides the info <a href="http://msdn.microsoft.com/en-us/library/930b76w0(VS.71).aspx" rel="nofollow noreferrer">here</a>.</p> <p>You also can refer to <a href="http://msdn.microsoft.com/en-us/library/aa302424.aspx" rel="nofollow noreferrer">patterns and practices</a> advocated by Microsoft.</p>
<p>There is one very important thing to remember with CAS: a lot of code (too much code) runs at full trust. And with full trust, most of CAS is silently ignored.</p>
31,531
<p>I have to override Add method of "Controls" property of myControl that is extended from a Panel control of windows. For that i extended ControlCollection class into MyControlCollection where i overriden its Add method. Now i declared a Controls property of MyControlCollection type to hide panel's Controls property. ...
<p>You may instead override the CreateControlCollection function, and return an instance of the class of your choice, which inherits System.Web.UI.ControlCollection. Remove the Controls property from your class, you should not need to override or hide original implementation.</p>
<p>Actually i have to restrict adding controls in my control if some flags are true. I used that ControlAdded event but it added problems only. ControlAdded fires only after adding the that control in parent at location 0, 0. After raising that event it relocates the control according to mouse position at droping time....
28,890
<p>I have given a location defined by latitude and longitude. Now i want to calculate a bounding box within e.g. 10 kilometers of that point.</p> <p>The bounding box should be defined as latmin, lngmin and latmax, lngmax.</p> <p>I need this stuff in order to use the <a href="http://www.panoramio.com/api/" rel="norefe...
<p>I suggest to approximate locally the Earth surface as a sphere with radius given by the WGS84 ellipsoid at the given latitude. I suspect that the exact computation of latMin and latMax would require elliptic functions and would not yield an appreciable increase in accuracy (WGS84 is itself an approximation).</p> <p...
<p>It is very simple just go to panoramio website and then open World Map from panoramio website.Then go to specified location whichs latitude and longitude required.</p> <p>Then you found latitude and longitude in address bar for example in this address.</p> <p><a href="http://www.panoramio.com/map#lt=32.739485&amp;...
29,466
<p>In Java, is there a programmatic way to find out how many concurrent threads are supported by a CPU?</p> <p><strong>Update</strong></p> <p>To clarify, I'm not trying to hammer the CPU with threads and I am aware of Runtime.getRuntime().availableProcessors() function, which provides me part of the information I'm l...
<p>Runtime.availableProcessors returns the number of logical processors (i.e. hardware threads) not physical cores. See <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5048379" rel="noreferrer">CR 5048379</a>.</p>
<p>This is a function of the VM, not the CPU. It has to do with the amount of heap consumed per thread. When you run out of space on the heap, you're done. As with other posters, I suspect your app becomes unusable before this point if you exceed the heap space because of thread count.</p> <p>See this <a href="http...
26,454
<p>Why do you think Microsoft wants us to go through IEnumerable to get to IEnumerator? Isn't the presence or absence of a valid cast to IEnumerator for a given type enough to determine if the type is enumerable or not?</p> <p>For example whats wrong with the following?</p> <pre><code>class MyClass : IEnumerator { ...
<p>You might have two threads enumerating - each needs its own enumerator.</p> <p>IEnumerable.GetEnumerator returns an enumerator that is initially positioned before the first element of the collection. If you only had IEnumerator, you'd have to remember to reset yourself before using it, even in a single-threaded sc...
<p>It is a matter of seperating responsibilities, IEnumerable is a class that can be iterated over IEnumerator is a class that does the iteration.</p>
42,640
<p>I like having my warning level set at W4 but all new projects start at W3. Is there some way to change the default value for warning levels for new projects?</p>
<p>I don't know how to do it at the IDE but you cand always edit the new project templates at:</p> <pre><code>%PROGRAM_FILES%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\ </code></pre> <p>If you're using the express version there could be a minor variation in the path:</p> <pre><code>%PROGRAM_FILES%\Mic...
<p>I couldn't find any project templates or anything on my machine so I just searched in all the files for WarningLevel. I found common.js at</p> <pre><code>%\Microsoft Visual Studio 9.0\VC\VCWizards\1033 </code></pre> <p>Searching in the file showed WarningLevel appeared in three places, lines 672, 699 and 3354. I...
20,451
<p>What can I do to increase the performance/speed of my PHP scripts without installing software on my servers?</p>
<p>Profile. Profile. Profile. I'm not sure if there is anything out there for PHP, but it should be simple to write a little tool to insert profiling information in your code. You will want to profile function times and SQL query times.</p> <p>So where you have a function:</p> <pre><code>function foo($stuff) { .....
<p>Whenever I look at performance problems, I think the best thing to do is time how long your pages take to run, and then look at the slowest ones. When you get these real metrics, you can often improve performance on the slowest ones by orders of magnitude, either by fixing a slow SQL query or perhaps tightening up ...
3,360
<p>In eclipse, I have a javaproject (not a web project), though it does provide reusable tag files.</p> <p>layout</p> <p>+src<br> +++META-INF<br> ----my.tld<br> +++++++++++tags<br> ---------------include.jsp<br></p> <p>I keep on getting Fragment "/META-INF/tags/include.jsp" was not be found at expected path /Project...
<p>Josh, if you're working with .jsp and .tld files, then you really shouldn't be doing this as a "Java Project", but instead a "Dynamic Web Project" in Eclipse. Nonetheless, I'll try to answer your question.</p> <p>Based on the diagram of your file system, your files are laid out incorrectly. If you're trying to cr...
<p>Maybe the path of the jsp page is incorrect!You can check it using ctrl+left click,if can't open the jsp file,I suggest you check the path.</p>
33,021
<p>I am trying to use the following code to write data into an excel file</p> <pre><code> Dim objexcel As Excel.Application Dim wbexcel As Excel.Workbook Dim wbExists As Boolean Set objexcel = CreateObject("excel.Application") obje...
<p>You will need to change this line:</p> <pre><code> Set wbexcel = objexcel.WorkBooks.Open( _ "C:\Documents and Settings\TAYYAPP\Desktop\test folder\ERROR REPORT2.xls") </code></pre> <p>Note WorkBooks, not Documents </p> <p>As For this line Set wbexcel = objexcel.Workbook.Add, wbexcel is defined as a ...
<p>I have got this code which works fine</p> <pre><code>Dim objexcel As Excel.Application Dim wbexcel As Excel.Workbook Dim wbExists As Boolean Dim objSht As Excel.Worksheet Dim objRange As Excel.Range Set objex...
35,505
<p>Anybody have a good example how to deep clone a WPF object, preserving databindings?</p> <hr> <p>The marked answer is the first part.</p> <p>The second part is that you have to create an ExpressionConverter and inject it into the serialization process. Details for this are here:<br> <a href="http://www.codeproje...
<p>The simplest way that I've done it is to use a XamlWriter to save the WPF object as a string. The Save method will serialize the object and all of its children in the logical tree. Now you can create a new object and load it with a XamlReader.</p> <p>ex: Write the object to xaml (let's say the object was a Grid con...
<p>How about:</p> <pre><code> public static T DeepClone&lt;T&gt;(T from) { using (MemoryStream s = new MemoryStream()) { BinaryFormatter f = new BinaryFormatter(); f.Serialize(s, from); s.Position = 0; object clone = f.Deserialize(s); ...
5,250
<p>Why is it called a single in VB.net? I'm sure there is a good reason but it doesn't seem intuitive to a non formally trained programmer like me.</p>
<p>BPAndrew's question seems to be really "why float in C# and Single in VB.NET", which noone actually answered, so here's my 2p...</p> <p>The use of "float" in C# seems to be a throwback to its C/C++ heritage. "float" still maps to the System.Single type in C#, so the keyword just exists for convenience. You could ju...
<p>The technical name is a 'single precision floating point', 'single' because it takes a single word in memory (32 bits). A double, meanwhile, takes 64 bits on most architectures.</p>
34,234
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/311054/how-do-i-select-last-5-rows-in-a-table-without-sorting">How do I select last 5 rows in a table without sorting?</a> </p> </blockquote> <p>I want to select the top 10 records from a table in SQL Server wi...
<p>if random order is needed, you can try</p> <pre><code>select top 10 * from [tablename] order by newid() </code></pre>
<p>SELECT TOP 10 &lt;requiredfieldListHere> FROM &lt;TheTableNameHere></p> <p>If you have clustered index this will return the first 10 records in the table. Note however that this would be bad form. A relational table should not be considered as having any particular order. If you don't have a clustered index, i...
40,077
<p>I've seen it used a couple places:</p> <ul> <li><a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/" rel="nofollow noreferrer">http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/</a></li> <li><a href="http://developer.yahoo.com/flash/astra-flash/classreference/" rel="nofollow noreferrer">http...
<p>Take a look at <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html" rel="nofollow noreferrer">asdoc</a>. It's what the documentation is automatically generated with.</p>
<p>Take a look at <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html" rel="nofollow noreferrer">asdoc</a>. It's what the documentation is automatically generated with.</p>
47,579
<p>What is a proxy object in the Inversion of Control / Aspect-Oriented sense?</p> <p>Any good articles on what a proxy object is ?<br> Why you would want to use one ?<br> And how to write one in C# ? </p>
<p>In general, a Proxy object is an object (instance of a class) that exposes the exact same public interface as a "real class" but simply forwards all calls made to it's members to the other real class. Proxy objects are used for a variety of reasons... </p> <p>One purpose is to "pretend" to be the real class so a c...
<p>A very good resource about this is the old "Gang of Four" design patterns book. This book is very usefull for anyone developing object-oriented software. I'm personally using proxy objects for lazy loading with NHibernate. I don't use proxies with inversion of control because I resolve interfaced types only with my...
36,575
<p>I am very close to buying a 3D printer and have started to do some preliminary design work from the things I'd like to make, but I have a question: Which corner of the print bed corresponds to the origin (0,0,0) in slicer software? Is this the same across slicers and printers?</p> <p>The reason I ask this is becaus...
<p>Depending on what kind of printer you have, the build table origin and slicer origin (0,0) are usually either the front left corner, or the center of the build plate. This can be changed by the end-user in most open-source printers. There is no standard or requirement for a particular origin location. The important ...
<p>Normally the home position of the printer is the front left corner of the bed. The slicing software will ask you where this is so you can than position your object anywhere on the bed. The slicing software will make all the necessary adjustments for you. You normally would print the object in the middle of the bed,...
279
<p>I'm aware there is an AssociationChanged event, however, this event fires after the association is made. There is no AssociationChanging event. So, if I want to throw an exception for some validation reason, how do I do this and get back to my original value? </p> <p>Also, I would like to default values for my en...
<p>This is in reply to a comment I left. Hopefully this answers your question, Shimmy. Just comment, and I will shorten it or remove it if it doesn't answer your question.</p> <p>You will need both INotifyPropertyChanging and INotifyPropertyChanged interfaces to be implemented on your class (unless it is something l...
<p>Concerning your first question, I would simply implement the changes to the associations as business logic. For example, if you add a Teacher class with multiple Student, do not add students like</p> <pre><code>aTeacher.Students.Add(new Student) </code></pre> <p>instead, create a AddStudent method</p> <pre><code>...
38,909
<p>What is and how can it be used in C#.<br/> Can you use the same concept in Python/Perl?</p>
<p>A <a href="http://msdn.microsoft.com/en-us/library/wa80x488.aspx" rel="noreferrer">partial type</a> (it doesn't have to be a class; structs and interfaces can be partial too) is basically a single type which has its code spread across multiple files.</p> <p>The main use for this is to allow a code generator (e.g. a...
<p>A Partial type is a type whose declaration is separated across multiple files. It makes sense to use them if you have a big class, which is hard to handle and read for a typical developer, to separate that class definition in separate files and to put in each file a logically separated section of code (for instance ...
37,796
<p>What are your experiences with running SQL server in a virtual pc? Currently we have an sql2008 instance running in a virtual machine. Both CPU's hit the roof the moment a query is executed.</p> <p>what are your experiences and what do you suggest in this matter?</p>
<p>I've had some serious performance issues using virtualised SQL servers for database heavy applications (ETL development). See <a href="https://stackoverflow.com/questions/149318/virtualized-sql-server-why-not#149381">this Stackoverflow post</a> for a run-down on my experiences and the outcomes of digging into the u...
<p>Are you using VMWare? If so apply service packs from back in September and since.</p> <p>Otherwise you can limit the resources that 2008 uses if you have no limited of a machine.</p>
48,034
<p>I have an Interbase DB. How can I convert it to SQL Server?</p>
<p>You could use SQL Server built in <strong>Data Transformation Services (DTS)</strong> in SQL Server 2000 or <strong>SQL Server Integration Services (SSIS)</strong> in SQL Server 2005.</p> <p>Try setting up an <strong>ODBC DSN</strong> for Interbase. Then in DTS / SSIS use the Other (ODBC Data Source) and the DSN.<...
<p>The Interbase DB Wikipedia page says that it supports OBDC and ADO.NET, so I would think that SQL Server can probably import this database on its own. I don't have access to an Interbase DB installation to try, but you might find these pages helpful.</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms141209...
13,647
<p>There's lots of information about how cached execution plans in SQL Server eliminate much if not most of the performance advantage of stored procedures over dynamic sql. However, I have not found much about whether the same is true for Oracle databases. Does anyone have information or pointers to information about d...
<p>Oracle also has a cached execution facility. The Query is hashed and matched to a plan if it hits on the hash table. You can also use this mechanism to force a plan for a particular query. As with SQL Server, you need to use a parameterised query to do this, rather than substituting the values into the string - a...
<p>There is something called client side statement caching: <a href="http://www.oracle.com/technology/oramag/oracle/06-jul/o46odp.html" rel="nofollow noreferrer">http://www.oracle.com/technology/oramag/oracle/06-jul/o46odp.html</a></p> <p>Be aware, client side result caching and client side statement caching are diffe...
48,684
<p>I wanna stop the reading of my text input file when the word "synonyms" appears. I'm using ifstream and I don't know how to break the loop. I tried using a stringstream "synonyms" but it ended up junking my bst. I included the complete project files below in case you wanna avoid typing. </p> <p>Important part:</p>...
<p>You can do it like</p> <pre><code>/* here, it stops when reading "synonyms" or when failing to extract a word. */ while(inStream &gt;&gt; word &amp;&amp; word != "synonym") { wordTree.insert(word); } wordTree.graph(cout); </code></pre> <p>Note that when it fails to read a sequence of non-whitespace characters,...
<p>@SoapBox:</p> <p>I created this == operator:</p> <pre><code> //--- equals operator for String bool operator==(const string &amp; aString) const { return word == aString; } // word is the WordInfo string field for 'real' word </code></pre> <p>And changed the for(;;) to:</p> <pre><code>for(;;) ...
48,358
<p>Can someone tell me what the statuses mean in SQL Server's sp_who command? Why might a spid be suspended? What does it mean to be "runnable"?</p> <p>Thanks!</p>
<p>Pretty easy to find answer online. <a href="https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-who-transact-sql" rel="nofollow noreferrer">Link</a></p> <p><strong>dormant.</strong> SQL Server is resetting the session.</p> <p><strong>running.</strong> The session is running one or ...
<p>I believe that part of the confusion on this is that there are statuses outside of the list shown above that are seen. Three that come to mind are</p> <ul> <li>Sleeping </li> <li>Awaiting Command</li> <li>Other</li> </ul>
25,289
<p>I was thinking about <a href="https://lifehacks.stackexchange.com/questions/24627/how-to-paint-a-circle-pattern-on-a-big-piece-of-paper">this question</a> and thought of maybe printing a pattern-drawing roller painter.</p> <p>The question is: is it possible to print with an ink absorbing material that could make a p...
<p>While printing a <em>roller stamp</em> or rubber-roll from a flexible material such as <a href="https://all3dp.com/2/tpe-vs-tpu-flexible-filament-the-differences/" rel="nofollow noreferrer">[hard]TPU, [softer] TPE</a>, or even a [super soft] foaming flexible filament is certainly possible. In any case, this would cr...
<p>I'm relatively new to 3D printing, but I know some stuff. If you really wanted to print a paint roller with a pattern, I would actually go with nylon or TPR. TPE is okay, but I find that it is less cushy. I would highly suggest buying your own printer for this project. It would be much more cost effective in not onl...
1,907
<p>I can print with <code>printf</code> as a hex or octal number. Is there a format tag to print as binary, or arbitrary base?</p> <p>I am running gcc.</p> <pre><code>printf(&quot;%d %x %o\n&quot;, 10, 10, 10); //prints &quot;10 A 12\n&quot; print(&quot;%b\n&quot;, 10); // prints &quot;%b\n&quot; </code></pre>
<p>Hacky but works for me:</p> <pre><code>#define BYTE_TO_BINARY_PATTERN "%c%c%c%c%c%c%c%c" #define BYTE_TO_BINARY(byte) \ (byte &amp; 0x80 ? '1' : '0'), \ (byte &amp; 0x40 ? '1' : '0'), \ (byte &amp; 0x20 ? '1' : '0'), \ (byte &amp; 0x10 ? '1' : '0'), \ (byte &amp; 0x08 ? '1' : '0'), \ (byte &amp; 0x04 ?...
<p>Even for the runtime libraries that DO support %b it seems it's only for integer values.</p> <p>If you want to print floating-point values in binary, I wrote some code you can find at <a href="http://www.exploringbinary.com/converting-floating-point-numbers-to-binary-strings-in-c/" rel="nofollow noreferrer">http://...
13,710
<p>Are there any good tools out there for automatically converting non-Java source code into Java source?</p> <p>I'm not expecting something perfect, just to get the worst of the grunt work out of the way.</p> <p>I guess there is a sliding scale of difficulty. C# should be relatively easy (so long as you ignore all t...
<p>One thing you can try is find a Java bytecode compiler for the language you're talking about (there are JVM compilers for all kinds of languages) and then decompile the bytecode back into Java using a decompiler like Jad. </p> <p>This is fraught with peril. The regenerated code will suck and will probably be unre...
<p>ADA to Java can be done with a find-and-replace!</p>
6,893
<p>What is the fastest way of transferring few thousand rows of data from one DataTable to another? Would be great to see some sample code snippets.</p> <p>Edit: I need to explain a bit more. There is a filtering condition for copying the rows. So, a plain Copy() will not work.</p>
<p>You can't copy the whole table, you need to copy one rows. From <a href="http://support.microsoft.com/kb/308909" rel="noreferrer">http://support.microsoft.com/kb/308909</a> (sample code if you follow the link)</p> <p>"How to Copy DataRows Between DataTables Before you use the ImportRow method, you must ensure that...
<p>What is wrong with <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.copy.aspx" rel="nofollow noreferrer">DataTable.Copy</a>?</p>
9,347
<p>I'm building a Lifestreaming app that will involve pulling down lots of feeds for lots of users, and performing data-mining, and machine learning algorithms on the results. GAE's load balanced and scalable hosting sounds like a good fit for a system that could eventually be moving around a LOT of data, but it's lack...
<p>While I can not answer your question directly, my experience of building <a href="https://github.com/juvenn/microupdater" rel="nofollow noreferrer">Microupdater</a> (a news aggregator collecting a few hundred feeds on AppEngine) may give you a little insight.</p> <ul> <li><p>Fetching feeds. Fetching lots of feeds b...
<p>No. If you need to pull lots of things down, App Engine isn't going to work so well. You can use it as a front end by putting your data in their store after doing your offline preprocessing, but you can't do much in the ~1 second time you have per request without doing some <i>really</i> crazy things.</p> <p>Your a...
16,372
<p>Are <strong>CDATA</strong> tags ever necessary in script tags and if so when?</p> <p>In other words, when and where is this:</p> <pre><code>&lt;script type="text/javascript"&gt; //&lt;![CDATA[ ...code... //]]&gt; &lt;/script&gt; </code></pre> <p>preferable to this:</p> <pre><code>&lt;script type="text/javascript...
<p>A CDATA section is required if you need your document to parse as XML (e.g. when an XHTML page is interpreted as XML) <em>and you want to be able to write literal <code>i&lt;10</code> and <code>a &amp;&amp; b</code> instead of <code>i&amp;lt;10</code> and <code>a &amp;amp;&amp;amp; b</code></em>, as XHTML will parse...
<p><a href="http://javascript.about.com/library/blxhtml.htm" rel="nofollow noreferrer">When you want it to validate</a> (in XML/XHTML - thanks, <a href="https://stackoverflow.com/users/6436/loren-segal">Loren Segal</a>).</p>
9,238
<p>I am trying to convince those who set standards at my current organization that we should use jQuery rather than Prototype and/or YUI. What are some convincing advantages I can use to convince them?</p>
<p>The 3 main advantages of jQuery are:</p> <ul> <li>its light weight when compared to other javascript frameworks</li> <li>it has a wide range of <a href="http://plugins.jquery.com/" rel="nofollow noreferrer">plugins</a> available for various specific needs</li> <li>it is easier for a designer to learn jQuery as it u...
<p>Why don't you create a quick comparison? </p> <p>Take a task like "find all divs or tables which contain images of class foo and attach a click event to each of them which makes them expand 50%." Or something more relevant to what you're doing.</p> <p>Then code that with jQuery, Prototype, etc, and compare. Which ...
9,262
<p>I'm using the mockrunner package from <a href="http://mockrunner.sourceforge.net/" rel="noreferrer">http://mockrunner.sourceforge.net/</a> to set up a mock queue for JUnit testing an XML filter which operates like this:</p> <ol> <li>sets recognized properties for an ftp server to put and get xml input and a jms que...
<p>I'd recommend having a look at using <a href="http://activemq.apache.org/camel/" rel="nofollow noreferrer">Apache Camel</a> to create your test case. Then its really easy to switch your test case from any of the <a href="http://activemq.apache.org/camel/components.html" rel="nofollow noreferrer">available components...
<p>I'd recommend having a look at using <a href="http://activemq.apache.org/camel/" rel="nofollow noreferrer">Apache Camel</a> to create your test case. Then its really easy to switch your test case from any of the <a href="http://activemq.apache.org/camel/components.html" rel="nofollow noreferrer">available components...
19,126
<p>Is there a way to sniff SQL queries sent to a SQL Server db on any level (above transport level)? Perhaps there's some kind of a tracer in ASP.NET or built-in log in SQL Server ? </p>
<p>SQL Server Profiler perhaps? This will pick up what queries are executed. You can also get statistics, query plans and many other items of interest from this.</p>
<p>The tool your looking for is <a href="http://msdn.microsoft.com/en-us/library/ms181091.aspx" rel="nofollow noreferrer">SQL Server Profiler</a>, learn to use it and to love it.</p> <p>Try starting with a filter on ApplicationName and/or HostName for your IIS server running your ASP.NET application. Profiler can get ...
45,477
<p>Suppose we have:</p> <pre><code>interface Foo { bool Func(int x); } class Bar: Foo { bool Func(int x) { return (x&gt;0); } } class Baz: Foo { bool Func(int x) { return (x&lt;0); } } </code></pre> <p>Now we can toss around Bar and Baz as a Foos and call their Func methods.</p> <p>Delegate...
<p>There is a slight difference, delegates can access the member variables of classes in which, they are defined. In C# (unlike Java) all inner class are consider to be static. Therefore if you are using an interface to manage a callback, e.g. an ActionListener for a button. The implementing inner class needs to be ...
<p>A delegate is a typed method pointer. This gives you more flexibility than interfaces because you can take advantage of covariance and contravariance, and you can modify object state (you'd have to pass the this pointer around with interface based functors).</p> <p>Also, delegates have lots of nice syntactic sugar ...
12,151
<p>I'm working on an application for work that is going to query our employee database. The end users want the ability to search based on the standard name/department criteria, but they also want the flexibility to query for all people with the first name of "James" that works in the Health Department. The one thing I ...
<p>While the <code>COALESCE</code> trick is neat, my preferred method is:</p> <pre><code>CREATE PROCEDURE ps_Customers_SELECT_NameCityCountry @Cus_Name varchar(30) = NULL ,@Cus_City varchar(30) = NULL ,@Cus_Country varchar(30) = NULL ,@Dept_ID int = NULL ,@Dept_ID_partial varchar(10) = NULL AS SELE...
<p>My first thought was to write a query something like this...</p> <pre><code>SELECT EmpId, NameLast, NameMiddle, NameFirst, DepartmentName FROM dbo.Employee INNER JOIN dbo.Department ON dbo.Employee.DeptId = dbo.Department.Id WHERE IdCrq IS NOT NULL AND ( @bitSearchFirstName = 0 ...
25,178
<p>short:</p> <p>Is there a way in Ruby to DRY-ify this:</p> <pre><code>def entry_point_one begin do_something rescue MySyntaxErrorOne, MySyntaxErrorTwo, MySyntaxErrorEtc =&gt; syn_err raise syn_err.exception(syn_err.message) end end def entry_point_two begin do_something_else rescue MySyntaxEr...
<p>while thinking about it a bit more, I came up with this:</p> <pre><code>interpreter_block {do_something} def interpreter_block yield rescue ExceptionOne, ExceptionTwo, ExceptionEtc =&gt; exc raise exc.exception(exc.message) end </code></pre> <p>Although it's still not quiet what I would like to have, at least...
<p>If you have all of the information you need in the exceptions, and you do not need the backtrace at all, you can just define your own error and raise that, instead of reraising the existing exception. This will give it a fresh backtrace. (Of course, presumably your sample code is incomplete and there is other proc...
16,515
<p><a href="http://php.net/Interfaces" rel="noreferrer">Interfaces</a> allow you to create code which defines the methods of classes that implement it. You cannot however add any code to those methods. </p> <p><a href="http://php.net/Abstract" rel="noreferrer">Abstract classes</a> allow you to do the same thing, along...
<p>The entire point of interfaces is to give you the flexibility to have your class be forced to implement multiple interfaces, but still not allow multiple inheritance. The issues with inheriting from multiple classes are many and varied and the <a href="http://en.wikipedia.org/wiki/Multiple_inheritance" rel="norefer...
<p>Below are the points for PHP Interface </p> <ol> <li>It is used to define required no of methods in class [if you want to load html then id and name is required so in this case interface include setID and setName].</li> <li>Interface strictly force class to include all the methods define in it. </li> <li>You can on...
4,082
<p>I'm auditing a project that uses what is called a <a href="http://en.wikipedia.org/wiki/Business_rules_engine" rel="noreferrer">Rules Engine</a>. In short, it's a way to externalize business logic from application code. </p> <p>This concept is entirely new to me and I'm pretty skeptical about it. After hearing peop...
<p>Most rule engines that I have seen are viewed as a black box by system code. If I were to build a domain model, I would probably want certain business rules to be intrinsic to the domain model, e.g. business rules that tell me when an object has invalid values. This allows multiple systems to share the domain model ...
<p>The biggest complexity from my experience in Rule Engines is that:</p> <ol> <li>from OOP POV it's a real pain to refactor and test rules written in a declarative language while you are refactoring code that affects them.</li> <li>Often we should always think about the execution order of rules which turns into a mes...
31,153
<p>I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both the start and end line numbers of the data that I want.</p> <p>Does anyone know a Unix command (or series of comman...
<pre><code>sed -n '16224,16482p;16483q' filename &gt; newfile </code></pre> <p>From the <a href="https://www.gnu.org/software/sed/manual/sed.html#Common-Commands" rel="noreferrer">sed manual</a>:</p> <blockquote> <p><strong>p</strong> - Print out the pattern space (to the standard output). This command is us...
<p>The -n in the accept answers work. Here's another way in case you're inclined.</p> <pre><code>cat $filename | sed "${linenum}p;d"; </code></pre> <p>This does the following:</p> <ol> <li>pipe in the contents of a file (or feed in the text however you want).</li> <li>sed selects the given line, prints it</li> <li>d...
10,903
<p>How can I Handler 404 errors without the framework throwing an Exception 500 error code?</p>
<p><a href="http://jason.whitehorn.ws/2008/06/17/Friendly-404-Errors-In-ASPNET-MVC.aspx" rel="noreferrer">http://jason.whitehorn.ws/2008/06/17/Friendly-404-Errors-In-ASPNET-MVC.aspx</a> gives the following explanation:</p> <p>Add a wildcard routing rule as your final rule:</p> <pre><code>routes.MapRoute("Error", ...
<p>With MVC 3 you can return HttpNotFound() to properly return a 404.</p> <p>Like this:</p> <pre><code>public ActionResult Download(string fontName) { FontCache.InitalizeFonts(); fontName = HttpUtility.UrlDecode(fontName); var font = FontCache.GetFontByName(fontName); if (font == null) retur...
13,412
<p>This is more an observation than a real question: MS-Access (and VBA in general) is desperately missing a tool where error handling code can be generated automatically, and where the line number can be displayed when an error occurs. Did you find a solution? What is it? I just realized how many hundreds of hours I s...
<p>My solution is the following:</p> <ol> <li>install <a href="http://www.mztools.com" rel="nofollow noreferrer">MZ-Tools</a>, a very interesting add-on for VBA. No they did not pay me to write this. Version 3 was free, but since version 8.0, the add-in is commercially sold.</li> <li>program a standard error handler c...
<p>Love it Vlado!</p> <p>I realize this is an old post, but I grabbed it and gave it a try, but I ran into a number of issues with it, which I managed to fix. Here's the code with fixes:</p> <p>First of course, be sure to add the &quot;Microsoft Visual Basic for Applications Extensibility 5.3&quot; library to your proj...
46,661
<p>The <a href="http://msdn.microsoft.com/en-us/library/ms724284(VS.85).aspx" rel="nofollow noreferrer"><code>FILETIME</code> structure</a> counts from January 1 1601 (presumably the start of that day) according to the Microsoft documentation, but does this include leap seconds?</p>
<p>The question shouldn't be if <code>FILETIME</code> includes leap seconds. </p> <p>It should be:</p> <blockquote> <p>Do the people, functions, and libraries, who interpret a <code>FILETIME</code> (i.e. <code>FileTimeToSystemTime</code>) include leap seconds when counting the duration?</p> </blockquote> <p>The si...
<p>A very crude summary:</p> <p>UTC = (Atomic Time) + (Leap Seconds) ~~ (Mean Solar Time)</p> <p>The MS documentation says, specifically, "UTC", and so should include the leap seconds. As always with MS, your mileage may vary.</p>
15,855
<p>I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway.</p> <p>What would you, as a member of a user community, look for in order to keep you coming back month to month?</p>
<p>It's true that some of the talks out there are very rudimentary, unfortunately some times the bulk of your crowd may need that. I consider myself a novice in a lot of fields, but I've attend talks that I thought were beneath me and still people were asking very basic questions. Perhaps it would be worth having a b...
<p>If there isn't beer, its not a good enough user group to attend. The open source guys get this. Their user group meetings are funner, and more dynamic because of this. Just make it BYOB and it'll naturally get better in my experience.</p>
3,128
<p>I'm after (short) opinions on FCKeditor vs TinyMCE and whether either or both are XHTML compliant.</p> <p>In the interest of keeping with the spirit of stackoverflow, if someone has already made your point, just upvote them.</p>
<p>From my experience FCKEditor does indeed produce XHTML compliant code, but that code is slightly different depending on what browser you're in. Mostly, this was related to the enter key producing either a break or a paragraph, and I think it may have been configurable.</p>
<p>Afaik, they both allow the browser to mess with the code they produce, which doesn't result in XHTML compliance.</p> <p><a href="http://xstandard.com/" rel="nofollow noreferrer">XStandard</a> is the only rich web editor I'm aware of that produces XHTML compliant code, but unfortunately it requires a client-side ins...
20,517
<p>When using Mercurial I sometimes find that it is hard to understand the relationship between changesets when there are thousands of changesets, and sometimes ten or more active branches at any one time. Currently, I use <a href="http://www.logilab.org/project/hgview/screenshots?selected=4873" rel="noreferrer">hgvie...
<p>the <code>gitk(1)</code> tool for git is what I use at work. Note that it takes a <code>git rev-list</code> constraint so you can limit what you see. You definitely want to begin doing such selective picking in the long run when the amount of commits go up.</p>
<p>I use ClearCase VCS at work and its Version Tree browser could presumably suit you. But, alas, I don't know any separate ready-made tool for this. </p>
20,765