input
stringlengths
51
42.3k
output
stringlengths
18
55k
Can you have more than one ASP.NET State Server Service in a cluster? <p>We have a 4 server cluster running ASP.NET web application using ASP.NET State Server Service for session. On one of the 4 servers ASP.NET State Server Service is running and other servers are configured to look at this. Very often we have to patc...
<p>I'd look into Session State Partitioning. Good info here: <a href="http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Balancing.aspx" rel="nofollow">http://blog.maartenballiauw.be/post/2008/01/ASPNET-Session-State-Partitioning-using-State-Server-Load-Balancing.aspx<...
How to fix an MFC Painting Glitch? <p>I'm trying to implement some drag and drop functionality for a material system being developed at my work. Part of this system includes a 'Material Library' which acts as a repository, divided into groups, of saved materials on the user's hard drive.</p> <p>As part of some UI poli...
<p>Remote debugging is a godsend for debugging visual issues. It's a pain to set up, but having a VM ready for remote debugging will pay off for sure.</p> <p>What I like to do is set a ton of breakpoints in my paint handling, as well as in the framework paint code itself. This allows you to effectively "freeze frame" ...
Random in python 2.5 not working? <p>I am trying to use the <code>import random</code> statement in python, but it doesn't appear to have any methods in it to use.</p> <p>Am I missing something?</p>
<p>You probably have a file named random.py or random.pyc in your working directory. That's shadowing the built-in random module. You need to rename random.py to something like my_random.py and/or remove the random.pyc file.</p> <p>To tell for sure what's going on, do this:</p> <pre><code>&gt;&gt;&gt; import random...
VisualSVN Server wants a username and password <p>I've renamed my server and am trying to get to the VisualSVN Server repository via TortoiseSVN. In <a href="http://stackoverflow.com/questions/69646/svn-and-renaming-the-server-its-running-on">this post</a> Gordon helped me find the right command - thanks Gordon.</p> <...
<p>It depends on how your Visual SVN Server is set up. If you are using native windows authentication, just enter you domain username and password. Otherwise, you will have to log into the machine running Visual SVN Server and reset your password there. Visual SVN Server provides a convenient tool for managing users, p...
CSS : Bad Gray Line to the side of the Navigation Bar on http://perl-begin.org/ <p>I'm maintaining <a href="http://perl-begin.org/" rel="nofollow">the Perl Beginners' Site</a> and used a modified template from Open Source Web Designs. Now, the problem is that I still have an undesired artifact: a gray line on the left ...
<p>It's the <code>background-image</code> on the body showing through. Quick fix (edit style.css or add elsewhere):</p> <pre><code>#page-container { background-color: white; } </code></pre>
Date.getTime() not including time? <p>Can't understand why the following takes place:</p> <pre><code>String date = "06-04-2007 07:05"; SimpleDateFormat fmt = new SimpleDateFormat("MM-dd-yyyy HH:mm"); Date myDate = fmt.parse(date); System.out.println(myDate); //Mon Jun 04 07:05:00 EDT 2007 long timestamp = myDate.ge...
<p>What milliseconds? You are providing only minutes information in the first example, whereas your second example grabs current date from the system with milliseconds, what is it you're looking for?</p> <pre><code>String date = "06-04-2007 07:05:00.999"; SimpleDateFormat fmt = new SimpleDateFormat("MM-dd-yyyy HH:mm:s...
How do I store the window size between sessions in Qt? <p>I have a QMainWindow in a Qt application. When I close it I want it to store its current restore size (the size of the window when it is not maximized). This works well when I close the window in restore mode (that is, not maximized). But if I close the window i...
<p>Use the <a href="http://doc.qt.io/qt-4.8/qwidget.html#saveGeometry" rel="nofollow">QWidget::saveGeometry</a> feature to write the current settings into the registry.(The registry is accessed using QSettings). Then use restoreGeometry() upon startup to return to the previous state.</p>
is there a way for my binary to react to some global hotkeys in linux? <p>Is it possible to listen for a certain hotkey ( e.g:<kbd>Ctrl</kbd><kbd>-</kbd><kbd>I</kbd> ) and then perform a specific action ? My application is written in C , will only run on Linux , and it doesn't have a GUI . Are there any libraries that ...
<p>How global do your hotkeys need to be? Is it enough for them to be global for a X session? In that case you should be able to open an Xlib connection and listen for the events you need.</p> <p>Ordinarily keyboard events in X are delivered to the window that currently has the focus, and propagated up the hierarchy...
Delegating a task in and getting notified when it completes (in C#) <p>Conceptually, I would like to accomplish the following but have had trouble understand how to code it properly in C#:</p> <pre><code> SomeMethod { // Member of AClass{} DoSomething; Start WorkerMethod() from BClass in another thread; Do...
<p>The <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx">BackgroundWorker</a> class was added to .NET 2.0 for this exact purpose.</p> <p>In a nutshell you do:</p> <pre><code>BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { myBClass.DoHardWork();...
How do I add a namespace reference to a SOAP response with Apache Axis2 and WSDL2Java <p>I'm looking at the SOAP output from a web service I'm developing, and I noticed something curious:</p> <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;soapenv:Body&gt; &lt;n...
<h3>Using WSDL2Java</h3> <p>If you have used the Axis2 WSDL2Java tool you're kind of stuck with what it generates for you. However you can try to change the skeleton in this section:</p> <pre><code> // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; env = toEnvelope( ...
How to display a dynamically allocated array in the Visual Studio debugger? <p>If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of th...
<p>Yes, simple. say you have</p> <pre><code>char *a = new char[10]; </code></pre> <p>writing in the debugger:</p> <pre><code>a,10 </code></pre> <p>would show you the content as if it were an array.</p>
How do you quickly find the URL for a Win32 API on MSDN? <p>How do you quickly find the URL for a Win32 API on MSDN? It's easy for .NET methods -- just add the method name (for example, System.Byte.ToString) to <a href="http://msdn.microsoft.com/library/" rel="nofollow">http://msdn.microsoft.com/library/</a>.</p> <p>...
<p>Google might be your best bet. I know the msdn site search has time and again pointed me in the wrong direction, but a quick switch to Google ("GetLongPathName site:msdn.microsoft.com") never steers me wrong.</p>
Open Source Database Plugin For Eclipse? <p>Does anyone know of a good open source plugin for database querying and exploring within Eclipse? </p> <p>The active Database Exploring plugin within Eclipse is really geared around being associated with a Java project. While I am just trying to run ad-hoc queries and explor...
<p>I use SQL Explorer.</p> <p>It comes as an Eclipse plugin or standalone.</p> <p><a href="http://eclipsesql.sourceforge.net/" rel="nofollow">http://eclipsesql.sourceforge.net/</a></p>
XSLT processing in/from ruby <p>Can anyone recommend an efficient method to execute XSLT transforms of XML data within a Ruby application? The XSL gem (REXSL) is not available yet, and while I have seen a project or two that implement it, I'm wary of using them so early on. A friend had recommended a shell out call to ...
<p>Try the "libxslt-ruby" gem. It depends on the "libxmlr-ruby" bindings for libxml library, which you probably already have installed if you're developing on Linux.</p>
NHibernate to not cache a property <p>How can I configure NHibernate to not cache a file?<br> I know I can create a method that does an HSQL, but can I through a configuration setting in the &lt;class>.xml file or the hibernate xml file itself to not cache a property?</p>
<p>You cannot set secondary caching settings at property level (as far as I know), but you can individually tune cache settings for each entity directly in their XML files.</p> <p>For instance:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt; ...
How do I get the name of a python class as a string? <p>What method do I call to get the name of a class?</p>
<pre><code>In [1]: class test(object): ...: pass ...: In [2]: test.__name__ Out[2]: 'test' </code></pre>
Best way to convert pdf files to tiff files <p>I have around 1000 pdf filesand I need to convert them to 300 dpi tiff files. What is the best way to do this? If there is an SDK or something or a tool that can be scripted that would be ideal. </p>
<p>Use Imagemagick, or better yet, Ghostscript.</p> <p><a href="http://www.ibm.com/developerworks/library/l-graf2/#N101C2">http://www.ibm.com/developerworks/library/l-graf2/#N101C2</a> has an example for imagemagick:</p> <pre><code>convert foo.pdf pages-%03d.tiff </code></pre> <p><a href="http://www.asmail.be/msg005...
Best way to do Visual Studio post build deployment in a team environment? <p>I'm working in a team environment where each developer works from their local desktop and deploys to a virtual machine that they own on the network. What I'm trying to do is set up the Visual Studio solution so that when they build the soluti...
<p>i'd look into MSBuild or ANT</p>
JPA Multiple Transaction Managers <p>I have one applicationContext.xml file, and it has two org.springframework.orm.jpa.JpaTransactionManager (each with its own persistence unit, different databases) configured in a Spring middleware custom application. <br><br>I want to use annotation based transactions (@Transactiona...
<p>I guess you have 2 choices</p> <p>If your use-cases never require updates to both databases within the same transaction, then you can use two JpaTransactionManagers, but I'm not sure you will be able to use the @Transactional approach? In this case, you would need to fallback on the older mechanism of using a simpl...
When are you supposed to use escape instead of encodeURI / encodeURIComponent? <p>When encoding a query string to be sent to a web server - when do you use <code>escape()</code> and when do you use <code>encodeURI()</code> or <code>encodeURIComponent()</code>:</p> <p>Use escape:</p> <pre><code>escape("% +&amp;="); </...
<h1>escape()</h1> <p>Don't use it, as it has been deprecated since ECMAScript v3.</p> <h1>encodeURI()</h1> <p>Use encodeURI when you want a working URL. Make this call:</p> <pre><code>encodeURI("http://www.google.com/a file with spaces.html") </code></pre> <p>to get:</p> <pre> http://www.google.com/a%20file%20wit...
How do you reliably get the Quick Launch folder in XP and Vista? <p>We need to reliably get the Quick Launch folder for both All and Current users under both Vista and XP. I'm developing in C++, but this is probably more of a general Windows API question.</p> <p>For reference, here is code to get the Application Data...
<p>AppData on vista refers to C:\Users\xxxx\AppData\Roaming not the C:\Users\xxxx\AppData folder it's self.</p> <p>Also this artical <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0901.mspx" rel="nofollow">http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0901.ms...
Production, Test, Developer Environments vs Security <p>What are current practices for enabling developers to build systems that contain private data? Can anyone point to a "best practices" guide for that sort of thing?</p> <p>We have a Catch-22 here in that developers need to write applications that go against system...
<p>My view of the world may be different, as I'm based in the UK, but for the past 20-odd years, I've worked primarily in the public sector on systems handling sensitive data. The rules are **completely** cut-and-dried. No production data is allowed on the development estate.</p> <p>As a fundamental principle, we do n...
What's the best way to return variables from a syncExec? <p>In my SWT Java app I often want to return information from inside a Display.syncExec() call. The best way I've found so far to do this is:</p> <pre><code>final ArrayList&lt;Integer&gt; result = new ArrayList&lt;Integer&gt;(); GUI.display().syncExec(new Runna...
<p><a href="http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html" rel="nofollow"><code>ArrayList</code> is not thread-safe</a>. You can obtain a thread-safe <code>List</code> with <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedList%28java.util.List%29" rel="nofollo...
Free/cheap PowerDesigner alternative? <p>We are using PowerDesigner at work for database modelling. But there is a hell of a price tag on that piece of software. And frankly, all I use is physical diagrams for MS SQL, which is about 1% of what PD knows.</p> <p>Are there any good alternatives? I know about Visio and MS...
<p><a href="http://www.sqlpower.ca/page/architect">Power*Architect</a> is the way to go. It's free, open source, and does a really great job helping you build your ERDs. Plus, it works on Windows, Linux, and OSX.</p>
Extreme Programming <p>As developers and as professional engineers have you been exposed to the tenants of Extreme Programming as defined in the "version 1" by Kent Beck. Which of those 12 core principles do you feel you have been either allowed to practice or at least be a part of in your current job or others?</p> <...
<p>We are following these practices you've mentioned:</p> <ul> <li>Planning game</li> <li>Test driven development</li> <li>Whole team (being empowered to deliver)</li> <li>Continuous integration</li> <li>Refactoring or design improvement</li> <li>Small releases</li> <li>Coding standards</li> <li>Collective code owners...
Perl: Use of uninitialized value in numeric lt (<) at /Date/Manip.pm <p>This has me puzzled. This code worked on another server, but it's failing on Perl v5.8.8 with <a href="http://search.cpan.org/dist/Date-Manip" rel="nofollow">Date::Manip</a> loaded from CPAN today.</p> <pre><code>Warning: Use of uninitialized valu...
<p>It is a <a href="http://rt.cpan.org/Public/Bug/Display.html?id=29655" rel="nofollow">bug</a> in Date::Manip version 5.48-5.54 for Win32. I've had difficulty with using standard/daylight variants of a timezones, e.g. 'EST5EDT', 'US/Eastern'. The only timezones that appear to work are those without daylight savings, e...
Fetch unread messages, by user <p>I want to maintain a list of global messages that will be displayed to all users of a web app. I want each user to be able to mark these messages as read individually. I've created 2 tables; <code>messages (id, body)</code> and <code>messages_read (user_id, message_id)</code>.</p> <p>...
<p>Well, you could use</p> <pre><code>SELECT id FROM messages m WHERE m.id NOT IN( SELECT message_id FROM messages_read WHERE user_id = ?) </code></pre> <p>Where ? is passed in by your app.</p>
What's a simple method to dump pipe input to a file? (Linux) <p>I'm looking for a little shell script that will take anything piped into it, and dump it to a file.. for email debugging purposes. Any ideas?</p>
<p>The unix command tee does this.</p> <pre><code>man tee </code></pre>
VS2008 Setup Project: Shared (By All Users) Application Data Files? <p>fellow anthropoids and lily pads and paddlewheels!</p> <p>I'm developing a Windows desktop app in C#/.NET/WPF, using VS 2008. The app is required to install and run on Vista and XP machines. I'm working on a Setup/Windows Installer Project to insta...
<p>I have learned the answer to my question through other sources, yes, yes! Sadly, it didn't fix my problem! What's that make me -- a fixer-upper? Yes, yes!</p> <p>To put stuff in a sub-directory of the Common Application Data folder from a VS2008 Setup project, here's what you do:</p> <ol> <li><p>Right-click your s...
Is there a way to dynamically load a properties file in NAnt? <p>I want to load a different properties file based upon one variable.</p> <p>Basically, if doing a dev build use this properties file, if doing a test build use this other properties file, and if doing a production build use yet a third properties file.</p...
<p><strong>Step 1</strong>: Define a property in your NAnt script to track the environment you're building for (local, test, production, etc.).</p> <pre><code>&lt;property name="environment" value="local" /&gt; </code></pre> <p><strong>Step 2</strong>: If you don't already have a configuration or initialization targe...
What is the easiest way to adjust EXIF timestamps on photos from multiple cameras in Windows Vista? <p><strong>Scenario:</strong> Several people go on holiday together, armed with digital cameras, and snap away. Some people remembered to adjust their camera clocks to local time, some left them at their home time, some...
<p>use exiftool. open source, written in perl, but also available as standalone .exe file. author seems to have though of <em>everything</em> exif related. mature code.</p> <p>examples:</p> <pre><code>exiftool "-DateTimeOriginal+=5:10:2 10:48:0" DIR exiftool -AllDates-=1 DIR </code></pre> <p>refs:</p> <ul> <li><a ...
Are there any good Continuous Testing plugins for Eclipse out right now? <p>I've used the <a href="http://groups.csail.mit.edu/pag/continuoustesting/">MIT Continuous testing</a> plugin in the past, but it has long since passed out of date and is no longer compatible with anything approaching a modern release of Eclipse...
<p>I found that <a href="http://infinitest.github.com/">Infinitest</a> now has an Eclipse plugin that seems to work pretty well. </p>
How do you set up an API key system for your website? <p>Let say that I have a website with some information that could be access externally. Those information need to be only change by the respected client. Example: Google Analytic or WordPress API key. How can I create a system that work like that (no matter the prog...
<p>A number of smart people are working on a standard, and it's called <a href="http://oauth.net/">OAuth</a>. It already has a number of <a href="http://oauth.net/code">sample implementations</a>, so it's pretty easy to get started.</p>
What is the best way to create a security architecture? <p>I'm designing a portal's security architecture. The site has pages, videos, pictures, users, databases, file system objects, etc. What is the best way to control access to all of these objects? How would you store permissions? Is a 64-bit database variable enou...
<p>I don't like idea of storing permissions as flags in one variable. I'd rather make roles objects in relation many-to-many with users.</p> <p>For editing rights of the specific object I use an object's method or external function depending on how can I generalise security policies.</p> <p>For a middle sized portals...
In Delphi, How do I get an enumerator from LocalPolicy.CurrentProfile.GloballyOpenPorts in the Firewall API <p>I am writing some code to see if there is a hole in the firewall exception list for <strong>WinXP</strong> and <strong>Vista</strong> for a specific port used by our client software. </p> <p>I can see that I ...
<p>OK, I think that I have it figured out. </p> <p>I had to create a type library file of the hnetcfg.dll. I did that when I first started but have learned a lot about the firewall objects since then. It didn't work then, but its working now. You can create your own file from Component|Import Component. And then follo...
How to convert all controls on an aspx webform to a read-only equivalent <p>Has anyone ever written a function that can convert all of the controls on an aspx page into a read only version? For example, if UserDetails.aspx is used to edit and save a users information, if someone with inappropriate permissions enter th...
<p>Scott Mitchell posted a good article on this a while back. </p> <p><a href="http://aspnet.4guysfromrolla.com/articles/012506-1.aspx" rel="nofollow">http://aspnet.4guysfromrolla.com/articles/012506-1.aspx</a></p> <p>I've used this approach in the past in conjection with css on the 'read only' fields to make them lo...
What to put in a session variable <p>I recently came across a ASP 1.1 web application that put a whole heap of stuff in the session variable - including all the DB data objects and even the DB connection object. It ends up being huge. When the web session times out (four hours after the user has finished using the appl...
<p>This is pretty hard to answer because it's so application-specific, but here are a few guidelines I use:</p> <ol> <li>Put as little as possible in the session.</li> <li>User-specific selections that should only last during a given visit are a good choice</li> <li>often, variables that need to be accessible to multi...
Redraw screen in terminal <p>How do some programs edit whats being displayed on the terminal (to pick a random example, the program 'sl')? I'm thinking of the Linux terminal here, it may happen in other OS's too, I don't know. I've always thought once some text was displayed, it stayed there. How do you change it with...
<p>Depending on the terminal you send control seuqences. Common sequences are for example esc[;H to send the cursor to a specific position (e.g. on Ansi, Xterm, Linux, VT100). However, this will vary with the type or terminal the user has ... curses (in conjunction with the terminfo files) will wrap that information...
Compiling mxml files with ant and flex sdk <p>I am just getting started with flex and am using the SDK (not Flex Builder). I was wondering what's the best way to compile a mxml file from an ant build script. </p>
<p>The Flex SDK ships with a set of ant tasks. More info at:</p> <p><a href="http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html">http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html</a></p> <p>Here is an example of compiling Flex SWCs with ant:</p> <p><a href="http://www.mikec...
Absolute Minimum Requirements for Good Software Design <p>I am trying to write a spec for a software application. The application takes inputs from static files (configuration data), files that it obtained by ftp, and "live" data obtained via a TCP socket. It does some stuff and generates output data, which is delivere...
<p>Testability: If you make your design testable, everything else will fall in line.</p>
Fighting with Protected Mode in Vista <p>Our application commonly used an ActiveX control to download and install our client on IE (XP and prior), however as our user base has drifted towards more Vista boxes with "Protected Mode" on, we are required to investigate.</p> <p>So going forward, is it worth the headache of...
<p>This client, is it a desktop application and not some software that runs inside the browser? In that case, please just supply a regular download installer application. My personal experience with browser-hosted installers is that they are just confusing and the few I have seen seemed to be poorly coded in some way.<...
Python ReportLab use of splitfirst/splitlast <p>I'm trying to use Python with ReportLab 2.2 to create a PDF report.<br /> According to the <a href="http://www.reportlab.com/docs/userguide.pdf">user guide</a>,</p> <blockquote> <p>Special TableStyle Indeces [sic]</p> <p>In any style command the first row index ma...
<p>Well, it looks as if I will be answering my own question.</p> <p>First, the documentation flat out lies where it reads "In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or t...
Locked SQL Server Data Files <p>I have an SQL Server database where I have the data and log files stored on an external USB drive. I switch the external drive between my main development machine in my office and my laptop when not in my office. I am trying to use sp_detach_db and sp_attach_db when moving between desk...
<p>Crazy as it sounds, did you try manually granting yourself perms on the files via right-click / properties / security? I think SQL Server 2005 will set permissions on a detached file exclusively to the principal that did the detach (maybe your account, maybe the account under which the SQL Server service runs) and n...
Which JavaScript library is recommended for neat UI effects? <p>I need a JavaScript library that supports Ajax as well as help me in making simple and neat animation effects <a href="http://www.voidy.com/" rel="nofollow">in a website</a> I am working on.</p> <p>Which library do you recommend?</p>
<p>I would definitely recommend JQuery as the easiest to use and the one which requires you to write the least code. <a href="http://jquery.com/" rel="nofollow">http://jquery.com/</a></p>
Similar thing to RJS (used in Ruby on Rails) in the Java web app world? <p>In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I h...
<p>Yes, I think <a href="http://code.google.com/webtoolkit/" rel="nofollow">Google Web Toolkit</a> is the java equivalent to RJS templates.</p>
KVM and Linux wireless bridging? <p>I'm using KVM to run a Windows virtual machine on my Linux box. Networking is accomplished through a tap device, hooked into a bridged Ethernet device, which allows the Windows VM to basically appear like a separate physical computer on my network. This is pretty nice.</p> <p>Howeve...
<p>I assume that you could configure your Windows guest to use the host as its default gateway, and set up NAT via the wireless interface on the host. So the signal flow would look like this:</p> <ol> <li>Windows software opens connections to a host on the internets.</li> <li>Windows routes the packet via the default ...
Publishing vs Copying <p>What is the difference between publishing a website with visual studio and just copying the files over to the server? Is the only difference that the publish files are pre-compiled?</p>
<p>There is not much difference between "publish", and copying the files. Publish appears in a webapplication. The only difference really is publishing gives you the option to only include html and dll's, where as copying you would need to parse out source code manually. There is no full precompiling in the publish opt...
How to check for memory leaks in Guile extension modules? <p>I develop an extension module for Guile, written in C. This extension module embeds a Python interpreter.</p> <p>Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects. </...
<p>You've got a couple options. One is to write a supressions file for valgrind that turns off reporting of stuff that you're not working on. Python has such a file, for example: <a href="http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp" rel="nofollow">http://svn.python.org/projects/python/trunk/M...
Best C++ IDE for *nix <p>What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?</p>
<p>On Ubuntu, some the IDEs that are available in the repositories are:</p> <ul> <li><a href="http://www.kdevelop.org/">Kdevelop</a></li> <li><a href="http://geany.uvena.de/">Geany</a></li> <li><a href="http://anjuta.sf.net/">Anjuta</a></li> </ul> <p>There is also: </p> <ul> <li><a href="http://eclipse.org">Eclipse...
What open source virtual private server program do you recommend with windows as host <p>I am looking to have 4 Virtual servers(various linux flavors) running on a Windows server 2003 R2 64 bit edition server located at a datacenter. I can also purchase a 2008 server or 32 bit 2k3 if needed. They would each have thei...
<p><a href="http://technet.microsoft.com/en-gb/bb738033.aspx" rel="nofollow">Virtual Server 2005 R2 SP1</a> is free (registration required) and supports x64 hosts. It does not support x64 guests.</p> <p>Windows Server 2008 includes Hyper-V, Microsoft's new virtualization technology, which supports x64 guests and multi...
How can I prevent deformation when rotating about the line-of-sight in OpenGL? <p>I've drawn an ellipse in the XZ plane, and set my perspective slightly up on the Y-axis and back on the Z, looking at the center of ellipse from a 45-degree angle, using gluPerspective() to set my viewing frustrum.</p> <p><a href="http:/...
<p>It looks like you're using 1.0 as the aspect when you call gluPerspective(). You should use width/height. For example, if your viewport is 640x480, you would use 1.33333 as the aspect argument.</p>
linux uptime history <p>How can I get a history of uptimes for my debian box? After a reboot, I dont see an option for the uptime command to print a history of uptimes. If it matters, I would like to use these uptimes for graphing a page in php to show my webservers uptime lengths between boots.</p> <p>Update: Not su...
<p>Install <a href="https://github.com/rpodgorny/uptimed">uptimed</a>. It does exactly what you want.</p> <p>Edit:</p> <p>You can apparantly include it in a PHP page as easily as this:</p> <pre><code>&lt;? system("/usr/local/bin/uprecords -a -B"); ?&gt; </code></pre> <p><a href="http://www.robertjohnkaper.com/softw...
Parsing HTTP Headers <p>I've had a new found interest in building a small, efficient web server in C and have had some trouble parsing POST methods from the HTTP Header. Would anyone have any advice as to how to handle retrieving the name/value pairs from the "posted" data?</p> <pre><code>POST /test HTTP/1.1 Host: tes...
<p>You can retrieve the name/value pairs by searching for newline newline or more specifically \r\n\r\n (after this, the body of the message will start).</p> <p>Then you can simply split the list by the &amp;, and then split each of those returned strings between the = for name/value pairs. </p> <p>See the <a href="...
How do you design data models for Bigtable/Datastore (GAE)? <p>Since the Google App Engine Datastore is based on <a href="http://research.google.com/archive/bigtable.html">Bigtable</a> and we know that's not a relational database, how do you design a <strong><em>database schema</em>/*data model*</strong> for applicatio...
<p>Designing a bigtable schema is an open process, and basically requires you to think about:</p> <ul> <li>The access patterns you will be using and how often each will be used</li> <li>The relationships between your types</li> <li>What indices you are going to need</li> <li>The write patterns you will be using (in or...
ActiveRecord#save_only_valid_attributes <p>I'm looking for a variation on the #save method that will only save attributes that do not have errors attached to them. So a model can be updated without being valid overall, and this will still prevent saving invalid data to the database.</p> <p>By "valid attributes", I ...
<p>I'm not sure how much luck you will have with this without a lot of messing around.</p> <p>No matter how DRY and OO and easy your framework makes things ( which is in this case - alot =) you've still got to remember it's running in front of a bog-standard relational database, which has atomic commits as one of it'...
How to Truncate a string in PHP to the word closest to a certain number of characters? <p>I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage. The original block of text can be a lengthy article or a short sentence or two; but for this widget I can'...
<p>By using the <a href="http://www.php.net/wordwrap">wordwrap</a> function. It splits the texts in multiple lines such that the maximum width is the one you specified, breaking at word boundaries. After splitting, you simply take the first line:</p> <pre><code>substr($string, 0, strpos(wordwrap($string, $your_desired...
Cruise Control .Net vs Team Foundation Build <p>Our team is setting up nightly and continuous integration builds. We own Team Foundation Server and could use Team Foundation Build. I'm more familiar with CC.Net and lean that way but management sees all the money spent on TFS and wants to use it.</p> <p>Some things I...
<p>I've used both. I guess it depends on what your organization values.</p> <p>Since you are familiar with CC Net, I won't speak much to that. You already know what makes it cool.</p> <p><strong>Here's what I like about Team Foundation Build:</strong></p> <ul> <li>Build Agents. It's very simple to turn any box into ...
What does COINIT_SPEED_OVER_MEMORY do? <p>When calling <code>CoInitializeEx</code>, you can specify the following values for <code>dwCoInit</code>:</p> <pre><code>typedef enum tagCOINIT { COINIT_MULTITHREADED = 0x0, COINIT_APARTMENTTHREADED = 0x2, COINIT_DISABLE_OLE1DDE = 0x4, COINIT_SPEED_OVER_M...
<p>No idea if it's still used but it was meant to change the balance used by the COM algorithms.</p> <p>If you had tons of memory and wanted speed at all costs, you would set that flag.</p> <p>In low-memory environments, leaving that flag off would favor reduced memory usage.</p> <hr> <p>As it turns out, the marvel...
Poppler programming <p>Poppler is a classic example of something without documentation that you would prefer be documented. This question is language agnostic, just asking about the general idea.. In short, how do you make a PDF viewer control with poppler?<br /> From what I can tell, you'd need to use poppler to rende...
<p>You have to code it all yourself -- Poppler only handles the PDF part, you have to write the GUI. Look at the code to <a href="http://www.gnome.org/projects/evince/" rel="nofollow">Evince</a> for a good example. </p>
Reparenting a Window as a Tab in a GTK Notebook <p>I'm using Mono with GTK# and am trying to display an existing window as a new tab in a GTK.Notebook. I'm currently re-parenting the widget to the notebook as follows:</p> <pre> MyWindow myWindow = new MyWindow(); myWindow.Children[0].Reparent(myNotebook) </pre> <p>S...
<p>Your way is the best way, there's no way to embed windows into tabs without using horrible hacks like <code>GtkPlug</code> (which I'd guess you'd be uninterested in if you're using .NET). Look at the code to <code>gnome-terminal</code> for an example of how to do this.</p>
Performance of an large directory structure, networked application <p>I'm trying to find out what the performance of a large directory structure would be if deep directories were to be accessed on a shared, nfs filesystem. The structure would be excessively large, with 4 levels of nested directories, each level contain...
<p>I did that at my work once. Don't remember the exact numbers offhand, but I think it was 8 levels deep, 10 subdirectories in each level (user id 87654321 maps to directory 8/7/6/5/4/3/2/1/. Turned out that was not such a great idea, started running into problems with filesystem inode number limits, iirc (10^10 = 100...
Provisioning Issue using CrmDeploymentService <p>i've been working on Provision of an organization for quite a few days , and had faced few issues which i was successful in resolving them.Let me explain abt the issues i faced, the MSCrmServices is a process that is running under the Network Service. When I call the 'E...
<p>Edit: Actually you're not alone.</p> <p><a href="http://www.eggheadcafe.com/software/aspnet/31450420/crmdeploymentservice-crm.aspx" rel="nofollow">http://www.eggheadcafe.com/software/aspnet/31450420/crmdeploymentservice-crm.aspx</a></p> <p>Hope that helps.</p>
How do I register a custom URL protocol in Windows? <p>How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?</p>
<p>I think this is covered in MSDN, please see <a href="http://msdn.microsoft.com/en-us/library/aa767914.aspx" rel="nofollow">Registering an Application to a URL Protocol</a>.</p>
Phantom Referenced Objects <p>Phantom References serve for post-mortem operations. The Java specification states that a <strong>phantom referenced object</strong> will not be deallocated until the phantom-reference itself is cleaned.</p> <p>My question is: What purpose does this feature (object not deallocated) serve?...
<p>Edit, since I've misunderstand the question first:</p> <p>Quoted from here <a href="http://www.memorymanagement.org/glossary/p.html" rel="nofollow">http://www.memorymanagement.org/glossary/p.html</a>:</p> <blockquote> <p>The Java specification says that the phantom reference is not cleared when the reference...
how XQUERY is actually used? <p>I have been reading lot of XQUERY tutorial on the web site. Almost all of them are teaching me the XQUERY syntax. Let's say i have understood the XQUERY syntax, how am i going to actually implement XQUERY on my web site?</p> <p>For example, i have book.xml:</p> <pre><code>&lt;?xml ve...
<pre><code>(: file: titles.xqy :) &lt;table&gt; &lt;tr&gt;&lt;th&gt;title&lt;/th&gt;&lt;th&gt;author&lt;/th&gt;&lt;/tr&gt; { let $books-doc := doc("books.xml") let $authors-doc := doc("authors.xml") for $b in $books-doc//book, $a in $authors-doc//author where $a/@id = $b/authorid return &lt;tr&gt; &lt;td&gt;{$...
OpenFileDialog. How about "Specify Directory Dialog"? <p>On a file path field, I want to capture the directory path like:</p> <pre><code>textbox1.Text = directory path </code></pre> <p>Anyone?</p>
<p>There is a FolderBrowserDialog class that you can use if you want the user to select a folder.</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.aspx</a></p> <pre><co...
Is anyone using XForms in their web applications? <p>A few years ago we started playing around with <a href="http://www.w3.org/MarkUp/Forms/">XForms</a> from the W3C for a web app which required hundreds of custom forms.</p> <p>As they aren't currently supported natively by the major browsers, what parsers/tools are y...
<p>We use XForms for creating user interfaces for SOAP-based web services. Currently we settled with <strong>Chiba</strong> XForms engine (<a href="http://chiba.sourceforge.net/" rel="nofollow">http://chiba.sourceforge.net/</a>), but <strong>Orbeon</strong> (<a href="http://www.orbeon.com" rel="nofollow">http://www.orb...
Creating/modifying images in JavaScript <p>Is it possible to <strong>dynamically create and modify images</strong> on a <strong>per pixel level</strong> in JavaScript (on client side)? Or has this to be done with server based languaged, such as PHP? </p> <p>My use case is as follows:</p> <ul> <li>The user opens webpa...
<p>Some browsers support the canvas: <a href="http://developer.mozilla.org/En/Drawing_Graphics_with_Canvas">http://developer.mozilla.org/En/Drawing_Graphics_with_Canvas</a></p>
Best way to tackle global hotkey processing in c#? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/48935/how-can-i-register-a-global-hot-key-to-say-ctrlshiftletter-using-wpf-and-ne">How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET...
<p>The nicest solution I've found is <a href="http://bloggablea.wordpress.com/2007/05/01/global-hotkeys-with-net/">http://bloggablea.wordpress.com/2007/05/01/global-hotkeys-with-net/</a></p> <pre><code>Hotkey hk = new Hotkey(); hk.KeyCode = Keys.1; hk.Windows = true; hk.Pressed += delegate { Console.WriteLine("Window...
Auto-generating Unit-Tests for legacy Java-code <p>What is the best, preferably free/open source tool for auto-generating Java unit-tests? I know, the unit-tests cannot really serve the same purpose as normal TDD Unit-Tests which document and drive the design of the system. However auto-generated unit-tests can be usef...
<p>Not free. Not opensource. But I have found AgitarOne Agitator (<a href="http://www.agitar.com/solutions/products/agitarone.html" rel="nofollow">http://www.agitar.com/solutions/products/agitarone.html</a>) to be REALLY good for automatically generating unit tests AND looking for unwanted obscure side effects</p>
How to get the file path from HTML input form in Firefox 3 <p>We have simple HTML form with <code>&lt;input type="file"&gt;</code>, like shown below:</p> <pre><code>&lt;form&gt; &lt;label for="attachment"&gt;Attachment:&lt;/label&gt; &lt;input type="file" name="attachment" id="attachment"&gt; &lt;input type="sub...
<blockquote> <p>In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like '//server1/path/to/file/filename' it works properly and gives the full path to the file and the filename.</p> <p>I have no clue how to overcome this 'new feature' because it causes all upload forms in my ...
Easiest way to merge a release into one JAR file <p>Is there a tool or script which easily merges a bunch of <a href="http://en.wikipedia.org/wiki/JAR_%28file_format%29">JAR</a> files into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.</p> <p>The concrete case is a <a href=...
<p>Ant's <code>zipfileset</code> does the job</p> <pre><code>&lt;jar id="files" jarfile="all.jar"&gt; &lt;zipfileset src="first.jar" includes="**/*.java **/*.class"/&gt; &lt;zipfileset src="second.jar" includes="**/*.java **/*.class"/&gt; &lt;/jar&gt; </code></pre>
How can I listen to a RoutedEvent from a class that doesn't derive from FrameworkElement ? Can it be done? <p>The question says it all basically. </p> <p>I want in a </p> <pre><code>class MyClass </code></pre> <p>to listen to a routed event. Can it be done ?</p>
<p>Actually I wiredup the event the wrong way :|</p> <p>I had</p> <pre><code>EventManager.RegisterClassHandler ( typeof ( MyClass )...... </code></pre> <p>Instead of</p> <pre><code>EventManager.RegisterClassHandler ( typeof ( TheClassThatOwnedTheEvent ) </code></pre> <p>So .. my bad.</p>
private IP address ranges <p>What are the private IP address ranges?</p>
<p>You will find the answers to this in <a href="http://www.faqs.org/rfcs/rfc1918.html">RFC 1918</a>. Though, I have listed them below for you.</p> <pre><code> 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 pref...
How to retrieve stored procedure return values from a TableAdapter <p>I cannot find an elegant way to get the return value from a stored procedure when using TableAdapters.</p> <p>It appears the TableAdapter does not support SQL stored procedure return values when using a non-scalar stored procedure call. You'd expect...
<p>The way to get the return value is to use a SqlParameter on the SqlCommand object which has its Direction set to ParameterDirection.ReturnValue. You should check the SelectCommand property of the TableAdapter after calling Fill.</p>
How do you add a JavaScript widget to a Wordpress.com hosted blog? <p>I've got a <a href="http://notebooks.readerville.com/">site</a> that provides blog-friendly widgets via JavaScript. These work fine in most circumstances, including self-hosted Wordpress blogs. With blogs hosted at Wordpress.com, however, JavaScript ...
<p>you could always petition wp to add your widget to their 'approved' list, but who knows how long that would take. you're talking about a way to circumvent the rules they have in place about posting arbitrary script. myspace javascript exploits in particular have increased awareness of the possibility of such workaro...
How to suppress Terminated message after killing in bash? <p>How can you suppress the <code>Terminated</code> message that comes up after you kill a process in a bash script?</p> <p>I tried <code>set +bm</code>, but that doesn't work.</p> <p>I know another solution involves calling <code>exec 2&gt; /dev/null</code>, ...
<p>In order to silence the message, you must be redirecting <code>stderr</code> <strong>at the time the message is generated</strong>. Because the <a href="http://ss64.com/bash/kill.html"><code>kill</code></a> command sends a signal and doesn't wait for the target process to respond, redirecting <code>stderr</code> of ...
override constraint from no action to cascading at runtime <p>I feel like I have a verry basic/stupid question, yet I never saw/read/heard anything in this direction.</p> <p>Say I have a table <em>users(userId, name)</em> and a table <em>preferences(id, userId, language)</em>. The example is trivial, but could be exte...
<p>What I would do is this:</p> <ol> <li>The constraint is CASCADE</li> <li>The application checks if preferences exist.</li> <li>If they do, show the warning.</li> <li>If no preferences exist, or the warning is accepted, delete the client.</li> </ol> <p>Changing database relationships on the fly is not going to be a...
What prevents a Thread in C# from being Collected? <p>In .NET, after this code, what mechanism stops the <code>Thread</code> object from being garbage collected?</p> <pre><code>new Thread(Foo).Start(); GC.Collect(); </code></pre> <p>Yes, it's safe to assume <strong>something</strong> has a reference to the thread, I ...
<p>The runtime keeps a reference to the thread as long as it is running. The GC wont collect it as long as anyone still keeps that reference.</p>
Is anyone developing facebook apps on Grails <p>I have not seen much support for Grails to develop facebook apps.I was just wondering if people around are developing facebook apps on grails </p>
<p>Jozef Dransfield: <a href="http://www.grassr.com/wordpress/?cat=8" rel="nofollow">http://www.grassr.com/wordpress/?cat=8</a></p>
Rails or Grails? <p>Grails vs Rails. Which has better support? And which one is a better choice to develop medium size apps with? Most importantly which one has more plug-ins?</p>
<p>One other thing worth mentioning: the design philosophy of both framework is somewhat different when it comes to the model. Grails is more "domain-oriented" while Rails is more "database-oriented".<br /> In Rails, you essentially start by defining your tables (with field names and their specifics). Then ActiveRecord...
Is it possible to print a variable's type in standard C++? <p>For example:</p> <pre><code>int a = 12; cout &lt;&lt; typeof(a) &lt;&lt; endl; </code></pre> <p>Expected output:</p> <pre><code>int </code></pre>
<p>C++11 update to a very old question: Print variable type in C++.</p> <p>The accepted (and good) answer is to use <code>typeid(a).name()</code>, where <code>a</code> is a variable name.</p> <p>Now in C++11 we have <code>decltype(x)</code>, which can turn an expression into a type. And <code>decltype()</code> comes...
PyQt and PyCairo <p>I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?</p>
<p>Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt?</p> <p>For the basics of using QPainter see <a href="http://www.informit.com/articles/article.aspx?p=1174421" rel="nofollow">this excerpt</a> from the book "C++ GUI Progra...
How do I use calculated value date in Sharepoint lists field to find a date+30 days? <p>I have a list I've built in Sharepoint, where one of the fields is a date that the user enters. I want to add another field, which is a calculated value field that needs to be the date provided by the user + 30 days. What formula do...
<p>Try this:</p> <ol> <li>Create a new Calculated column</li> <li>In the Forumla box, enter something like this: =TEXT([existing date column]+30,"yyyy-mm-dd") You can use any date format string you like instead of "yyyy-mm-dd"</li> <li>Make the data type "Date and Time"</li> <li>Make the date and time format "Date...
Is there a way to specify a different session store with Tomcat? <p>Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this informati...
<p>There definitely is a way. Though I'd strongly vote for sticky sessions - saves so much load for your servers/database (unless something fails)...</p> <p><a href="http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html" rel="nofollow">http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html</a> has informati...
Way to Alt-Tab through all applications in Virtual and Host PC <p>I am using VirtualPc 2007 more and more, the one annoyance is "Alt-Tab".</p> <p>What I want is to be able to use alt-tab to iterate through all of the applications in the host pc and virtual(s) as if they were one long list. Is there a setting or progra...
<p>No. If the VPC is in full screen mode, alt+tab works only within the context of the VPC. If the VPC Screen is not focused, you will get the collection of applications that are in the Host (including the instance of VPC)</p>
Best way to handle URLs in a multilingual site in ASP.net <p>I need to do a multilingual website, with urls like</p> <pre><code>www.domain.com/en/home.aspx for english www.domain.com/es/home.aspx for spanish </code></pre> <p>In the past, I would set up two virtual directories in IIS, and then detect the URL in global...
<p>I decided to go with the new ASP.net Routing.<br /> Why not urlRewriting? Because I don't want to change the clean URL that routing gives to you.</p> <p>Here is the code:</p> <pre><code>Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Code that runs on application startup RegisterRoute...
svn over HTTP proxy <p>I'm on laptop (Ubuntu) with a network that use HTTP proxy (only http connections allowed).<br> When I use svn up for url like 'http://.....' everything is cool (google chrome repository works perfect), but right now I need to svn up from server with 'svn://....' and I see connection refused.<br> ...
<p>In <code>/etc/subversion/servers</code> you are setting <code>http-proxy-host</code>, which has nothing to do with <code>svn://</code> which connects to a different server usually running on port 3690 started by <code>svnserve</code> command.</p> <p>If you have access to the server, you can setup <code>svn+ssh://<...
Boost serialization: specifying a template class version <p>I have a template class that I serialize (call it C), for which I want to specify a version for boost serialization. As BOOST_CLASS_VERSION does not work for template classes. I tried this:</p> <pre><code>namespace boost { namespace serialization { templa...
<pre><code>#include &lt;boost/serialization/version.hpp&gt; </code></pre> <p>:-)</p>
What files are you allowed to modify in SharePoint 2007? <p>What files can we modify so that our solution is still supported by Microsoft?</p> <p>Is it allowed to customize error pages? Can we modify the web.config files to use custom HTTPHandlers?</p>
<p>You can certainly edit the web.config file for your sites. The one thing that you should be aware of, however, is that when you start editing files manually on the file system, you will have to remember to manually make those changes across all servers in the farm (assuming a farm exists). In addition to this, whe...
Using Yahoo! Pipes <p>Have you used <a href="http://pipes.yahoo.com/pipes/" rel="nofollow">pipes.yahoo.com</a> to quickly and easily do... anything? I've recently created a quick <a href="http://pipes.yahoo.com/kooshmoose/stackoverflow_merge" rel="nofollow">mashup of StackOverflow tags</a> (<a href="http://pipes.yahoo....
<p>It's nice for aggregating feeds, yes, but the other handy thing to do is filtering the feeds. A while back, I created a feed for Digg (before Digg fell into the Fark pit of dispair). I didn't care about the overwhelming Apple and Ubuntu news, so I filtered those keywords out of Technology, which I then combined with...
Connecting to Oracle using PHP <p>I am a PHP Developer, but I am confused on how to connect to a remote Oracle database instance from PHP. I simply need to query a read only database and get some data. Do I need to have the Oracle Instant Client or the extension is enough? Thanks.</p>
<p>From <a href="http://php.net/manual/en/oci8.setup.php" rel="nofollow">PHP Manual</a></p> <ul> <li><p>You will need the Oracle client libraries to use this extension.</p></li> <li><p>The most convenient way to install all the required files is to use Oracle Instant Client, which is available from <a href="http://www...
Trip time calculation in relational databases? <p>I had this question in mind and since I just discovered this site I decided to post it here.</p> <p>Let's say I have a table with a timestamp and a state for a given "object" (generic meaning, not OOP object); is there an optimal way to calculate the time between a sta...
<p>Here's an Oracle methodology using an analytic function.</p> <pre><code>with data as ( SELECT 1 trip_id, to_date('20080801 13:30:00','YYYYMMDD HH24:mi:ss') dt, 'Initial' step from dual UNION ALL SELECT 1 trip_id, to_date('20080802 13:30:00','YYYYMMDD HH24:mi:ss') dt, 'Work' step from dual UNION ALL SELECT 1 t...
ORA-00161: transaction branch length 103 is illegal (maximum allowed 64 <p>Error:</p> <pre><code>ORA-00161: transaction branch length 103 is illegal (maximum allowed 64… </code></pre> <p>I'm using the DAC from Oracle, any idea if there is a patch for this?</p>
<p>This looks to be a similar issue for .net 2.0, vista and oracle <a href="http://forums.oracle.com/forums/thread.jspa?threadID=516250" rel="nofollow">http://forums.oracle.com/forums/thread.jspa?threadID=516250</a></p>
What alternatives are there to the MATLAB Editor? <p>Some things that I personally find as shortcomings in the MATLAB Editor:</p> <ul> <li>virtually no code completion available</li> <li>does not run OS native (on MacOS) - but in X-Environment (shortcuts, copy&amp;paste problems, keymappings, non intuitive window-mana...
<p>You can use any editor you like in MATLAB by going to </p> <p>File -> Preferences -> Editor/Debugger</p> <p>and then change the radio button from 'MATLAB Editor' to 'Text editor' and the command for your editor of choice in there. I use this to launch gedit on my Linux box.</p> <p>On the Mac-Specific side - it s...
How can I get the unique values of an array in .net? <p>Say I've got this array: MyArray(0)="aaa" MyArray(1)="bbb" MyArray(2)="aaa"</p> <p>Is there a .net function which can give me the unique values? I would like something like this as an output of the function: OutputArray(0)="aaa" OutputArray(1)="bbb"</p>
<p>A solution could be to use LINQ as in the following example:</p> <pre><code>int[] test = { 1, 2, 1, 3, 3, 4, 5 }; var res = (from t in test select t).Distinct&lt;int&gt;(); foreach (var i in res) { Console.WriteLine(i); } </code></pre> <p>That would print the expected:</p> <pre><code>1 2 3 4 5 </code></pre>
What is the difference between TrueType fonts and Type-1 fonts? <p>What is the difference between TrueType fonts and Type-1 fonts?</p>
<p>The Postscript Type-1 specification was created by Adobe back in 1985 or so. Type-1 fonts are vector based. You can find the specification in "<a href="http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF">Adobe Type 1. Font Format.</a>".</p> <p>TrueType fonts were defined by Apple a couple of years earli...
How do I call a SQL Server stored procedure from PowerShell? <p>I have a large CSV file and I want to execute a stored procedure for each line.</p> <p>What is the best way to execute a stored procedure from PowerShell?</p>
<p>This answer was pulled from <a href="http://www.databasejournal.com/features/mssql/article.php/3683181">http://www.databasejournal.com/features/mssql/article.php/3683181</a></p> <p>This same example can be used for any adhoc queries. Let us execute the stored procedure “sp_helpdb” as shown below.</p> <pre><cod...
C++ does begin/end/rbegin/rend execute in constant time for std::set, std::map, etc? <p>For data types such as std::set and std::map where lookup occurs in logarithmic time, is the implementation required to maintain the begin and end iterators? Does accessing begin and end imply a lookup that could occur in logarithmi...
<p>They happen in constant time. I'm looking at page 466 of the ISO/IEC 14882:2003 standard:</p> <p><strong>Table 65 - Container Requiments</strong></p> <p>a.begin(); <em>(constant complexity)</em></p> <p>a.end(); <em>(constant complexity)</em></p> <p><strong>Table 66 - Reversible Container Requirements</str...
Dynamically add CalendarExtender to Textbox subclass server control? <p>I'm trying to create a server control, which inherits from TextBox, that will automatically have a <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx" rel="nofollow">CalendarExtender</a> attached to it. Is it possibl...
<p>I accomplished this in a project a while back. To do it I created a CompositeControl that contains both the TextBox and the CalendarExtender.</p> <p>In the <code>CreateChildControls</code> method of the CompositeControl I use code similar to this:</p> <pre><code>TextBox textbox = new TextBox(); textbox.ID = this.I...