input
stringlengths
51
42.3k
output
stringlengths
18
55k
Strongly typed dataset modification breaks binding <p>I'm building a winform app which uses datagrids, lists, textboxes which are bound to columns in a strongly typed dataset which is part of my project. I am having issues when I want to add an extra column at design time to one of the tables in the dataset where once ...
<p>Unfortunately I've seen a lot of buggy behavior from the Visual studio designer like this...hopefully someone else has a direct fix for you, but I've taken to moving my databindings manually to the constructor or OnLoad function:</p> <pre><code>txtAddress1.DataBindings.Add("Text", myBindingSource, "sAddress1"); cmb...
Can the Terminal Services session ID change during the lifetime of a process? <p>When using .NET's <code>Process.SessionId</code> property or the Windows API call <code>ProcessIdToSessionId()</code>, can the result be relied on to be the same throughout the lifetime of the process?</p> <p>i.e. If I want to use this va...
<p>No it's not safe, especially console sessions can change it's sessionid when the connection changes from RDP/remote to the physical console and vice versa or when Fast User Switching is done (Windows XP). Also it wouldn't hurt to call this API often since the SessionId is retreived from the PEB of the process.</p>
use object created in class constructor in class methods <p>Is it possible to use an object that was created during a class' construction within the member methods of that class?</p> <p>Ex</p> <pre><code>&lt;?php include ('AClass.php'); class Auto_Cart { function Auto_Cart() { $aclass = new AClass(); ...
<p>You need to store the instance of <code>AClass</code> as a member variable (aka "property") of the instance of <code>Auto_Cart</code>.</p> <p>Assuming PHP4 by the style of your constructor</p> <pre><code>class Auto_Cart { /** @var $aclass AClass */ var $aclass; function Auto_Cart() { $this-...
Saving state before shutting down using .NET <p>I'd like to save the state of my machine before shutdown (for machines that do not support hibernate). </p> <p>Essentially, I'm trying to mimic the Windows Hibernate feature. When the machine its turned back on, it looks exactly like it did previous to being shut down.<...
<p>For all applications running on your computer, this is simply not possible using pure managed code. In fact, even with unmanaged code you will have a hell of a time. I wouldn't say it's impossible but likely extremely difficult and time comsuming.</p> <p>Here are a few helpful resources to get you started:</p> <p>...
C# LinkButton.PostBackUrl - New window without JS <p>Is it possible to use <code>asp:LinkButton</code> without JavaScript to open new windows? Currently i have workable next code, but with JS.</p> <pre><code>&lt;asp:LinkButton ID="lnkPcName" runat="server" OnClientClick="window.document.forms[0].target='_blank';" Post...
<p>As i know <strong>linkbuttons</strong> were originally designed to do a postback to the same page</p> <p>If i were you i would use a <strong>hyperlink</strong> control instead</p>
Run Function Every Minute In Cocoa <p>I am wondering if there is some way to run a function every minute in Cocoa. I, personally, will be using this for saving content as the user types it in case they quit - But I have seen this effect also used in Twitter clients. When the user keeps the window open, it will auto-u...
<blockquote> <p>I, personally, will be using this for saving content as the user types it in case they quit - But I have seen this effect also used in Twitter clients. </p> </blockquote> <p>A better solution would be to be the text view's delegate, and respond to <code>textDidChange:</code> by creating the <em>non-r...
PHP VLookup (conditional match) Alternative? <p>How do I return the results for the provision_id column so that they are conditional on contracts.id for each row? Right now, I get the same result on every row. The desired effect is sort of like VLookup in Excel. Not sure how to use if else/sql values to achieve it in ...
<p>Try the following query. Then, you can do it all with one request to the database.</p> <pre><code>SELECT salaries.id AS salaries_id, salaries.name, salaries.remaining, salaries.contract_value, contracts.provision_id AS provision_id FROM salaries LEFT JOIN contracts ON contracts.id=salaries.id </code></pre>
Calling a php file everytime when i click the button in Flex <p>The problem i am facing right now is a filename.php generates filename.xml.... and this filename.xml is called in my Flex Tree.</p> <p>Now everytime i update my DB, the values are not getting reflected into filename.xml unless i call the filename.php</p> ...
<p>In <a href="http://stackoverflow.com/questions/1032283/mapping-php-and-flex-objects">http://stackoverflow.com/questions/1032283/mapping-php-and-flex-objects</a> you said<blockquote>I am using ZendAMF for remoting.</blockquote></p> <p>Why not sending the xml data (maybe but not necessarily as xml document) the same ...
"fatal error U1087: cannot have : and :: dependents for same target" <p>Using the Microsoft Driver Development Kit (DDK), this error plagued me as I attempted even to build the default drivers included with the DDK.</p> <p>I had a some difficulty in tracking down the cause and solution through Google. In an effort to ...
<p>Tthe solution to this problem is to ensure that there are no spaces in the build directory.</p>
Save a text file to a remote network shared folder like https:// <p>My client provides a network shared folder in the format of <a href="https://xxxx" rel="nofollow">https://xxxx</a> with user name and pwd. I need to write a console application to put a text file there. Is there any .Net class or library available? I p...
<p>You might want to take a look at </p> <p>HTTP put - that's the first thing that came to mind. An example can be seen here::</p> <p><a href="http://www.java2s.com/Code/CSharp/Network/HTTPputwithusernameandpassword.htm" rel="nofollow">http://www.java2s.com/Code/CSharp/Network/HTTPputwithusernameandpassword.htm</a><...
Standard way of adding Sound to an iPhone app (global volume indicator) <p>I have an app with various views. The <em>main menu</em> does not have any sounds, but the next views play sounds using the AVAudioPlayer Class.</p> <p>So when someone launches the app and is in the <em>main menu</em>, if he changes the volume ...
<p>The volume buttons will affect the ringer volume if your application isn't currently playing audio. Some apps work around this by playing a silent audio file. Carefully consider how you do this, though - is adjusting the apps volume when it's not actually playing something actually useful?</p> <p>It seems like you ...
Removing a Recently Used Query from the List on the Work Items Tab of Pending Changes <p>On the Work Items tab of the Pending Changes window in Visual Studio (I'm using 2008), there is a dropdown list for the Query field which contains recently selected queries. Where is this list stored? I'd like to clean the list up....
<p>There's one for each server you've connected to: %LOCALAPPDATA%\Microsoft\Team Foundation\2.0\Cache\WorkItemHistory_[guid].config</p> <p>where [guid] is the server's GUID.</p>
Automatically Create XmlSerializer assembly <p><strong>Duplicate:</strong> This is duplicate of <a href="http://stackoverflow.com/questions/134224/generating-an-xml-serialization-assembly-as-part-of-my-build">http://stackoverflow.com/questions/134224/generating-an-xml-serialization-assembly-as-part-of-my-build</a>. Ple...
<p><a href="http://stackoverflow.com/questions/134224/generating-an-xml-serialization-assembly-as-part-of-my-build">http://stackoverflow.com/questions/134224/generating-an-xml-serialization-assembly-as-part-of-my-build</a></p> <p><a href="http://social.msdn.microsoft.com/forums/en-US/sqlnetfx/thread/d252d732-5e5b-480b...
Valid XML for posting to QuickBooks Online Edition - Receiving (400) Bad Request Error <p>I am trying to post the below xml to <a href="https://apps.quickbooks.com/j/AppGateway" rel="nofollow">https://apps.quickbooks.com/j/AppGateway</a> and all I keep getting is the error: The remote server returned an error: (400) Ba...
<p>Change your qbXML version to 6.0, QuickBooks Online Edition doesn't support 7.0 yet. </p>
Realtime microphone sound level monitoring <p>I'm trying to access sound volume data from the microphone in realtime. I've tried AVAudioPlayer but it only monitors sounds from a source like an mp3 and not from a microphone. I've also tried The SpeakHere app but it's proving to be much tougher to understand with all the...
<p><a href="https://github.com/stephencelis/sc_listener">sc_listener</a> is deprecated. The correct answer today is to use <a href="http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioRecorder_ClassReference/Reference/Reference.html"><code>AVAudioRecorder</code></a>. <a href="http://mobi...
How to fix page so it displays correctly in IE7? <p>A reader has just brought to my attention that IE7 on Windows XP Professional, ver 2002, SP 2 displays pages such as <a href="http://beachpaper.com/issues/current/page28.html" rel="nofollow">http://beachpaper.com/issues/current/page28.html</a> to look like beachpaper....
<p>I went to a page on your site that didn't display correctly in IE, saved the source and DL'd the CSS and applied it to the page... and I've got the issue duplicated.</p> <p>And I think I found the problem.</p> <p>The following line is causing the issue:</p> <pre><code>&lt;td rowspan="3" colspan="3" valign="top" w...
Html form, radio button and Servlet <p>I've writen a servlet that builds an html page showing the content of a database. The code is:</p> <pre><code>Statement st = (Statement) conexion.createStatement(); ResultSet rs = st.executeQuery("select * from audiolist" ); while (rs.next()) { contado...
<p>In the second servlet you can use:</p> <pre><code>String value = request.getParameter("tituloX"); </code></pre> <p>to read the value. You need to know the name of the parameter to do. If this is not known, you can try to enumerate the parameters:</p> <pre><code>for ( Enumeration e = request.getParameterNames(); e...
SQL Server roles, schemas, users <p>I've been trying to figure out why SQL Server has db_owner schema and db_owner role? This is very confusing. I've been searching for answers and so far this is how my understanding goes:</p> <ol> <li>All tables and objects (such as constraints etc) belong to a schema. DBO being t...
<p>A SQL Server schema is simply container of objects, such as tables, stored procedures, etc. A Database Role is a group of principals, such as windows logins, sql server users, etc.</p> <p>The idea is you can have a role of say "IT", and have all IT users under that role. Then you have can a schema called "IT", an...
What bizarre averaging algorithm is my bike computer using? <p>My bike computer can show me various figures such as distance travelled, time elapsed, max speed, average speed, current speed etc. I usually have it set to display the current and average speeds.</p> <p>You can reset the distance and time (both together) ...
<p>I'm going to guess that it has a history of a certain number of data points and displays the average over them. As time goes on the older points are pushed off.</p> <p>If you were going faster at the point far enough back to be the end of the history pushing off a point will lower your average.</p>
Lapack's row reduction <p>I am trying to write a function that produces a single solution to an underrepresented system of equations (e.g. the matrix that describes the system is wider than it is tall). In order to do this, I have been looking in the LAPACK documentation for a way to row-reduce a matrix to it's reduced...
<p>One often used method for this is the least square solution, see lapack's sgelsx</p>
XML Caching issue in FLex <pre><code>private function loadGallery():void { theSend.url = "http://localhost/userMana/file.xml"; theSend.send(); } </code></pre> <p>I am calling this XML in Flex Tree and its works fine, but when after an update in XML it does not update back in...
<p>I usually do this by appending the time to the XML url:</p> <pre><code>var now:Date = new Date(); theSend.url = "http://localhost/userMana/file.xml?" + now.getTime(); theSend.send(); </code></pre> <p>non-cached every time.</p>
Migrating from Visual C++ 6 to Visual C++ 2008 express <p>I'm tring to migrate my code from VCpp 6 to VCpp 2008 express but when I build the solution I receive this error message:</p> <blockquote> <pre>icl: warning: problem with Microsoft compilation of 'c:\Desenvolvimento\DFF\Base\\version.cpp' 1>C:\Arquivos de progr...
<p>Be careful about upgrading to express version if you have need for MFC and the control wizards/editors. You will not have access to that kind of functionality in Express if I recall correctly.</p>
Windows Messagebox Icons in VS2008 using C# <p>I am looking for the Icon's that are standard on the Messagebox control. I want to use these Icon's on my Form. Where are they located at and the names of them?</p>
<p>Some of the icons can be found at [VS2008 home directory]\Common7\VS2008ImageLibrary\VS2008ImageLibrary.zip</p>
Distinct Values in Dictionary<TKey,TValue> <p>I'm trying to loop over distinct values over a dictionary list:</p> <p>So I have a dictionary of key value pairs .</p> <p>How do I get just the distinct values of string keys from the dictionary list?</p>
<pre><code>var distinctList = mydict.Values.Distinct().ToList(); </code></pre> <p>Alternatively, you don't need to call ToList():</p> <pre><code>foreach(var value in mydict.Values.Distinct()) { // deal with it. } </code></pre> <p><strong>Edit:</strong> I misread your question and thought you wanted distinct value...
Modules v. namespaces in F# <p>I've got a library written in F#, consumed by C# and F#. this library defines a class <code>foo</code>, in module <code>bar</code>, in namespace <code>random</code>:</p> <pre><code>#light namespace random module bar type foo() = ... </code></pre> <p>Now, when I go to consume type <cod...
<p>If you're publishing F# components for consumption from other .Net languages, then you should avoid modules in the public interfaces, and stick to namespaces containing classes, structs, and enums.</p> <p>(Modules are a handy way either to publish values, functions and types among F#-only components, or as 'interna...
How to handle message responses over (async) network communication (VB.NET) <p>I'm writing an app that sends messages over a network to another PC that processes the message and sends back a reply (e.g. a boolean or some other data). My network communication subs (based on WCF) just give me the ability to send a messa...
<p>What if you wrap all of this in a class? Then the idea would be that you'd only have one "NetComm" object in each instance. Say you call the class MessagingUtility. And whenever you want to send a new message you'll have to call</p> <pre><code>Dim myMessage As New MessagingUtility() myMessage.NetSendMessage("Hel...
How Can i Make Dynamic a JtabbedPane? <p>as i said in title i wanna do dynamic jtabbedpane .. for example ;</p> <pre><code>JTabbedPane tabbedPane = new JTabbedPane(); ImageIcon icon = createImageIcon("images/middle.gif"); JComponent panel1 = makeTextPanel("Panel #1"); tabbedPane.addTab("Tab 1", icon, panel1,"Does noth...
<p>Why is it more difficult than dynamically adding tabs? Are you perhaps not using the right sort of LayoutManager? Generally, if you choose a good layout manager configuring panels will be much easier. I use the JGoodies Forms, and I heard good things about MigLayout.</p>
Get the total number of nodes and counting nodes <p>Is it possible to get the total number of XML nodes?</p> <p>Also, how does one do a for-statement with XSLT?</p>
<p>If you want to count the node of you XML you could use count(object/node) and it will be something like this:</p> <pre><code> &lt;xsl:value-of select="count(/root/*)"/&gt; </code></pre> <p>The instruction above will let you know how many child nodes does your root node has</p> <pre><code>&lt;xsl:for-each select="...
cdonts and relay server? <p>I use CDONTS when I need to send up send email form on websites. Recently changed my hosting company to godaddy. I realized my send email form gives "permission denied" error. I called GoDaddy support. They told me I should use relay server "relay-hosting.secureserver.net" in my codes. I tho...
<p>A web search for "cdonts relay" yielded <a href="http://nicole.cfwebtools.com/index.cfm/2007/12/6/ASP%20form%20mail" rel="nofollow">this example</a> which relates directly to your issue with GoDaddy.com - Based on everything I've read, this only works with <code>CDO.Message</code> instead of <code>CDONTS.NewMail</co...
How do I tell which account is trying to access an ASP.NET web service? <p>I'm getting a 401 (access denied) calling a method on an internal web service. I'm calling it from an ASP.NET page on our company intranet. I've checked all the configuration and it should be using integrated security with an account that has ac...
<p>Have you looked in the IIS logs?</p>
Can I Iimit the memory used by a Perl process in an OS-agnostic way? <p>Is there an OS-agnostic Perl module that puts a hard limit on the amount of virtual memory a process can use; e.g. so that the process will be killed if it starts eating up too much memory?</p> <p>I see <a href="http://search.cpan.org/dist/Apache-...
<p>I don't think perl can have any awareness of whether its memory usage is real or virtual. However if you remove real vs. virtual from your requirement, you could place a limit simply on the memory being used.</p> <p><a href="http://search.cpan.org/perldoc?Devel::Size" rel="nofollow">Devel::Size</a> and <a href="ht...
How to install iis 6.0 on windows xp-32? <p>well, according to what I've found googling around, it's imposible... (maybe with with windows xp 64...)</p> <p>but I thought that maybe someone could find a way to achieve it, or at least some workaround...</p> <p><a href="http://www.iisanswers.com/IISFAQ.htm" rel="nofollo...
<p>IIS 6 cannot be installed on Win XP. However, debugging classic ASP code is possible on Windows XP / IIS 5.1 using Visual Studio 2003 and up. You will need to configure IIS 5.1 to "enable ASP server-side debugging" (disabled by default):</p> <p><img src="http://www.freeimagehosting.net/uploads/f1a6f781b9.png" alt...
Date/Time input for an HTML Form <p>I'm having trouble finding an elegant way to allow for date/time input in an html form. I am thinking of having drop down menus for year, month, day, hour, minute, second, millisecond that are populated with valid entries only. I <em>could</em> do this by hard coding values for each ...
<p>This can be done quite elegantly with a Jquery plug-in called <a href="http://docs.jquery.com/UI/Datepicker">Datepicker</a></p>
Winform keyboard management <p>I would like to control the focus of my winform application. It is made of a custom listbox and several other component. I want all the keyboard event be managed by my window handlers in order to avoid specific control key handling (for example when I press a character and the list box is...
<p>Make sure your form's KeyPreview property is set to true. Then this code should work for canceling your key events to the listbox...</p> <pre><code>private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if (this.ActiveControl == listBox1) e.Handled = true; } </code></pre> <p>The KeyPress ev...
Is there a DocumentAfterPrint event in MS Word? <p>I am working on a project where I need to return a word document back to a certain state after it is printed. I have found a <a href="http://msdn.microsoft.com/en-us/library/aa263710%28office.10%29.aspx" rel="nofollow">DocumentBeforePrint event</a> but I cannot find a ...
<p>Here is <a href="http://www.pcreview.co.uk/forums/showpost.php?s=49465a34a4f26b04a3575bbe8b446daa&amp;p=2562097&amp;postcount=2" rel="nofollow">one workaround</a> based on subroutine names. I do not believe there is a specific <code>DocumentAfterPrint</code> event like you desire. Here's the code:</p> <pre><code>...
maintaining class library assemblies utilized by multiple projects <p>Okay, so here's the scenario.</p> <p>Project A has a class library developed for it (lets call it MyLib). I release project A (in house project) with version 1 of MyLib.</p> <p>I begin development on Project B, but expand MyLib to version 2, inclu...
<p>You can try <a href="http://msdn.microsoft.com/en-us/library/7wd6ex19.aspx" rel="nofollow">assembly redirection</a> and have Project A load the newer version of your library. This would require that you add the redirect information to the configuration of all the machines that the application is run on but you would...
Must every test-case undo their operation at the end? <p>The question may be a little vague but here's an example of what I want to know (pseudocode):</p> <pre><code>//start test-case for CreateObject function { // initialization of parameters MyObject *obj = CreateObject(); // test results } //end test-case for Creat...
<p>In this case, you should deallocate the memory your test case has allocated. That way, you can use a tool that lets you run your tests and confirms that no memory was leaked. Letting your test code leak memory means that this would fail, and you wouldn't be able to tell for certain that the leak was in the test and ...
Composable Regexp in Python <p>Often, I would like to build up complex regexps from simpler ones. The only way I'm currently aware of of doing this is through string operations, e.g.:</p> <pre><code>Year = r'[12]\d{3}' Month = r'Jan|Feb|Mar' Day = r'\d{2}' HourMins = r'\d{2}:\d{2}' Date = r'%s %s, %s, %s' % (Month, D...
<p>You can use Python's formatting syntax for this:</p> <pre><code>types = { "year": r'[12]\d{3}', "month": r'(Jan|Feb|Mar)', "day": r'\d{2}', "hourmins": r'\d{2}:\d{2}', } import re Date = r'%(month)s %(day)s, %(year)s, %(hourmins)s' % types DateR = re.compile(Date) </co...
WPF MVVM: Find out on which header context menu has been clicked <p>I am trying to use the MVVM pattern to write a WPF application. I am using WPF data grid (from the toolkit) which lacks the autofiltering feature. So I want to implement it. I've added a context menu to the column header template, it has MenuItem calle...
<p>Can you pass the Column header value as a Command Parameter and use that to get the Column details at the ViewModel?</p>
How to create an ICalendar Feed that people can subscribe to <p>I need to create a application in vb.net that puts out those cool <code>&lt;&lt;Subscribe to ical&gt;&gt;</code> links, which I can prefill with our events and milestones. While I have figured out I need to use DDay.ical.dll to get the events into a <code>...
<p>You can host the .ics files with any web server such as IIS.</p> <p>For example, if you create a web application at <a href="http://foo">http://foo</a> with virtual directory X:\Foo, and your VB.net app saves a calendar to X:\Foo\iCal\Calendar1.ics, others can consume the iCal feed at <a href="http://foo/iCal/Calen...
WPF application which embed winform controls and winform usercontrols <p>This question might be a little vague but I've created a WPF application and I was wondering if I can embed winform controls and winform user controls. </p>
<p>Yes. Use a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx" rel="nofollow">WindowsFormsHost</a>.</p>
Webservice printing access denied <p>I have a webservice that takes PrintersSetting and a file from a users PC and prints them to the printer on our print server. PrintersSetting settings is being a set by the user In Dev and Testing environment it works fine but in production I am getting an error "Access Denied". ...
<p>The problem wasn't the printing it was a call to a command line utility. the user was not admin on the box so there was insufficient rights to run the utility.</p>
Google Webmaster error: "We've detected that your 404 (file not found) error page returns a status of 200 (Success) in the header." <p>I have an asp.net website (SQL Server, Windows 2003, IIS 6) and I am using google.com/analytics/ to track visits. It all works fine.</p> <p>Now I would like to use Google Webmaster to ...
<p>Set the <code>StatusCode</code> of the <code>Response</code> object manually. Put something like this in your 404 page's code behind:</p> <pre><code>protected override void Render(HtmlTextWriter writer) { base.Render(writer); Response.StatusCode = 404; } </code></pre>
Moving from being a C# "Programmer" to a .net "Developer" <p>I've been coding in C# for a while, A little over a year professionally, but I think I'm ready to learn more about the CLI and the .net framework, learning about things such as assembly versioning, deployment, CIL, and tons of things I'm sure I'm not even awa...
<ul> <li>CLR Via C# by Jefferey Richter</li> <li>Framework Design Guidelines by Brad Abrams et al</li> <li>C# in a Nutshell by the Albahari brothers</li> </ul> <p>The best three books for general .NET stuff. I'd read in reverse order. Hope that helps!</p>
add five minute to filemtime function (php)! <p>i have the flowing code </p> <pre><code>$LastModified = filemtime($somefile) ; </code></pre> <p>i want to add ten minute to last modified time and compare with current time then if $LastModified+ 10 minute is equal to current time delete the file . how can i do that ?! ...
<p>Since the UNIX timestamp is expressed in "seconds since 1970", you just add five minutes in seconds:</p> <pre><code>$LastModPlusFiveMinutes = $lastModified + (60 * 5); </code></pre> <p>Or, maybe more readable:</p> <pre><code>$LastModPlusFiveMinutes = strtotime("+5 minutes", $lastModified); </code></pre>
How do you make eclipse use an existing svn working copy? <p>I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but tha...
<p>i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such. </p> <p>i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its o...
Rearranging UITableView with Core Data <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1077568/how-to-implement-re-ordering-of-coredata-records">How to implement re-ordering of CoreData records?</a> </p> </blockquote> <p>I'm trying to find a code sample that ...
<p>Usually when you see artifacts like that what is going on is the UI has animated to a new position and told you about it, then the updates you have done to your model don't correctly reflect the state which results in glitches the next time the view has to refer to the model for an update.</p> <p>I think you don't ...
Has anyone used Open Office embedded in a .NET Desktop Application? <p>Is there a way to embed OpenOffice inside a .NET Application?</p> <p>Something like the use of the <a href="http://codebetter.com/blogs/paul.laudeman/archive/2006/05/25/Registration_2D00_Free-COM-with-the-DsoFramer-Control.aspx" rel="nofollow">DsoF...
<p>There is an API for doing it, </p> <p><a href="http://www.opendocument4all.com/download/OpenOffice.net.pdf" rel="nofollow">http://www.opendocument4all.com/download/OpenOffice.net.pdf</a></p> <p>The only thing I had to modify is that i couldn't fing the .dll in the directory it says on the PDF, I downloaded the Ope...
Why are some websites spread across www2, www3 sub-domains whilst others manage scaling without it? <p>I know it's to do with having a variety of load balancing servers, but why do some sites make use of differently named "www" sub domains (www2.somesite.com, www3.somesite.com etc) where as other can be perfectly massi...
<p>www[n] is an easy way to add more more servers to cope with load since you can load balance very easily between the various servers - with www[n] you can just redirect the request to the appropriate server and forget about subsequent requests - because the client then deals with www1 or www2 etc... Adding more serv...
DB2 Database Compare Tool <p>Does anyone know of a product similar to Red-Gate's SQL Compare that targets DB2? I am aware of <a href="http://www.dkgas.com/dbdiff.htm" rel="nofollow">DBDiff</a> but need a tool that compares schema and stored procedures.</p> <p><strong>Update:</strong> After some more google searching I...
<p>You can use Embarcadero Change Manager (I guess it is free tool)</p>
Informix query plan <p>How can I get the execution plan for a query in Informix?</p> <p>I need something similar to what I get in Oracle with <code>explain plan</code> or in SQL Server with <code>set showplan_all on</code>.</p> <p>I'm connecting from a .NET application (using IBM.Data.Informix), if that's important.<...
<p>In your SQL, you can either:</p> <ul> <li>execute <code>SET EXPLAIN ON;</code> This will remain in effect until you disconnect or execute the equivalent <code>OFF</code> statement. Works at least as far back as v7, may even work in v5.</li> <li>add an optimiser directive (v9 onwards), ie <code>SELECT {+EXPLAIN} fo...
Class Design: Demeter vs. Connection Lifetimes <p>Okay, so here's a problem I'm running into.</p> <p>I have some classes in my application that have methods that require a database connection. I am torn between two different ways to design the classes, both of which are centered around dependency injection:</p> <ol> ...
<p>Here is a third pattern to consider:</p> <ul> <li>Create a class called ConnectionScope, which provides access to a connection</li> <li>Any class at any time, can create a ConnectionScope</li> <li>ConnectionScope has a property called Connection, which always returns a valid connection</li> <li>Any (and every) Conn...
OpenGL texture combining not (always) working <p>If you've seen my last few questions you'd know by now that I've been working on terrain stuff with OpenGL. I had a failed attempt at using vertex alphas and multiple render passes to blend one texture into another in a tiled heightmap... So now instead, I've got another...
<p>IT WORKS!! After hours of trying stuff, I finally got it.</p> <p>After setting TEXTURE0, I changed this line:</p> <pre><code>gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_DECAL); </code></pre> <p>to this:</p> <pre><code>gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);...
Issue with inheriting custom control <p>I have an user control in our library that I need to inherit and make some update to it. The issue that I'm having right now is that I cannot instantiate the new user control directly. I have to call a method in the library that will create and pass an instance of the user contro...
<p>It's because you aren't instantiating an ExtendedCustomControl, you are instantiating a CustomControl. Activator.CreateObject is just creating the base class. You can't upcast something unless it actually IS of the class you're casting to.</p> <p>Maybe you want CreateCustomControl() to take a System.Type and then...
multiple has_many associations in Rails <p>Let's say you have two models which can be associated in different ways:</p> <p>A User has many conversations they have created. (one to many) A User has many conversations in which they are involved. (many to many)</p> <p>My first thought was to store the id of the user who...
<p>The key is to not use HABTM (where all relationships are considered simple), but to use has_many, through , with an attribute on the join to indicate the particular join that denotes the starter/initiator of the conversation.</p> <pre><code>class User &lt; ActiveRecord::Base has_many :user_conversations has_...
Any Best practice of doing table record insert with SQL CLR store procedure? <p>Recently we turned a set of complicate C# based scheduling logic into SQL CLR stored procedure (running in SQL Server 2005). We believed that our code is a great SQL CLR candidate because:</p> <ul> <li>The logic involves tons of data from...
<p>I ran across <a href="http://sqlite.phxsoftware.com/forums/t/134.aspx" rel="nofollow">this</a> while working on an SQLite project a few months back and found it enlightening. I think it might be what you're looking for.</p> <p>...</p> <blockquote> <p><strong>Fastest universal way to insert data using standard...
(.net) CriticalFinalizerObject - What does it really do? <p>My understanding about this class is that you should use it when you want to be sure that the Finalizer(destructor) or the class is called, but from a couple of tests I did, it doesn't seem to be true. If it does not make sure that the dispose method is called...
<p><a href="http://blogs.msdn.com/cbrumme/archive/2004/02/20/77460.aspx">Chris Brumme has explained this topic in a way I'm not sure could ever be topped. :)</a></p>
taocp, sequential allocation questions <p>i've run into few problems while working tacop 2.2.2 sequential allocations, repacking memory section at page 247. </p> <p>the subject is there are n stacks sharing a common area locations L0 &lt; L &lt; LX, initially we set BASE[j] = TOP[j] = L0 for 1 &lt;= j &lt;= n</p> <p...
<p>To find the stack that isn't yet filled, the basic idea used is the fact:</p> <blockquote> <p>Stack <code>k</code> is not full &lt;==> <code>TOP[k] &lt; BASE[k+1]</code></p> </blockquote> <p>The loop in the first step of the algorithm runs <code>k</code> from <code>i+1</code> to <code>n</code> to find the first ...
Hello need help with on how to do this in SQL Server News from Forum Topics/Messages <p>Okay I have three tables that all communicate with each other.</p> <pre><code>ForumTopic t ForumMessage m ForumUser u </code></pre> <p>What I am trying to do is get the first message of each Topic.</p> <p>I have tried this </p> ...
<p><strike>It is giving multiple records for a message because you are JOINing it with user table &amp; message has multiple users (other than Topic 4,3,1).</strike></p> <p>EDIT: You will have to reduce the output of outer query by limiting to give 1 record (as per max(PostedDateTime).</p>
WPF won't let me put a binding on the path of a binding -- is there another way? <p>I have a <code>DataTemplate</code> that I'm using as the <code>CellTemplate</code> for a <code>GridViewColumn</code>.</p> <p>I want to write something like this for the <code>DataTemplate</code>:</p> <pre><code>&lt;DataTemplate x:...
<p>You cannot assign a Binding to just any property. The property must either of the type <code>Binding</code> or be implemented as a Dependency Property on the object.</p> <p>The <code>Path</code> property of the Binding class is of type <code>PropertyPath</code> and Binding does not implement the Path property as a...
How to automatically update tag file in vim? <p>I use vim C++ tag file for navigation using Ctrl-]. The problem is whenever some file gets modified, the links are no longer valid and I have to re-run ctags and update the tag file. Our code base is huge and it takes quite a while for generating tag file. </p> <p>Is the...
<p>Further to Blixtor's answer, you'll need to think a little carefully about the design of the script. I'd recommend segregating the design such that the autocommand uses the Windows "start" command or similar to run an external script <b>in the background</b>: thereby preventing Vim from being unresponsive while the...
Accessing a inner div value in javascript, with no ids to help <p>I have following structure</p> <pre><code>&lt;div onClick="javascript:Myfunction('value');"&gt; &lt;div title="Mytitle"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Can I access in the javascript Myfunction, the title of the inner div. There are no...
<p>If you do not want to change the html code then you can use this.</p> <pre><code>function MyFunction ( elem ) { var child = jQuery(elem).find("div"); alert ( child.attr("title") ); } &lt;div onclick="MyFunction(this);"&gt; &lt;div title="Mytitle"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Othe...
DBCP connection validation problem <p>I decided to use <a href="http://commons.apache.org/dbcp/" rel="nofollow">DBCP</a> mainly because I was getting timeouts on my database connections. In theory, once you define a "validation query", DBCP will by default run that query on the connection before using it, so you always...
<p>This is not always true. I experienced similar problems, but it turned out to be that DBCP has a default behavior that is not very well documented.</p> <p>You must set the time between eviction runs to purge idle connections. This can be set on a SharedPoolDataSource object by calling setTimeBetweenEvictionRunsMill...
How to hide and password protect an image stored on iPhone? <p>how to hide any image stored in iPhone. And also how to password protect that image using XCODE.</p>
<p>What are you trying to accomplish?</p> <p>As I understand it, if you store an image in your application, only your application can access it. Your application would be the only possible way to access the images, so I wouldn't think that you'd have to do anything complicated to hide it or restrict access. Just ask f...
How do I access a template programmatically? <p>I am using the following code to get the required SPtemplate:<br> <code>SPListTemplate template = RootWeb.ListTemplates["TaskTemplate"];</code></p> <p>However this statement throws the following error:<br> <code>Value does not fall within the expected range.</code></p> ...
<p>By looking at the Name of your template I would say that is your Custom Template. For accessing the custom template you need to use the below code.</p> <pre><code>//This gives you only the built-in template or templates deployed using Features foreach (SPListTemplate item in oWeb.ListTemplates) { Console.WriteL...
How to wait for exit of non-children processes <p>For child processes, the <code>wait()</code> and <code>waitpid()</code> functions can be used to suspends execution of the current process until a child has exited. But this function can not be used for non-child processes. </p> <p>Is there another function, which c...
<p>Nothing equivalent to <code>wait()</code>. The usual practice is to poll using <code>kill(pid, 0)</code> and looking for return value -1 and <code>errno</code> of <code>ESRCH</code> to indicate that the process is gone.</p>
JSON security issues? <p>Are there any security issues in using JSON for just data transfer, other than that it is plain text? Like, the eval() which poses a security issue when used in JavaScript. Are there any such issues, when JSON is just used to transfer data between computers and read by programs written in Java ...
<p><a href="http://www.xml.com/cs/user/view/cs_msg/3370" rel="nofollow">http://www.xml.com/cs/user/view/cs_msg/3370</a></p> <p><strong><a href="http://directwebremoting.org/blog/joe/2007/03/05/json_is_not_as_safe_as_people_think_it_is.html" rel="nofollow">http://directwebremoting.org/blog/joe/2007/03/05/json_is_not_as...
Get the decimal part of a number and the number of places after the decimal point (C#) <p>Does anyone know of an elegant way to get the decimal part of a number only? In particular I am looking to get the exact number of places after the decimal point so that the number can be formatted appropriately. I was wondering i...
<p>It it's only for formatting purposes, just calling <code>ToString</code> will do the trick, I guess?</p> <pre><code>double d = (double)5 / 4; Console.WriteLine(d.ToString()); // prints 1.75 d = (double)7 / 2; Console.WriteLine(d.ToString()); // prints 3.5 d = 7; Console.WriteLine(d.ToString()); // prints 7 </code><...
understanding mysql explain <p>So, I've never understood the explain of MySQL. I understand the gross concepts that you should have at least one entry in the <code>possible_keys</code> column for it to use an index, and that simple queries are better. But what is the difference between ref and eq_ref? What is the best ...
<p>Paul:</p> <blockquote> <p><strong>eq_ref</strong></p> <p>One row is read from this table for each combination of rows from the previous tables. <strong>Other than the system and const types, this is the best possible join type.</strong> It is used when all parts of an index are used by the join and the index...
How do I pass parameters to a subroutine? <p>I have encountered a difficulty in understanding the subroutine syntax.</p> <p>using the following code:</p> <pre><code>sub build_dyne_file{ open(DYNAP, "+&gt;$veri_dir/$dyna_para") or die $!; for (keys %hash){ print DYNAP "#define ",$_," ",$hash{$_}-&gt;[$i],"\n"...
<p>You have to <em>receive</em> the parameter.</p> <pre><code>sub build_dyne_file { my $i = shift; # take it off the parameter queue ... </code></pre> <p>You declared it with a <em><a href="http://perldoc.perl.org/perlsub.html#Private-Variables-via-my%28%29" rel="nofollow">lexical</a></em> scope in the lower...
Check if an element is within a sequence <p>how to check if an element is contained within a sequence? I expected some Seq.contains, but i could not find it. Thanks</p> <p><strong>EDIT</strong>: Or, for an easier task, how to make the diff between two sequences? Like, getting all the elements within a list that doesn ...
<p>Little bit simpler:</p> <pre><code>let contains x = Seq.exists ((=) x) </code></pre>
jQuery Custom Scroll Plugin <p>I want to develop a jQuery plugin that instead of having scrollbars, it instead has scroll "buttons" on the top and button of a container. The container itself is just an unordered list as a menu on the left hand side of the page, but I also need to calculate when it needs to scroll. Th...
<p>Check out <a href="http://flowplayer.org/tools/scrollable.html" rel="nofollow">jQuery TOOLS Scrollable</a></p>
Read file that is used by another process <p>Is there ability to read file that is used by another process?</p> <p>Thanks.</p>
<p>If the process holds an exclusive lock on the file then no. If the process holds a shared lock, you can read it.</p>
JDBC Connection closed by peer (weird) <p>I'm facing sort of a strange issue with two applications of mine. Here's the setting:</p> <p>Two tomcat / java apps, running in the same network, connecting to the same MS-SQL-Server. The one app, which happens to be in an DMZ in order to be accessible from the internet uses t...
<p>What's between your problematic app and the database ? Since it's in a DMZ I suspect you've got a router. If the application keeps a connection open to the database, but that connection is quiet for a period (say, overnight?), then in the absence of traffic, the router <em>may</em> close that connection. I've seen b...
visual studio 2005 designer moves controls and resizes Form <p>When i open a form in visual studio 2005 (c#) the designer automaticaly resize the form and move/resize controls without touching the designer at all. The source file is changed and when i close the designer i'm asked to save the *.cs file. I tried to look ...
<p>I have been working on this problem for most of today and found some interesting things: The main source of the problem seems to be relying on anchoring. If I use docking to position my controls, instead of anchoring, my problems seem to go away. I found a couple of blog posts from 2003(!), which detail how you migh...
reloadData method not called from another class <p>I will directly start from an ex: I have two classes A and B, both are derived from UITableViewController.</p> <p>I have also added them into navigation controller so there is navigation going on from A to B. These both classes use database for showing data into the t...
<p>Have you connected the <code>UITableView</code>'s <code>delegate</code> and <code>dataSource</code> outlets correctly (either in your nib or using code, depending on how you create the table)?</p>
Bind to ICollectionView.Count property in XAML <p>I'm trying to bind a text box to the count of a filtered, collection view in XAML. It doesn't generate any errors but it also doesn't produce any output. Does anyone know how to do this?</p> <p>Here's are some snippets of my XAML:</p> <pre><code>&lt;Window.Resources...
<p>You don't need the "View." in the path. it should just be: </p> <pre><code>Path="Count" </code></pre>
How do you clear changes in LinqToSql? <p>I have a combobox in my WPF app that is databound to my list of objects in my View Model. When the user makes changes to the selected object and then selects another item before saving, I need to clear the changes made.</p> <p>I thought I could use dataContext.GetChangeSet()....
<p>Your best bet is probably to re-query into a separate data-context. You <em>can</em> negate an insert (from the change-set) by using <code>DeleteOnSubmit</code> (and the reverse), but I'd rather not, myself.</p>
How does wordpress.com and other similar services create a subdomain instantly, that is instantly available? <p>i know almost anything about sub-domains and dns records. i have heard about them and i know just the basics.</p> <p>Actually, on my server, i do create the subdomain under plesk and then contact my hosting ...
<p>Most people achieve this by using a <a href="http://en.wikipedia.org/wiki/Wildcard%5FDNS%5Frecord">Wildcard DNS Record</a>, this gives the appearence of creating subdomains instantly.</p> <p><hr /></p> <p>Once you've got a wildcard DNS setup like this:</p> <pre><code> *.example.com A 77.75.105.197 </...
Binding to a member variable <p>I am confused as to what boost::bind does when we bind to member variables. With binding to member function, we essentially create a function object, and then call it passing to it the arguments that are provided or delayed and substituted via placeholders.</p> <p>But what does this exp...
<p>Behind the scenes it is using a member pointer and applying it to the passed in argument. It is quite complex in the context of binds, so here is a simple example of pointer to member usage:</p> <pre><code>int main() { std::pair&lt; int, int &gt; p1 = make_pair( 1, 2 ); std::pair&lt; int, int &gt; p2 = make_p...
How to handle incorrect values in a constructor? <p><strong>Please note that this is asking a question about constructors, not about classes which handle time.</strong></p> <p>Suppose I have a class like this:</p> <pre><code>class Time { protected: unsigned int m_hour; unsigned int m_minute; unsigned int ...
<p>The typical solution is to throw an exception.</p> <p>The logic behind that is the following: the constructor is a method that transforms a chunk of memory into a valid object. Either it succeeds (finishes normally) and you have a valid object or you need some non-ignorable indicator of a problem. Exceptions are th...
Can I still do object oriented programming when using OpenGL ES on iPhone OS? <p>When I program with OpenGL ES on iPhone OS, I have to use a lot of OpenGL functions. This looks very procedural to me. I wonder if I could make a class called "cube", which will draw an cube if called. Or must all the application code be i...
<p>You can structure your code in any way you like. Yes, OpenGL commands are procedural imperative style, but you can built your own abstractions in e.g. object-oriented style on top of them. So you can have a cube object, that has certain properties, and then draw method that uses OpenGL commands to draw a cube with t...
use jquery to animate lines of text <p>I have a paragragh of text.</p> <pre><code>&lt;p&gt; line1 line2 line3 &lt;/p&gt; </code></pre> <p>intially all the text are red when a button is pressed each line's color changes to black gradually (2 sec each line)</p> <p>can this be done with only jquery?</p>
<p>Yes it can be done with jQuery but you will need the Color Animation plugin...</p> <p><a href="http://plugins.jquery.com/project/color" rel="nofollow">http://plugins.jquery.com/project/color</a></p> <p>EDIT: Sorry mate this script should do it for you (you will need the color plugin still)</p> <pre><code>// Renam...
JQuery: Prevent fadeOut when form has focused or when dialogue is moused over <p>The title is a little vague, but I can't explain it in the character limit.</p> <p>I'm creating a little splash screen with dialogues that appear as you hover over certain triggering links. Two of these contain forms (log-in prompt and a ...
<p>I just follow your logic and simplify a bit to something below:</p> <pre><code>$(function() { var hide = false; $(".trigger, .login").hover(function() { if (hide) clearTimeout(hide); $(".login").fadeIn(500); $(".login2").fadeOut(500); }, function() { // Make timeout for this hide = setTimeout(f...
ASP.NET Server.Mappath problem from inner folders <p>I have an ASP.NET application where in my APP_Code folder i have a class.In that i have the following code to read the content of an XML file which is in my root folder</p> <pre><code>XmlDocument xmlSiteConfig = new XmlDocument(); xmlSiteConfig.Load(System.Web.HttpC...
<p>If it's in the root folder, use this:</p> <pre><code>Server.MapPath("~/myConfig.xml") </code></pre> <p>This will work from any directory.</p>
Using XML parser implementation as OSGi service <p>I am developing an application using OSGi (Equinox platform), and one of the bundles needs to parse XML files. So far I implemented this with SAX (javax.xml.parsers.SAXParserFactory) and I would like to retrieve the SAXParserFactory from the platform.</p> <p>I saw the...
<p>Generally it is not a good idea to use JAXP in OSGi (because of the classloading mechanism primarily) and a much better idea to get the factory like a service.</p> <p>If you are using equinox, the SaxParserFactory (using the JRE/JDK one you are running on) is actually provided by the System Bundle, which means you ...
How to prevent external JS to block your site from loading? <p>how do I prevent slow loading external js files from blocking the loading process of the whole website (because the browser processes 2 requests only at a time)?</p> <p>Let's say I want to include the sharethis button but the server is encountering heavy l...
<p>Personally I would load the extra items after the ones that you need.</p> <p>For example add the code to bottom of the page so that jQuery has already loaded and then load them from jQuery like below</p> <pre><code>$(document).ready(function(){ $.getScript("urlofscript"); }); </code></pre> <p>Details of getScr...
Variables not initialized in Fortran 2003 <p>Why the variables are not initializing to zero in fortran 2003 when compared with f90?</p> <p>I have a variable in a function from a file. its initialized to 0. I want to use it another function then it shows a garbage value. even for global variables also. Is there any opt...
<p>You could try using -zero or /Qzero -- these will initialize local scalars to zero -- but you really should be explicitly setting initial values. Depending on the compiler to do it for you is, as you have found out, a good way to introduce bugs. Note that the option names may be different for different compilers. ...
Auto-sizing the height of a TileList <p>Is there a way to have the TileList component to auto-size to its contents? I have tried setting it 100%, but it seems that won't help. I don't want to hard-code the height because the content will be vary, and I don't want scrollbars to show up. Please help.</p>
<p>This is how I ended up solving this issue: First I set the values for rowHeight and maxColumn properties. Then I did a little function that fires on the updateComplete event of the TileList to calculate the height of the tileList by doing a rowHeight * number of rows. That worked.</p>
different css formatting on different <p> tags <p>i am creating a website where i read in html data from other websites. </p> <p>The problem is that the source that i am reading all has <code>&lt;p&gt;</code> tags in it, but i actually want to format them differently</p> <p>is there a way to have some <code>&lt;p&gt;...
<p>Wrap the imported content with something like this:</p> <pre><code>&lt;div class='imported'&gt; &lt;p&gt;Imported content here...&lt;/p&gt; &lt;p&gt;These paragraph tags were imported...&lt;/p&gt; &lt;/div&gt; </code></pre> <p>and style it like this:</p> <pre><code>div.imported p { /* My style for imported &l...
How to Concatenate String in Objective-C (iPhone)? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/510269/how-do-i-concatenate-strings-in-objective-c">How do I concatenate strings in Objective-C?</a> </p> </blockquote> <p>Firstly, the platform is iPhone and l...
<p>Try this:</p> <pre><code>NSMutableString* theString = [NSMutableString string]; for (int i=0; i&lt;=10;i++){ [theString appendString:[NSString stringWithFormat:@"%i ",i]]; } label.text = theString; </code></pre>
How do I speed up deletes from a large database table? <p>Here's the problem I am trying to solve: I have recently completed a data layer re-design that allows me to load-balance my database across multiple shards. In order to keep shards balanced, I need to be able to migrate data from one shard to another, which inv...
<p>Please see: <a href="http://stackoverflow.com/questions/955435/optimizing-delete-on-sql-server">Optimizing Delete on SQL Server</a></p> <p>This MS support article might be of interest: <a href="http://support.microsoft.com/kb/323630">How to resolve blocking problems that are caused by lock escalation in SQL Server<...
Setting FileIOPermissions in ASP.NET incode <p>I have this small app that loads plugin type components that other users can freely upload to the server. But I don't want the users to be able to access other users files. I need to set the access of each plugin component to a restricted access.</p> <p>I tried to set the...
<p>The solution is actually quite simple, as you can implement your own attribute (which allows you to resolve the allowed path programmatically instead of having to use a constant for the decorator attribute).</p> <pre><code>using System.Security; using System.Security.Permissions; public sealed class CustomFileIOPe...
Voice Alteration Algorithm <p>Could somebody point me to a voice alteration algorithm? Preferably in Java or C? Something that I could use to change a stream of recorded vocals into something that sounds like Optimus Prime. (FYI- Optimus Prime is the lead Autobot from transformers with a very distinctive sounding voice...
<p>You can't just change the sample rate. The human voice has formants. What you want to do is move the formants. That should be your line of research.</p> <p>Read about vocoders and filter banks.</p> <p><hr /></p> <p>Could you provide a link as example? I haven't seen the film so I'm just speculating.</p>
Where is Java source code for various com.sun.* packages on Leopard? <p>I am working on my MacBook at home, running Leopard, with the latest JDK 1.6 from Apple installed. In IDE, I'd like to browse source code for com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel, but IDE cannot find it. Another example I'd like to brow...
<p>The Nimbus classes are here in my 1.6 Mac installation:</p> <p>/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Classes/classes.jar</p> <p>and I would jad them if you need the source. I use JadClipse to view jad'ed source inside Eclipse. It's not perfect of course, but serves in a pinch.</p> <p>You can a...
Windows Forms: detect the change of the focused control <p>I'm implementing copy-paste in a Windows Forms application. I need to enable/disable the bar-buttons for this two operations when the user changes the focused element in the application.</p> <p>I can find the current focused control using something like this: ...
<p>In your form load event handler you could also loop through all of the controls contained in the form and for each focusable control add an event handler for the Enter event:</p> <pre><code> private void Form1_Load(object sender, EventArgs e) { foreach (Control control in Controls) { control.Enter += Contro...
creating sub-domains on signup <p>I'm building a site where businesses will be able to sign-up for there own account which should be located at <a href="http://businessname.example.com" rel="nofollow">http://businessname.example.com</a> with the "businessname" changing each time.</p> <p>I want to do this on a windows ...
<p>via <a href="http://forums.asp.net/t/874598.aspx" rel="nofollow">http://forums.asp.net/t/874598.aspx</a></p> <blockquote> <p>If your DNS provider (ie. ISP) have "wildcard" option you could set *.mydomain.com -> myIP</p> <p>Next step. Option #1 Make a script that creates 1 sites for each subdomain in I...
How to use login callback for application client <p>I'm writing a Swing application client (it's runs over webstart, and I'm using glassfish). In the application class I have:</p> <pre><code>@EJB private static MyBean myBean; </code></pre> <p>and in <code>MyBean</code> I have:</p> <pre><code>@Remote public interface...
<p>Well I've solved the second (and most important issue) by Adding the following to <code>application-client.xml</code>:</p> <pre><code>&lt;application-client...&gt; ... &lt;callback-handler&gt;package.name.ClassName&lt;/callback-handler&gt; &lt;/application-client&gt; </code></pre>
Put A String In A ifstream Method <p>I'm learning C++ and i'm getting some troubles when i'm trying to use a <em>String</em> in a <em>ifstream</em> method, like this:</p> <pre><code>string filename; cout &lt;&lt; "Enter the name of the file: "; cin &gt;&gt; filename; ifstream file ( filename ); </code></pre> <p>He...
<p>You should pass <code>char*</code> to <code>ifstream</code> constructor, use <code>c_str()</code> function.</p> <pre><code>// includes !!! #include &lt;fstream> #include &lt;iostream> #include &lt;string> using namespace std; int main() { string filename; cout &lt;&lt; "Enter the name of the file: "; cin...
Hype around graph databases... why? <p>There is some <a href="http://neo4j.org/">hype around graph databases</a>. I'm wondering why. </p> <p>What are the possible problems that one can be confronted with in today's web environment that can be solved using graph databases? And are graph databases suitable for classical...
<p>Many relational representations of graphs aren't particularly efficient for all operations you might want to perform.</p> <p>For example, if one wants the connected set of all nodes where edges satisfy a given predicate, starting from a given node, there's no natural way in SQL to express that. Likely you'll either...