input
stringlengths
51
42.3k
output
stringlengths
18
55k
Looking for "localhost" apache server that allows .htaccess <p>Is there some apache server software out there that can be installed on my Windows PC (for local development purposes) that also allows .htaccess for URL rewriting?</p> <p>I'm currently using Xampp which does not seem to offer this functionality (although ...
<p>You will have to activate mod_rewrite in your apache config. Go to your xampp folder an you will find the httpd.conf file in apache/conf/. Open it an go to the line with:</p> <pre><code>#LoadModule rewrite_module modules/mod_rewrite.so </code></pre> <p>Change it to</p> <pre><code>LoadModule rewrite_module modules...
JComboBox getSelectedItem() not changing <p>I'm binding a <code>JComboBox</code> to an observable <code>List</code>. I clear and add <code>Objects</code> form the observable list. This works fine and reflects the changes in the <code>JComboBox</code> correctly. </p> <p>The problem is I can't select the content of the ...
<p>without a working example it's hard to prove, but you probably need to fire the event listeners to have the UI track your model correctly.</p> <p>see <a href="http://java.sun.com/javase/6/docs/api/javax/swing/AbstractListModel.html#fireContentsChanged%28java.lang.Object,%20int,%20int%29" rel="nofollow">AbstractList...
https to http redirection when ssl is not installed <p>We have a site which was https enabled. After a site revamp we have removed the certificate and https://www.foo.com is not <a href="http://www.foo.com" rel="nofollow">http://www.foo.com</a>.</p> <p>There are many links in other sites, which link to th old https si...
<p>You're pretty much out of luck - you can do URL rewriting as @Josh says, but before the browser even gets that far, most of them will give the user a big warning message telling them the SSL certificate isn't valid, which will put off most of the visitors.</p> <p>I'd recommend buying an SSL certificate - they're no...
Problem passing querystring from from silverlight to http handler <p>I am using Silverlight 3 beta and Visual Studio 2008 SP1 for this.</p> <p>In the web application (Server side) I have a HTTP handlter ImageFetcher.ashx which expects an ID parameter from the query string and retrieves the data from database and write...
<p>I posted on Silverlight forums as well, but I'll copy it here too.</p> <p>A relative URL is relative to the XAP - which is loaded on the client machine. Once the XAP is downloaded to the client, the loading ashx page will no longer be relative to the XAP and will therefore not be found. Once you make the url abs...
autoformat Time in TextBox ASP.Net Javascript <p>I need to format time like 10:00 PM or 12:23 AM in both 12 or 24 hour format using Javascript</p>
<p>10 way to do it </p> <p><a href="http://www.webdevelopersnotes.com/tips/html/formatting_time_using_javascript.php3" rel="nofollow">http://www.webdevelopersnotes.com/tips/html/formatting_time_using_javascript.php3</a></p> <pre><code>&lt;script type="text/javascript"&gt; &lt;!-- var a_p = ""; var d = new Date(); v...
sum arrays <p>I have to sum some arrays(an array of arrays). The structure of my arrays is like this: </p> <pre><code>Array([id]=&gt;some_id, [name]=&gt;some_name, [value]=&gt;float_value) </code></pre> <p>I know that I have N arrays as the one before. I need to sum those with the same id. </p> <p>any idea?</p> <p>...
<p>I'm not completely sure what you are trying to do - I assume you want the sum grouped by the id for each distinct id, but I may be wrong.</p> <pre><code>&lt;?php //result array of sums $sums = array(); //example data $source = array( array('id'=&gt;3, 'name'=&gt;'some_name6', 'value'=&gt;1.6), array('id'=&...
Log4net: Log Context Only for Exception <p>I'm looking for a way to collect a set of data that will only be used for debugging. I.e., the data should only be logged if I log an exception. When I get an exception argument with <code>ILog.Error</code>, <code>Fatal</code> or <code>Debug</code> I want to log the extra info...
<p>Hooking in and changing the pattern doesn't feel quite right. I would suggest looking at the filter stuff. So you would set up your "ForMessagesWithExceptionsOnly" appender which uses the MessagesWithExceptionOnly filter. This appender would ofcourse only process messages that contains an exception.</p> <p>To imple...
What is the easiest way to handle SelectedItem event with MVVM? <p>In the code below, <strong>when user selects Customer</strong> in the combobox, the <strong>customer's name is displayed</strong> in a textbox. I fill the Combox box with an ObservableCollection property on my ViewModel but how do I handle the Selected...
<p>You should be able to bind a property in you ViewModel to the SelectedItem property of the combobox. If you set this up as two way binding you will be notified when the SelectedItem is changed because it will trigger the set method on the property.</p> <p>ViewModel:</p> <pre><code>public ObservableCollection Custo...
What are the technical reasons behind the "Itanium fiasco", if any? <p>In <a href="http://www.pcmag.com/article2/0,2817,2339629,00.asp">this article</a> Jonh Dvorak calls Itanium "<em>one of the great fiascos of the last 50 years</em>". While he describes the over-optimistic market expectations and the dramatic financi...
<p>Itanium failed because VLIW for today's workloads is simply an awful idea.</p> <p>One of the computer science luminaries (I forgot which one, sadly the search engines are failing me) said something along the lines of "EPIC was a wonderful idea until they realized that the compilers needed to make it work cannot be ...
Why does std::string.find(text,std::string:npos) not return npos? <p>I am doing a series of searches in a string, and somewhere along the line one of the strings will be missed, and my set of searches should fail.</p> <p>I had expected that once the position reached std::string::npos it would stay there, but it does n...
<p>Looking at the spec, I think that there may be a bug in your implementation.</p> <p><code>basic_string::find</code> should return the lowest position <code>xpos</code> such that <code>pos &lt;= xpos</code> and <code>xpos + str.size() &lt;= size()</code> and <code>at(xpos + I) == str.at(I)</code> for all elements <c...
Need education regarding HttpApplicationState of ASP.net <p>Today I've got confused with 2 issues related to the HttpApplicationState of ASP.net. My questions are as follows</p> <ol> <li><p>If I use a StateServer for my session management (the out proc session management stuff that I want to use for my web garden depl...
<ol> <li><p>StateServer supports Session state only, Application state is limited to the AppDomain.</p></li> <li><p>The StateServer stores a serialisation of a Session. It has no way to know how access a specific key value. When accessed the session is re-hydrated into the application requiring it and is used as nor...
Price Tracking App: Best Practice <p>I am working on a price tracking application that gathers data from different online stores and remap them to our own product database. We are already gathering prices together with the date they are retrieved.</p> <p>Our first presentation of this data would be retrieving average ...
<p>Martin Fowler has a nice article dealing with <a href="http://martinfowler.com/ap2/timeNarrative.html" rel="nofollow">things that change with time</a>. It might give you some inspiration.</p> <p>From the first sight storage seems pretty obvious: a table with ID, <a href="http://en.wikipedia.org/wiki/GTIN%27" rel="n...
.NET MVC - Default .onError handler for javascript? <p>is it possible to set a default .OnError handler for AjaxOptions in ActionLinks etc. ?</p>
<p>I currently use an edited version of the default MVC javascript file.</p>
ISO-8859-1 to UTF8 in ASP.NET 2 <p>We've got a page which posts data to our ASP.NET app in ISO-8859-1</p> <pre><code>&lt;head&gt; &lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"&gt; &lt;title&gt;`Sample Search Invoker`&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form name="advanced...
<p>You have this line of code:-</p> <pre><code>String sSentSearchText = postedValues[i]; </code></pre> <p>The decoding of octets in the post has happen here. </p> <p>The problem is that META http-equiv doesn't tell the server about the encoding.</p> <p><strike>You could just add RequestEncoding="ISO-8859-1" to the...
Delaying a jquery script until everything else has loaded <p>I have a jquery script which I need to run only once everything else on the page, including some other javascripts (over which I have no control) have finished doing their thing.</p> <p>I though perhaps there was an alternative to $(document).ready but I hav...
<p>You can have <code>$(document).ready()</code> multiple times in a page. The code gets run in the sequence in which it appears. </p> <p>You can use the <code>$(window).load()</code> event for your code since this happens after the page is fully loaded and all the code in the various <code>$(document).ready()</code> ...
How to disable autocomplete for passwords in IE8 via GPO? <p>In IE6 there was a registry key hidden away that would allow you to enable autocomplete but only for usernames, not passwords.</p> <p>This key no longer has any effect in IE8. I can either enable or disable autocomplete for usernames <strong>and</strong> pa...
<p>Seems that this isn't possible anymore ;(</p> <p><a href="http://serverfault.com/questions/27981/how-to-disable-autocomplete-for-passwords-in-ie8-via-gpo/27998">http://serverfault.com/questions/27981/how-to-disable-autocomplete-for-passwords-in-ie8-via-gpo/27998</a></p>
Eclipse: On Save execute a program <p>I have recently come across the <a href="http://lesscss.org/">LESS Leaner CSS</a> a template engine for CSS based on ruby. The idea sounded neat, but in practice we need to compile the program to get CSS. This is cumbersome as we make too many changes while working on CSS and for e...
<p>I think all you need is to define a custom Builder for your project. That way, you can run a program or an ant script whenever certain files change.</p> <p>Right click on the project -> Properties -> Builders -> New</p>
key events with Robot class <p>hi there is a problem during handling Robot.KeyPress(KeyEvent...) is it neccesarry to specify all the keys every time.... e.g Robot.KeyPress(KeyEvent.VK_A); Robot.KeyPress(KeyEvent.VK_B); Robot.KeyPress(KeyEvent.VK_C); if there is any shortkut for not repeating this everytime...pl...
<p>There is no method that accepts simultaneous key presses from a large number of keys since most keyboards have a limit on the maximum number of pressed keys at a given time, and there is rarely a reason to simultaneously press more than three keys at once.</p> <p>If you have a specific sequence of keys you want to ...
Sizing customized button to size of content <p>I've created the following very simple button style:</p> <pre><code>&lt;ControlTemplate x:Key="SimpleButton" TargetType="{x:Type ButtonBase}"&gt; &lt;ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" /&gt; &lt;ControlTemplat...
<p>try</p> <pre><code>&lt;Button Template="{StaticResource SimpleButton}" HorizontalAlignment="Center" VerticalAlignment="Center"&gt; &lt;Image Source="pack://application:,,,/Program;component/Art/icon.png" Stretch="None" /&gt; &lt;/Button&gt; </code></pre>
How to add attributes for C# XML Serialization <p>I am having an issue with serializing and object, I can get it to create all the correct outputs except for where i have an Element that needs a value and an attribute. Here is the required output:</p> <pre><code>&lt;Root&gt; &lt;Method&gt;Retrieve&lt;/Method&gt; &...
<p>Where do you have the <code>type</code> stored?</p> <p>Normally you could have something like:</p> <pre><code>class Document { [XmlAttribute("type")] public string Type { get; set; } [XmlText] public string Name { get; set; } } public class _Filter { [XmlElement("Times")] public _...
How do I call a serverside function from javascript? <p>I have a javascript function from where I am trying to call the serverside function <code>WebSchedule.Client.RadGrid1_SelectedIndexChanged</code>. This is the code:</p> <pre><code>&lt;script type="text/javascript"&gt; function RowSelected(sender, args) ...
<p>Check out so called <a href="http://www.singingeels.com/Articles/Using%5FPage%5FMethods%5Fin%5FASPNET%5FAJAX.aspx" rel="nofollow">page methods</a>.</p> <p>Btw, is this supposed to be server side method or client side?</p> <pre><code>function RowSelected(sender, args) { var dataKeyValue = args.getDataKeyValue(...
How to get RadioButtons to work like ComboBox in MVVM pattern? <p>In the following code, the <strong>user selects a customer from the ComboBox</strong> and that customer's information is displayed in the box. </p> <p>Now I also <strong>want to get RadioButtons to work</strong> with the same functionality. I've got the...
<p>ItemsControl doesn't have a SelectedItem property, you should use a ListBox instead</p> <p>This sample works fine :</p> <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorli...
Bash or Python to go backwards? <p>I have a text file which a lot of random occurrences of the string @STRING_A, and I would be interested in writing a short script which removes only some of them. Particularly one that scans the file and once it finds a line which starts with this string like</p> <pre><code>@STRING_A...
<p>Funny that after all these hours nobody's yet given a solution to the problem as actually phrased (as @John Machin points out in a comment) -- remove just the leading marker (if followed by another such marker 3 lines down), not the whole line containing it. It's not hard, of course -- here's a tiny mod as needed of...
Compile different code on whether a function is available or not <p>Windows provides only GetTickCount up to Windows Vista and starting from that OS also GetTickCount64. How can I make a <strong>C</strong> program compile with calls to different functions?</p> <p>How can I make a <strong>C</strong> compiler check whet...
<p>Compile time selection of an API based on the target Windows version locks the built executable to that version and newer. This is a common technique for open source, *nix targeted projects where it is assumed that the user will configure the source kit for his platform and compile clean to install.</p> <p>On Windo...
Building a set of specific projects in TFS <p>Does anybody know how can I configure TFS Build to build a set of projects in a solution instead? The solution I have, has 16 projects but for one of my build definitions I want some of them to be compiled. </p>
<p>The easiest way in my opinion is to create a new solution file. There is nothing stopping you from having several solutions that reference the same projects (or some subset).</p> <p>The other way is to create a new configuration. In Solution Explorer, rightclick the root node -> Configuration Manager. In additio...
WPF: Read only say TextBox and binding <p>Say I have a grid, I click an object and it displays in a detail screen. I don't want the user to edit some data so I set the TextBox as disabled? Will binding work? Basically what I want is the TextBox to be greyed out or disabled? How about it in WPF? Can someone explain?</p>...
<p>Yes, binding will work with a disabled textbox. For disabling the textbox you have three options:</p> <ul> <li><p>Set the IsReadOnly property to true. This will not affect the appearance of the textbox, but will stop the user changing the value inside it.</p></li> <li><p>Set IsEnabled to false. This will gray out t...
SQL to check if database is empty (no tables) <p>I need to check if a database is totally empty (no tables) using an SQL query. How can this be done?</p> <p>Thanks for the help!</p>
<pre><code>select count(*) from information_schema.tables where table_type = 'BASE TABLE' and table_schema = 'your_database_name_here' </code></pre>
Check User.Identity.IsAuthenticated in ActionFilter right after login <p>I'm basically using the AccountController from the ASP.NET MVC samples. It uses FormsAuthentication to handle the user login. Just to be sure, here is the code to handle user login:</p> <pre><code> public ActionResult LogOn(string userName, st...
<p>I had a similar problem with log out because User.Identity.IsAuthenticated was true until next page request but I needed a way to know if user is really finished work with an application. </p> <p>I think you should set Session or ViewData variable in controller or pass it to another controller via routeValues.</p>...
Asp.net MVC Partial View Form Submit Problem <p>How do i return a partial view inside a master page after submitting a form. Basically what i'm trying to do is display form validation errors, but the problem i can only manage to return a partial view not the master page or full view that its in. Any suggestions?</p>
<p>I'm using MS Mvc with spark + jquery so I'm not sure if it solves your problem but what I think you have to do is return a partial and say which part of page have to be updated (by id of DOM element).</p>
How does the constraints GUI work in SQL Server Management Studio? <p>In my TSQL table I added a constraint with the following sQL statement</p> <pre><code>alter table disabledqualities add constraint uc_uIdQualCode unique (userId, qualitycode) </code></pre> <p>I did it by hand because I just can't work out how the G...
<p>you would use <strong>new index</strong> not new constraint to add a unique constraint (read index) <strong>new constraint</strong> is to add check constraints </p> <p>in the <strong>new index</strong> window check unique</p>
Finite State Machine compiler <p>What is the best Opensource FSM compiler which can generate c++ code ?</p>
<p>I don't know about the <em>best</em>, but you could look at <a href="http://www.complang.org/ragel/">Ragel</a>:</p> <blockquote> <p>Ragel compiles executable finite state machines from regular languages. Ragel targets C, C++, Objective-C, D, Java and Ruby. Ragel state machines can not only recognize byte sequence...
Choosing the correct CI Server for my needs <p>I am in the process of researching/setting up a Continuous Integration Server for a major project and am in the need of either recommendations or criticism.</p> <p><strong>The Need</strong><br> CI is just the next step in our path. It's been mandated at the right time, as...
<p>Have you seen/considered Hudson ?</p> <p><a href="https://hudson.dev.java.net/" rel="nofollow">https://hudson.dev.java.net/</a></p> <p>If you're building your .NET project with NAnt for example, it has a plugin that may allow it to serve your needs.</p> <p>It integrates with most SCM systems, bug trackers, etc. a...
How to inspect a CustomAction's property (Wix)? <p>I am trying to put together a small 'prerequisites' dialog in Wix to give confidence to the users that they have all of the required things needed to run my software:</p> <p>For example, I have a need for Managed DirectX, so I look for some DLLs:</p> <pre><code>&lt;P...
<p>I think I may have found the answer, but I can't try it until I'm next at my development PC.</p> <p>It appears I have to compare the values to TRUE/FALSE (or empty string) not just expecting it to work as boolean (<a href="http://www.tramontana.co.hu/wix/lesson5.php#expression" rel="nofollow">Source</a>)</p> <bloc...
How is Morpha Lemmatizer Used? <p>I'm intending to use SQL version of WordNet and I have a problem finding a way to lemmatize words in order to find them in the DB; I can't use the WordNet lemmatizer itself because it is applied to the textual version of WorldNet.</p> <p>I've read here that there is a good lemmatizer ...
<p>The UW has <a href="http://mvnrepository.com/artifact/edu.washington.cs.knowitall/morpha-stemmer" rel="nofollow">uploaded morpha stemmer to Maven central</a>. There's a wrapper that makes it much easier to use. You just need to add it as a dependency and use the <code>edu.washington.cs.knowitall.morpha.MorphaStemm...
What are the security considerations of using the content-dispositon HTTP header? <p>In response to <a href="http://stackoverflow.com/questions/1012437/uses-of-content-disposition-in-an-http-response-header/1012461#1012461">this</a>, what are the security considerations when using the content-disposition HTTP header?</...
<p>Uh... They're spelled out in <a href="http://www.ietf.org/rfc/rfc2183.txt" rel="nofollow">RFC 2183</a>, linked to from the answer <em>you</em> link to!</p> <blockquote> <ol> <li><p>Security Considerations</p> <p>There are security issues involved any time users exchange data. While these are not to be mi...
Developing in Ruby on Windows <p>I'm starting a new job soon where I'm going to be developing in Ruby and Rails on a Windows machine. I haven't used Windows for years, and the likes of Textmate, Git and Bash, are an integral part of the workflow using a Mac.</p> <p>So, does anybody have any suggestions or recommendati...
<h2>Ruby and Rails</h2> <ul> <li><a href="http://rubyinstaller.org/" rel="nofollow">RubyInstaller for Windows</a></li> <li><a href="http://bitnami.org/stack/rubystack" rel="nofollow">RubyStack installer for Windows</a></li> <li><a href="http://rubyonrails.org/download" rel="nofollow">Rails</a></li> </ul> <h2>Developm...
Remote desktop software to be used within my application <p>Does anybody know a good, free remote desktop solution to be used within another application, namely, the application I'm developing?</p> <p>My application displays a list of computers currently available on the local network. I want the user to be able to se...
<p>Any reason not to use one of the various implementations of <a href="http://en.wikipedia.org/wiki/VNC" rel="nofollow">VNC</a>? There are implementations available under various licenses so you should be able to find one to suit your needs. You could tunnel it over a VPN of some sort if you require more security.</...
Querying a Dictionary with a Lambda Expression <p>I've created some sample code below, and am trying to use a lambda expression to query against the SoftwareComponents Dictionary. The problem is that the query returns a var of type IGrouping, when what I need to do is further refine the query so that it returns a type...
<p>Try this: </p> <pre><code>var components = (from s in software.SoftwareComponents.Values select new { Name = s.ComponentName, Description = s.ComponentDescription }) .ToList().GroupBy(s=&gt;s.Name); </...
Is there a way to map an enumeration to another enumeration in C#.NET 3.5? <p>I'm trying to set up an enumeration that maps certain project-specific values to the standard System.Drawing.Color enum.</p> <p>Here's the idea of what I'd like to do:</p> <pre><code>public enum SessionColors { Highlights = Color.HotPi...
<p>Just do it with public constants:</p> <pre><code>public static class SessionColors { public static readonly Color Highlights = Color.HotPink; public static readonly Color Overlays = Color.LightBlue; public static readonly Color Redaction = Color.Black; } </code></pre>
Find deleted files in Mercurial repository history, quickly? <p>You can use hg grep, but it searches the contents of all files.</p> <p>What if I just want to search the file names of deleted files to recover one?</p> <p>I tried hg grep -I <em>file-name-pattern</em> <em>pattern</em> but this seems to return no results...
<p>using <a href="http://hgbook.red-bean.com/read/customizing-the-output-of-mercurial.html">templates is simple</a>:</p> <pre><code>$ hg log --template "{rev}: {file_dels}\n" </code></pre>
Why DateTime.TryParse returning false when given a real year string? <p>In the code below I am giving the function a sTransactionDate="1999" and I am trying to covert it to a date x/x/1999. </p> <pre><code>DateTime dTransactionDate = new DateTime(); if(DateTime.TryParse(sTransactionDate, out dTransactionDate)) { //Hap...
<p>Try something like this (adjust the <code>CultureInfo</code> and <code>DateTimeStyles</code> appropriately):</p> <pre><code>DateTime.TryParseExact ("1999", "yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out dTransactionDate) </code></pre>
Stealing wheelEvents from a QScrollArea <p>I wanna put my custom widget in a QScrollArea, but in my custom widget, i reimplemented wheelEvent(e) and it never gets called. Im fine with the scroll area not having its mouse wheel scrolling functionality, I just need those wheelEvents to call my handler. I tried handling t...
<p>I figured out that its got something to do with the installEventFilter method of QObject, but I couldn't get the example to work so I said to hell with this and changed my plan completely.</p> <p>problem solved</p>
Communication between Java and Javascript without Netscape or IE? <p>In the lab I work in, we use Mozilla 1.7 for Sun Java™ Desktop System and Firefox 2.0.0.4. My goal is to modify an existing Java application (run via executable jar) to communicate with our web-based login system.</p> <p>I am open to the idea of u...
<p>Look at HTTPURLConnection and <a href="http://www.devx.com/tips/Tip/18188" rel="nofollow">perform POST</a> of the same values login form contains to the same URL. </p>
Emulate Excel Web Query in .net <p>I need to emulate an Excel Web Query in .net Below is the sample code. I get an Error500 when I attempt to do this in .net, however in Excel it works fine. Any ideas on what I am doing wrong? When I change the URI to a normal website it works fine, and returns the html from the page, ...
<p>I found the problem I was having. </p> <p>I used fiddler to figure out the headers that were being sent via excel and compared those with the headers .net was sending <a href="http://www.fiddler2.com/Fiddler2/version.asp" rel="nofollow">http://www.fiddler2.com/Fiddler2/version.asp</a></p> <p>I had to add the follo...
How to determine whether a string has regex metacharacters? (C#) <p>Does the System.Text.RegularExpressions namespace offer me anything to discover whether an input string has ("abc[0-9]" or "^aeiou$") or has not ("abc123") metacharacters? Or do I have to check manually for non-escaped characters in a certain list?</p>...
<p>You have at least three options:</p> <ol> <li><p>Use <a href="http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.escape.aspx" rel="nofollow">Regex.Escape</a> and compare the result:</p> <pre><code>private static bool ContainsMetaCharacters(string s) { if (String.IsNullOrEmpty(s)) ...
Canceling Worker threads in winforms <p>I've got two list boxes, one a master, the other a child. When the index changes on the master, the child listbox gets filled appropriately with records relating to the master. My problem is coming up when one master takes a long time to get all the records and before it has co...
<p>Your method, bg_LoadAllWork, should be defined as:</p> <pre><code>void bg_LoadAllWork(object sender, DoWorkEventArgs e) { // Do your work here... } </code></pre> <p>Inside of bg_LoadAllWork, you need to check for <code>e.CancellationPending</code>, and if it's true, set <code>e.Cancel = true;</code></p> <p>Th...
how to get number of sub files in PHP? <pre><code>[root@file nutch-0.9]# ls resume/ crawldb index indexes linkdb segments </code></pre> <p>like the above example,</p> <p>how to get number of sub files(can be file or directory) in PHP?</p>
<p>use the PHP function readdir or scandir in PHP, get the file list as an array and get a count on the array. you may have to do some tweaking to avoid the current and parent directory ( . and .. )</p> <p><a href="http://us3.php.net/manual/en/function.readdir.php" rel="nofollow">http://us3.php.net/manual/en/function...
How do I know if an object is already referenced? <p>In some VBA attached to an Excel 2003 spreadsheet I need to make use of some objects that take a while to instantiate - so I only want to do the 'set' thing once...</p> <p>It's easier the show the code than to write an explanation!</p> <pre><code>' Declare the expe...
<p>This should work:</p> <pre><code> If myObj IS Nothing Then </code></pre> <p>(note the "IS") If that does not work, then there must be asynchronous intialization implemented specifically by that Class because COM init calls are synchronous by default. So, you need to check the doc for, or talk to the developer...
Dos based printing using C#.net <p>i m using Dotmatrix printer EPSON for printing the reports, and i need the of how to print the reports without using crystalReport and print dialog, i.e. i want the code for DOS based printing in C#.net.........</p>
<p>I know a very old and dirty way. Just open LPT1 (or the printer port you are using) as a stream and output the characters.</p>
software transactions in c# <p>I have some C# code that needs to work like this</p> <pre><code>D d = new D(); foreach(C item in list) { c.value++; d.Add(c); // c.value must be incremented at this point } if(!d.Process()) foreach(C item in list) c.value--; </code></pre> <p>It increments a value o...
<p>Without knowing the full details of your application, I don't think it's possible to give you a concrete solution to the problem. Basically, there is no method that will always work in 100% of the situations you need something like this.</p> <p>But if you're in control of the class <code>D</code> and are aware of t...
How can I change a Windows user's regional settings/date format? <p>I use a VB6/COM+ application which outputs date/time values based on the short date settings in the Control Panel, Regional Settings, for the user that runs it. The program that then parses that output has a configurable setting for the date format it...
<p>This is specifically discouraged by Microsoft. Any solution you may come up with will be a filthy hack that will probably stop working soon.</p> <p>Think of it this way: who are you to decide those settings? Don't you think that's the user's decision?</p> <p>Back on topic: find an unambiguous format for the applic...
Locking on several methods only if a thread is in a certain method <p>I have a class (simplified example) like :</p> <pre><code>public class SomeCollection : ICloneable { public void Add(Item item) { /* ... */ } public void Remove(Item item) { /* ... */ } public Item Get(Key key) { /* ... */ } /* ....
<p>Could you explain more why ReaderWriterLockSlim doesn't fit for your scenario?</p> <p>Sure, you won't use it for it's classic use, but consider the Clone method as your writer and the add/remove methods as your readers and I think it fits.</p> <p>[edit] One other thing: If you go this route, make sure you document...
Discuss an estimate with a programmer <p>What is the least offensive way to confront a programmer about an estimate they've provided?</p> <p>Even considering that some programmers consistently under or over estimate, sometimes an estimate is far off from what you would ever imagine it to be (one of those... <em>you're...
<p>Ask them to break it down. Estimates should usually be a sum of estimates of smaller tasks. Then if tasks are missing or there are tasks that don't need to be done, you can sort it out. </p>
Unit test summary incorrect in Visual Studio for mbunit tests <p>When I run my mbunit tests in Visual Studio test runner (VS 2008) my tests pass but the test summary does not include the passed tests. For a test, I created a test project with a single test and this is the test summary VS returns when I run it:</p> <p>...
<p>You should probably create a user defect report in the <a href="http://code.google.com/p/mb-unit/issues/list" rel="nofollow">Gallio issue tracking tool</a>, or directly ask your question to the <a href="http://groups.google.com/group/gallio-dev?hl=en" rel="nofollow">development group</a>.</p>
sharepoint- creating a new web application <p>i have sharepoint (wss 3.0) installed. I would like to create a new web application but instead of using the default templates (team site, blank site, etc.) i would like to use a custom template. Basically, I want to copy a site that I have created (copy as site template) a...
<p>On the site you want to copy, go to '<strong>Site Actions</strong>' and pick '<strong>Site Settings</strong>'. From there, you can pick '<strong>Save site as template</strong>' under the '<strong>Look and Feel</strong>' section.</p> <p>When you're creating a new site, there should be a new tab on the Templates box ...
Transitioning from one source-control tool to another. Advice please? <p>Recently I was told, I have to migrate our Perforce repository to TrueChange <a href="http://www.mccabe.com/cm.htm" rel="nofollow">(McCabe TrueChange)</a>. I had not heard of TrueChange up until that point. I have used cvs, subversion, vss and per...
<p>I have been using TRUEchange since September 1999 and I think you are fortunate that you have been told you have to migrate from Perforce to TRUEchange.</p> <p>I have worked with a number of open source, home-grown and commercial CM software systems and by far and away, TRUEchange is the best product I have ever us...
How can I tell if an object is statically or dynamically allocated on the constructor? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7434062/detect-dynamically-allocated-object">Detect dynamically allocated object?</a> </p> </blockquote> <p>I have an object...
<p>You should be able to achieve what you want while leaving a single user-accessible default constructor (which will be used for static <em>and auto</em> objects -- you appear to ignore the existence of auto objects, e.g. local variables, so I imagine you want to treat these cases the same).</p> <p>Make <code>operato...
Hibernate findByCriteria strange behaviour <p>I have a simple method that just does two lines and tries to return all objects in an oracle database table:</p> <pre><code>DetachedCriteria criteria = DetachedCriteria.forClass(Object.class); return (Collection)getHibernateTemplate().findByCriteria(criteria); </code></pre...
<p>Yes it was supposed to return all objects.</p> <p>I found out the most un-obvious problem:</p> <p>In the getName method, I did some substring functions and returned a modified string.</p> <p>I guess hibernate immediately tried to update the database with what was returned in getName. (What?! Why?!)</p> <p>Was th...
mfc copy certain sections of a CString <p>Let's say I have a CString variable carrying the string "Bob Evans". I want to copy from position 4 until the end of the original CString to a new CString, but I am having trouble finding semantics examples for this:</p> <pre><code>CString original("Bob Evans"); // Below is wh...
<pre><code>newStr = original.Mid(4); </code></pre>
Python Authentication with urllib2 <p>So I'm trying to download a file from a site called vsearch.cisco.com with python</p> <p>[python]</p> <pre><code>#Connects to the Cisco Server and Downloads files at the URL specified import urllib2 #Define Useful Variables url = 'http://vsearch.cisco.com' username = 'xxxxxxxx...
<p>A "password manager" might help:</p> <pre><code> mgr = urllib2.HTTPPasswordMgrWithDefaultRealm() mgr.add_password(None, url, user, password) urllib2.build_opener(urllib2.HTTPBasicAuthHandler(mgr), urllib2.HTTPDigestAuthHandler(mgr)) </code></pre>
iPhone Accelerometer crashes app <p>I have an navigation-based app that I want to use the accelerometer to detect a shake and cause a scroll view to scroll to the next page. I have added accelerometer code to the view controller of my scrollView, and it works great; a shake calls my page change method. But when I unloa...
<p>Found the answer in another thread:</p> <p><a href="http://stackoverflow.com/questions/740519/how-do-you-release-a-shared-accelerator-instance-on-the-iphone">http://stackoverflow.com/questions/740519/how-do-you-release-a-shared-accelerator-instance-on-the-iphone</a></p> <p>I needed to set the accelerometer's deleg...
Best way to detect whether code is running in an application server java <p>For a J2EE bean I am reusing code that was developed for a java swing application. JOptionPane.showMessageDialog() is unfortunately commonly used. Most occurences luckily in code sections that are not reused by the J2EE application, but in some...
<p>Make sure the server is started with </p> <pre><code>java -Djava.awt.headless=true </code></pre> <p>Most servers should be started that way by default. Then you can check:</p> <pre><code>boolean headless_check = GraphicsEnvironment.isHeadless(); </code></pre> <p>More details on headless available <a href="http:...
C: better way to do sizeof(((SomeStruct *) 0)->some_member)? <p>I want to get the size of a specific member in a struct.</p> <p><code>sizeof(((SomeStruct *) 0)-&gt;some_member)</code> works for me but I feel like there might be a nicer way to do it.</p> <p>I could <code>#define SIZEOF_ELEM(STRUCT, ELEM) sizeof(((STRU...
<p>What you've got is about as clean as it gets if you can't guarantee you have a variable to dereference. (If you can, then use just <code>sizeof(var.member)</code> or <code>sizeof(ptr-&gt;member)</code>, of course, but this won't work in some contexts where a compile-time constant is needed.)</p> <p>Once upon a lon...
Stroustrup swan book Vector Problem <p>I'm using Stroustrup's swan book. I have run into a problem getting output from a vector. I followed the text example from sec. 4.6.3 on page 121. I managed to get the source compiled and am able to execute it. After typing in a list of whitespace separated words, the program hang...
<p>while(cin>>temp) only ends when it hits an end of file. Use control-D to send an end of file into the terminal.</p>
How to read an ASP.NET internal server error description with .NET? <p>Behold the code:</p> <pre><code>using (var client = new WebClient()) { try { var bytesReceived = client.UploadData("http://localhost", bytesToPost); var response = client.Encoding.GetString(bytesReceived); } catch (E...
<p>Web servers often return an error page with more details (either HTML or plain text depending on the server). You can grab this by catching <code>WebException</code> and reading the response stream from its <code>Response</code> property.</p>
Send objects from/to Java using GWT <p>To learn GWT and Google AppEngine (GAE) I'm trying to create a simple application using GWT with two or three objects (entities). In this application one object, let's say <strong>Student</strong>, encapsulates ArrayList of other objects, say <strong>Classes</strong> and <strong>B...
<p>I would suggest the following:</p> <ol> <li>Run through the <a href="http://code.google.com/webtoolkit/tutorials/1.6/gettingstarted.html" rel="nofollow">GWT StockWatcher Tutorial</a>. If you haven't already, this will help you with the basics of GWT.</li> <li>Continue with the <a href="http://code.google.com/webto...
Creating a More Attractive DataGridView <p>My form looks like this with a DataGridView:</p> <p><img src="http://i.stack.imgur.com/bwKLW.jpg" alt="Screenshot"></p> <p>I would like to make it look more professional. Can someone recommend a "makeover" for it? Perhaps there is a more attractive way to display this data.<...
<p>I have been using a free grid control from <a href="http://www.componentfactory.com/toolkit%5Fdatagridview.php" rel="nofollow">Component Factory</a>, it has all the same features as the standard DataGridView. The grid allows customization for pretty much all UI elements.</p>
How can I speed up this histogram class? <p>This is supposed to calculate the histogram of an 8-bit grayscale image. With a 1024x770 test bitmap, CreateTime ends up at around 890ms. How can I make this go (way, way) faster?</p> <p>EDIT: I should mention that this doesn't actually compute the histogram yet, it only g...
<p>The basic histogram algorithm is something like:</p> <pre><code>int[] hist = new hist[256]; //at this point dont forget to initialize your vector with 0s. for(int i = 0; i &lt; height; ++i) { for(int j = 0 ; j &lt; widthl ++j) { hist[ image[i,j] ]++; } } </code></pre> <p>The algorithm sums how ma...
hold-to-copy in uiwebview subclass <p>For my app, I subclassed UIWebView (the method described here <a href="http://ryan-brubaker.blogspot.com/2009/01/iphone-sdk-uiwebview.html" rel="nofollow">http://ryan-brubaker.blogspot.com/2009/01/iphone-sdk-uiwebview.html</a>).</p> <p>I did this so that I could intercept touch ev...
<p>You shouldn't have to do anything special, as long as you're passing all the touch events through. It's certainly possible to disable that functionality using <code>-webkit-user-select: none;</code> in your CSS file.</p>
GNU CC and Windows <p>I'm a bit confused about the options for using GNU CC on Windows.</p> <p>If I want to primarily develop console applications (as opposed to GUI apps) what do I need? Where do Cygwin and MinGW figure? For example, if I use the NetBeans IDE C/C++ option, that requires installation of Cygwin.</p> <...
<p>Both MinGW &amp; Cygwin give you the gcc compiler but if you use MinGW you don't need to install Cygwin because it uses native Windows libraries rather than Cygwin libraries</p> <p>Cygwin is more than just compilers, it tries to provide a UNIX programming environment by building a lot of UNIX libraries on top of Wi...
What is the best web viewable format to save a TIF with a 1 bit depth? <p>I want to convert <code>TIF</code> to an image type that is viewable in a web page.</p> <p>The <code>TIFs</code> are black and white so <code>JPG</code> does not work well at all and ends up even larger after conversion.</p> <p>Here are some te...
<p>PNG is certainly your best choice here.</p> <p>The reason your PNG ends up larger than the original TIF might be that the runtime doesn't do all the compression it possibly could. If you really need to compress every last little byte out of the PNG file, I would suggest using a tool like <a href="http://advancemame...
Where to Keep Event Handler code, in namespace objects or closures? <p>In the last couple of years I've been using JavaScript name spaces espoused by YUI as my default way of formatting JavaScript code.</p> <p>All in all it works well in more complex environments where many web widgets may be stuck together at differe...
<p>This is a very subjective question. That being said, I'll do my best to give what I think are the pros/cons of each approach.</p> <p>Namespace Objects:</p> <pre><code>yourNamespace.events.someClickHandler = function(event) {...} $(function() { $("#someElement").click(yourNamespace.events.someClickHandler); } </...
.class vs .java <p>What's the difference between a .class file and a .java file? I am trying to get my applet to work but currently I can only run it in Eclipse, I can't yet embed in HTML. Thanks</p> <p>**Edit: How to compile with JVM then?</p>
<p>A .class file is a compiled .java file. </p> <p>.java is all text and is human readable.<br> .class is binary (usually).</p> <p>You compile a java file into a class file by going to the command line, navigating to the .java file, and running</p> <pre><code>javac "c:\the\path\to\your\file\yourFileName.java" </cod...
Sharepoint Code Generation Tool <p>our team is looking to use a code generation tool for the current sharepoint application we are working on. We want to be able to generate most of the stored procedures and business entities instead of having to write them from scratch. Any recommendation what is the best code generat...
<p>Code generation is not really necessary for SharePoint, all the code is generated in the SharePoint .NET Libraries.</p> <p>The formulation of your question implies quite serious misunderstandings about SharePoint and it's use of databases.</p>
Java: How do I build standalone distributions of Maven-based projects? <p>I often encounter distributions of Java applications or libraries which use Maven as their build tool.</p> <p>Some of them, sadly, don't provide standalone (or redistributable) jars.</p> <p>Is it possible to build Maven-based applications in su...
<p><strong>Use the Maven Shade plugin</strong></p> <p>...but be careful of the gotchas (similar to the one described further down my answer), which has got <a href="http://stackoverflow.com/questions/5586515/idea-to-avoid-that-spring-handlers-spring-schemas-get-overwritten-when-merging-m">a workaround explained here</...
Autotools library and object file output control <p>My goal is to have all object files built in a .objs directory instead of the root of the Makefile, and to have the binaries (and libraries) copied into the project's <em>bin/</em> directory. But I have been unable to find any resources to explain how to do this. How ...
<p>The GNU Build System does not use <code>obj/</code> directories, so the autotools are not designed to support that.</p> <p>However I can think of two ways to work around this.</p> <p>As an installer, you can build any package out of its source directory by typing</p> <pre><code>mkdir builddir cd builddir ../path-...
No database connectivity from within Windows Service <p>I'm trying to write a service in CBuilder 6 (target XP Pro). Part of this service's job is to monitor and update a table on a database. We use direct ODBC to connect to the database, but the problem is happening with ADO as well, so we'll use that for simpliciti...
<p>If you are using domain authentication, you shouldn't have a user name or password in your connection string:</p> <pre><code>Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True; </code></pre> <p>Or an appropriate variant from <a href="http://www.connectionstrings.com/sql-server-2005" re...
Java: How to launch system's registered application for a URL <p>In Java 5, is there a default way to pass a URL to the system and have it launch the application associated with it? For example http:// links would usually open IE or Firefox, but things like itms:// should open iTunes.</p> <p>If possible I would rather...
<p>Use the <a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop%5Fapi/" rel="nofollow">Java Desktop API</a></p> <pre><code> Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.BROWSE)) { desktop.browse(uri); } </code></pre>
Why extremely occasionally will one of bof/eof be true for a new non-empty recordset <pre><code> set recordsetname = databasename.openrecordset(SQLString) if recordsetname.bof &lt;&gt; true and recordsetname.eof &lt;&gt; true then 'do something end if </code></pre> <p>2 questions :</p> <ol> <li><p>the abo...
<p>The documentation clearly states that, if you open a <code>Recordset</code> that has no records:</p> <ul> <li><code>BOF</code> will be true</li> <li><code>EOF</code> will be true</li> <li><code>RecordCount</code> will be <code>0</code></li> </ul> <p>For a non-empty <code>Recordset</code>, neither <code>BOF</code> ...
URL Bar id=1 Into jQuery ID <p>i want to get the id from the url bar and insert it into the href</p> <p>$("a[href='send_message.php?act=pm&amp;id=$id']").colorbox({width:"500", height:"350", iframe:true});</p>
<p>there's a jquery plugin to make this ridiculously simple:</p> <p>see: <a href="http://plugins.jquery.com/project/query-object" rel="nofollow">http://plugins.jquery.com/project/query-object</a></p> <p>e.g.</p> <pre><code>var id = $.query.get('id'); $("a[href='send_message.php?act=pm&amp;id="+id+"']").colorbox({wid...
How to do a radar animation in the iPhone SDK? <p>Does anyone know how to animate a radar animation like the image below? <img src="http://img197.imageshack.us/img197/7124/circle0.png" alt="alt text" /></p> <p>With it growing outwards? I have to draw the circle using Quartz or some other way?</p>
<p>To draw a static circle in a <code>UIView</code> subclass:</p> <pre><code>- (void)drawRect:(CGRect)rect { CGRect rect = { 0.0f, 0.0f, 100.0f, 100.0f }; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0); CGContextSetLineWidth(context, 2.0f); CGContextA...
Finding text in a table with jQuery <p>I have a table that has rows like this:</p> <pre><code>&lt;tr id="" class="objectRow"&gt; &lt;td class="bulkSelector"&gt;&lt;input id="" type="checkbox" value=""/&gt;&lt;/td&gt; &lt;td class="favorite"&gt;&lt;/td&gt; &lt;td class="name"&gt;&lt;a id="" class="" href=""&gt;Ut...
<p>jQuery's <a href="http://docs.jquery.com/Attributes/text" rel="nofollow"><code>text</code></a> function returns the combined text contents of the element, so you don't have to worry about nodeTypes and such. So you could then just filter all elements whose text contents is blank:</p> <pre><code>$('tr.objectRow', '#...
How is jQuery's data store functionning? <p>I recently asked a question related to jquery's datastore. <a href="http://stackoverflow.com/questions/999535/how-to-get-from-an-element-all-the-data-set-using-the-data-method">http://stackoverflow.com/questions/999535/how-to-get-from-an-element-all-the-data-set-using-the-dat...
<p>partial answer : jQuery's data is to be found using jQuery.cache.</p>
Twitter update_profile_image in C# <p>I am having trouble implementing Twitter's <code>[update profile image]</code> method. Does anyone have any sample code for passing an image as raw multiart data to the Twitter API?</p> <p>I am using .NET.</p>
<p>Have you looked at the following Twitter API Libararies for .NET? </p> <ul> <li><a href="http://code.google.com/p/twitterizer/" rel="nofollow">Twitterizer</a></li> <li><a href="http://devblog.yedda.com/index.php/twitter-c-library/" rel="nofollow">Yedda Twitter C# Library</a></li> <li><a href="http://rareedge.com/tw...
Swing GUI generator for XML <p>My application has an XML configuration file which users now edit in a text editor. I want to provide a (Swing) form for editing this configuration. I have a DTD for the XML, but the application does not accept all XML documents validated by the DTD i.e. the application imposes more restr...
<p>Other than your basic SAX or DOM type libraries, I don't think there is such a solution. It'll probably be a bit difficult to have a one size fits all solution based off of a DTD because the organization of data in XML doesn't necessarily correspond directly with the use or implementation of that data.</p>
Downloading multiple files in iphone app(Objective c) <p>In my iPhone app I want to download multiple files which are on IIS with authentication. On a button click i want to start the downloading process. </p> <p>I know how to download a file with authentication.</p> <pre><code> NSURLRequest* request = ...
<p>I'm not familiar with <code>MultipleDownload</code>, but in case it doesn't meet your needs, the issue I take it is that you have a single object that is the delegate to many <code>NSURLConnections</code>, and you want to know how to keep them straight.</p> <p>The delegate methods all return the <code>NSURLConnecti...
Why are HTML character entities necessary? <p>Why are HTML character entities necessary? What good are they? I don't see the point.</p>
<p>Two main things. </p> <ol> <li>They let you use characters that are not defined in a current charset. E.g., you can legally use ASCII as the charset, and still include arbitrary Unicode characters thorugh entities.</li> <li>They let you quote characters that HTML gives special meaning to, as Simon noted.</li> </o...
How would one represent scheduled events in an RDBMS? <p>I have to store scheduled events, (like say class times, for example) that can be organized on a weekly, daily or monthly basis. Events can occur, say, every Monday and Wednesday, or every second Thursday of the month. Is there a way to store this information in ...
<p>Yes I have solved this problem with my co-worker in the following way:</p> <pre><code>CREATE TABLE [dbo].[Schedule]( [ID] [int] IDENTITY(1,1) NOT NULL, [StartDate] [datetime] NOT NULL, [EndDate] [datetime] NULL ) CREATE TABLE [dbo].[ScheduleInterval]( [ID] [int] IDENTITY(1,1) NOT NULL, [ScheduleID] [int] NOT ...
How can I make deleteRowsAtIndexPaths: work with GenericTableViewController? <p>I'm using Matt Gallagher's <code>GenericTableViewController</code> idea for controlling my <code>UITableViews</code>. My datasource is a <code>NSFetchedResultsController</code>.</p> <p><a href="http://cocoawithlove.com/2008/12/heterogeneou...
<p>Well, bah. I just found <a href="http://stackoverflow.com/questions/998603/how-to-deal-with-non-visible-rows-during-row-deletion-uitableviews"><strong>this</strong></a> answer, which is not the same, but got me headed in the right direction. I'll leave this here for anyone in the future having similar troubles.</p> ...
Mysterious CPU Activity in MS SQL 2005 <p>I am looking at the activity monitor in MS SQL Management Studio 2005, and I see an entry from a login that I created, and it's using the tempdb, and the last command is always "SELECT INTO". And everytime I hit "Refresh" in activity monitor, that entry's "CPU" column goes up b...
<p>This is absolutely normal. The Select Into is selecting data into a temp table to show you what you see in the Activity Monitor. No need to panic. It will not crash your SQL Server.</p> <p>Raj</p>
Still nmake problem with Unicode-Map-0.112 after trying vcvarsall.bat <p>Many thanks to ephemient for recommending to try vcvarsall.bat.</p> <p>In DOS successfully ran vcvarsall.bat, which was part of MS C++ Express 2008 </p> <p>Next I continued to try to follow the PerlMonks advice by using ppm, i.e. <a href="http:/...
<p>The problem with going down this route is that your <code>perl</code> was compiled using a different compiler. You are much better off downloading the package and installing it via <code>ppm</code> as I described in <a href="http://stackoverflow.com/questions/1014637/using-ms-c-express-2008-to-make-perl-unicode-map-...
How to organize my classes? <p>I'm developing a small project in ASP.NET MVC to manage photos, but I don't know how to organize my classes in namespaces.</p> <p>I have 2 base classes (Photo and Category). Should I put these classes into which namespace? Domain? POCO/POJO?</p> <p>For Data Access, I have more 2 classes...
<p>I firmly espouse the simplicity / refactor-as-needed approach.</p> <p>In this approach you just put all your classes into one namespace, and get your code working. At whichever point in the development cycle you begin to feel 'cluttered' think about the classes you have and separate them logically into one or two ...
Where to put GUI based start-up code in a Blackberry App? <p>I'd like to know the proper place to put GUI based sequential start-up code in my Blackberry app.</p> <pre><code>In main(), I create MyApp and enterEventDispatcher() I have UiApplication (MyApp) In the MyApp CTOR: - I create a MainScreen (MyMain) - I call pu...
<p>If it's pretty quick UI stuff (creating a screen, pushing it onto the stack), do it from the main thread before calling enterEventDispatcher. You can actually do as much as you want, just the user experience will be worse if your app takes a long time.</p> <p>The thread that calls enterEventDispatcher basically be...
On blackberry : making a phonecall within an app on user action without J2ME? <p>Is there a way of making a phonecall within an application using Browser application development ? (for example using a link with a protocol similar to 'mailto:user@example.com' but that would make phonecalls instead of sending mails.)</p>...
<p>If this an app hosted in a browser, Blackberry respects WAP conventions for encoding a phone number.</p> <p>Here's an example snipppit for displaying a number that is callable via a Blackberry device:</p> <blockquote> <p>&lt;a href='wtai://wp/mc;5551231367' title='Call'&gt;555.123.1367&lt;/a&gt;</p> </blockquote...
how to fix a memory size for my application in C? <p>I would like to allocate a fixed memory for my application (developed using C). Say my application should not cross 64MB of memory occupation. And also i should avoid to use more CPU usage. How it is possible?</p> <p>Regards Marcel.</p>
<p>Under unix: "ulimit -d 64M"</p>
Dynamically changing gridview based on the value getting entered into a textbox <p>I have a textbox and a gridview. The gridview is populated based on the value entered in the textbox. Suppose I am entering any name in the textbox. As I type the name in the textbox, the results in the grid should change dynamically. Fo...
<p>You need to handle the text changed event of your txtBox. And rebind the datagrid with the data that matches the textbox</p> <pre><code>private void txtBox_TextChanged(object sender, EventArgs e) { string strValue = this.txtBox.Text; DataSet ds = ... // Get the dataset that matches strValue this.dgrid....
Need select query <p>Consider the following table structure with data -</p> <pre><code>AdjusterID | CompanyID | FirstName | LastName | EmailID ============================================================ 1001 | Sterling | Jane | Stewart | janexxx@sterlin.com 1002 | Sterling | David ...
<p>One way:</p> <p>SELECT * FROM Adjusters WHERE AdjusterID IN( SELECT min(AdjusterID) FROM Adjusters GROUP BY CompanyID )</p> <p>There are a handful of other ways involving unions and iteration, but this one is simple enough to get you started.</p> <p>Edit: this assumes you want the adjuster with the lowest ID, as ...
How do I get MySQL query-results using -initWithContentsOfURL? <p>I have a server-side php-script that fetches results from a MySQL table. I am trying to retrieve these results from within an iPhone OS app. I am using the following method:</p> <pre><code>NSURL *myURL = [NSURL URLWithString:@"http://www.someurl.com/log...
<p>In which format is your PHP script returning the MySQL results? It looks as though [NSArray initWithContentsOfURL:] requires the data to be in a very specific 'property list' format. Have you tried to see what output you get if you use NSString instead?:</p> <pre><code>[NSString initWithContentsOfURL:encoding:error...
How to improve the Performance of FtpWebRequest? <p>I have an application written in .NET 3.5 that uses FTP to upload/download files from a server. The app works fine but there are performance issues:</p> <ol> <li><p>It takes a lot of time to make connection to the FTP server. The FTP server is on a different network ...
<p>I have done some experimentation (uploading about 20 files on various sizes) on FtpWebRequest with the following factors</p> <p><strong>KeepAlive</strong> = true/false</p> <pre><code>ftpRequest.KeepAlive = isKeepAlive; </code></pre> <p><strong>Connnection Group Name</strong> = UserDefined or null</p> <pre><code>...
Facebook status update through php <p>I want to develop a bot which will update the status of a facebook account using php.</p> <p>Please guide me on this</p>
<p>@Porkchop is correct, you will probably need the Facebook Connect API. To update a users status on Facebook, you should look at the <a href="http://wiki.developers.facebook.com/index.php/Status.set" rel="nofollow">Status.set</a> API call.</p> <p>For coding a googletalk bot in php there are some articles that shoul...