input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Best way to format pretty URLs for numeric IDs <p>Alright, so let's say I'm writing a forum application, and I want pretty URLs. However, all my tables use numeric IDs, so I'm not sure the best way to format the URLs for those resources. Let's pretend I'm trying to get a topic with ID 123456 and title <em>This is a for... | <p>I would go with option 3, and make the slug (the last bit) optional</p>
<p>Because?</p>
<ul>
<li>The ID will always be unique... 2 people may make a thread with the name 'good news' for example</li>
<li>The search bots can access the slug for some SEO goodness</li>
<li>The slug should be optional ... Using just th... |
How to return a JsonResult in ASP.NET MVC <p>i have the following data as a string in my Action method:</p>
<pre><code>string json = "[[1,2],[3,4],[5,6]]";
</code></pre>
<p>Simple.</p>
<p>When I call the Json view, it encapsulates the result in two double quotes. This stops the client side javascript from loading th... | <p>I would guess that the <code>JsonResult</code> wants to serialize the object you pass in. And because your string is more-or-less 'serialized' (in Json terms) all it can do is see that the object is a string, and in 'Json land', string literals get quotes around them.</p>
<p>Maybe if you change your string into a s... |
How to disable the up/down buttons within the QDoubleSpinBox <p>I have a QDoubleSpinBox in QT. I would like to conditionally disable the step up and/or down buttons. I am not sure how to do this.</p>
<p>I saw that in the QAbstractSpinBox there is a flag called StepEnabledFlag. But i am not sure how to set that.</p>
<... | <p>You need to create a QDoubleSpinBox subclass with a custom implementation of the step enabled function. (<a href="http://doc.qt.digia.com/4.5/qabstractspinbox.html#stepEnabled" rel="nofollow">http://doc.qt.digia.com/4.5/qabstractspinbox.html#stepEnabled</a>)</p>
|
For QDoubleSpinBox, can I give an range 0.0<min<max<1.0. If yes how do I get the step buttons to work with it <p>I am using a <code>QDoubleSpinBox</code>,</p>
<p>And during sometime, I have a range where min and max is less than 1 and greater than 0.
If I set that range, when I hit the step down the value in the spin ... | <p>Use setSingleStep() to set the step size to something reasonable for your range. (<a href="http://doc.trolltech.com/4.5/qdoublespinbox.html#singleStep-prop" rel="nofollow">http://doc.trolltech.com/4.5/qdoublespinbox.html#singleStep-prop</a>)</p>
|
How to traverse keys of a Hashtable in alphabetical order? <p>What is the easiest way to traverse a hashtable's keys in ascending alphabetical order?</p>
| <p>This is fairly dependent upon what the type of the key is. But lets assume for a minute that they are strings. You could use the following LINQ query</p>
<pre><code>Hashtable table = GetHashTable();
var keys = table.Keys.Cast<String>().OrderBy(x => x);
</code></pre>
<p>For more complex structures the LI... |
What is the use of maintance plans in SQLSERVER2005 <p>Can anyone tell me what is the need and use of sqlserver maintanance plans and how to configure them.</p>
| <p>Google explains all: <a href="http://www.sql-server-performance.com/articles/dba/creating_backup_jobs_p1.aspx" rel="nofollow">http://www.sql-server-performance.com/articles/dba/creating_backup_jobs_p1.aspx</a></p>
|
Garbage collection of static members <p>Will static members be ever collected by the garbage collector?</p>
| <p>Objects referenced by static variables will only be garbage collected when the relevant <code>AppDomain</code> is garbage collected. In client applications, there's often just a single <code>AppDomain</code> which lives for the duration of the process. (An exception is when the application uses a plug-in architectur... |
Highlighting a textfield value <p>Hi guys i am using a dropdownlist which have the value please specify other, when that value is selected in prompts out a textfield which has the value please specify other, but for the user to type in anything in the textfield he has to delete the value manually..i am looking for a co... | <p>Using jQuery, you can make textbox hints. Even better, reuse someone else's code:</p>
<p><a href="http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/" rel="nofollow">http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/</a></p>
<p>Example: <a href="http://remysharp.com/wp-content/uploads/200... |
How does Python import modules from .egg files? <p>How can I open <code>__init__.pyc</code> here?</p>
<pre><code> >>> import stompservice
<module 'stompservice' from 'C:\Python25\lib\site-packages\stompservice-0.1.0-py2.5.egg\stompservice\__init__.pyc'>
</code></pre>
<p>All I see in <code>C:\Pyt... | <p><a href="http://peak.telecommunity.com/DevCenter/PythonEggs">http://peak.telecommunity.com/DevCenter/PythonEggs</a></p>
<p>.egg files are simply renamed zip files.</p>
<p>Open the egg with your zip program, or just rename the extension to .zip, and extract.</p>
|
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel <p>I have a web service which calls make a soap request. While debugging in VS.NET 2008 the soap request is successful. However when I deploy it, I get the following error</p>
<p>The underlying connection was cl... | <p>If you are attempting to use SSL with your local IIS server you'll need to configure it with a self signed certificate using <a href="http://stackoverflow.com/questions/496658/using-makecert-for-development-ssl">makecert</a> or a similar tool.</p>
|
Holocentric - Does anyone use it for modeling? <p>A simple poll essentially.... Searching google for Holocentric reveals very little about the takeup of product. Has anyone used it? Is it any good good?</p>
| <p>They are an Australian company and I believe most of their sales have been in Australia, I've only ever seen the product used in various Aus government organisations where it seems to be quite popular. In general it tends to end up being used more as a business modelling tool than a design tool.</p>
<p>While it doe... |
How to use Union method or left outer join? <p>i can not join #Temp with scr_SecuristLog. How can i do it? </p>
<pre><code>CREATE TABLE #Temp (VisitingCount int, [Time] int )
DECLARE @DateNow DATETIME,@i int,@Time int
set @DateNow='00:00'
set @i=1;
while(@i<48)
begin
set @DateNow = DAT... | <p>As you don't mention a specific error, I am guessing your error comes from the fact you have not prefixed your select values.</p>
<pre><code>select t.VisitingCount, t.[Time]
</code></pre>
<p><hr /></p>
<p><strong>Edit</strong></p>
<p>Your second error should be resolved with this group by.</p>
<pre><code>select... |
Django ImageField issue <p>I have a similar model</p>
<pre><code>Class Student(models.Model):
"""A simple class which holds the basic info
of a student."""
name = models.CharField(max_length=50)
age = models.PositiveIntegerField()
photo = models.ImageField(upload_to='foobar', blank=True, null=True)
</code></pre>
<p>... | <p>It doesn't work because <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups">field lookups</a> only work on other models. Here, <code>name</code> is an attribute on the return value of your <code>photo</code> field.</p>
<p>Try this instead:</p>
<pre><code>Student.objects.exclude(photo__i... |
With WPF, scrolling down a ListView is fast, scrolling up is slow <p>I have a weird issue with my ListView. This ListView is linked to a DataSource containing a thousands items so it's pretty big.</p>
<p>My issue is that scrolling up is very slow... whereas scrolling down is ok. Any idea why?</p>
| <p>Have you tried Recycling and DeferredScrolling </p>
<pre><code> <ListBox VirtualizingStackPanel.VirtulizationMode="Recycling" ...
<ListBox ScrollView.IsDeferredScrollingEnabled="True" ...
</code></pre>
|
Check a collection size with JSTL <p>How can I check the size of a collection with JSTL?</p>
<p>Something like:</p>
<pre><code><c:if test="${companies.size() > 0}">
</c:if>
</code></pre>
| <p>From: <a href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html">http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html</a></p>
<blockquote>
<p><strong>length( java.lang.Object)</strong> - Returns the number of items in a collection, or the number of characters in a s... |
User options in another table: what is the best practice to check if an option is there? <p>I have several option that a user can have, mainly to validate his presence around the site.</p>
<p>Tables are like this:</p>
<p>Users:</p>
<pre><code>id=1
username=stackoverflow
password=oSKAJMMS;
address=xyz
...
</code></pr... | <pre><code>SELECT *
FROM users u
WHERE EXISTS (
SELECT 1
FROM options o
WHERE o.user_id = u.id
AND o.option = 'AC1'
)
</code></pre>
<p>Make sure you have an index on <code>options (user_id, option)</code></p>
|
Windsor castle Injecting properties of constructed object <p>Some dependency injection containers enable you to inject configured services into an already constructed object. </p>
<p>Can this be achieved using Windsor, whilst taking account of any service dependencies there may be on the target object?</p>
| <p>This is an old question but Google led me here recently so thought I would share my solution lest it help someone looking for something like StructureMap's BuildUp method for Windsor.</p>
<p>I found that I could add this functionality myself relatively easily. Here is an example which just injects dependencies into... |
TFS UnitTesting not deploying local copy assembly to test dir when on build server <p>I have an assembly that needs to be in the test output dir for my tests to run.
I have the assembly referenced as a local copy in the project but on the build server this gets ignored.
The two ways I have found to fix this are</p>
<o... | <p>As my assembly was being dynamicly loaded the unit test framework was not copying it.
I added a explict refrence to it by calling typeof on one of the types in the assembly and all is fine.</p>
<p>Thanks Jerome Laban for your help with this one.</p>
|
Multiply defined symbols <p>If I declare a global variable in a header file and include it in two .cpp files, the linker gives an error saying the symbol is multiply defined.
My question is, why does this happen for only certain types of object (eg. int) and not others (eg. enum)?</p>
<p>The test code I used is given ... | <p>That's because enumerations are not objects - they are types. Class types (class,struct,union) and enumerations can be defined multiple times throughout the program, provided all definitions satisfy some restrictions (summed up by the so-called <em>One Definition Rule</em> (ODR)). The two most important ones are</p>... |
Designing an XACML API <p>Currently, the XACML specification defines a protocol for request / response but leaves it up to interpretation as to how it can be integrated into an enterprise application. I believe that the value of XACML won't be realized unless there is the creation of a new open source project that atte... | <p>Maybe I don't understand the question, but doesn't the SAML profile for XACML do what you want? It defines SOAP formats for authzDecisionQuery and response records, which should be all you need for the WSDL.</p>
<p>I built one of these around Sun's interpreter for DOD/DISA (its on forge.mil), and a much faster vers... |
Does Vista Voice Recognition engine have scripting like Naturally Speaking? <p>I want to have an action performed whenever the user (while using Vista voice recognition) says "Wingbats are crazy!". How do I do this? Is there scripting or is there a dll to tie into? </p>
| <p>You might want to check out the <a href="http://msdn.microsoft.com/en-us/library/ms723627%28VS.85%29.aspx" rel="nofollow">Microsoft Speech API</a> (SAPI). I used this in Windows XP a while ago and it supports an XML markup that declares the command(s) that you want the system to recognise. Your application then dete... |
go beyond Integer.MAX_VALUE constraints in Java <p>Setting aside the heap's capacity, are there ways to go beyond Integer.MAX_VALUE constraints in Java? </p>
<p>Examples are:</p>
<ol>
<li>Collections limit themselves to Integer.MAX_VALUE.</li>
<li>StringBuilder / StringBuffer limit themselves to Integer.MAX_VALUE.</l... | <p>If you have a huge Collection you're going to hit all sorts of practical limits before you ever have <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#MAX%5FVALUE">2<sup>31</sup> - 1</a> items in it. A Collection with a million items in it is going to be pretty unwieldy, let alone one with mo... |
Does MySQL collation type need to match PHP page charset type? <p>I have started debugging my RSS feed because it has some strange characters in it (i.e. the missing-character glyph). I started with two excellent beginner resources:</p>
<ul>
<li>The Absolute Minimum Every Software Developer Absolutely, Positively Must... | <blockquote>
<p>The real reason I'm raising this question though, is because my DB fields that store my user input are in "latin1_swedish_ci" and I want to know whether I NEED to convert them to "utf8_general_ci"?</p>
</blockquote>
<p>No. <code>latin1_swedish_ci</code> and <code>utf8_general_ci</code> are collations... |
Ubuntu: "Could not find rails locally or in a repository" <p>I'm following <a href="https://help.ubuntu.com/community/RubyOnRails" rel="nofollow">these instructions</a> to set up Ruby on Rails on my Ubuntu machine. For now at least, I'm planning to use Mongrel.</p>
<p>When I get to this step:</p>
<pre><code>sudo gem ... | <p>I would try to update gems first. The latest version is 1.3.3. You can do this on Ubuntu by either:</p>
<pre><code>sudo gem install rubygems-update
sudo update_rubygems
</code></pre>
<p>or </p>
<pre><code>sudo gem install rubygems-update
cd /var/lib/gems/1.8/gems/rubygems-update-*
sudo ruby setup.rb
</code></pr... |
How to run iReport-nb 3.x.x from whithin another java application? <p>I'd like to start using iReport (netbeans edition) and replace the good old classic iReport 3.0.x. Seems like the classic iReport won't be improved anymore and abandoned at some point. </p>
<p>The point is that I need to start iReport from another j... | <p>iReport based on the NetBeans platform works as standalone application (just like the classic one), even if it can be installed and used as NetBeans plugin too.
Soon iR 3.5.2 will be released, it will cover all the remanining features present in iR classic that have been not covered yet in the previous versions, but... |
Sum a subquery and group by customer info <p>I have three tables something like the following:</p>
<pre><code>Customer (CustomerID, AddressState)
Account (AccountID, CustomerID, OpenedDate)
Payment (AccountID, Amount)
</code></pre>
<p>The Payment table can contain multiple payments for an Account and a Customer can h... | <p>If you want the data grouped by month, you need to group by month:</p>
<pre><code>SELECT AddressState, DATEPART(mm, OpenedDate), SUM(Amount)
FROM Customer c
INNER JOIN Account a ON a.CustomerID = c.CustomerID
INNER JOIN Payments p ON p.AccountID = a.AccountID
GROUP BY AddressState, DATEPART(mm, OpenedDate)
<... |
C# Remove process from task manager <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c">How do I hide a process in Task Manager in C#?</a> </p>
</blockquote>
<p>Hey all, im just wondering, how would i remove a ... | <p>I don't believe it's possible, however you could rename it to svchost.exe.</p>
|
What types to use for boxing in generics <p>I've written a simple abstract generic class in C# (.NET 2.0) and I preferably want to limit it to only reference types, so I can indicate no value by a null. However, I also want to use types such as long and decimal, why don't allow null (being structs after all). I consi... | <p>The whole point of generics (among others) is to avoid boxing. See <a href="http://msdn.microsoft.com/en-us/library/25tdedf5%28VS.80%29.aspx" rel="nofollow">this</a>:</p>
<pre><code>private bool _Required = false;
protected T _Value = default(T);
</code></pre>
<p>If you need to distinguish between "0" and "not set... |
Use Zend Framework to create a flexible base application <p>We are developing an e-commerce platform utilizing the Zend Framework. We have several instances of the application up and running, using the same code base. Config settings are used in order to differentiate the various shops.</p>
<p>The challenge we are fac... | <p>I've been looking at the same issue recently at my agency and the solution I'm currently testing involves the following app folder structure:</p>
<pre><code>app/
default/
controllers/
models, etc
ecommerce/
controllers/
models, etc
lib/
S24/
Co... |
Blackberry storm touchEvents <p>Ive ported an Blackberry 4.6.0 application over to the storm on 4.7.0.
All is working fine apart from the touch events i'm trying to control.
I trap touch events in the method below which does as its supposed to but the problem is
after my logic in the touchEvent executes and return the ... | <p>Just to clarify haagmm's answer:</p>
<p>After a TouchEvent.CLICK has been sent to your application, a navigationClick event will also be sent. This is for compatibility reasons, so things like ButtonFields will work on a touchscreen device even if the app hasn't been explicitly written to respond to touchEvents.</p... |
adding jQuery click events to dynamically added content <p>I have a table with multiple rows and columns populated by php and mySQL. For some of the td's I'm adding jQuery click-events in the document.ready function to let the user change the content.</p>
<p>But I also have an option for adding rows to the table and p... | <p>You want to use <a href="http://docs.jquery.com/Events/live" rel="nofollow">live events</a>, which were introduced in 1.3.</p>
<pre><code>$("tr.clickable").live("click", function() {
//add input fields
});
$("span#addNewRow").live("click", function() {
$("table").append('<tr><td class="clickable">... |
Installing .NET framework from USB drive when necessary <p>We have a .NET application that will be distributed through USB drive. End users will connect the drive and double click on the EXE (a .NET exe) to run it WITHOUT installing it.</p>
<p>Now the problem is, if .NET is not installed we would like to trigger the .... | <p>Why not use ClickOnce, and it will do all that for you.</p>
|
Format a device with parted into a specific pattern using parted <p>This is really a parted usage question, but other ideas about how to accomplish this are welcome. </p>
<p>I need to create a boot device set up as follows: </p>
<blockquote>
<p>( up to 4MB erase block size (EBS)):</p>
<p>partitions aligned on ... | <p>I would use sfdisk. For example, for multiple operating systems:</p>
<pre><code>#Warning: sfdisk starts at zero, fdisk at one
sfdisk --force -i -D -uC /dev/hda << EOF
0 383 07 -;
383 383 83 -;
766 1 0c -;
767 1665 E -;
768 2 a -;
771 120 6 -;
892 120 a5 -;
1013 120 83 -;
1134 120 eb -;
1256 120 82 -;
1377 240... |
Enable all firebug tools for ALL webpages? <p>I'm using Firebug 1.3.3 with Firefox 3.0.10, and I wanted to know if it was possible to enable the Console, Script, and Net consoles all the time. </p>
<p>It used to be such that it was always on. Now, if its disabled I have to manually turn on each tool and send requests ... | <p>If you do want to enable parts of Firebug globally, you can do this:</p>
<p>Click on the tab you want to enable, the main firebug window will give you the option to enable bit for just this site, and a 'down arrow' icon will appear next to the tab.</p>
<p>The down arrow will give you a menu to set its enabled/disa... |
Partials in Liquid <p>We're trying to rewrite our current views from ERb to Liquid and we got following problem:
we have a lot of <code>render(:partial => '/path/to/partial')</code> in our code, but we found absolutely no instructions how to render partials in Liquid. The only one solution we found was with help of ... | <p>The Liquid way is to use the <code>include</code> tag: <a href="http://liquid.rubyforge.org/classes/Liquid/Include.html" rel="nofollow">http://liquid.rubyforge.org/classes/Liquid/Include.html</a></p>
<p>(I know that documentation isn't very helpful. Here's a post that shows an example usage: <a href="http://foru... |
Best way to calculate ETA of an operation? <p>I am looking for the best way to calculate ETA of an operation (IE: file download) using a linear progress information.</p>
<p>Lets say that I have the following method that gets called:</p>
<pre><code>void ReportProgress(double position, double total)
{
...
}
</code>... | <p>I actually despise both those ideas because they've both bitten me before as a developer.</p>
<p>The first doesn't take into account the situation where the operation actually gets faster, it says that there's 10 minutes to go and I come back after 3 and it's finished.</p>
<p>The second doesn't take into account t... |
How to : create an Ajaxified HTMLHelper in ASP.Net MVC <p>the more i dig into MVC the more i love it and think how was I working with Web Forms :) </p>
<p>but somethings are really confusing like in in Web forms if i wanted to encapsulate a controls, let us say a Combo Box, then i would create a user control and add t... | <p>The HtmlHelper Extension Methods are executed within the View on the Server. The resulting HTML that they generate is included within the page that is send to the Browser.</p>
<p>You can't create a traditional ASP.NET WebForms Server Control using an HtmlHelper Extension Method the way that you describe, "emulate W... |
Reverse proxy capable pure python webserver? <p>I am looking for a pure python based web server has the capability for reverse proxy as well? </p>
| <p>Have a look at <a href="http://twistedmatrix.com/" rel="nofollow">Twisted</a>, especially its <a href="http://twistedmatrix.com/documents/current/api/twisted.web.proxy.ReverseProxyResource.html" rel="nofollow">ReverseProxyResource</a>.</p>
<blockquote>
<p>Twisted Web also provides various facilities for being set... |
Executing Sql statements with Fluent NHibernate <p>Basically I want to be able to do this: </p>
<p><code>session.ExecuteSql("...");</code></p>
<p>I don't need it to map to any entities or return any values. Any suggestions?</p>
| <p>As already mentioned, this is not a Fluent NHibernate issue but here is an example:</p>
<pre><code>public int GetSqlCount<T>(Session session, string table)
{
var sql = String.Format("SELECT Count(*) FROM {0}", table);
var query = session.CreateSQLQuery(sql);
var result = query.UniqueResult();
... |
Adding history support to ASP.NET / jquery web page <p>I've implemented a web page that loads content dynamically from the server via the <a href="http://malsup.com/jquery/form/" rel="nofollow">jQuery.form</a> plugin (for form POST requests) and via the standard jQuery load method (for all other requests). </p>
<p>Now... | <p>There is no built in support for modifying history directly with JQuery. But there is a JQuery History plugin (or two or three).</p>
<p><a href="http://www.mikage.to/jquery/jquery_history.html" rel="nofollow">http://www.mikage.to/jquery/jquery_history.html</a></p>
<p><a href="http://plugins.jquery.com/project/his... |
WCF: Retrieving MethodInfo from OperationContext <p>Is there an elegant way to get the method that will be executed on a service instance from MessageInspector/AuthorizationPolicy/some other extension point? I could use</p>
<blockquote>
<p>OperationContext.Current.IncomingMessageHeaders.Action</p>
</blockquote>
<p>... | <p>It took me forever, but I did find a way that's better than finding and slogging through the entire contract:</p>
<pre><code>string action = operationContext.IncomingMessageHeaders.Action;
DispatchOperation operation =
operationContext.EndpointDispatcher.DispatchRuntime.Operations.FirstOrDefault(o =>
... |
Google Maps Flash API disables bubbling of MouseEvent over their Markers <p>By default Google Maps Flash API cancels bubbling of all MouseEvents that occur over their Markers (dragable at least). However in MapMouseEvent constructor I see that it has a parameter "bubbles?" so I guess they can be made to bubble mouse ev... | <p>Sorry, but I haven't tested the new Google Maps API in Flash. As far as I remember, you could assign listeners to markers, so if by default bubbling is disabled, in theory all you need to do is listen for the event you want for all of the markers you have and when the event listener is triggered you dispatch you own... |
JTable Scrolling to a Specified Row Index <p>I have a JTable that is within a <code>JScrollPane.</code> Rows are added to the table at runtime based on events that happen in my application. I want to have the scoll pane scroll to the bottom of the table when a new row is added to the table.</p>
<p>For JLists There is ... | <p>It's very easy, JTable has scrollRectToVisible method too. If you want, you can try something like this to make scrollpane go to to the bottom if a new record is added :</p>
<pre><code>jTable1.getSelectionModel().setSelectionInterval(i, i);
jTable1.scrollRectToVisible(new Rectangle(jTable1.getCellRect(i, 0, true)))... |
ASP.NET MVC Spark view engine <p>What pros(positive sides) of using Spark view engine for ASP.NET MVC project. Why it better then default view engine?</p>
| <p>One important thing about Spark View engine is that its syntax is very similar to HTML syntax, that way your views will be clean and you will avoid "tag soup" that is in WebForms View engine.
here is an example:</p>
<p><strong>Spark:</strong></p>
<pre><code><viewdata products="IEnumerable[[Product]]"/>
<u... |
Using Lambda in Unit Test in VB.NET 2008 with Rhino.Mocks <p>I am trying to create a unit test similar to how I would have done one in C# but am struggling with the lambdas in vb. </p>
<p>Bascially I am trying to mock a class and then create a stub and return. In C# I would have done something like;</p>
<pre><code>Mo... | <p>One easy example I typically show (as I'm a VB developer also) is the below: (for some odd reason in VB you need to pull this out into another function that returns nothing)</p>
<pre><code> <TestMethod()> _
Public Sub Should_Call_Into_Repository_For_GetAllUsers()
Dim Repository As IUserRepository = Moc... |
Create a Email message in .NET <p>I want to be able to create an email message with an attachment, but not send it.
The email should open in Outlook where the user can send himself.</p>
<p>I have been playing around with Mailto: command in order to open a new mail message, however, Outlook client doesn't seem to suppo... | <p>If you want to open the mail message in Outlook, then I'm pretty sure you <em>will need to use COM</em>. Is there any particular reason you want to interact with Outlook rather than automate the sending using SMTP and the <code>System.Net.Mail</code> namespace?</p>
<p><strong>Edit:</strong> It seems you can specify... |
Tab Seperated text converted to tabular format with border <p>I needed to convert a Tab Seperated Text file into a tabular format as follows </p>
<p>File content</p>
<pre><code>ID<TAB>WorkId<TAB>Date
0<TAB>W-1230699600000<TAB>2008-12-31
1<TAB>W-1233378000000<TAB>2009-01-31
</code><... | <p>I ended up using awk to do this. Here is what I did.</p>
<pre><code>cat /tmp/1.txt | awk -F'\t' '
BEGIN {
fieldSize=5;
for (i=1; i < fieldSize; i++) {
fLength[i]=0;
}
}
{
for (i=1; i <= fieldSize; i++) {
if (fLength[i] < length($i)) {
fLength[i] = length($i)
}
... |
How can I make the browser scroll to the top after submitting a form in a frame <p>I have a page with an iframe. In the iframe is a form targeting that frame. The submit button is down near the bottom but the results page is short and appears at the top. So when the user hits submit, the form disappears but they don't ... | <p>Try this:</p>
<pre><code><form onsubmit="parent.scrollTo(0, 0); return true"> ...
</code></pre>
<p>I have no idea how cross-browser compatible that is.</p>
|
Hiding an Excel worksheet with VBA <p>I have an Excel spreadsheet with three sheets. One of the sheets contains formulas for one of the other sheets.</p>
<p>Is there is a way of hiding it that sheet pprogrammatically, which contains these formulas?</p>
| <p>To hide from the UI, use Format > Sheet > Hide</p>
<p>To hide programatically, use the <code>Visible</code> property of the <code>Worksheet</code> object. If you do it programatically, you can set the sheet as "very hidden", which means it cannot be unhidden through the UI.</p>
<pre><code>ActiveWorkbook.Sheets("Na... |
Do I need a protocol for notification? <p>I have classDownload that uses NSURLConnection. I'd like to keep all of the NSURLConnection events in classDownload. ClassA wants to use classDownload but also receive notifications such as connectionDidFinishLoading, which is called Finish in classDownload. How do I get the... | <p>Assuming <code>classDownload</code> is the delegate of the <code>NSURLConnection</code>, you could just use <code>NSNotificationCenter</code> to broadcast events when the delegate methods are called. Then, in <code>classA</code>, subscribe to the events in <code>classDownload</code> using <code>addObserver:</code>. ... |
ADO.Net Insert strongly-typed Row without loading dataset to memory <p>Is there a way to insert a row using ADO.Net without filling the dataset or specifying the columns? My datasets may be large, so I don't want to load them just to add a row. I know I can insert using an adapter and specifying the columns, but I'll... | <p>Load your table into an ADO.NET DataSet using a query like this:</p>
<pre><code>select * from myTable where (1=0)
</code></pre>
<p>This will give you a zero-row dataset.</p>
<p>Then add your row to the dataset and get the adapter to save it for you.</p>
|
What do I need to read Microsoft Access databases using Python? <p>How can I access Microsoft Access databases in Python? With SQL?</p>
<p>I'd prefere a solution that works with Linux, but I could also settle for Windows.</p>
<p>I only require read access.</p>
| <p>On Linux, MDBTools is your only chance as of now. <sup><a href="http://stackoverflow.com/questions/853370/#comment53931912_15400363">[disputed]</a></sup></p>
<p>On Windows, you can deal with mdb files with pypyodbc.</p>
<p>To create an Access mdb file:</p>
<pre><code>import pypyodbc
pypyodbc.win_create_mdb( "D:\\... |
Maintaining focus on ajax update panel after updating form <p>I've have a formview that is designed to update it's datasource each time a text_changed event or dropdown list has been changed. On every text_changed event and equivalent for other controls I call the formView.UpdateItem method and this causes the form to ... | <p>For things like this, I often stash the value in an asp:Hidden control (input type="hidden") using the javascript and then add a pageLoad function (in the javascript) to parse that field and then set the focus. This way the id of the focused control is persisted through the postback.</p>
<p>Something like this (pse... |
ASP.NET RewritePath not working as expected / URL in browser changing <p>When I try to rewrite a URL in ASP.NET I'm finding that the URL changes on the user's browser. I'm using WCF REST services and I want to change the way that you access URLs. See the code example below.</p>
<p>I have an HttpModule that is interc... | <p>It may be more likely that the IIS pipeline is not routing all URLs through the ASP.NET pipeline. So it sees the .pox or .svc extension and just passes it through generic, static file handlers.</p>
<p>Your "fix" actually hides the extension, so it gets routed through the full .NET pipeline.</p>
|
Getting info from Wikipedia - how do I get HTML form? <p>I'm using curl to retrieve information from wikipedia. So far I've been successful in retrieving basic text information but I really would want to retrieve it in HTML.</p>
<p>Here is my code:</p>
<pre><code>$s = curl_init();
$url = 'http://boss.yahooapis.c... | <p>The simplest solution would probably be to grab the page itself (e.g. <a href="http://en.wikipedia.org/wiki/Combination" rel="nofollow">http://en.wikipedia.org/wiki/Combination</a> ) and then extract the content of <code><div id="content"></code>, potentially with an xpath query.</p>
|
How do you make a Kohana website portable? <p>I just finished coding an online portal with <a href="http://kohanaphp.com/" rel="nofollow">Kohana PHP</a>.</p>
<p>It works fine on my PC, but when I tried to host it on another server, "BONK!",
it shows up without displaying the pictures of the products.</p>
<p>I don't e... | <p>I'm using Kohana to develop a few websites and here are some tricks that I use to make sure that the websites are portable, as in I can just upload the files from my development environment into the server and have them running without having to modify anything:</p>
<ol>
<li><p>Use the same directory structure. For... |
What bitrate can I expect with MPEG? <p>What bit-rate (approximately) can I expect MPEG encoders to produce for 160x120 "ok-quality" webcam stream?</p>
<p>How much CPU-demanding will the encoding be? The decoding?</p>
<p>Are there any better encoding formats for that purpose? (In terms of bit-rate or CPU)</p>
| <p><code>256 KBps</code> is enough for <code>QSIF</code> (<code>160x120</code>, <code>25 fps</code>) in <code>MPEG2</code>.</p>
<p>Any modern <code>CPU</code> (since <code>Pentium IV</code>) can encode and decode it in realtime.</p>
<p>There are hardware solutions (like <code>Compro VideoMate</code> <code>H900</code>... |
Free libraries for adding some eye candy to WinForm apps? <p>I want to spice up some gray WinForm apps. Any recommendations for free WinForm libraries.</p>
<p>I have seen AquaButtons at <a href="http://www.codeproject.com/KB/buttons/aquabutton.aspx" rel="nofollow">http://www.codeproject.com/KB/buttons/aquabutton.aspx<... | <p><a href="http://www.componentfactory.com/" rel="nofollow">Krypton</a> controls are pretty good</p>
|
Programmatic way to place a website into a new Word file... in Java <p>Is it possible to programmatically place the contents of a web page into a Word file? </p>
<p>To further complicate this, I'd like to do these steps in Java (using JNI if I must). </p>
<p>Here are the steps I want to do programmatically, followe... | <p>you could do better imho downloading the file using HTTP then create a new word file using <a href="http://poi.apache.org/hwpf/index.html" rel="nofollow">Apache POI</a> and copying the HTTP stream inside the word file</p>
|
Secure Web Services: REST over HTTPS vs SOAP + WS-Security. Which is better? <p>I'm not a security expert by any means, but I favor creating REST-style web services. </p>
<p>In creating a new service which needs to have the data it transmits secure. We've entered a debate over which approach is more secure - REST wi... | <p>HTTPS secures the transmission of the message over the network and provides some assurance to the client about the identity of the server. This is what's important to your bank or online stock broker. Their interest in authenticating the client is not in the identity of the computer, but in your identity. So card nu... |
First & Follow Sets check for simple grammar <p>Here's a few questions I had on a quiz in a class and just want to verify their correctness.
Grammar:</p>
<pre><code>S -> ABC
A -> df | epsilon
B -> f | epsilon
C -> g | epsilon
</code></pre>
<p>1.) The Follow set of B contains g and epsilon (T/F)? Ans: F.
T... | <ol>
<li>You are correct. If epsilon is involved, it will be accounted for in the First set, not the Follow set. If it's possible for the production to end the string, then $ goes in the Follow set, not epsilon.</li>
<li>The quiz is correct. The production S can indeed start with any of d, f, and g, and it can also be ... |
In WPF, can you bind a ListView (NOT DataGrid) to a Matrix (Cross-Tab) DataSet? <p>Is it possible in WPF to bind a ListView (NOT a DataGrid) to a Matrix (Cross-Tab) DataSet in which the columns are unknown beforehand?</p>
<p>Using the Northwind database as an example: the simple query below will return a wellknown dat... | <p>You can generate the GridViewColumns for the ListView programatically and apply the binding to that. Loop through the columns in the DataSet and add a corresponding GridViewColumn into the ListView.</p>
<pre><code>var gridView = (GridView)list.View;
foreach(var col in table.Columns) {
gridView.Columns.Add(new Gr... |
jQuery XML parsing with namespaces <p>I'm new to jQuery and would like to parse an xml document.</p>
<p>I'm able to parse regular XML with the default namespaces but with xml such as:</p>
<pre><code><xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:... | <p>I got it.</p>
<p>Turns out that it requires <code>\\</code> to escape the colon.</p>
<pre><code>$.get(xmlPath, {}, function(xml) {
$("rs\\:data", xml).find("z\\:row").each(function(i) {
alert("found zrow");
});
}, "xml");
</code></pre>
<p>As Rich pointed out:</p>
<p>The better solution does not r... |
HTML login form return error <p>I was tasked with cleaning up some errors on a site my company built quite a few years ago. I want to preface the code I post here with the caveat that I didn't write it, and I know it is not a very secure login system, but I have only been assigned to fix the bug at hand.</p>
<p>PROBL... | <p>Resisting the urge to shout 'SQL injection attack!!!!1111', as you say it does rather look like the form isn't submitted correctly. A couple of ideas:</p>
<p>Do you check in some way that the form has been submitted in the code before you query the database? If so, is this value definitely being posted?</p>
<p>I h... |
Add CSS class on parent node if child node is selected <p>I have a recusive-method that creates a unordered list from a XML document. To check which node I am positioned on I use the querystring to match the URL in the XML document.</p>
<p>I need to add the class 'current' on the parent node if I am positioned on its ... | <p>This isn't an especially elegant solution, but if I understand the problem correctly, you could create a method to check if a child node is selected:</p>
<pre><code>private static bool IsChildSelected(XmlNode item)
{
foreach(XmlNode child in item.ChildNodes)
{
if(HttpContext.Current.Request.Url.Abso... |
jsp pageing problem <p>i am using the redy made paging tags.B But it give me a error of null pontinter exception.
the first page is displayed correctly.But when i click next it gives the error</p>
<p><%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%</p>
<p>Iterator i = null;
Set tuto... | <p>It looks like the new request isn't getting the tut_lst attribute.</p>
<p>Are you getting a null pointer exception?</p>
<p>edit: normally an attribute is set in session scope. Is there a reason you don't want to do this?</p>
|
IIS Server Name Change <p>I have a certificate for that is valid for *.MyCompany.<strong>com</strong>. That is fine for my dev and test servers because the first part of the URLs for those computers ends like that.</p>
<p>I want to test this on my computer and the certificate is incorrect because my computer defaults... | <p>you could edit your hosts file and add an entry to point <a href="http://you.yourcompany.com" rel="nofollow">http://you.yourcompany.com</a> to your local ip or 127.0.0.1</p>
<p>Edit c:\Windows\System32\drivers\etc\hosts with a text editor.</p>
<p>save it and you should be able to hit your own IIS using the new fak... |
C# New form never gains focus <p>I have been trying to write a small app with its own option windows. When I try to launch the window I can never seem to set focus on the new form. This is not a mdi form, but merely a new form that I create when a user selects an option from the menu. It should be noted that Form.Show ... | <p>It's because <code>Form.canFocus()</code> is false when the form loads. Use <code>Form.Activate()</code> on <code>Form.Shown</code> event. That's all.</p>
<pre><code>private void ServerForm_Shown(object sender, EventArgs e)
{
this.Activate();
}
</code></pre>
|
Is there an easy way to append lambdas and reuse the lambda name in order to create my Linq where condition? <p>I have a user control which takes a Func which it then gives to the Linq "Where" extension method of a IQueryable. The idea is that from the calling code, I can pass in the desired search function.</p>
<p>I... | <p>Just save the current lambda in a temporary variable to prevent recursion.</p>
<pre><code>var tempFunc = func;
func = a => tempFunc(a) && ...
</code></pre>
|
a method creates an object and I call the method from an other object <p>If a method creates an object and I call the method from an other object, will the last object have access to the first object's properties and methods?</p>
| <p>There's some extraneous information there that may be confusing you. </p>
<p>The method and the object (in this case) are disconnected from one another. So the question becomes, are you storing the created object in a scope that the second object has access to? </p>
|
How can I jump from one placeholder to the next in Xcode autocompletion? <p>When Xcode autocompletes an method for me, it gives me blue blocks for parameters. I always go into the first, but then I click into all next ones rather than fast going there by keyboard commands. I guess that there are some good ones to know.... | <p>The default is Command-/, but you can customize that in the key bindings section of XCode's settings window.</p>
|
How much does an CGAffineTransformMakeRotation() cost? <p>Is that an very cost-intensive function that sucky my performance away under my feet? I guess they used that one for the waggling buttons on the home screen + core animation. I just want to know before I start wasting my time ;)</p>
| <p>Seems unlikely that it'd be much of a performance problem - it works out to something like a Cosine, a Sine, and a few multiplications. Don't call it thousands of times a second, and you'll be fine. </p>
|
JQuery slimbox rebind after ajax callback <p>I'm having trouble rebinding slimbox2 after ajax content is loaded. I realize I need to rebind the function on the ajax load but I have no idea how to do that. I'm using this code to generate the external content.</p>
<pre><code>$(document).ready(function() {
$('.content_b... | <p>I took a look at <a href="http://docs.jquery.com/Plugins/livequery" rel="nofollow">liveQuery</a> for you. Here's what you'd need to do:</p>
<pre><code>$("a[rel^='lightbox']").livequery(function(){
$(this).slimbox({/* Put custom options here */}, null, function(el) {
return (this == el) || ((this.rel.len... |
LINQ to SQL - Tracking New / Dirty Objects <p>Is there a way to determine if a LINQ object has not yet been inserted in the database (new) or has been changed since the last update (dirty)? I plan on binding my UI to LINQ objects (using WPF) and need it to behave differently depending whether or not the object is alre... | <p>ChangeSet changes = context.GetChangeSet();</p>
<p>If changes.Inserts.Contains(yourObject) then it is new and will be inserted when SubmitChanges is called</p>
<p>If changes.Updates.Contains(yourObject), it's already in the database, and will be updated on SubmitChanges()</p>
|
.Net client vs Java Server with raw data <p>I am writting a .Net/C# client to a Java Server on Solaris.</p>
<p>The Java server is writting Raw byte data in a Gziped format which I need to extract, but I am having trouble to read the data in the right buffer sizes. I read the message not-deterministicly incomplete or c... | <p>The GZIP format is not complex. It is available in all its glory in <a href="http://www.ietf.org/rfc/rfc1952.txt" rel="nofollow">a simple, accessible specification document, IETF RFC 1952</a>. </p>
<p>The GZIP format specifies the bit-order for bytes. It is not tunable with a flag for endianness. The producer of... |
How can I chain animations in iPhone-OS? <p>I want to do some sophisticated animations. But I only know how to animate a block of changes. Is there a way to chain animations, so that I could for example make changes A -> B -> C -> D -> E -> F (and so on), while the core-animation waits until each animation has finished... | <p>Assuming you're using UIView animation...</p>
<p>You can provide an animation 'stopped' method that gets called when an animation is actually finished (check out <code>setAnimationDelegate</code>). So you can have an array of animations queued up and ready to go. Set the delegate then kick off the first animation. ... |
How Do I Backup My PostgreSQL Database with Cron? <p>I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so:</p>
<pre><code>/usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/prevac.gz
/usr/bin/sudo -u postgres /usr/bin/vacuumdb --analyze mydatab... | <p>I have a dynamic bash script that backs up all the databases on the server. It gets a list of all the databases and then vacuums each DB before performing a backup. All logs are written to a file and then that log is emailed to me. This is something you could use if you want.</p>
<p>Copy the code below into a file ... |
Crystal Reports Summing <p>So I two groups
tblTenant.ID
tblTransaction.TenantID</p>
<p>In tblTransactions there are two fields I want to manipulate, AmountCharged and AmountPaid. How can I sum both fields and subtract them per group? I.E., each Tenant will have all their amountCharged's summed and then have their Amou... | <p>The easiest way I can think of is to create a formula field on your detail line that is AmountCharged-AmountPaid and make it hidden. Then just right click on it and insert a sum on the group.</p>
|
If Pentaho is Open Source, can I just use it? <p>I see that <a href="http://www.pentaho.com/">Pentaho</a> wants to charge me for their software. How can I get to the underlying Open Source software for dashboards to see what it can do without having to deal with Pentaho marketing folks?</p>
| <p>Most commercial open source editions have a community edition that the community hacks on <strong>if the license permits it*</strong>. Pentaho is no different from them and has a <a href="http://community.pentaho.com/">community edition</a>.</p>
<p>In these cases, the "community edition" is not the same thing as th... |
Visual Studio inserts invalid characters in batch files <p>I've got some batch files that I use to help automate the process of creating and reloading development databases. It makes sense to create and maintain these batch files in Visual Studio (i.e., in a VS Database project). They look pretty simple, like this:</... | <p>Ray is correct when he says that Visual Studio's default format for text is something like UTF-8. Although Notepad++ is a great tool and I use it myself, there is an alternative in that you can tell Visual Studio to store your text file in ASCII format:</p>
<p>In VS2008, select your file in the solution explorer a... |
How do I use logback-access in combination with Tomcat 5.5? <p>I've got several Web apps running on a Tomcat 5.5 server, and I'm working on improving/updating the overall logging system used throughout the system. I already had some success with logback-classic. However, when I try to use logback-access (i.e. access th... | <p>I've got it working. With <strong>maven and logback-classic</strong> the jars end in <strong>WEB-INF/lib</strong> and it works well.
I've seen the same error only when deploying old version of my WAR.</p>
<p>excerpt of dependencies section of my <strong>pom.xml</strong></p>
<pre><code><dependency>
<gro... |
Silverlight Project -Expression Blend <p>Is there a way to apply bitmapeffects within a silverlight web project.</p>
| <p>Silverlight2 currently doesn't support any form of bitmap effects. The workaround to add bitmap effects to any elements in your Silverlight app, for example, a drop shadow, you would have to manually create the shadow of the UI element, and export it as an image, and place it within your silverlight application as a... |
Ways in .NET to get an array of int from 0 to n <p>I'm searching the way(s) to fill an array with numbers from 0 to a random. For example, from 0 to 12 or 1999, etc.</p>
<p>Of course, there is a <code>for</code>-loop:</p>
<pre><code>var arr = int[n];
for(int i = 0; i < n; i++)
{
arr[i] = i;
}
</code></pre>
<p>A... | <p>This already exists(returns IEnumerable, but that is easy enough to change if you need):</p>
<pre><code>arr = Enumerable.Range(0, n);
</code></pre>
|
RegisterClientScriptResource + AJAX update panel <p>I have a problem that is really making me feel dumb. I have a custom control that inherits textbox. This textbox (at least for this example) simply has a .js file that is embedded in the .dll.</p>
<p>Long story short, works great when not in an AJAX update panel. ... | <p>Try to pass <code>this</code> instead of <code>this.Page</code>. The ScriptManager would output scripts only for controls which are being updated (children of UpdatePanel that is).</p>
<p>I've just noticed that you are doing this during Render. That's too late. Try PreRender instead. </p>
|
Cocoa Control/View for displaying list of directories <p>I'm new to Cocoa development - I want to display an aribitrary number of directory paths in a control/view. What's the best type of built-in control/view for this?</p>
<p>Requirements:
<li>
This should be a flat list only and not a full File System browser.
</l... | <p>Perhaps you're looking for the <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableView%5FClass/Reference/Reference.html" rel="nofollow">NSTableView</a> class if you simply want to display the directory paths as a list. The <a href="http://developer.apple.com/documentation... |
Can anyone suggest some good tutorials for Lucene? <p>can anyone suggest me some good tutorials on Lucene. I was reading Lucene in Action, but it seems to be a old edition of current lucene. Most of the methods are deprecated. </p>
<p>Where to start? I am googling around a bit.</p>
<p>Thanks,
Kapil</p>
| <p>It's true that there has been changes, but they're not as substantial as it might seem. The most radical change that I can think of is that the api for the IndexSearcher.search() method has changed, but it really isn't that difficult to adapt your code to the new usage. </p>
<p>In general, the old methods are still... |
How do I remove old signatures from Outlook forms? <p>I modified an existing form and saved it on my desktop as .oft file.
Whenever I send this form I have an old signature that shows.</p>
<p>If I double click the .oft file I see the body with that old signature and then my newer one below it. I would like to delete t... | <p>If you or a collaborator accidentally saves an .oft Outlook Form with RTF in the message body (which includes signatures), this rich text will be forever stuck in the .oft, as far as I can tell (unless you decide to hack it up in a hex editor). As others suggest in the dark corners of the web, you can run the form, ... |
Mercurial cherry picking changes for commit <p>Say, I made many changes to my code and only need to commit a few of those changes. Is there a way to do it in mercurial? I know that <code>darcs</code> has a feature like this one.</p>
<p>I know <code>hg transplant</code> can do this between branches, but I need somethin... | <p>MQ as Chad mentioned are one way. There's also more lightweight solutions:</p>
<ul>
<li><a href="http://www.selenic.com/mercurial/wiki/RecordExtension">Record extension</a> which works roughly the same way as darcs record. It's distributed with mercurial.</li>
<li><a href="http://www.selenic.com/mercurial/wiki/Shel... |
Help Linq to Sql <p>Why am I getting a exception when ApplyPropertyChanges???</p>
<p>The code is almost the same when I'm editing a user table but is not working with my news table.</p>
<p>The create, delete and details are all working fine but when I try to edit a news I'm getting the exception below:</p>
<p><stron... | <p>I solve it.</p>
<p>The problem is on the EF model.</p>
<p>To solve it you'll need a extension method to persist your data:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
namespace MagixCMS.Model... |
how to map memory as USWC under windows/linux? <p>I need to map most of the computer memory as uswc to take advantage of non-caching movntdqa. Is there any easy way to do this under windows or linux?</p>
| <p>Under Linux, this is easy - although you'll have to be careful that you don't map kernel memory to W/C - that could get ugly. Assuming you know how to reserve a physical range of memory from userspace, you can then use "/proc/mtrr" to change the memory type. </p>
<p>One example page describing the interface is <... |
Why is the use of tuples in C++ not more common? <p>Why does nobody seem to use tuples in C++, either the <a href="http://www.boost.org/doc/libs/1%5F39%5F0/libs/tuple/doc/tuple%5Fusers%5Fguide.html">Boost Tuple Library</a> or the standard library for TR1? I have read a lot of C++ code, and very rarely do I see the use ... | <p>A cynical answer is that many people program in C++, but do not understand and/or use the higher level functionality. Sometimes it is because they are not allowed, but many simply do not try (or even understand).</p>
<p>As a non-boost example: how many folks use functionality found in <code><algorithm></code... |
Is it possible to shutdown linux kernel and resume in Real Mode? <p>Let's say I'd like to start a small linux distro before my ordinary operating system start.</p>
<ol>
<li>BIOS load MBR and execute MBR.</li>
<li>MBR locates the active partition which is my linux partition.</li>
<li>Linux start and I perform what I ne... | <p>Linux does not normally support this, particularly since it reinitializes hardware in a way that the BIOS and DOS programs may not expect. However, there is some infrastructure to switch back to real mode in specific cases - particularly, for a reboot (see machine_real_restart in arch/x86/kernel/reboot.c) - and has ... |
How do I check my appplication's cpu usage (inside the app of course)? <p>Duplicate: <a href="http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-c">http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-c</a></p>
<p><hr /></p>
<p>I have an application that is displaying stuff in real time.... | <p>I found it <a href="http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-c">here</a>. </p>
<p>Somehow I always find it after. </p>
|
JMS vs Webservices <p>What are the big advantages from JMS over Webservices or vice versa?</p>
<p>(Are webservices bloated? Is JMS overall better for providing interfaces?)</p>
| <p>EDITED after correction from erickson:</p>
<p>JMS requires that you have a JMS provider, a Java class that implements the MessageListener interface for processing messages, and a client that knows how to connect to the JMS queue. JMS means asynchronous processing - the client sends the message and doesn't necessar... |
Wireshark Info Filter Help <p>I have looked all over the net for a tutorial on how to filter the info column but cant find any that makes sense.</p>
<p>I want to filter all logs where the info column contains the text "insitu-conf" but cant find out how. Help please.</p>
| <p>You actually can't do this directly. The info column is decoded based on the properties of the packet, though, and you can filter on these which will have exactly the same effect. The only difference is you have to figure out what info wireshark is using to create that info line, which may be non-intuitive.</p>
<p>... |
Combine several bitmaps into (TrueType) font <p>I have several (~200) small bitmap files with glyph images. How can I combine them to a single bitmap font file? </p>
<p>Actually, I need a TrueType font created from these bitmaps (with no curves, smoothing, vectorization or any transformations). It's a designer 'pixel'... | <p>Maybe <a href="http://chris.pirillo.com/how-to-create-your-own-truetype-font-for-free/" rel="nofollow">this</a> or <a href="http://fontforge.sourceforge.net/" rel="nofollow">fontforge</a> is of any help.</p>
|
Javascript window.open observation when window already exists using Prototype <p>I've come across an odd scenario in which window.open() is not triggering the 'load' event if the actual window is already on the screen. </p>
<p><strong>Synopsis</strong><br />
I have a button that when clicked runs some javascript and o... | <p>I'm guessing that either the child window is in a different domain when the binding happens, or it is loading from cache before the load happens. try putting your binding in a 500ms timeout. If you control the child window's url, it would be easier to call the parent from the child. Alternatively close & re-o... |
TCP socket timeout configuration <p>I have a Java application which uses a third-party COM component through a Java-COM bridge.
This COM component opens a socket connection to a remote host.</p>
<p>This host can take some time to respond, and I suspicious that I'm getting a timeout. I'm not sure because as I said, it'... | <p>Do you want to build your application so that it knows at runtime whether or not a timeout happened, or do you want to inspect the behavior of the closed-source COM component? If it's the latter, install Wireshark on your dev box and watch the connection. If it's the former, do you want to ensure that your Java ca... |
When and why to 'return false' in JavaScript? <p>When and why to <code>return false</code> in JavaScript?</p>
| <p>Often, in event handlers, such as <code>onsubmit</code>, returning false is a way to tell the event to not actually fire. So, say, in the <code>onsubmit</code> case, this would mean that the form is not submitted.</p>
|
In CakePHP, is it possible to have internal and external routes? <p>A Facebook app is hosted on my server at, say, <a href="http://server.com/projects/fbapp/" rel="nofollow">http://server.com/projects/fbapp/</a>, but is only ever viewed <em>in</em> Facebook at, for instance, <a href="http://apps.facebook.com/fbapp/" re... | <p>Cross posting my comment by request: </p>
<p>Wouldn't an (apache) rewrite of traffic from facebook be the most elegant solution? Your internal machine would only have to deal with one path, and if you wanted to integrate the app with another service/platform at a later date, you would only have to add another rewri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.