input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
BouncyCastle RSA encryption for BlackBerry <p>How do I implement BouncyCastle RSA encryption for a BlackBerry application?</p>
| <p>As @itsteju points out, you can get the same functionality using the BlackBerry methods, but that does require an agreement and a royalty payment to Certicom.</p>
<p>Bouncy Castle maintains a J2ME compatible release on their <a href="http://www.bouncycastle.org/latest%5Freleases.html" rel="nofollow">releases page</... |
Tricky brace expansion in shell <p>When using a POSIX shell, the following</p>
<pre><code>touch {quick,man,strong}ly
</code></pre>
<p>expands to</p>
<pre><code>touch quickly manly strongly
</code></pre>
<p>Which will touch the files <code>quickly</code>, <code>manly</code>, and <code>strongly</code>, but is it poss... | <p>... There is so much wrong with using <code>eval</code>. What you're asking is only possible with <code>eval</code>, <strong>BUT</strong> what you might <strong>want</strong> is easily possible without having to resort to bash bug-central.</p>
<p>Use arrays! Whenever you need to keep <em>multiple</em> items in <e... |
Adsense equivalent for a desktop application? <p>Jeff has <a href="https://stackoverflow.fogbugz.com/default.asp?W2434">mentioned</a> in the past that dealing directly with the advertiser is "a great model if you can get it", but I imagine getting the critical mass that will attract advertisers to a desktop application... | <p>BSA seems to provide ads for desktop apps</p>
<p><a href="http://blog.buysellads.com/2010/04/using-bsa-for-selling-ads-in-a-desktop-application/" rel="nofollow">http://blog.buysellads.com/2010/04/using-bsa-for-selling-ads-in-a-desktop-application/</a></p>
|
ASP.net's equivalent of "cycle" from Rails? <p>Going from Rails to ASP.net has been quite a pain. But I was wondering if any gurus out there know of equivalent translation of "cycle" from Rails for ASP.net ?</p>
<p><a href="http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001721" rel="nofollow">... | <p>There's no built-in function to accomplish that - you will have to code it yourself. You can accomplish the same thing using modulo, but you will have to use a for loop (or some kind of index):</p>
<p>var colours = new List {"Red", "Green", "Blue"};</p>
<pre><code>for (int i=0; i < rows.length; i++) {
out.w... |
Persist header data across reply emails <p>Am trying to determine the best way to persist information from an originating email, through to a reply back.</p>
<p>Essentially, it is to pass a GUID from the original email (c#), whereby when the receiver replies back, that GUID is also sent back for reference.</p>
<p>I h... | <p>Some variation on VERP is probably the most reliable...</p>
<p><a href="http://en.wikipedia.org/wiki/Variable_envelope_return_path">http://en.wikipedia.org/wiki/Variable_envelope_return_path</a></p>
<p>Specifically, instead of having all your replies coming to the same address, encode the information you want to p... |
Read Unicode characters from command-line arguments in Python 2.x on Windows <p>I want my Python script to be able to read Unicode command line arguments in Windows. But it appears that sys.argv is a string encoded in some local encoding, rather than Unicode. How can I read the command line in full Unicode?</p>
<p>Exa... | <p>Here is a solution that is just what I'm looking for, making a call to the Windows <code>GetCommandLineArgvW </code> function:<br>
<a href="http://code.activestate.com/recipes/572200/">Get sys.argv with Unicode characters under Windows</a> (from ActiveState)</p>
<p>But I've made several changes, to simplify its usa... |
Client Monitoring keylogger problem <p>First of all, the keylogger that i am developing is not at all for offensive and destructive purposes. :)</p>
<p>I am developing a client monitoring application in C#.NET.
Keylogging is one of the features in my application.
Though i have developed the code for the keylogger, i h... | <p>You should add the code of your KeyboardHook.</p>
|
Is Twisted an httplib2/socket replacement? <p>Many python libraries, even recently written ones, use httplib2 or the socket interface to perform networking tasks.</p>
<p>Those are obviously easier to code on than Twisted due to their blocking nature, but I think this is a drawback when integrating them with other code... | <p>See <a href="http://stackoverflow.com/questions/80617/asychronous-programming-in-python-twisted">asychronous-programming-in-python-twisted</a>, you'll have to decide if depending on a non-standard (external) library fits your needs. Note the answer by <a href="http://stackoverflow.com/users/13564/glyph">@Glyph</a>, ... |
how to compare two msword document in java? <p>I am looking for a Java API which can compare two microsoft word documents.</p>
<p>We want to compare two msword document and things which are not common that we have to highlight with some color or any other way ... So I thing we have to merge both document and highlight... | <p>Try <a href="http://weblogs.java.net/blog/tchangu/archive/2005/12/open%5Foffice%5Fjav%5F1.html" rel="nofollow">OpenOffice API</a>, but there arent many resources out there to tell you how to use it.</p>
|
Easily access an array based on its dimensions <p>Lets say I have an array which has <em>n</em> dimensions. Now in order to access a slot you typically use:</p>
<pre><code> array [1][0]
</code></pre>
<p>What if the number of dimensions are not known at compile-time, is there an easy access like:</p>
<pre><code> slot... | <p>There is no such facility in AS3. Neither is <code>eval</code> (taken out due to security reasons mostly, IIRC). The latter also being one of those few areas where AS3 differs from the ECMAScript specification.</p>
|
How can I write apps for the latest Sony Ericsson phones? <p>For me in particular it's about Sony Ericsson W715.
What languages can I use and what environment do I need?</p>
<p>A tutorial recommendation would also be nice.</p>
| <p>They have a developer page..
<a href="http://developer.sonyericsson.com" rel="nofollow">http://developer.sonyericsson.com</a></p>
|
how to create installer inside another installer? <p>I want to create a Windows Installer, the 1st step I want it to call another installer (will install dependent components of my application), and the 2nd step I want to install my own application. I want to do all tasks in one installation process, and I have the dep... | <p>You might want to take a look at the <a href="http://msdn.microsoft.com/en-us/magazine/cc163899.aspx">Microsoft Bootstrapper</a>, assuming the dependent components are libraries such as .NET or similar then it's fairly straightforward.</p>
<p>If you want to create a <a href="http://en.wikipedia.org/wiki/Windows%5FI... |
Disable key input in TreeView <p>I have a TreeView in my form for which I dont want to have key input enabled.
Which means that if I have this tree structure:</p>
<pre><code>Root
|
-- Abba
|
-- Basic
|
-- Center
</code></pre>
<p>...and press <kbd>b</kbd> key. I do not want "Basic" to be selected. I only want the user... | <p>in key press event of tree view</p>
<pre><code> if(Char.IsDigit(e.KeyChar) || Char.IsLetter(e.KeyChar))
{
e.Handled = true;
}
</code></pre>
|
How to get public key from a certificate in iPhone programe? <p>Now I have a certificate which includes a public key,i want to get the public key from it in iPhone SDK programming, and encrypt a string by RSA with the public key.What should i do?
Please help me!!Thanks very much.</p>
| <pre><code>SecKeyRef publicKeyReference = NULL;
NSMutableDictionary* queryPublicKey;
SecItemCopyMatching((CFDictionaryRef)queryPublicKey, (CFTypeRef *)&publicKeyReference);
</code></pre>
<p>publicKeyReference - is your public key representation;
queryPublicKey - is your certificate representation;
SecItemCopyMatc... |
How to add Windows Mobile 6.1 image to VS 2008 Device Emulator Manager? <p>I have VS 2008 SP1 on my pc, also Virtual PC and ActiveSync 4.5 is installed
I just download and install "Windows Mobile 6.1 Emulator Images" msi from microsoft</p>
<p>but after install, Mobile images not add to Device Emulator Manager (Under D... | <p>If you read the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=3D6F581E-C093-4B15-AB0C-A2CE5BFFDB47&displaylang=en" rel="nofollow">download</a> page carefully it requires the <a href="http://www.microsoft.com/downloads/details.aspx?familyid=06111a3a-a651-4745-88ef-3d48091a390b&displaylang=... |
Why is my icon not being distributed to the device? <p>During the work on my iPhone application the icon changed from time to time. Colleagues or management came with fancy new ideas and .pngS and all I did was changing the Icon.png in the file system. Most times the new icon was distributed to simulator or device with... | <p>Try cleaning all targets, that is most likely the case of the old icon showing up. </p>
<p>Also, this happened to me a few times (with in app images)...</p>
<p>The simulator is case insensitive to file names, but the device IS case sensitive.</p>
<p>So, if in the info.plist you say your icon file is: ICON.png</p>... |
In what way a WPF Wrap panel is slower that we need virtual wrap panel <p>I hear a lot about the wrap panel being slower to load things and hence we need a virtualising panel.</p>
<p>Can somebody give me a small wrap panel sample where it can be proven it is slower to load etc that it needs a virtualising panel please... | <p>I think the performance issue depends mainly on the number of visual objects in your tree.</p>
<p>The default ListBoxItem template consists of a low number of elements (a border and a textblock i think). If you have a template that creates a complex visualization of lets say 100 visual elements per item you get a f... |
Writing functional programs in non-functional languages <p>Suppose I write a program using immutable data structures in Java. Even though it is not a functional language, it should be able to execute parallely. How do I ensure that my program is being executed using all the cores of my processer? How does the computer ... | <p>Java programs are parallelized through threads. The computer can't magically figure out how to distribute the pieces of your application across all the cores in an imperative language like Java. Only a functional language like Erlang or Haskell could do that. Read up on Java threads.</p>
|
checksum calculation <p>To calculate CRC I found a piece of code but I am not understanding the concept.
Here is the code: </p>
<pre><code>count =128 and ptr=some value;
</code></pre>
<pre><code>calcrc(unsigned char *ptr, int count)
{
unsigned short crc;
unsigned char i;
crc = 0;
while (--count ... | <p>This looks like a <a href="http://en.wikipedia.org/wiki/Cyclic%5Fredundancy%5Fcheck" rel="nofollow">CRC</a> (specifically it looks like CRC-16-CCITT, used by things like 802.15.4, X.25, V.41, CDMA, Bluetooth, XMODEM, HDLC, PPP and IrDA). You might want to read up on the CRC theory on the linked-to Wikipedia page, to... |
Are there any other uses for Perlin Noise besides the obvious? <p>I have been looking into different algorithms lately and have read quite alot about perlin noise. It seems like the only thing people use it for is to generate textures (clouds/wood grain) or to distribute trees.</p>
<p>What else can Perlin Noise be use... | <p>The best treatise on Perlin noise and things you can do with it I know is in <a href="http://rads.stackoverflow.com/amzn/click/0122287606">Texturing and Modelling</a> by Ebert, but Hugo Elias put together a rather good collection of <a href="http://freespace.virgin.net/hugo.elias/">pages on noise and other related s... |
Java date iterator factory, with rules specifying how to calculate the intervals <p>I am looking for a Java class where I can specify a set of date rules, such as "every 3rd sunday" and "the first occurrence of a monday every second month". I want to be able to get something like an infinite iterator out of it (.next()... | <p>I don't think there's any readily made iterators for joda-time or Java Calendar API for that matter, however with joda it's so easy that you should just go with it. For example after re-familiarizing myself with joda after a few months pause I made this in about 10 minutes:</p>
<pre><code>public class InstantIterat... |
c# Where can I lookup Microsoft Namespace names? <p>I'm using a MS namespace but Visual Studio is telling me I don't have a reference to it. Is there a place you can go to and lookup namespaces?</p>
<p>Thanks</p>
| <p>If you mean "to find which dll I need (per-type)": <a href="http://msdn.microsoft.com/en-us/library/ms229335.aspx" rel="nofollow">MSDN</a>?</p>
<p>For example, <a href="http://msdn.microsoft.com/en-us/library/microsoft.aspnet.snapin.clsid.aspx" rel="nofollow"><code>CLSID</code></a></p>
<blockquote>
<p><strong>Na... |
Writing a crude implementation as part of the design - good idea? <p>I am starting to fully understand the philosophy which claims that doing something, anything at all, is better than doing nothing, and advance <em>will</em> come from there.</p>
<p>So I am thinking something along these lines:</p>
<blockquote>
<p>... | <p>There are definitely times where the approach you layout make sense. No sense sitting there with writers block over analyzing a problem...sometimes you just need to get something coded, and without a doubt as you work deeper into, and around, the problem, new ideas will help you refine your original idea. </p>
<p>Y... |
Where can I find an online function reference for LoadRunner? <p>Is there an online reference manual I can query which contains details of LoadRunner functions such as:</p>
<pre><code>lr_start_transaction
web_url
web_submit_data
web_custom_request
lr_end_transaction
</code></pre>
<p>etc.?</p>
<p>Essentially, I want ... | <p>There doesn't seem to be a web-based function reference but a ZIP file of Windows HTMLHelp (.CFM) files (the LoadRunner 9.10 VuGen API Reference) can be <a href="http://support.openview.hp.com/selfsolve/document/KM548035/binary/LR-version9.10-funcref.html?searchIdentifier=-294d700c%3a1212170de9d%3a14d2&resultTyp... |
Lazy loading infragistics Ultragrid <p>Does anyone know if the Infragistics UltraGrid for Windows Forms support lazy loading? If so, how to do that?</p>
| <p>Yes it can be done with the Infragistics WinForm.</p>
|
How to make faster this statement : "paramDate Between startDate and NULL"? <p>This query is taking long time when endDate is null (i think that its about case statement, before case statement it was fast)</p>
<pre><code>SELECT *
FROM HastaKurumlari
WHERE CONVERT(SMALLDATETIME,'21-05-2009',103)
BETWEEN startDate
... | <p>You could try the <a href="http://doc.ddart.net/mssql/sql70/ca-co%5F8.htm" rel="nofollow">coalesce</a> function:</p>
<pre><code>select *
from HastaKurumlari
where convert(smalldatetime, '21-05-2009', 103)
between startDate and coalesce(endDate, getdate());
</code></pre>
<p>The only way to be certain is to tr... |
Loading a popup using ajax <p>I have a jsp page which should load a popup using ajax. The content of the page is determined by form filled by user.</p>
<p>Something like this:</p>
<p>javascript:</p>
<pre><code>ajax('getPage.action', 'content_id', 'form_id');
</code></pre>
<p>foo.jsp:</p>
<pre><code><div id="con... | <p><a href="http://malsup.com/jquery/form" rel="nofollow">jQuery form plug-in</a> can help you easily transform a regular form to an Ajax one. You only need a single line of code:</p>
<pre><code>$("#myform").ajaxForm(
{beforeSubmit: validate, success: showPopup} );
</code></pre>
|
two column layout, left col height constrains right col height, don't know why...? <p>I'm a little stuck, it's due to my inexperience with html/css and iframes.</p>
<p>Basically, I've got a LH column, which is my menu. and a RH column which house's my content. the RH column is a iframe. </p>
<p>The problem is i can'... | <p>I'm not 100% sure on this, but I'm fairly certain that there is no way to do this without using JavaScript to dynamically size the iFrame. And if there is, it probably isn't easy.</p>
<p>It's happening because '100%' in CSS terms only takes up as much space as it can <em>of what is already on the page</em>. Since y... |
Cross-platform way of getting temp directory in Python <p>Is there a cross-platform way of getting the path to the <em><code>temp</code></em> directory in Python 2.6? </p>
<p>For example, under Linux that would be <code>/tmp</code>, while under XP <code>C:\Documents and settings\[user]\Application settings\Temp</code... | <p>That would be the <a href="http://docs.python.org/library/tempfile.html">tempfile</a> module.</p>
<p>It has functions to get the temporary directory, and also has some shortcuts to create temporary files and directories in it, either named or unnamed.</p>
<p>Example:</p>
<pre><code>import tempfile
print tempfile... |
How to write a vb.net code to compile C/C++ programs? <p>I'm trying to make a vb.net application that has got 2 textboxes, 7 radio buttons and 2 buttons(one named compile and the other 'run'). How can I load the content of a C/C++(or any programming language) file into the 1st textbox and on clicking the compile button... | <p>Look at the <code>System.IO</code> namespace for clues as to how you go about loading the contents of a file into a text box. In particular, the <code>File</code> class.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.io.file.aspx" rel="nofollow">System.IO.File Class</a></p>
<p>Look at the <code>Sys... |
ABPersonViewController+delete <p>Can anyone help me enable a delete button in <code>ABPersonViewController</code>?</p>
| <p>Take a look at ABPersonViewController+Delete category which does not use any private methods:</p>
<p><a href="https://github.com/shrtlist/ABDelete" rel="nofollow">https://github.com/shrtlist/ABDelete</a></p>
|
how to implement winform session like session timeout especially <p>Hi i've plan to implement a feature like session in window application but not for the purpose to hold use information at first.the main purpose is to log out or at least prompt for login/password after session expires.I can't find information regardin... | <p>Your simplest solution would be to use a <code>Timer</code> and set the <code>Duration</code> property to the number of milliseconds you'd like in your timeout. Whenever you encounter activity, you can just reset the timer by calling <code>Stop</code> then immediately calling <code>Start</code>. Place whatever code ... |
how to Validate Client Side with jquery and Server side at same time? <p>i really love the jquery validation plugins, look neat stylish and accessible, but as you know JavaScript can be turned off and boom your user can enter what ever he wants, therefore you should validate on server too, so what is the best approach ... | <p>The only way to go is to validate with jQuery and then do the same validation again on the server side.</p>
<p>Client side validation is only for making your application more user friendly. So validate the fields that will save the user some round-trips to the server and that will contribute to a better user experi... |
Understanding database inserts <p>Most databases support some form of "insert into select..." statement. </p>
<pre><code>insert into a
select value from b;
</code></pre>
<p>How is this being achieved?</p>
<p>My understanding: The rows that are present at that point of time when the statement starts execution qualify... | <p>Since you are not talking about any engine in particular, that could be happening. Also there could be a point where the database just pick a row at the time.. It's all depends on the engine, and the locks applied to the database.</p>
|
Merging only modified files using Git <p>I have a repository which contains Content & Source files. Developers should work only on source files. To save space, developers should not clone the content files (which are in GB) to their local repo. Source files are not present in the project as sub-modules rather they ... | <p>The obvious answer is that you should have <strong>separate source and content repositories</strong>. Or just leave the content be.</p>
|
Applying Spring .Net Advice to HibernateTemplate object <p>I have an class for auditing:</p>
<pre><code>public class AuditAfterAdvise : IAfterReturningAdvice
</code></pre>
<p>This is applied to a Dao class in my Spring.Net configuration, using a RegularExpressionMethodPointcutAdvisor.</p>
<p>The Dao class implementa... | <p>It certainly <em>should</em> be possible. </p>
<p>Instead of configuring the Dao, add the advice to the object definition for the LocalSessionFactoryObject. The RegularExpressionPointCutAdvisor should continue to work -- just applied to a different object.</p>
<p>I'm assuming the HibernateTemplate is retrieved f... |
Access to creator object <p>I have a simple windows application in C# with 3 forms.
first form is main form (its name is FrmMain), second is FrmData and third is FrmShow.
In main form (FrmMain) I have created an instance from second form (FrmData) and show it :</p>
<pre><code> public partial class FrmMain : Form
... | <p>You would need to add a property to your FrmModifyData class to take an instance of the FrmMain class. Then you can do this:</p>
<pre><code>FrmModifyData = new FrmData();
FrmModifyData.ParentData = this;
FrmModifyData.ShowDialog();
</code></pre>
<p>Then inside FrmModifyData you would have access to the public memb... |
How can I get the interface name/index associated with a TCP socket? <p>I'm writing a TCP server that needs to know which interface each connection arrived from. I cannot use the address/subnet to deduce which interface was used, since there might be interfaces with the same address/subnet values. It's Linux based, and... | <p>In general, you shouldn't need to know what interface the packets are going to be sent/received on; that's the kernel's routing table's job. It's difficult to find out the interface for a socket because there really is no direct association. The routing of packets can change within the socket's lifetime based on rou... |
JavaScript bulleted list generation <p>I'm using Rails 2.2, and as well as standard JavaScript libraries, we jQuery also.</p>
<p>Given that, can anyone advise me of a starting point in creating a UI component which would allow users to create a bulleted list, adding bullets/deleting bullets/indenting sub-bullets etc? ... | <p>Have you tried something like TinyMCE? You can customize it to have whatever controls you want.</p>
<p><a href="http://tinymce.moxiecode.com/" rel="nofollow">http://tinymce.moxiecode.com/</a></p>
|
Custom sort in SQL Server <p>I have a table where the results are sorted using an "ORDER" column, eg:</p>
<pre><code>Doc_Id Doc_Value Doc_Order
1 aaa 1
12 xxx 5
2 bbb 12
3 ccc 24
</code></pre>
<p>My issue is to initially set up this order column as e... | <p>Based on your comment, I think you have a very workable solution. You could make it a little more userfriendly by specifying it as a default:</p>
<pre><code>alter table documents
add constraint constraint_name
default (dbo.documents_initial_order()) for doc_order
</code></pre>
<p>As an alternative, you could ... |
DESCENDING/ASCENDING Parameter to a stored procedure <p>I have the following SP</p>
<pre><code>CREATE PROCEDURE GetAllHouses
set @webRegionID = 2
set @sortBy = 'case_no'
set @sortDirection = 'ASC'
AS
BEGIN
Select
tbl_houses.*
from tbl_houses
where
post... | <p>You could use two order by fields:</p>
<pre><code>CASE @sortDir WHEN 'ASC' THEN
CASE UPPER(@sortBy)
...
END
END ASC,
CASE @sortDir WHEN 'DESC' THEN
CASE UPPER(@sortBy)
...
END
END DESC
</code></pre>
<p>A CASE will evaluate as NULL if none of the WHEN clauses match, so that causes on... |
application couldn't be initialized error (manifest file problem) <p>I am trying to use a library (.dll) in my project. Everything seems to
be set up fine. It all works in release mode.
When I go debug on it, I get this darn error on startup:</p>
<p>ldr: ... application couldn't be initialized error (or similar, I t... | <p>I always use <a href="http://www.dependencywalker.com/" rel="nofollow">Dependency Walker</a> for debugging this sort of thing. It will tell you which dependencies your dll is missing.</p>
|
Is VisualSVN Server generally viewed as a trustworthy SVN server? <p>is <a href="http://en.wikipedia.org/wiki/VisualSVN_Server" rel="nofollow">VisualSVN Server</a> generally viewed as a trustworthy SVN server? </p>
| <p>My company has been using it. As far as I can tell, it's just a custom distribution of SVN + Apache rolled into an installer, so its "trustworthiness" will be the same as Apache's and subversion's.</p>
|
Netcat anomaly in VMWare/Cygwin/Sockets environment <p>I'm happily running Ubuntu Linux in a VMWare box hosted on XP.</p>
<p>My Linux application opens up your basic server socket port, to which I connect netcat (nc) as a client to listen in on the traffic I'm putting on that socket for the "real" clients. All's well.... | <p>Which <a href="http://cygwin.com/ml/cygwin/2002-09/msg00174.html" rel="nofollow">netcat code</a> are you using? At least one variant has known issues...</p>
|
funny enough,this is probably a stack overflow problem <p>The following procedure (explanation follows) works fine for really small lists, but when the list contains a larger number of items (1/2 million) the application enters "not responding" state,and it takes about 2.5 minutes to finish (very bad time).
I might add... | <p>The run time of this procedure in big O notation would be n^2, which is fairly slow and you can expect a slow run time if one of the lists has 100 million entries. There is no stack overflow problem here, it's simply slow to iterate through this much data. I don't really see a question here, are you looking to make ... |
Using Tapestry jwcid attribute and @Block component for CSS classing? <p>How does the Block component handle CSS classes? I have code like this:</p>
<pre><code><style type="text/css">
.nameColumnHeader { width: 30%; }
.nameColumnValue { width: 30%; vertical-align:top; }
</style>
...
<table>
<... | <p>You're probably using the contrib:Table component - by default it applies classes to the and it generates (or perhaps in the , check the generated markup).</p>
<p>The value for those classes are generated from each column name, so for the 'phone' column they should be: phoneColumnHeader and phoneColumnValue... It... |
Atomic modification of files across multiple networks <p>I have an application that is modifying 5 identical xml files, each located on a different network share. I am aware that this is needlessly redundant, but "it must be so."</p>
<p>Every time this application runs, exactly one element (no more, no less) will be ... | <p>Unfortunately, for it to be truly "atomic" isn't really possible. My best advice would be to wrap up your own form of transaction for this, so you can at least undo the changes.</p>
<p>I'd do something like check for each file - if one doesn't exist, throw.</p>
<p>Backup each file, save the state needed to undo, ... |
Left join using LINQ <p>Could someone give me an example of how to perform a left join operation using LINQ/lambda expressions?</p>
| <p>The <a href="http://msdn.microsoft.com/en-us/vbasic/bb737929.aspx#grpjoinleftout" rel="nofollow">LINQ to SQL samples page</a> on MSDN gives an example of how to accomplish this. The code should be pretty much identical for LINQ to Objects.</p>
<p>The key here is the call to <code>DefaultIfEmpty</code>.</p>
<pre><c... |
Crystal Report fails to load on Windows 2003 os <p>Crystal Report 10 fails to load on Windows 2003 OS. We're developing with .net 3.5 with C#.net.</p>
<p>It works properly on dev box which contains similar configuration but without a McAFEE Anti-virus software on it.</p>
<p>Any pointers would be greatly appreciated.<... | <p>Looking at the stacktrace, it seems it is unable to find the file on the specified path OR the access to the file (or dir) could be a problem.</p>
|
Locale-aware JavaScript validation <p>Can you suggest a locale-aware way to validate a currency value on the client using Javascript?</p>
<p>Obvious issue to consider: 1,234.56 in the US and UK is the same as 1.234,56 in most of Europe</p>
<p>Sri</p>
| <p>Here's a link to a free javascript library that can help you with that: <a href="http://api.dojotoolkit.org/jsdoc/HEAD/dojo.currency.format" rel="nofollow">Dojo Currency Formatter</a>, there's also a similar feature in <a href="http://msdn.microsoft.com/en-gb/library/bb310813.aspx" rel="nofollow">ASP.NET Ajax</a>.</... |
cols, colgroups and css :hover psuedoclass <p>I'm trying to create a table to display an individual's BMI.</p>
<p>As part of this, I'd like, on :hover, for the <code><tr></code> <strong>and</strong> <code><col></code> (or <code><colgroup></code>) to be highlighted also, in order for the intersection ... | <p>Here's a pure CSS method using no Javascript. </p>
<p>I used <code>::before</code> and <code>::after</code> pseudo-elements to do the row and column highlighting. <code>z-index</code> keeps the highlighting below the <code><tds></code> in case you need to handle click events. <code>position: absolute</code> a... |
How do I add Paging to a sharepoint DataFormWebPart? <p>I'm creating an archive of news articles in a sharepoint publishing site. users can browse or search the archive. browsing is a simple list of article dates titles. I'm using the DataFormWebPart to display the contents of the Pages (articles). as there are tho... | <p>If you look at the page using the sharepoint designer in 'design' mode, you can click the common task arrow ( > ) and customize the data view properties.</p>
<p>One of the tabs will be about 'paging' and you can set how many items per page.</p>
<p>Hope this helps!</p>
|
How do I get the coordinate position after using jQuery drag and drop? <p>How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that position. For example, x: 520px, y: 300px?</p>
<p>EDIT:</p>
<p>I am PHP and... | <p>I just made something like that (If I understand you correctly).</p>
<p>I use he function position() include in jQuery 1.3.2.</p>
<p>Just did a copy paste and a quick tweak... But should give you the idea.</p>
<pre><code>// Make images draggable.
$(".item").draggable({
// Find original position of dragged im... |
one-to-many mapping // how to map an association of legacy tables (Hibernate) <p>I've got two legacy database tables, layouted in simplified manner like this:</p>
<pre><code>MASTER SLAVE
ident ident
sName sName
sNumber sNumbe... | <p>Hibernate does not work well with composite keys, in my experience. It's the one main problem with Hibernate as far as I've seen. I've worked around it in the past by avoiding the use of "purely" composite keys; that is, I've given composite key tables a unique ID column which Hibernate can then work off of.</p>
|
is mod_rails or Phusion Passenger finally the answer to Ruby on Rails Deployment? <p>I read from some books that Phusion Passenger is the answer to easy Ruby on Rails deployment. But my friend said that first there was Apache + bunch of Mongrels, and then lighttpd, and then nginx, and now Passenger, and it seems endle... | <p>short answer: yes.</p>
<p>long answer: yeeeeeeeeeeeeeeesssssssssssssssss.</p>
<p>In all seriousness, Phusion Passenger and Ruby Enterprise Edition have taken out pretty much all of the pain of moving a Rails app into production. Previous approaches, including running a suite of Mongrels, required lots of setup sur... |
How do I cast from System.Web.HttpPostedFileBase to System.Web.HttpPostedFile? <p>While trying to implement an MVC file upload <a href="http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx">example</a> on Scott Hanselman's blog. I ran into trouble with t... | <p>Just work with it as an HttpPostedFileBase. The framework uses the HttpPostedFileWrapper to convert an HttpPostedFile to an object of HttpPostedFileBase. HttpPostedFile is one of those sealed classes that are hard to unit test with. I suspect that sometime after the example was written they applied the wrapper co... |
Is there a tool to convert ANSI C code to C#? <p>I need to import some ANSI C code into a project I'm working on. For reasons I prefer not to go into, I want to refactor the code to C# rather than trying to wrap the original code. It will take me perhaps a couple of days to do the work by hand, but before I start, is t... | <p>If manual refactoring is "only" going to take a few days, that would get my vote. Depending on what the C code is doing and how it is written (pointers, custom libraries, etc.) an automated converter may just make a mess. And untangling that mess could be a larger task than just converting by hand.</p>
|
URL loads correctly when accessed directly, but not within an iframe in IE8 and Safari <p>I am attempting to mimic a pretty simple feature of Facebook. When you click on a link someone has shared, you're taken to a page that has a Facebook toolbar at the top and the actual page loaded below it within an iframe. The url... | <p>This sounds like a problem with IE IFrame rejecting cookies due to the privacy being lowered. If that's the case, this is a duplicate of <a href="http://stackoverflow.com/questions/389456/cookie-blocked-not-saved-in-iframe-in-internet-explorer">this post</a> and you should be able to use the solution found there.</p... |
Difficult page make-up with centered elastic blocks <p>I have 3 blocks: one wrapper and 2 other inside the wrapper. Inside-blocks have same size. </p>
<p>Wrapper is elastic and its width is being changed during window resizing. 2 blocks inside wrapper are elastic too. Each of these 2 inside blocks has min-width proper... | <p>Something like this works in IE 7 & FF 3 for me:</p>
<pre><code><div style="width: 49%; min-width: 300px; float: left; background: red;">Test</div>
<div style="width: 50%; min-width: 300px; float: left; background: blue">Test</div>
</code></pre>
<p>Problem is it won't center align when ... |
How do you hide a column in a datagrid using the .net compact framework 3.5 <p>I have a DataGrid that is using a DataReader as its datasource. I want to hide the first column of the datagrid. I am using the .net compact framework 3.5. I can find examples for windows forms but the api is changed enough that they don'... | <p>You can set the column style width to 0 or -1. </p>
<p>DataGridTableStyle ts = new DataGridTableStyle();
ts.MappingName = "Order";</p>
<pre><code> // Order date column style
DataGridColumnStyle cust_id = new DataGridTextBoxColumn();
cust_id.MappingName = "cust_id";
... |
ASP.NET Treeview control and Client side javascript - Highlight selected tree view node <p>How to do following -
ASP.NET 2.0 TreeView and Selecting the Selected Node <strong>using JavaScript</strong></p>
<p>I am trying this by reading <a href="http://www.codeproject.com/KB/webforms/ClientSideTreeView.aspx" rel="nofoll... | <p>JQuery Solution - for selecting single node (highlighting) ASP.NET 2.0 Treeview Control on Client Side</p>
<pre><code>$("#TreeView1t5").addClass("TreeView1_5");
</code></pre>
<p>Where <code>#TreeView1t5</code> is id of <code>node</code> and <code>TreeView1_5</code> is <code>css class</code> for selection.</p>
<p>... |
Spring MVC DefaultRequestToViewNameTranslator capitalization issue <p>I'm trying out the whole "convention over configuration" thing with Spring MVC. Spring has all sorts of tools to help with this, and I'm trying some of them out. However, I ran into a problem with our team's configuration not quite matching what Sp... | <p>The <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/DispatcherServlet.html" rel="nofollow">Javadocs for DispatcherServlet</a> specify how the 'viewNameTranslator' is determined:</p>
<blockquote>
<p>If a View or view name is not supplied by the user, then the config... |
Where do I put dependency creation for a Presenter class in a Passive View architecture? <p>I've just refactored out a new domain class from a presenter class but I can't figure out where to instantiate it.</p>
<p>This is part of a larger ongoing refactoring effort with a poorly maintained legacy project.</p>
<p>The ... | <p>I have it already done !!!
Have a look here in <a href="http://code.google.com/p/mytodotodaylist/source/browse/#svn/trunk/prototype" rel="nofollow">my repository</a>. My choice here is to use constructor ... satisfying the greediest I'm sure that presenter is Up. In your case you can provide from view specific impl... |
MOSS All Groups does not show pagination when more than 100 groups returned <p>When I go to <code>/_layouts/groups.aspx</code> in my site collection, I only see the first 100 groups. There is no pagination control visible. How do I correct this, to work with more than just the first 100 groups?</p>
| <p>You can also modify this view through the standard UI, rather than using code if you need to:</p>
<ol>
<li>Browse to "http://<strong><em><site collection url></em></strong>/_catalogs/users/AllGroups.aspx"</li>
<li>Site Actions-> Edit Page</li>
<li>Modify the List View web part</li>
<li>Under Selected View cli... |
How to stop the 'gem' utility from accessing my home directory? <p>When I run </p>
<pre><code>gem install <somegem>
</code></pre>
<p>command the <code>gem</code> utility tries to access my home directory. It contains some non-latin characters and installation fails because of that. For example: </p>
<pre><code... | <p>Just change HOMEDRIVE and HOMEPATH before running <em>gem</em>, and restore after (if needed).</p>
<p>I've changed my <em>gem.bat</em> like this:</p>
<pre><code>@ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=E:
SET HOMEPATH=/Dev/Ruby
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "E:/D... |
Error in velocity and log4J <p>I built a webapp that works perfectly fine in my localhost (tomcat). But when I tried to deploy, velocity crashes in init(), leaving me with this strange stack trace here (sorry for the size):</p>
<pre>
<code>
ERROR [main] (VelocityConfigurator.java:62) - Error initializing Velocity!
org... | <p>Velocity tries to put the logfile in the directory Tomcat was started from, and I believe that is actually /.</p>
<p>You can force Velocity to log to Tomcat's standard log by adding these lines to your velocity.properties:</p>
<pre><code>runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSys... |
Bring current user to the database layer <p>I have a classic 3-tier web application build with MySQL and Tomcat.</p>
<p>I want to save the creator id of each database record for all tables at creator_id column or just log it somewhere.
Current user is stored at the http session object.
Modify all queries and pass crea... | <p>The database can't possibly know which <strong>site user</strong> is sending the query, all it knows is which <strong>database user</strong>. And if it's a web application, it's probably the same database user all the time, no matter who is logged in on the website.</p>
<p>The short answer is that no, you're going ... |
Large Report Implementation Reccomendations 250 - 300 pages <p>My group has a report that was recently developed utilizing Reporting Services 2005 with the NeoDynamics Bar Code component. The report is for return authorizations and consists of 2 main reports.</p>
<blockquote>
<p>The first set of data on the report ... | <p>I'm not particularly familiar with Reporting Services. I think it's a Microsoft product. Which means that you're probably talking to a SQL Server database on the back end. And so there are two pieces of advice.</p>
<ol>
<li>check the client and server configuration because there is a query timeout value set somew... |
Using a Wiki for Requirements Management? <p>I have been looking for a collaborative tool for developing functional specifications. I am looking for the ability to: </p>
<ul>
<li>Have multiple users contribute to the specification.</li>
<li>Provide some form of traceability, which could be done manually if needed. </l... | <p>It's possible to do what you describe, to develop requirements in a collaborative way, <em>in spite of</em> using a wiki. Nothing about the wiki paradigm assists in this process.</p>
<p>I managed a wiki on the Zend Framework project to track proposals for components. <a href="http://framework.zend.com/wiki/displa... |
AJAX support in smart phones <p>How mature is AJAX support for mobile phones?
Are there mobile versions of some famous AJAX frameworks?
I would live even with a limited support for some ajax lib.</p>
| <p>iPhones won't cache anything larger than 25 KB uncompressed, which means libraries like jQuery and Prototype won't be cached like they would be on a normal computer. I suspect this sort of thing is the case with lots of other mobile browsers, too.</p>
<p><a href="http://xuijs.com/" rel="nofollow">XUI</a> is a slimm... |
Simple MVC NerdDinners Lambda <p>In this code from Microsoft's MVC Tutorial NerdDinners:</p>
<blockquote>
<p>public class DinnerRepository {</p>
<pre><code>private NerdDinnerDataContext db = new NerdDinnerDataContext();
//
// Query Methods
public IQueryable<Dinner> FindAllDinners() {
return db.Dinners;
... | <p>You should probably read up on <a href="http://msdn.microsoft.com/en-us/library/0yw3tz5k%28VS.80%29.aspx" rel="nofollow">anonymous methods</a>.</p>
<p>Basically the code you are referring to can be written as an anonymous method without lamba syntax like this:</p>
<pre><code>public Dinner GetDinner(int id) {
... |
what do I use to match MS Word chars in regEx <p>I need to find and delete all the non standard ascii chars that are in a string (usually delivered there by MS Word). I'm not entirely sure what these characters are... like the fancy apostrophe and the dual directional quotation marks and all that. Is that unicode? I k... | <p>Probably the best way to handle this is to work with character sets, yes, but for what it's worth, I've had some success with this quick-and-dirty approach, the character class</p>
<pre><code>[\x80-\x9F]
</code></pre>
<p>this works because the problem with "Word chars" for me is the ones which are illegal in Unico... |
will a mocked interface still serialize to a file? <p>I'm trying to unit test saving of a file. I have an interface that defines a document, and I pass a concrete object that implements that interface to the Save method, and it works in practice, but I'm trying to unit test it to ensure that it will always work (and I'... | <p>The BinaryFormatter uses the actual type of the object passed in - not the interface - when it serializes the data. So internally it will write something like Type:MyLib.Objects.MyObj,MyLib when you pass a real object and Type:Moq.ConcreteProxy,Moq etc. when you pass a mock object.</p>
<p>Using the BinaryFormatter ... |
how to count and rank data in php as efficiently as possible <p>I'm not new to programming, but i'm new to MySQL and PHP. I'm wondering what the most efficient way of doing the following. I dont need the actual code, but just the steps.</p>
<p>I have a list of user reviews, lets say simply:</p>
<pre><code>USER REV... | <p>As your query:</p>
<pre><code>SELECT user, COUNT(*) AS reviews
FROM <table name>
GROUP BY user
ORDER BY reviews DESC;
</code></pre>
|
Nested prohibit/require operators in Lucene search queries <p>I am using Lucene for Java, and need to figure out what the engine does when I execute some obscure queries. Take the following query:</p>
<pre><code>+(foo -bar)
</code></pre>
<p>If I use QueryParser to parse the input, I get a BooleanQuery object that lo... | <p>By default, Lucene assumes an OR relationship between terms, so the first query is equivalent to</p>
<pre><code>+(foo OR -bar)
</code></pre>
<p>which will match documents which contain (in the default field) "foo" or don't contain "bar"</p>
<p>In the second query, the "+" makes "bar" required, which makes the opt... |
LINQ - Joins in a dynamic query <p>Because of some business decisions I need to change a bit of what I was doing. Yay me. :)</p>
<p>Currently, I have:</p>
<pre><code>public IOrderedQueryable<ProductDetail> GetProductList(string productGroupName, string productTypeName, Dictionary<string,List<string>&... | <p>Ouch. Yeah, that's a complicated requirement. You know, lambdas are cumulative, so you can do this much simpler if you use successive linq expressions. Note that subsequent linq expressions are using the prior expression result and the entire isn't actually executed until iterated.</p>
<pre><code>public IOrderedQue... |
Javascript - override or prevent execution <p>I'm working on a client project and I have to include their header and footer, which includes some core javascript files. I have a couple of PNGs on the page, but their core JS file is poorly coded and doesn't check for IE 7 before attempting to replace IMG tags that contai... | <p>If that's the only thing running at load, I think you could do</p>
<pre><code>window.onload = null;
</code></pre>
<p>If there are other things running, I guess you'd have to reattach them. It's a little fragile, I suppose. </p>
|
Script a button to its rollover state? <p>Anyone know if it is possible via AS3 to change a button to its rollover state when it is not, in reality, rolled over?</p>
<p>Client decided way late in process to ask for some other elements to affect button states. If I had known I would have used movie clips instead of bu... | <p>Dispatch the rollover event manually? Apart from that, I don't see any other way. I am curious though, what sort of requirement(s) would mandate such an oddity.</p>
|
Can I launch a thread from a constructor? <p>Given the J5+ memory model (JSR-133) is the following code thread-safe and permissible?</p>
<p>And if it's safe, is it acceptable in some situations?</p>
<pre><code>public final class BackgroundProcessor
extends Object
implements Runnable
{
public BackgroundProcessor(...)... | <p><a href="http://docs.oracle.com/javase/specs/jls/se5.0/html/memory.html" rel="nofollow">JLS: Threads and Locks</a> says</p>
<blockquote>
<p>Two actions can be ordered by a happens-before relationship. If one action happens-before another, then the first is visible to and ordered before the second.</p>
<p>If ... |
Finding very similar program executions <p>I was wondering if its possible / anyone knows any tools out there to compare the execution of two related programs (for example, assignments on a class) to see how similar they are. For example, not to compare the names of functions, but how they use syscalls. One silly case ... | <p>An initial idea would be to use ltrace and strace to log the calls and then use diff on the logs. This would obviously only cover the library an system calls. If you need a more fine granular logging, the oprofile might help.</p>
<p>If you have access to the source code you could instrument your code by compiling i... |
Do you include Research & Development in your estimates? <p>My company requires that we achieve our estimates to within 30% of forecast. Typically, clients (any my business is no different) expect that they'll get their product as soon as possible for the lowest cost ("I want all the features delivered yesterday for fr... | <p>I generally hide it as Design or some form of Requirement Analysis. When I've tried to be honest/explicit about it at my organization, I received all kinds of warning signs from management who seemed to think Research = Unbounded Cost. I can only assume they'd been burned by less scrupulous devs in the past. <em>... |
Injecting a javascript file with the fewest possible characters? <p>I'm working on a bookmarklet, and thought I'd throw down a challenge: how to inject an external javascript file from a link in as few characters as possible.</p>
<p>Here's the shortest I was able to come up with:</p>
<pre><code>javascript:(function(d... | <pre><code>javascript:void(with(document)body.appendChild(createElement('script')).src='URL')
</code></pre>
<p>79 characters. Credit to <a href="http://stackoverflow.com/users/46387/ben-blank">Ben Blank</a> for the use of <code>void</code>.</p>
|
kernel mode driver write to file <p>I am working on a windows keyboard filter driver and I need to write to a file. I tried using zwcreate,zwwrite, and zwclose but the driver is not running at PASSIVE_LEVEL and I got the BSOD. I have never written a windows driver before. Thanks for the help!</p>
<p>EDIT: Thanks J. Pa... | <p>Schedule workitems (IoAllocateWorkItem/IoQueueWorkItem) and handle all file I/O from within the workitem callback routines.</p>
<blockquote>
<p>I'm not sure if it is a good idea to let the kernel driver write to a file in the first place. The best way to do that IMHO is to provide a user space program that commun... |
Cruisecontrol custom charts <p>Hi
I have solved my <a href="http://stackoverflow.com/questions/839306/help-needed-configuring-cruisecontrol-net-statistics-merge">initial problem</a> with statistics gathering, but now would like to present the data in some nice charts (much like the default ones already in CCNET). I hav... | <p>Solved! </p>
<p>I just had to actually following the instructions, so I don't need help on doing this anymore.</p>
|
maven s3 wagon provider <p>How to deploy with wagon s3 provider?</p>
<p>I've found several plugins, most of them are incomplete, some of them are not maintaned. There is also a sandbox plugin from official maven SVN repository but I'm figuring how to use it. </p>
<p>Any hint?</p>
| <p>There is a newer s3 provider by spring which works:
</p>
<pre><code><build>
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>... |
What's an efficient way to concatenate all strings in an array, separating with a space? <p>Let's say I have an array of strings:</p>
<pre><code>string[] myStrings = new string[] { "First", "Second", "Third" };
</code></pre>
<p>I want to concatenate them so the output is:</p>
<pre><code>First Second Third
</code></p... | <p>Try this:</p>
<pre><code>String output = String.Join(" ", myStrings);
</code></pre>
|
PHP: Transform a city, state, country string to proper title case <p>I've got city, state, country strings like:</p>
<pre><code>NEW YORK, NY, US
REDMOND, WA, US
US
HONG KONG
CALGARY, CA
E. SYRACUSE, NY, US
</code></pre>
<p>I'd like to transform them to their proper case (New York, NY, US; etc). Whats a quick way to d... | <pre><code>$locs = array(
'NEW YORK, NY, US',
'REDMOND, WA, US',
'US',
'HONG KONG',
'CALGARY, CA',
'E. SYRACUSE, NY, US',
);
foreach ($locs as &$loc) {
$items = explode(',', $loc);
if (strlen($items[0]) > 2) {
$items[0] = ucwords($items[0]);
}
$loc = implode(',', $items);
}
</code></pre>
|
Python *.py, *.pyo, *.pyc: Which can be eliminated for an Embedded System? <p>To squeeze into the limited amount of filesystem storage available in an embedded system I'm currently playing with, I would like to eliminate any files that could reasonably be removed without significantly impacting functionality or perform... | <p><a href="http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html">http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html</a></p>
<blockquote>
<p>When the Python interpreter is invoked with the -O flag, optimized code is generated and stored in â.pyoâ files. The optimizer currently doe... |
Reliable method to get machine's MAC address in C# <p>I need a way to get a machine's MAC address regardless of the OS it is running using C#. Application will need to work on XP/Vista/Win7 32 and 64 bit as well as on those OSs but with a foreign language default. Many of the C# commands and OS queries don't work acr... | <p>Cleaner solution</p>
<pre><code>var macAddr =
(
from nic in NetworkInterface.GetAllNetworkInterfaces()
where nic.OperationalStatus == OperationalStatus.Up
select nic.GetPhysicalAddress().ToString()
).FirstOrDefault();
</code></pre>
|
How can I append text to /etc/apt/sources.list from the command line? <p>I am new to linux, and just beginning to learn bash. I am using Ubuntu 9.04, and would like to add repositories to /etc/apt/sources.list from the command line. Basically, I would like to do this:</p>
<pre><code>sudo echo "[some repository]" >&... | <pre><code>echo "[some repository]" | sudo tee -a /etc/apt/sources.list
</code></pre>
<p>The <a href="http://en.wikipedia.org/wiki/Tee_(command)">tee</a> command is called as the superuser via <em>sudo</em> and the <em>-a</em> argument tells tee to append to the file instead of overwriting it.</p>
<p>Your original co... |
Cocoa Autoreleasing in loops <p>(I have read Apple's memory management guide, as well as other memory management help here, but am still confused on the following)</p>
<p>What should I do for memory management with convenience methods in a loop? Do I need to explicitly create an autorelease pool and then drain it. Or... | <p>The autorelease pool only gets drained when the run loop finishes, usually at the end of a method when control returns to the user. If you find yourself running through a loop many times which will result in the creation of a lot of autoreleased objects (which will build up in memory until your method ends), you mig... |
Regex prefix only matches when in a look-behind assertion <p>I'm trying to write a regex to parse a (seemingly very simple) piece of text like this.</p>
<pre><code>some stuff
First name: John
Last name: Smith
more stuff
</code></pre>
<p>I want to capture the first and last name, so I tried a regex like this:</p>
<pr... | <p>Since look-behind assertions are zero-width (i.e. they don't consume any characters), the FirstName capture will match/capture whatever is after "First name:", in this case "John". After this first match, the position in the target string will be immediately after "John". But since the next part of the regex is anot... |
What is this new Axum programming language? <p>I read <a href="http://msdn.microsoft.com/en-us/devlabs/dd795202.aspx" rel="nofollow">this</a> story on slashdot today where they announce a new parallel programming language by Microsoft.</p>
<p>What is this new programming language about? It says Parallel Programming. B... | <p>Axum is a language structured in such a way as to make safe and performant concurrent programming simpler. The concepts modelled by the language avoid the need to make thread synchronisation explicit via the use of <code>lock</code> (in C#), <code>Monitor</code>, <code>ReaderWriterLockSlim</code>, etc...</p>
<p>It... |
Calling a user defined JS function inside returned AJAX content <p>I have a system that loads a div with content through the use of AJAX. All is well, I can get the div to load perfectly with details from my database and it works great. <strong>The problem is this:</strong> Inside the returned div, I have a couple of b... | <p>if you are using prototype, jquery, etc.. (any JS framework), you need to be sure you have set the param "evalJS" to true. this last example I put works in prototype.</p>
<p>check <a href="http://prototypejs.org/api/ajax/request" rel="nofollow">here</a> for prototype</p>
|
Learning Objective C without a Mac <p>I do not have a Mac, or an iPhone. However, the concept of taking C and making it more dynamic towards the idea of smalltalk, python or ruby is really attractive to me. I'd love to start on objective C. </p>
<p>Is objective C just a syntax superset of C or is it <em>really</em> li... | <p><a href="http://en.wikipedia.org/wiki/Objective-C">Wikipedia</a> says </p>
<blockquote>
<p>Today it is used primarily on Apple's
Mac OS X and iPhone OS, two
environments based on, although not
compliant with, the OpenStep standard,
and it is the primary language used
for Apple's Cocoa API though it was
... |
Set instant messenger display message programmatically <p>Would a script that sets display messages for instant messengers be simple or complex? After some searching, there doesn't seem to be any information about this at all. </p>
<p>For the sake of an example, if I had a text file of quotations, would it be possible... | <p>Depends on which client you're using. As far as I know, Google's client doesn't offer any interface for plugins, but the open source instant messenger <a href="http://www.pidgin.im/" rel="nofollow">Pidgin</a> does. I think there already is a plugin for what you want to do, but you can write your own using the <a hre... |
Adding TemplateField to DetailsView <p>How do I add TemplateField control to the beginning of the DetailsView Fields collection?</p>
<p>Here is my code..</p>
<pre><code>TemplateField tf = new TemplateField();
...
...
dv.Fields.Add(tf);
</code></pre>
<p>This adds to the very end of the DetailsView control. I tried dv... | <p>To Add the field at the beginning, use the <strong><a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.datacontrolfieldcollection.insert.aspx" rel="nofollow">INSERT</a></strong> method as follows:</p>
<pre><code>TemplateField tf = new TemplateField();
...
...
dv.Fields.Insert(0, tf);
</code><... |
What is the purpose of using try, catch blocks? <p>Is it a replacement for if, then blocks? I have seen a lot of code where they are used like that.</p>
| <p>No, it is not a replacement for an if, then block, it serves an entirely different purpose. The objective of a try, catch block is to try and do something which could fail and raise an exception (e.g., read a file from disk, but the file might not be there, etc.). After catching an exception, you can handle it.</p>
... |
How do I check if a disk is in a drive using python? <p>Say I want to manipulate some files on a floppy drive or a USB card reader. How do I check to see if the drive in question is ready? (That is, has a disk physically inserted.)</p>
<p>The drive letter <em>exists</em>, so os.exists() will always return True in thi... | <p>And the answer, as with so many things, turns out to be in <a href="http://bcbjournal.org/articles/vol2/9806/Detecting%5Fdisk%5Ferrors.htm">an article about C++/Win32 programming from a decade ago</a>.</p>
<p>The issue, in a nutshell, is that Windows handles floppy disk errors slightly differently than other kinds ... |
What's the best way to change the namespace of a highly referenced class? <p>I am attempting to move a highly referenced class from one namespace to another. Simply moving the file into the new project which has a different root namespace results in over 1100 errors throughout my solution.</p>
<p>Some references to th... | <p>Try to use <a href="http://www.jetbrains.com/resharper/download" rel="nofollow">Resharper.</a> I have used it in the past for refactoring highly referenced namespaces both fully qualified and imported with no problems at all.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.