input
stringlengths
51
42.3k
output
stringlengths
18
55k
How to target the Blackberry browser? <p>I am using the following to target iphones, and handheld devices to use specific mobile styles sheets but the Blackberry browers is picking up only the regular screen style sheets.</p> <pre><code>&lt;link media="handheld, only screen and (max-device-width: 320px)" href="mobile....
<p>The state of mobile browsers is such a mess at the moment that I would not recommend trying to detect versions in the client. The most reliable way to do it is to use something like WURFL <a href="http://wurfl.sourceforge.net/" rel="nofollow">http://wurfl.sourceforge.net/</a> and do all your checking server side.</p...
DLL Dependencies - different on different systems? <p>I created an application, with the mingw compiler in a WinXP system. It worked fine. I then tried to run it in an older WinXP box(this has been in the shelf for some 6 months). The application terminated with an exception --'<em>The application could not initialize ...
<p>When I've had this problem, it was due to not installing <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&amp;displaylang=en" rel="nofollow">certain redistributables</a> on the target machine (you may need to look for a VS 2008 redistributable, or even .Net frame...
Why does push_back or push_front invalidate a deque's iterators? <p>As the title asks.</p> <p>My understanding of a deque was that it allocated "blocks". I don't see how allocating more space invalidates iterators, and if anything, one would think that a deque's iterators would have more guarantees than a vector's, no...
<p>The C++ standard doesn't specify how deque is implemented. It isn't required to allocate new space by allocating a new chunk and chaining it on to the previous ones, all that's required is that insertion at each end be amortized constant time.</p> <p>So, while it's easy to see how to implement deque such that it gi...
How to capitalize the first character of each word, or the first character of a whole string, with C#? <p>I could write my own algorithm to do it, but I feel there should be the equivalent to <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html#M001339">ruby's humanize</a> in...
<p>As discussed in the comments of <a href="http://stackoverflow.com/questions/913090/how-to-capitalize-the-first-character-of-each-word-or-the-first-character-of-a-w/913102#913102">@miguel's answer</a>, you can use <a href="http://msdn.microsoft.com/en-us/library/system.globalization.textinfo.totitlecase.aspx"><code>T...
css and div tag layout problems <p>I have a header bar that spans horizontally across my web page, which is comprised of one div tag and three nested div tags.</p> <p>HTML:</p> <pre><code>&lt;div id="top-bar"&gt; &lt;div id="leftTop"&gt; LEFT &lt;/div&gt; &lt;div id="rightTop"&gt; RIGHT ...
<p>Try <code>float: left;</code> on <code>#centerTop</code> or <code>display: inline</code> on all three without any floats.</p>
How can I select the tag-name and attributes AND values of those attributes with ONE regular expression? <p>I have the following Regular Expression from this post (<a href="http://stackoverflow.com/questions/317053/regular-expression-for-extracting-tag-attributes">Regular expression for extracting tag attributes</a>).<...
<p><code>([a-zA-Z]+)\:([a-zA-Z]+)</code> would work for something like Foo:bar </p> <p><code>&lt;.*?([a-zA-Z])+.*?\:.*?([a-zA-Z])+.*?\/&gt;</code> would work for &lt; Foo : BArrr /></p> <p>Things can be optimized depending on your requirements and whether you know that a certain type of formatting is enforced.<...
Is there any run-time overhead to readonly? <p>For some reason, I've always assumed that <code>readonly</code> fields have overhead associated with them, which I thought of as the CLR keeping track of whether or not a <code>readonly</code> field has been initialized or not. The overhead here would be some extra memory ...
<p>You have to look at it from the same point of view as the access modifiers. The access modifiers exist in IL, but are they really a run-time check? (1) I can't directly assign private fields at compile-time, (2) I can assign them using reflection. So far it seems no run-time check, like <em>readonly</em>.</p> <p>Bu...
Using System.Net.Socket, how can we know when the remote socket is closed? <p>Ok so here is how things are going:</p> <pre><code>[Server] Start [Server] Socket.AcceptConnection [Client] Start [Client] Socket.Connect [Server] Receive //blocking [Client] Send [Server] Print [Server] Receive [Client] Close socket </code...
<p>According to the docs for <a href="http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.connected.aspx" rel="nofollow">Socket.Connected</a>:</p> <blockquote> <p>The value of the Connected property reflects the state of the connection as of the most recent operation. If you need to determine the...
What's a quick way to familiarize myself with C#, .NET framework, etc? <p>I just graduated college and will be starting working in about a month and I was asked to familiarize myself with C++, C#, .NET framework for NT Services and web services. </p> <p>I'd appreciate recommendations on how to familiarize myself with ...
<p>I would start by pulling down Microsoft's <a href="http://www.microsoft.com/Express/" rel="nofollow">Visual Studio Express</a> products. Your O'Reilly book is a perfectly good book to start with.</p> <p>Start reading blogs and listening to podcasts, to begin to familiarize yourself with all of the technologies out...
iPhone SDK: How do you measure the width and height of a string using Quartz? <p>Before I ask my questions, this is from Apple's documentation re: how to determine the width of a string using Quartz:</p> <p><hr /></p> <p>If text measurements are important to your application, it is possible to calculate them using Qu...
<p>On the iPhone SDK, there's a family of methods on <code>NSString</code> that provide what you want.</p> <p>As of iOS 7.0, <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSString_UIKit_Additions/index.html#//apple_ref/occ/instm/NSString/boundingRectWithSize:options:attributes:context:...
What is "static"? <p>I'm beginning to program in Java.</p> <pre><code>public static void main(String[]args) </code></pre> <p>A book said that I should use static in this case, but doesn't clearly say why I should or what it means.</p> <p>Could you clarify this?</p>
<p>The concept of <code>static</code> has to do with whether something is part of a class or an object (instance).</p> <p>In the case of the <code>main</code> method which is declared as <code>static</code>, it says that the <code>main</code> method is an class method -- a method that is part of a class, not part of a...
Using google maps API with varied domains <p>Ok, so I have a site that uses the google maps API, and I want to serve it from more domains. The fact that the API key is tied to a domain greatly hinders my efforts on this front.</p> <p>Is there any solution more elegant than getting a key for every domain?</p>
<p>There is one way you can avoid using the API key <em>completely</em> - use the version 3 API.</p> <p>The v3 API is still in 'beta' but it has the key (no pun intended) functionality that most people use for their maps and there are no keys required. Nor will there be in the future according to Google. If you can ge...
django error 'too many values to unpack' <p>I'm learning Django by building a simple recipes app. I have a 1 table model using the 'choices' field option for recipe categories rather than using a 2nd 'categories' table and a foreign key relationship. So i created db table via syncdb and then loaded table with test data...
<p><strong>Edit: Updated in light of kibibu's correction.</strong></p> <p>I have encountered what I believe is this same error, producing the message:</p> <pre><code>Caught ValueError while rendering: too many values to unpack </code></pre> <p>My form class was as follows:</p> <pre><code>class CalcForm(forms.Form):...
Reading a file bug in VB.NET? <p>The way this file works is there is a null buffer, then a user check sum then a byte that gives you the user name letter count, then a byte for how many bytes to skip to the next user and a byte for which user file the user keeps their settings in.</p> <p>the loop with the usersm varia...
<p>When you change the position of the underlying stream, the <code>StreamReader</code> doesn't know you've done that. If it's previously read "too much" data (deliberately, for the sake of efficiency - it tries to avoid doing lots of little reads on the underlying stream) then it will have buffered data that it'll use...
Social programming <p>I am currently working in an office where the developers are not very social therefore don't discuss their work very much. So I feel that we are not using each other's skills as much as we could. </p> <p>What are some good ways to stimulate healthy development discussion in the workplace without...
<p><a href="http://en.wikipedia.org/wiki/Pair%5Fprogramming" rel="nofollow">Pair programming</a> and <a href="http://en.wikipedia.org/wiki/Peer%5Freviews" rel="nofollow">peer reviews</a> have worked well for my company (when we actually use them). We also started using an internal wiki where we can share project-relat...
Resin welcome-file doesn't load servlet! <p>Is is possible for Resin (3.0.27) to map a welcome-file to a Servlet? </p> <p>I can't find anything in the Caucho documentation that says this is not supported. Your help would be greatly appreciated.</p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;td&lt;/s...
<p>Due to the way that caucho_module loads its configuration, it very well may ignore welcome files. The welcome file mapping is done by the servlet container (e.g., Resin in your case). But caucho_module seems to be looking for an explicit mapping to exist to help it decide what goes and what doesn't go to Resin, vs...
Website logo appearing behind background image in I.E.7-8 <p>My website's logo shows up normally in firefox and such, but in internet explorer the logo shows up behind the background image and it's really bad looking. Can someone tell me how to make the logo appear in frount of the background image?</p> <p>Site like s...
<p>You write some whacky CSS, what's with all the negative margins? I'd stay away from that stuff, not sure why your #navi had 120px height on it either, (and hence all the -margins).</p> <p>Still, no reason for IE to put a logo behind the body's background-image! That was strange for sure.</p> <p>Anyway these chan...
Confusion on iterators invalidation in deque <p>I'm bit confused regarding iterator invalidation in deque. (In the context of <a href="http://stackoverflow.com/questions/913070/why-does-pushback-or-pushfront-invalidate-a-deques-iterators">this</a> question)</p> <p>Following is the excerpts from -- The C++ Standard Li...
<p>From the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf">standard working draft</a></p> <blockquote> <p>template &lt; class InputIterator > void insert ( iterator position , InputIterator first , InputIterator last );</p> <p>1 Effects: An insert in ...
Unit testing in C++ <p>I've been reading a lot about Unit tests and Test Driven developemnt.</p> <p>Recently, I also read java unit test code.</p> <p>I however, prefer to develop in Qt. So I googled up "unit testing in c++" and found a host of information about various unit testing frameworks available for C++.</p> ...
<p>Usually use <a href="http://www.boost.org/doc/libs/1_52_0/libs/test/doc/html/intro.html" rel="nofollow">Boost</a>, but if you are using Qt, their <a href="http://qt-project.org/doc/qt-5.0/qttestlib/qtest-overview.html" rel="nofollow">QtTestLib</a> might be the better choice.</p>
XSD with imports and namespaces <p>Hi I am trying to get my mind around XSDs, XML and namespaces but I can't get things to work the way I want them to.</p> <p>I have an XSD which, at the moment, starts like this:</p> <pre><code>&lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" ...
<p>If you aren't using namespaces or your schemas share the same namespaces, you would be much better off using xs:include rather than xs:import. Schema A can include schema B if B either has the same namespace as A or has no namespace declared (if the latter is the case, B 'adopts' the includer's namespace when includ...
obj is null, javascript <pre><code>function init() { alert("init()"); /** * Adds an event listener to onclick event on the start button. */ xbEvent.addEventListener(document.getElementById("viewInvitation"), "click", function() { new Ajax().sendRequest("31260xml/invitations.xml", null, new...
<p>Try calling your function like this:</p> <pre><code>window.onload=init; </code></pre> <p>The javascript runs as the page loads. At that point, the element does not yet exist in the DOM tree. You'll need to delay the script until the page has loaded.</p>
svn script to rename member variables on checkout/update <p>I work with a guy who prefers to name his member variables using the mCamelCase convention, for example: mSomeVar or mSomeOtherVar. I can't stand this format. I prefer the m_camelCase convetion, for example: m_someVar or m_someOtherVar. We drive each other ...
<p>Sounds like a recipe for disaster. In order to get this to work you'd need to decide on a repository wide standard, where every file uses the same variable naming conventions. If you can do that, why not just have everyone code like that?! The important thing about conventions is not <strong><em>which</em></strong> ...
How to Queue JS with Rails Helpers <p>Say I want to queue these JS calls, can that be done with the Rails helpers?</p> <pre><code>render :update do |page| page.replace_html replace_html 'notice', flash[:notice] page.visual_effect :blind_down, "notice", :duration =&gt; 0.5 page.visual_effect :blind_up, "notice", :du...
<p>Scriptaculous effects have a <code>queue</code> option, which you can give as a parameter to <code>visual_effect</code>. For instance,</p> <pre><code>render :update do |page| page.replace_html replace_html 'notice', flash[:notice] page.visual_effect :blind_down, "notice", :duration =&gt; 0.5, :queue =&gt; 'end' ...
Complicated MySQL query for newsletter queue <p>Hey everyone, I'm back and looking forward to more of your brilliance. I have two tables:</p> <ol> <li>newsletters — each row contains a 'id', 'subject', 'body' &amp; 'from' headers for an email</li> <li>newsletter_queue — each row contains an 'id', 'email' address, ...
<pre><code>SELECT GROUP_CONCAT(email ORDER BY date ASC SEPARATOR '|'), newsletterid, date FROM (SELECT email, newsletterid, date FROM newsletter_queue WHERE status="0" ORDER BY date ASC LIMIT 125) as Unsent GROUP BY newsletterid </code></pre> <p>This applies the limit to the inner query, before th...
I created a resource but files inside it are shown as not existing <p>I embedded my files as resource in my C# program. Now i am trying to see that files exist or not through </p> <pre><code> if(File.Exists(path)) </code></pre> <p>but it is not going inside the if block when even the path is the valid path to th...
<p>If you want to access your resources in c#, you should use the Properties.Resources class.</p> <p>For example:</p> <pre><code>string data = Properties.Resources.dtd </code></pre>
Why am I getting these Errors in the Console when Debugging in XCode? <p>I am creating an App and when I run it I check the Debug Pane, I am getting these errors Inside the Console:</p> <p><strong>2009-05-27 07:18:03.852 Spark[1228:10b] [ valueForUndefinedKey:]: the entity Projects is not key value coding-compliant fo...
<p>If a project is selected in your outline view, the text field tries to get the value notes from the 'selected' treecontroller item, which is a project. Since a Projects entity has no notes attribute, the KVO throws an exception.</p> <p>Deselect the binding option 'Raises for Not Applicable Keys' in the 'value' bind...
Why does visual studio break the naming convention for methods in C#? <p>I know the naming convention for class methods in C# is to begin with a capital letter and each new word is a capital letter (e.g. GetDeviceName).</p> <p>So my question is why when I create a form, place a control on it, then double click the con...
<p>The naming convention for event handlers of controls have always been <code>controlName_EventName</code>, so basically, it reuses your own naming convention for the control, and then tucks on the name of the event.</p> <p>This might be contrary to the general naming standard, but it has always been this way.</p> <...
Creation and positioning of dynamic buttons in as3 inside a movie clip <p>HI Am NEW TO as3 , can any one help me regarding creation of dynamic buttons and assign click events, please view the attachment picture to know my requirements..</p> <pre><code> http://i39.tinypic.com/9gkmds.jpg </code></pre> <p>Pls guide m...
<p>Here's a start:</p> <pre><code>for (var i:int = 0; i &lt; 8; i++) { var button:SimpleButton = new MyButton(); //whatever the library linkage of your button is addChild(button); button.x = i * 100; } </code></pre>
capture stderr from python subprocess.Popen(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE) <p>I have seen this posted so many times here; yet failed to capture intentional errors from command. Best partial work I have found so far..</p> <pre><code>from Tkinter import * import os import Image, ImageTk import ...
<p>This works perfectly for me: </p> <pre><code>import subprocess try: #prints results result = subprocess.check_output("echo %USERNAME%", stderr=subprocess.STDOUT, shell=True) print result #causes error result = subprocess.check_output("copy testfds", stderr=subprocess.STDOUT, shell=True) except s...
StartUp Url in WPF <p>I have a problem regarding StartUp Url in WPF. I have a LoginView.xaml and MainWindow.xaml. I want at first to open LoginView after that automatically to be opened MainWindow.</p> <p>App.xaml</p> <pre><code>&lt;Application x:Class="XXX.App" xmlns="....." Startup="App_Startup"...
<p>Again I found the solution of my problem myself :) here is the solution</p> <p><a href="http://www.ageektrapped.com/blog/the-wpf-application-class-overview-and-gotcha/" rel="nofollow">http://www.ageektrapped.com/blog/the-wpf-application-class-overview-and-gotcha/</a></p>
Where does a published RDL file sit? <p>When publishing a reporting services report. Where does the actual .RDL file sit on the server?</p> <p>I can redownload the .RDL file via browsing through the report manager? But where is this file situated on the reporting services server?</p> <p>Thanks</p>
<p>It is not a file on the server. It stored as a BLOB in the ReportServer database.</p> <p>(In the Catalog table to be precise on SSRS 2005)</p>
Application-wide Restriction of objects, methods etc <p>I have a very theoretical question: Is there a way to ban the use of some methods, objects etc. inside of my application/project map in C#, .Net and/or Visual Studio?</p> <p>To be more specific: I'm developing a DMS System where it should never be possible to del...
<p>Wouldn't it be simpler to control delete permissions to the archived files?</p>
Vector of pointers template clearing function fails to compile with "undefined reference" message <p>For a program of mine I made a small function to clear the various std::vectors of pointers that I have.</p> <pre><code>template &lt;class S&gt; void clearPtrVector(std::vector&lt;S*&gt; &amp;a,int size) { for(size...
<p><strong>Hot Fix</strong></p> <p>Write following instead:</p> <pre><code> template &lt;class Vector&gt; void clearPtrVector(Vector &amp;a) { for(size_t i = 0; i &lt; a.size(); i++) delete a[i]; a.clear(); } </code></pre> <p>Make sure you define the template somewhere where compiler can see...
jQuery: Chaining Events - code correction <p>Can any one tell me how can i replace the slideup function with fadeout('slow') for the below code</p> <pre><code> div.slideUp(function() { div.load("GetResults.aspx?mode=bymanu&amp;mid="+manuId, { symbol: $("#txtSymbol" ).val() }, ...
<p>The <a href="http://docs.jquery.com/Effects/fadeIn" rel="nofollow">jQuery docs</a> are actually a really good place to check for syntax like this.</p> <pre><code>div.fadeOut('slow', function() { div.load( "GetResults.aspx?mode=bymanu&amp;mid="+manuId, { symbol: $("#txtSymbol" ).val() }, ...
How can I change the Visibility of a TextBlock with a Trigger? <p>When I try to compile the following code, I get the error <strong>'Visibility' member is not valid because it does not have a qualifying type name.</strong></p> <p>What do I have to change so that I can <strong>make the TextBlock disappear</strong> when...
<p>You need to specify the Type on which the visibility should be set</p> <pre><code>&lt;Setter Property="FrameworkElement.Visibility" Value="Visible"/&gt; </code></pre>
Create a Supersedes Condition in Entity Framework <p>As the title of the question states... I've got a database that is using a supersedes model to store information... meaning that each time a customer is edited, instead of updating the row, the software simply slams a new record into the database, and then updates th...
<p>This is a normal 1:1 relationship with the FK pointing to a new record on each update (which is actually an insert and an update). You just need to make sure you insert first and then update the FK reference to the newly inserted record.</p> <p>Aside, if you do wish to keep old records you should move them to a dif...
Making my SSIS package portable - how to do this? <p>I know how to create SSIS packages and getting my data source and destinations. But what will I have to do in my package if I want to make it portable in the sense where I can change the source and destination connection strings when I move my package onto another PC...
<p>Couple of options. Do you mean you want to make the solution portable, so that you can develop on different PC's, or do you mean you want to make the end-deployable package portable?</p> <p>You can use package configurations for both. They're accessible under the SSIS / Configurations menu. You specify the properti...
Flex Remoting problem with PHP as Back end <p>My PHP Code returns always NO regardless there is a username and password. </p> <p>Flex/MXML code: </p> <pre><code>&lt;mx:RemoteObject id="zendAMF" destination="zend" showBusyCursor="true" source="test_class" &gt; &lt;mx:method name="doLogin" result="onSayHelloResult(ev...
<p>I'm pretty sure since $username and $password are parameters of your method, and since you send those two arguments via RemoteObject, that you already have values for them, and so you don't need to use $_POST. </p> <pre><code>public function doLogin($username,$password) { include("connection.php"); if (isset($use...
What is ISCL in terms of TCP <p>What is ISCL in terms of TCP</p>
<p>It stands for <a href="http://adsabs.harvard.edu/abs/1999SPIE.3662..120K" rel="nofollow">Integrated Secure Communication Layer Protocols for Secure Medical Image Management Systems</a>.</p> <blockquote> <p>ISCL is a security layer which manages security function between presentation layer and TCP/IP layer. I...
Weird bug in device: UITableView's cell content not displayed <p>I have this really weird bug. When I scroll down my table view, down to a section I called "description", the cells in this section won't be displayed. Instead, the title of the section is repeated again and again. It sounds like whoever is in charge of t...
<p>Try changing the word description to something else. Objective C classes use the word description to signify a method where an object can describe itself with an NSString. If changing the name fixes it, your bug is something to do with that.</p> <p>You can see description at work like this:</p> <pre><code>NSString...
Database connection pooling datastructure <p>I would like to develop database connection pooling. </p> <p>Could anyone please tell me about which data structure need to use to maintain the pool ?</p>
<p>It should be implemented using <strong>Object Pool desing pattern</strong>. You can read about it in <a href="http://www.kircher-schwanninger.de/michael/publications/Pooling.pdf" rel="nofollow">Kircher, Michael; Prashant Jain; (2002-07-04). "Pooling Pattern". EuroPLoP 2002. Retrieved on 2007-06-09.</a> or in <a hre...
Mocking framework for .Net fx 1.1? <p>Anyone have any ideas what I can do?</p> <p>Please reserve commenting about using 1.1 still, it's out of my hands :(</p>
<p><strong>Rhino Mocks</strong> is supposed to be compatible with the framework 1.1, according to their website. It is a really good mocking framework, once you get used to it</p> <p>Have a look here to see what you'll be able to do, and what you won't be able to do: </p> <p>ayende.com/Wiki/(S(lqa0ob552sfbu545c5ss4b5...
how do i copy/upload file from S3 to EC2 in PHP <p>I am having a file on S3 Example: test-company/upload/abc.txt I want to upload this abc.txt to my EC2 in php Do anybody having any idea please share it with example..</p>
<p>I've used <a href="https://github.com/tpyo/amazon-s3-php-class" rel="nofollow">amazon-s3-php-class</a> which works great. </p> <p>Zend Framework also has <a href="http://framework.zend.com/manual/en/zend.service.amazon.s3.html" rel="nofollow">AWS support</a> though you can't use it with Europe until ZF 1.8.2 is r...
How can I run SQL statements on a named range within an excel sheet? <p>All I am trying to do is take a standard range on an excel sheet (i.e. a named range, or even A1:F100), and run some sql queries on it, and return a recordset that I can either step through in VBA code, or even just paste into some other sheet in t...
<p>You can just use the name.</p> <pre><code>Dim cn As ADODB.Connection Dim rs As ADODB.Recordset strFile = Workbooks(1).FullName strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &amp; strFile _ &amp; ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";" Set cn = CreateObject("ADODB.Connection") Set rs =...
Web based word processor <p>Do you know of any free JavaScript framework that knows how to read and write doc, docx and odf documents like Google Docs? I want do download it and include it in my own web based application. If there is no such framework, what are my alternative?</p>
<p>I don't think such a "framework exists". It would be much too complex to develop such functions as reading XML/zip files (odf) or doc file (including each different revisions/versions). Such a framework would need a server side component.</p> <p>Alternatives would be simple text editors like tinyMCE. But they just ...
SQL Timeout Errors <p>I'm getting a problem with only 1 of about 30 sites we run on a W2003 Web Server.</p> <p>Probably for about 25% of the day, the website constantly returns : SQL Timeout Errors on various connections to SQL (using ODBC)</p> <p>I have checked and updated the ODBC drivers to the latest that I coul...
<p>You mention changing the timeout of SQL connections, but it's not clear what exactly is timing out: is it the connection to the database, or do the queries take too long?</p> <p>One tool that might help is Sql Profiler. Limit it to the user or database that is experiencing the timouts. If query length is an issue...
How can you limit the allowed values of a XML tag property in a DTD? <p>I have a DTD and I would like to limit a few attribute properties' possible values to, say, "yes" or "no".</p> <pre><code>&lt;!ATTLIST node postgrad CDATA ""&gt; </code></pre> <p>How do I do that?</p>
<p>By defining that the attribute postgrad can have values yes or no:</p> <pre><code>&lt;!ATTLIST node postgrad (yes | no)&gt; </code></pre> <p>That will do it =)</p>
How can i connect MySQL database with objective project? <p>I want to connect MySQl database with my iphone application.Read, write, save some data into the database.How can i do this.</p>
<p>There's a wrapper at <a href="http://code.google.com/p/mysql-cocoa-framework/" rel="nofollow">http://code.google.com/p/mysql-cocoa-framework/</a></p>
How can i get the path of the current user's "Application Data" folder? <p>1)how can i find out the Windows Installation drive in which the user is working.? I need this to navigate to the <strong>ApplicationData</strong> in DocumentsandSettings.</p> <p>2)Also how can i get the <strong>user name</strong> too so that i...
<p>Look at combining <a href="http://msdn.microsoft.com/en-us/library/system.environment.getfolderpath.aspx">Environment.GetFolderPath</a> and <a href="http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx">Environment.SpecialFolder</a> to do this.</p> <pre><code>Environment.GetFolderPath(Envir...
SQL; Only count the values specified in each column <p>In SQL I have a column called "answer", and the value can either be 1 or 2. I need to generate an SQL query which counts the number of 1's and 2's for each month. I have the following query, but it does not work:</p> <pre><code>SELECT MONTH(`date`), YEAR(`date`),C...
<p>I would group by the year, month, and in addition the answer itself. This will result in two lines per month: one counting the appearances for answer 1, and another for answer 2 (it's also generic for additional answer values)</p> <pre><code>SELECT MONTH(`date`), YEAR(`date`), answer, COUNT(*) FROM results GROUP BY...
How to get row from dataset with sql query? <p>i need to take some row. They came from sql TARIH (sql column) is smalldatetime format. But give me error : DataRow[] rows = dsChart.Tables[0].Select("TARIH&#60;='" + datestart + " " + txtStartDateTime.Text + "' and TARIH&#62;='" + dateend + " " + txtEndDateTime.Text+"'...
<p>My guess is that it's not recognizing your string as a valid datetime. The easiest way is to cast your strings to date using the appropriate SQL function.</p> <p>Assuming it's SQL2005, you need to use CONVERT: <a href="http://msdn.microsoft.com/pt-br/library/ms187928.aspx" rel="nofollow">http://msdn.microsoft.com/p...
NSTimer on device is slower than in simulator <p>I am new to iPhone development. I used <code>[NSTimer scheduledTimerWithTimeInterval:0.01]</code> for game loop. The game consists drawscreen function in which I use <code>CGContextClipToRect</code> to clip the large images for animation. </p> <p>But the speed 0.01 seco...
<p>NSTimer is the wrong tool for this job. It's not meant to be a real-time timer. It has no guarantees on when it will fire, and you can miss frames easily.</p> <p>There are a lot of good recommendations for how to develop this kind of program on <a href="http://stackoverflow.com/questions/96265/what-is-a-better-way-...
ASP.NET MVC Session vs Global vs Cache <p>I have an application that was written in vanilla ASP.NET that I would like to port over to ASP.NET MVC.</p> <p>I, however, am confused about the right place to persist objects. I need to persist for a couple reasons:</p> <ol> <li>I would like all to have a <strong>single</s...
<p>Your database would go in a base class for your controllers. This base class should extend Controller, and all your controllers should extend the base class. Here's a little example:</p> <pre><code>public class BaseController : Controller { private AuthServices _auth; private LogHelper _log; private R...
How do I chose the most appropriate type of exception to throw? <p>There are already lots of questions on SO about exceptions, but I can't find one that answers my question. Feel free to point me in the direction of another question if I've missed it.</p> <p>My question is quite simple: how do other (C#) developers g...
<p>Krzysztof Cwalina has a good post on this <a href="http://blogs.msdn.com/kcwalina/archive/2005/03/16/396787.aspx">see chapter "1.1.1 Choosing the Right Type of Exception to Throw"</a></p> <p>PS Consider subscribing to his blog. Good reading!</p> <p>To answer your question: <strong>InvalidEnumArgumentException</str...
ASP.NET GridView HeaderRow <p>Is it possible to set the a gridview's headerrow property from the aspx code? I'd like to be able to include extra controls to the header such as textbox for filter. I can do this from the C# code behind by dynamically adding the controls, but doing this seems to introduce some suitable pr...
<p>Use a header template field.</p> <pre><code>&lt;columns&gt; &lt;asp:templatefield&gt; &lt;headerstyle backcolor="Navy" forecolor="White"/&gt; &lt;headertemplate&gt; &lt;asp:textbox id="txtFilter" runat="server"/&gt; &lt;/headertemplate&gt; &lt;/asp:templatefield&gt; ...
Write a shell which can embed other application and run as a separate process <p>I found an interesting article from HP website. They wrote a TouchSmart Shell application, and it allows other applications to embed in that shell, and run as a separate process. Of course, HP defined some restrictions with the embedded ap...
<p>Isn't this what all the unix shells do? Embed applications into themselves. I hope I have understood your question correctly. A similar thing can definitely be done in Win32. MSYS (Minimal SYStem) and Cygwin all do the same. They have their own shells, though I would assume they're written in C and not in C++</p>
How can I stream documents via a webservice? <p>I am developing a broker service which accepts a clients request to search for an image with certain tags. I have an existing web service in C# 2.0 which delivers the requested info and due to business rules, I cannot expose my 2.0 webservice to the new client and hence t...
<p>use MTOM attachments. See this article for a comparison and explanation: <a href="http://msdn.microsoft.com/en-us/library/ms733742.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms733742.aspx</a></p>
WAV / MP3 Conversion On Web Server <p>I'm looking to convert uploaded WAV files to MP3 on my shared hosting server (ASP.NET / C#) and am curious if anyone else has tackled this before.</p> <p>I've seen a few open source C# libraries for performing audio conversion (AumpLib, for example), but in most cases it looks lik...
<p>Have you tried LAME? <a href="http://lame.sourceforge.net/index.php" rel="nofollow">http://lame.sourceforge.net/index.php</a> </p>
Memory leak using JNI to retrieve String's value from Java code <p>I'm using GetStringUTFChars to retrieve a string's value from the java code using JNI and releasing the string using ReleaseStringUTFChars. When the code is running on JRE 1.4 there is no memory leak but if the same code is running with a JRE 1.5 or hig...
<p>Release <strong>array</strong> object.</p> <p>(*env)->DeleteLocalRef(env, array);</p>
Multiple parameters in NSURL object <p>I would like to pass multiple parameters from the iphone sdk to a server-side php which interfaces with a mySQL database.</p> <p>i found some answers on how to do this, but i'm having a hard time figuring out how to include several parameters.</p> <p>what i have right now is</p>...
<p>The <code>- initWithFormat</code> method takes multiple arguments for the format string.</p> <p>So you can do things like this:</p> <pre><code> NSString *urlstr = [[NSString alloc] initWithFormat:@"http://server.com/file.php?date=%d&amp;second=%d&amp;third=%d", theDate, 2, thirdIVar]; </code></pre> <p><code>- in...
Is XML or XUL the future of Java GUI building? <p>After spending a lot of time and code on programming in Swing, I thought this can't be state-of-the-art Java GUI building. After not finding a user-friendly visual gui bilder for eclipse I stumbled upon declarative GUI building with XML UI toolkits... and I thought: Thi...
<p>There new fresh and interesting approach - it uses <strong>YAML</strong>. Check it out at <a href="http://code.google.com/p/javabuilders/" rel="nofollow">http://code.google.com/p/javabuilders/</a></p>
Is there a lock statement in VB.NET? <p>Does VB.NET have the equivalent of C#'s <code>lock</code> statement?</p>
<p>Yes, the <a href="http://msdn.microsoft.com/en-us/library/3a86s51t.aspx">SyncLock</a> statement.</p> <p>For example:</p> <pre><code>// C# lock (someLock) { list.Add(someItem); } // VB SyncLock someLock list.Add(someItem) End SyncLock </code></pre>
Restrict browser plugin usage to specific servers? <p>For a new banking application we are currently discussing the details of a browser plugin installed on client PCs for accessing smartcard readers.</p> <p>A question that came up was: Is there a way to restrict the usage of this plugin to a specified list of domains...
<p>You could hard code the list of authorized domains into the plugin itself.</p> <p>Alternatively, you could expose a web service which will deliver a list of authorized domains. The plugin could make a call to your web service when instantiated to determine whether it can be started or not.</p>
django auth User truncating email field <p>I have an issue with the django.contrib.auth User model where the email max_length is 75.</p> <p>I am receiving email addresses that are longer than 75 characters from the facebook api, and I need to (would really like to) store them in the user for continuity among users tha...
<p>EmailField 75 chars length is hardcoded in django. You can fix this like that:</p> <pre><code>from django.db.models.fields import EmailField def email_field_init(self, *args, **kwargs): kwargs['max_length'] = kwargs.get('max_length', 200) CharField.__init__(self, *args, **kwargs) EmailField.__init__ = email_fie...
Python plotting libraries <p>What alternatives are there to pylab for plotting in Python? In particular, I'm looking for something that doesn't use the stateful model that <a href="http://en.wikipedia.org/wiki/Matplotlib">pylab</a> does.</p>
<p><a href="https://plot.ly/" rel="nofollow">Plotly</a> lets you make graphs using a <a href="https://plot.ly/api" rel="nofollow">Python API</a>, <a href="https://plot.ly/python/matplotlib-to-plotly-tutorial/" rel="nofollow">matplotlib</a>, and <a href="https://plot.ly/ipython-notebooks/big-data-analytics-with-pandas-a...
How to control trackball behaviour in Android Views? <p>I have a FrameLayout view which contains one (MapView-like) control and some additional buttons overlaying it. (the layout xml is below).</p> <p>I want to allow the user to pan/scroll the main view using not only touch but also the Trackball. The problem is - us...
<p>The trick is to override the <code>dispatchTrackball</code> in your custom view, and grab the events.</p> <p>I hope this helps someone.</p>
In emacs XML mode, how to pretty-format an XML schema file? <p>I want to automatically format an XML schema definition file. All the normal pretty-print stuff: linebreaks after end-element, indentiing. I have seen <a href="http://stackoverflow.com/questions/12492/pretty-printing-xml-files-on-emacs">this answer</a>, a...
<p>Try something like the following:</p> <pre><code>(defun prettyprint-xml () (interactive) (goto-char (point-min)) (while (search-forward "=" (point-max) t) (search-forward "\"") (search-forward "\"") (forward-char) (newline-and-indent)) (align-regexp (point-min) (point-max) "\#")) </code></pr...
SQL Case statement Syntax <p>I am trying to write a select statement that will select a number of fields including an email field. There are 3 email fields available in this table which can sometimes contains null values. I wan to look at 3 fields; [email address1], [email address2], [email address3] and basically wh...
<p>What you need is <a href="http://msdn.microsoft.com/en-us/library/aa258244.aspx" rel="nofollow">COALESCE(...) function</a>:</p> <pre><code>SELECT COALESCE(t.Email3, t.Email2, t.Email1) FROM MyTable t </code></pre>
MySQL - show field value only in first instance of each grouped value? <p>I don't think this is possible, but I would like to be proved otherwise.</p> <p>I have written a simple report viewing class to output the results of various database queries. For the purpose of improving the display, when I have a report with g...
<pre><code>SELECT CASE WHEN @r = year THEN NULL ELSE year END AS year, quarter, total, @r := year FROM ( SELECT @r := 0 ) vars, mytable ORDER BY year </code></pre> <p><code>@r</code> here is a session variable. You can use these in <code>MySQL</code> like an...
Is it possible to "cast" an object to a more specialized object? <p>The problem is that I need a little extra functionality to an object of a class that I can’t change (I’m trying to add data binding support). The best solution that I can think of is to just write a derived class with this functionality. So I can ...
<p>You have just about answered this yourself - the 'standard' way to do this is to take an instance of the base class in the constructor of your derived class. It's an example of the <a href="http://en.wikipedia.org/wiki/Decorator%5Fpattern" rel="nofollow">decorator pattern</a></p> <p>From the wikipedia page </p> <b...
How to handle exception when Directory.GetFiles() throws an exception when it finds a file name it does not "like"? <p>On a Vista machine with the valid path C:\Users\David, calling Directory.GetFiles(@"C:\Users\David") throws the following ArgumentException when run as the David user, who can view the contents of the ...
<p>Can you try listing the file using PInvoke <em>FindFirstFile</em>- <a href="http://www.pinvoke.net/default.aspx/kernel32.FindFirstFile" rel="nofollow">see here</a>. Does is cause simmillar issues?</p> <p>The file information will be returned in the <a href="http://www.pinvoke.net/default.aspx/Structures/WIN32%5FFIN...
How do I send an email to an Exchange Distribution list using c# <p>I need to send an email to an Exchange distribution list called "DL-IT" using c#.</p> <p>Does anyone know how to achieve this?</p>
<p>The simplest way would be to find the actual email address of the DL, and use that in your "To:" field. Exchange distribution lists actually have their own email addresses, so this should work fine.</p>
VS2010 and VS2008 project compatibility <p>Does anyone know if VS2010 will use the same project &amp; solution file format as 2008, or will the 2008 project files need to be upgraded to 2010 format before they'll open in that version?</p>
<p>"Visual Studio 2010 will allow you to move your projects from previous versions of Visual Studios to VS 2010 with ease, I will call this process as “Converting” the project from VS 200X to VS 2010… </p> <p>VS 2010 will also allow you to change your project’s Target Framework Version to .NET 4.0 from .NET ...
CONNECT_BY_ISLEAF with Conditions <p>Hoping someone can assist me - have a hierarchical set-up going on a table using the whole <code>START WITH</code> and <code>CONNECT BY</code> clauses, which I am using to set-up a vertical-aligned menu system that can expand out to the right, depending if a menu option has children...
<pre><code>SELECT * FROM table CONNECT BY parent = PRIOR id AND active = 1 </code></pre> <p>This will select a child only if it's active, if that's what you want.</p> <p>Note that this query will return <code>CONNECT_BY_ISLEAF = 1</code> for the items that do not have active children, and they wil...
Entity Framework IQueryable <p>I'm having problems querying the entity model to get additional information.</p> <p>My db has a Program table with a one to many relation with an Events table. The Entity model generates the relationships just fine, but I'm unable to figure out how to query the model to get the progam o...
<p>The Include Function is part of the ObjectQuery object...</p> <p>I think you are going to need to re-write your query to look something like this:</p> <pre><code>var contacts = context.Contact.Include("SalesOrderHeader.SalesOrderDetail").FirstOrDefault(); //Not sure on your dot path you might have to debug that ...
Strip specific parameteters when redirecting with Mod-Rewrite <p>I have a pretty complex RewriteRule where I need to check if certain parameters are present in QueryString and then redirect to the same URL but with those parameters stripped.</p> <p>How can I remove some parameters and preserve the rest?</p> <pre><cod...
<p>Try these rules:</p> <pre><code>RewriteCond %{QUERY_STRING} ^(([^&amp;]*&amp;)*)(color=red|status=continue)($|&amp;)(.*) RewriteRule .* $0?%1%5 [N,E=REMOVED:true] RewriteCond %{ENV:REMOVED} true RewriteRule ^ %{REQUEST_URI} [L,R=301] </code></pre> <p>Another way would be to use PHP to check what parameters are giv...
Printing a Calendar or Diary from ASP.NET Application <p>We have an ASP.NET application that uses the Infragistics WebSchedule control to display appointments etc in the same manner as Outlook. The problem we have is that the customer wants to be able to print the page as it appears on the screen - which the control it...
<p>Well in the end I decided to junk the Crystal Report in this instance. It's fine for tabular data and graph data but not really suitable for a graphical representation of a diary/scheduler.</p> <p>I opted for an XML/XSLT solution which has turned out better than I expected - especially in terms of speed.</p> <p>I ...
Third Party Email Senders <p>I am sending email from my asp.net application, and I wanted to see if anybody could recommend a third party that will actually send the emails. Ideally they should have some sort of web service available that I can send a request to.</p>
<p>Mike,</p> <p>Check out some of the following. They have API's that may or may not be of use/interest to you that your application could interface with. I am sure there are others, a few months ago I went through about 5-10 providers and these are the three that stuck for me. </p> <p>They send out emails to your...
Is there a way to find a table in a DBML file in Visual Studio 2008? <p>This ones been bugging me for ages.</p> <p>Back in the olden days when we hunted our own food and used DataSets, you could snap to a particular table in a DataSet by selecting what you want from a drop down list at the top.</p> <p>If I have a big...
<p>If you have your "Properties" View turned on, theres a DropDown at the top that you can select your DBML Entities from, and the canvas should snap focus to the particular entity when you select it</p>
Contact Management System Schema <p>I'm looking for something I can reference in designing the database for a contact management system. Any suggestions?</p>
<p>Google suggests:</p> <p><a href="http://www.databaseanswers.org/data_models/" rel="nofollow">http://www.databaseanswers.org/data_models/</a></p>
Django Model Inheritance: Duplicated class fields <p>I have a Django project whereby every model inherits from a common "Object" model - which defines only two fields - the ID of the object (so every object in the entire system has a unique identifier) and a "type". The type is the type of object that particular instan...
<p>Maybe renaming would be appropriate. If one of your fields has the same identifier as a class, you may break some naming conventions (although, of course these are only conventions).</p> <p>See <a href="http://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a>, section <em>Naming Conventions</em>.</p> <pr...
Can a C++ compiler re-order elements in a struct <p>Can a C++ compiler (specifically g++) re-order the internal elements of a struct?</p> <p>I'm seeing some strange behaviour where I have a structure that contains something like the following:</p> <pre><code>Struct SomeStruct{ ... ... long someLong; long ...
<p>It normally can't reorder elements, no. </p> <p>An exception is if there's an access specifier separating them:</p> <pre><code>struct Foo { A a; B b; C c; private: D d; E e; F f; }; </code></pre> <p>a, b and c are guaranteed to be stored in this order, and d, e and f are guaranteed to be stored in...
Windows CE Icon lost when using CAB installer <p>I have a C# Windows CE 5.0 application. I am using VS2005. My executable shows the correct icon (32x32 8 bit). If I move the .exe file to the CE device using ActiveSync then the icon is still correctly displayed. When I use a CAB file to install the application the icon ...
<p>With Windows CE you must do a soft reset for the icons to appear. Even when doing a full uninstall and reinstall of the program with the CAB the icons look at the image stored in cache. </p>
Assocating BDD Scenarios with results of Silverlight Tests <p>I work with a team that uses Behaviour Driven Development(BDD) to deliver our applications. We have started delivering Silverlight applications. </p> <p>I would like to associate the agreed <strong>BDD Scenarios written in plain text</strong> to the results...
<p>If you're using the <a href="http://silverlight.codeplex.com/" rel="nofollow">Silverlight Test Framework</a> that ships in the Silverlight Toolkit, you unfortunately won't find any trivial extensibility points to report this kind of information back today.</p>
Are event in tinyos signaled inside the stack? <p>I wanted to ask something that I think is not clearly specified in the tinyos2 programming manual. When a command or task signals an interface event are the wired functions called immediately, i.e. in the same callstack, or are these signaled events "posted" for later e...
<p>TinyOS 1 or 2 does not make a difference here - this is a nesC question. Upon signal, execution begins immediately. However, if multiple components are wired to an interface, execution is done one after another (aka. fan-out).</p>
Batch file: Password Stars/Circles <p>Like you already know, websites have certain special chars for passwords, like stars and circles.</p> <p>Could this be possible in a batch file, on the following one:?</p> <p>If this is not possible, if you type it in, could you just see nothing?</p> <pre><code>set pass= set /p ...
<p>Not directly. You would have to write a password entry programme in something else and then run it from your batch file to capture the password.</p>
How do I convert a CString to a double in C++? <p>How do I convert a <code>CString</code> to a <code>double</code> in C++? </p> <p>Unicode support would be nice also.</p> <p>Thanks!</p>
<p>A <code>CString</code> can convert to an <code>LPCTSTR</code>, which is basically a <code>const char*</code> (<code>const wchar_t*</code> in Unicode builds).</p> <p>Knowing this, you can use <a href="http://msdn.microsoft.com/en-us/library/hc25t012.aspx"><code>atof()</code></a>:</p> <pre><code>CString thestring("1...
Cannot display custom controls in VS 2008 Designer -- .NETCF <p>I'm having problems displaying custom (inherited) controls in my .NETCF windows mobile project in Visual Studio. The control appears on the designer surface as a gray box with the class name written in it.</p> <p>As a test case I have a simple control de...
<p>I'd say you add DesktopCompatible(true) as a Custom Attribute to the control. See: <a href="http://blogs.msdn.com/b/xinyan/archive/2005/10/26/485306.aspx" rel="nofollow">this post</a></p>
How can I get jcifs to play nicely with apache axis <p>I need to connect Apache Axis 1.4 to a Webservice that uses NTLM authentication to restrict access to its operations. I'm expecting to use Samba Jcifs to handle the NTLM handshake.</p> <p>I found </p> <p><a href="http://hc.apache.org/httpcomponents-client/ntlm.ht...
<p>Finally have a solution to this.</p> <h3>The problem</h3> <p>Apache Axis uses Apache <code>HTTPClient</code> which provides its own NTLM implementation.<br> However this implementation is incomplete; it only supports the primitive LM authentication.<br> The system I need to connect to insists upon the more recent ...
Mac OS X Java SDK Support <p>Can anyone tell me, or send me to a page, that can tell me what version of Java that a Mac OS X supports out of the box? I know for instance 10.5 comes with Java 1.5 installed by default. what about 10.4? 10.3? 10.2? 10.1? </p> <p>My app needs to be cross platform and I need to figure out ...
<p>See <a href="http://developer.apple.com/technotes/tn2002/tn2110.html" rel="nofollow">this document</a>, specifically the <strong>Java Version Strings</strong> section. I don't think there's a one-to-one relationship between Mac OS X versions and Java versions.</p>
choosing database FILEGROWTH as a % or as Fixed size <p>Does anyone know of any issues (performance or otherwise) associated with a FILEGROWTH setting as a % rather than as a fixed size? What advantage is there to % over fixed increments?</p>
<p>Using a percentage can mean big autogrows. When you are adding 10% to a 100GB DB, you're adding 10GB. If that takes longer than 30 seconds (it easily can) and you have a caller with a 30s timeout that will cause a rollback, you'll end up with a lot of disk activity for a long time if you have a retry loop. I might ...
Multiple .NET Configuration Files and Setup Project Problem <p>In order to handle settings for different deployment targets, I moved application settings from app.config to its own file and included that file in app.config via configSource. I also created a settings file for each target.Here is an illustration:</p> <p...
<p>If I had to approach this problem, I'd start by asking the following question:</p> <p>Why does settings.config have to be under source code control if settings.Debug.config or settings.Release.config provide the same information?</p> <p>The answer, if I read your question correctly, is because you needed to force ...
Having trouble with fork(), pipe(), dup2() and exec() in C <p>Here's my code:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;unistd.h&gt; #include &lt;wait.h&gt; #include &lt;readline/readline.h&gt; #define NUMPIPES 2 int main(int argc, char *argv[]) { char *bBuffer, *sPtr, *aPtr ...
<p>Even after the first command of your pipeline exits (and thust closes <code>stdout=~fdPipe[1]</code>), the parent still has <code>fdPipe[1]</code> open.</p> <p>Thus, the second command of the pipeline has a <code>stdin=~fdPipe[0]</code> that never gets an EOF, because the other endpoint of the pipe is still open.</...
Should I host Website and REST API on the same server or split? <p>I have a web application that consists of Website and REST API. Should I host them on the same server or should I host them on different servers? By "server" I mean a server cluster - several servers behind load balancer.</p> <p>API is mostly inbound t...
<p>Just as you stated, in most situations, there are more advantages in hosting the API on the same server as the website. So I would stick with that option. </p> <p>But if you predict allot of traffic for either the website or the API, then maybe a separate server would be more suited.</p>
How to Speed Up Simple Join <p>I am no good at SQL.</p> <p>I am looking for a way to speed up a simple join like this:</p> <pre><code>SELECT E.expressionID, A.attributeName, A.attributeValue FROM attributes A JOIN expressions E ON E.attributeId = A.attributeId </code></pre> <p>I am doing th...
<p>You definitely want to have indexes on <code>attributeID</code> on both the <code>attributes</code> and <code>expressions</code> table. If you don't currently have those indexes in place, I think you'll see a big speedup.</p>
Flex: when object has focus highlight parent instead? <p>I have a TextInput and a Canvas object both inside an HBox object. When the input text field has focus it highlights, I would like to change this to be the containing HBox that highlights when the Input Text has focus.</p> <p>Does anyone have any ideas on how I ...
<p>I don't think HBoxes have highlighting enabled by default. But you could make the HBox respond to the focusIn event: Setting the filter's alpha to 0 makes it completely transparent.</p> <pre><code>&lt;mx:HBox name="parentHBox" keyDown="checkKey(event)" horizontalGap="0"&gt; &lt;mx:filters&gt; ...
CollapsiblePanelExtender Click Event <p>I have a a CollapsiblePanelExtender with the usual extend and collapse buttons....I would like to have a click event fire off when the extender is extended and a different click event fire off when the extender is collapsed. But the most important event is when it is extended. I ...
<p>I assume you're talking about the ASP.Net AJAX Control Toolkit. You can add handlers to the collapsed and expanded events as follows:</p> <pre><code>//this would be &lt;%=myExtender.ClientID%&gt; when using a master page var extender = $find('myExtender_ClientId'); extender.add_collapsed( function() { alert('colla...
Deletes in one-to-one relationships? Normal behavior? <p>When working in Access, whenever I delete a record from one table - it's corresponding record in another table is also deleted when defined as a one-to-one relationship. This would be normal behavior when I tell it to enforce referential integrity with concerns ...
<p>Yes it's normal behaviour. If your form is based on a query that contains a single one-to-one relationship and you delete a "record" it will delete records in both tables.</p> <p>You need to suppress the normal delete process and run the delete manually via a custom button.</p> <pre><code>Private Sub Form_Delete(C...
Can v4l2 be used to read audio and video from the same device? <p>I have a capture card that captures SDI video with embedded audio. I have source code for a Linux driver, which I am trying to enhance to add video4linux2 support. My changes are based on the vivi example.</p> <p>The problem I've come up against is tha...
<p>Generally, the audio capture part of a device shows up as a separate device. It's usually a different physical device (posibly sharing a card), which makes sense. I'm not sure how much help that is, but it's how all of the software I'm familiar with works...</p>
combining similar functions into one common function involving passing function pointers as parameters <p>I am trying to combine the following two functions into one portable function:</p> <pre><code>void NeedleUSsim::FindIdxRho() { searchTmp = &amp;ninfo-&gt;rho; double *p = std::find_if(tplRho_deg, tplRho_de...
<p>The simplest way to make your code a bit more generic is the following :</p> <pre><code>template&lt;typename ComparisonType&gt; double* NeedleUSsim::FindIdx(double* containerBegin, double* containerEnd, ComparisonType comparison) { double* p = std::find_if(containerBegin, containerEnd, comparison); double* ...