input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to select only the records with the highest date in LINQ <p>I have a table, 'lasttraces', with the following fields.</p>
<pre><code>Id, AccountId, Version, DownloadNo, Date
</code></pre>
<p>The data looks like this:</p>
<pre><code>28092|15240000|1.0.7.1782|2009040004731|2009-01-20 13:10:22.000
28094|61615000|1.0... | <p>If you just want the last date for each account, you'd use this:</p>
<pre><code>var q = from n in table
group n by n.AccountId into g
select new {AccountId = g.Key, Date = g.Max(t=>t.Date)};
</code></pre>
<p>If you want the whole record:</p>
<pre><code>var q = from n in table
group n by... |
What are good cross-platform Game API? <p>I am in the process of designing/building a cross-platform game engine in C++. I would like to use an game API that has 2D/3D graphics, input, networking, audio, etc. One API I found that meets many of these requirements except for Audio is <a href="http://home.gna.org/amalth... | <p>You could look at <a href="http://www.libsdl.org/" rel="nofollow">SDL</a>, it's a popular cross-platform multimedia library used in many games.</p>
<p>Also the <a href="http://web.archive.org/web/20090301052144/http://gpwiki.org/" rel="nofollow">Game Programming Wiki</a> is a good source for lists of game programmi... |
XmlSerializer and InternalsVisibleTo attribute <p>Is it possible to make <code>XmlSerializer</code> serialize internal class members by using <code>InternalsVisibleTo</code> attribute? </p>
<p>If it is, what assembly should I make my internals visible to. In other words, what assembly name and public key should I prov... | <p>This is a common question, please see this post:</p>
<p><a href="http://stackoverflow.com/questions/420662/can-an-internal-setter-of-a-property-be-serialized">http://stackoverflow.com/questions/420662/can-an-internal-setter-of-a-property-be-serialized</a></p>
<p>The <code>DataContractSerializer</code> will let you... |
How to automatically generate N "distinct" colors? <p>I wrote the two methods below to automatically select N distinct colors. It works by defining a piecewise linear function on the RGB cube. The benefit of this is you can also get a progressive scale if that's what you want, but when N gets large the colors can start... | <p>This questions appears in quite a few SO discussions:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/1168260/algorithm-for-generating-unique-colors">Algorithm For Generating Unique Colors</a></li>
<li><a href="http://stackoverflow.com/questions/773226/generate-unique-colours">Generate unique colours</a></... |
Why do pages get slower as memory usage increases in Internet Explorer <p>I browse to a web page that has a javascript memory leak. If I refresh the page multiple times, it will eventually use up a significant amount of memory, and javascript on the page will slow down. On this particular page, I notice a very signific... | <p>Even without swapping,that's caused by the "stupid" implementation of the Garbage Collector for Javascript in IE. It uses some heuristics that call the GC more often, if there are more objects. </p>
<p>There's not way you can avoid this, other than avoiding memory leaks like hell and also avoid creating too many Ja... |
How do I resolve LNK1104 error with Boost Filesystem Library in MSCV? <p>I am having trouble getting my project to link to the Boost (version 1.37.0) Filesystem lib file in Microsoft Visual C++ 2008 Express Edition. The Filesystem library is <b>not</b> a header-only library. I have been following the <i><a href="http... | <p>Ferruccio's answer contains most of the insight. However, Pukku made me realize my mistake. I am posting my own answer to give a full explanation. As Ferruccio explained, Filesystem relies on two libraries. For me, these are:</p>
<ul>
<li>libboost_system-vc90-mt-gd-1_37.lib</li>
<li>libboost_filesystem-vc90-mt-... |
RewriteRule checking file in rewriten file path exists <p>How can you use ModRewrite to check if a cache file exists, and if it does, rewrite to the cache file and otherwise rewrite to a dynamic file. </p>
<p>For example I have the following folder structure:</p>
<pre>
pages.php
cache/
pages/
1.html
2.html
... | <pre><code>RewriteRule ^pages/([^/\.]+) cache/pages/$1.html [NC,QSA]
# At this point, we would have already re-written pages/4 to cache/pages/4.html
RewriteCond %{REQUEST_FILENAME} !-f
# If the above RewriteCond succeeded, we don't have a cache, so rewrite to
# the pages.php URI, otherwise we fall off the end and go... |
How to validate this scenario in ASP.NET MVC? <p>First, a little bit of context (cause I know you all love it!):</p>
<p>I have a model called <strong>Note</strong>. It has a field called <strong>Type</strong> which, in the database, is an integer value that designates which type of object this note belongs to (1 = Cus... | <p>When setting up your routes, there's a parameter you can use to specify constraints (done via Regex). You could use this to restrict the id there, but you would have to create a separate route for this scenario because you wouldn't want all "id"s to be filtered on that rule.</p>
<p>Alternatively, you could just st... |
Is it possible, and what is the simplest way, to wrap events in jQuery <p><strong>Background</strong></p>
<p>I would like to simulate the "active" behavior that most browsers support for links when they are clicked. For any element and event I would like to be able to add a css class to the element for the duration of... | <p>The problem is there is no general way to determine when an asynchronous call is done. You would need to set some kind of flag after the AJAX call (for example) is done and poll it with setInterval.</p>
<p>With synchronous functions, the browser probably won't update the display until the click handler is done anyw... |
Jython and python modules <p>I've just started using the <code>PythonInterpreter</code> from within my Java classes, and it works great! However, if I try to include python modules (<code>re</code>, <code>HTMLParser</code>, etc.), I'm receiving the following exception (for <code>re</code>):</p>
<pre>
Exception in thre... | <p>You embed jython and you will use some Python-Modules somewere:</p>
<p>if you want to set the path (sys.path) in your Java-Code :</p>
<pre><code>public void init() {
interp = new PythonInterpreter(null, new PySystemState());
PySystemState sys = Py.getSystemState();
sys.path.append(new PySt... |
How do I remove VSS hooks from a VS Web Site? <p>I have a Visual Studio 2008 solution with 7 various projects included with it. 3 of these 'projects' are Web Sites (the kind of project without a project file).</p>
<p>I have stripped all the various Visual Sourcesafe files from all the directories, removed the Scc ref... | <p>It probably is only trying to add it on your instance of VS. You have to remove the cache so VS thinks its no longer under SS</p>
<ol>
<li>under file -> SourceControl -> Workspaces</li>
<li>Select the SS location</li>
<li>Edit</li>
<li>Choose the working folder</li>
<li>Remove!</li>
</ol>
|
How can I reference a popup window from two different pages? <p>I need to allow a user to click a link in "page-1.htm" and open a popup window. Then, when the user browses to "page-2.htm" in the main browser window I need to be able to reference the popup window.</p>
<p><strong>JavaScript in "page-1.htm"</strong></p>... | <p>I just did a quick test even after you leave the opener page, the popup still have 'opener' object and you can access it. So either poll the opener and reset the reference, or add a timer after you leave the page to wait and then relink.</p>
<p>1.htm</p>
<pre><code><script>
var w = window.open("p.htm", "pla... |
Custom Control events not firing <p>I have a custom control with a LinkButton on it. When I click the LinkButton, its click event does not fire.</p>
<pre><code>[ToolboxData("<{0}:View runat=server></{0}:View>")]
public class View : Control
{
private LinkButton lbNextPage;
protected override void C... | <p>It is essentially because the control is created too late in the page life cycle. As per the <a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx" rel="nofollow">MSDN Lifecycle document</a>, you need to create any dynamic controls in PreInit and not in CreateChildControls. If you're developing a custom co... |
git: switch branch without detaching head <p>I have a repository on github with a main branch (master) and a branch for some experimental work. I made some commits and pushed to the experimental branch and everything was fine.</p>
<p>Now, on a different machine, I try to clone my repository (git clone <em>repository<... | <pre class="lang-bash prettyprint-override"><code># first time: make origin/branchname locally available as localname
git checkout -b localname origin/branchname
# othertimes
git checkout localname
git push origin
</code></pre>
<p>For convenience, you may use the same string for localname & branchname<br>
Whe... |
Use reflection to set a property value to Nothing (Null) <p>Edit: Based on the answer from LoveMeSomeCode, I believe this issue only appears in VB.Net.</p>
<p>I'm trying to revert a class to a previous state by saving the old values of changed properties in a dictionary and setting them via reflection when I need to r... | <p>The fact that you are seeing this in the 2nd and 3rd option stack traces</p>
<blockquote>
<p>System.NullReferenceException: Object
reference not set to an instance of an
object. at
myProject.Presenter.CustomerDetailPresenter.set_City(String
value)</p>
</blockquote>
<p>makes me think that there is somethi... |
Hide text using css <p>I have a tag in my html like this:</p>
<pre><code><h1>My Website Title Here</h1>
</code></pre>
<p>Using css I want to replace the text with my actual logo. I've got the logo there no problem via resizing the tag and putting a background image in via css. However, I can't figure out ... | <p>This is one way:</p>
<pre class="lang-css prettyprint-override"><code>h1 {
text-indent: -9999px; /* sends the text off-screen */
background-image: url(/the_img.png); /* shows image */
height: 100px; /* be sure to set height & width */
width: 600px;
whi... |
Customizing an Admin form in Django while also using autodiscover <p>I want to modify a few tiny details of Django's built-in <code>django.contrib.auth</code> module. Specifically, I want a different form that makes username an email field (and email an alternate email address. (I'd rather not modify <code>auth</cod... | <p>None of the above. Just use admin.site.unregister(). Here's how I recently added filtering Users on is_active in the admin (<strong>n.b.</strong> is_active filtering is now on the User model by default in Django core; still works here as an example), all DRY as can be:</p>
<pre><code>from django.contrib import ad... |
Managing Reusable Components <p>I have projects A and B. Both projects use component C (a graphical library for example). I get a issue ticket reporting that A has a bug. I determine that really the bug is in the C component. I create a branch for C, fix it, check back in, retag it, change the dependencies on A and cre... | <p>Configuration management always seems to be more 'hand-wavy' than it should be. In short, it really depends on you local policies.</p>
<p>My suggestion would be to use a Continuous Integration server like Hudson or Bamboo. I know that Hudson allows you to create project dependencies so that the latest build of co... |
Best way to integrate two ASP.NET sites <p>I have two ASP.NET sites that are used for managing patient information. One application allows entry/edit of the patient demographics and the other allows different types of assessments to be completed for each patient. The two sites each have a distinct look and feel and b... | <p>Have you considered exposing the elements you need as web services?</p>
|
Python/Twisted multiuser server - what is more efficient? <p>In Python, if I want my server to scale well CPU-wise, I obviously need to spawn multiple processes. I was wondering which is better (using Twisted):</p>
<p>A) The manager process (the one who holds the actual socket connections) puts received packets into a... | <p>I think that B is problematic. The thread would only run on one CPU, and even if it runs a process, the thread is still running. A may be better.</p>
<p>It is best to try and measure both in terms of time and see which one is faster and which one scales well. However, I'll reiterate that I highly doubt that B will ... |
How do you give a junior developer a shot on a big project with tight deadlines? <p>I'm looking for advice on how to give a junior developer a chance to gain experience on a big project with tight deadlines without hurting the timeline. If we all know it will take a little longer with the developer because of less expe... | <p>You need to know if they grasp the problem you are handing down. When I have to do this here is my approach:</p>
<ul>
<li>Give them a piece I think is a stretch for them but doable.</li>
<li>Explain the importance of the piece, how it fits into the larger picture, and how they will contribute to the project succes... |
Database update after inserting rows into Dataset <p>I am a newbie to Database programming. After inserting a couple of rows into a DataSet object, I am trying to write back the updated DataSet to the Database but cannot figure out how to do it.</p>
<p>Can you give an example for the following please?</p>
<ul>
<li>wh... | <p>What you need to do is configure a DataAdapter or TableAdapter object that contains the proper Update command. Then when you are done updating the rows in your DataSet, you can call DataAdapter.Update(DataSet) and it will do all the hard work for you.</p>
<p>Since you're starting out, I'd suggest looking at the Tab... |
asp.net http server push to client <p>What's the best way to push info from a server to a web client? I know it's possible to setup sockets with Silverlight and Flash but I want to stay way from those two technologies.</p>
<p>Gmail seems to do a great job of polling the servers for updated emails and even their chat p... | <p>Since you mention <code>ASP.NET</code> you should be using <code>SignalR</code>.
See my other answer here: <a href="http://stackoverflow.com/questions/11409563/instant-notifications-like-facebook/11410184#11410184">Instant notifications like Facebook</a></p>
|
How I do to force the browser to not store the html form field data? <p>When typing in html forms, browsers like firefox or ie store the values, sometimes quietly. So when typing in another webforms, the browser smartly suggest the same information. Another method to show the dropdown list is double-clicking an empty t... | <p>Try with the atribute <code>autocomplete="off"</code></p>
<p>It should work for single input elements:</p>
<pre><code><input type="text" autocomplete="off" name="text1" />
</code></pre>
<p>or to the entire form:</p>
<pre><code><form name="form1" id="form1" method="post" autocomplete="off"
action="http... |
Best Practices - set jQuery property from Code-Behind <p>I need to set a single property in a jQuery command using a value that is calculated in the code-behind. My initial thought was to just use <code><%= %></code> to access it like this:</p>
<p>.aspx</p>
<pre><code><script type="text/javascript" language=... | <p>The <% %> works fine. One thing that I do is set a value in a hidden field on the page (then writing the necessary javascript to extract that value), this is nice because I can change that hidden field via javascript and when/if the page posts back I can get that new value from code behind as well.</p>
<p>If you... |
Why NSUserDefaults failed to save NSMutableDictionary in iPhone SDK? <p>I'd like to save an <code>NSMutableDictionary</code> object in <code>NSUserDefaults</code>. The key type in <code>NSMutableDictionary</code> is <code>NSString</code>, the value type is <code>NSArray</code>, which contains a list of object which imp... | <p>I found out one alternative, before save, I encode the root object (<code>NSArray</code> object) using <code>NSKeyedArchiver</code>, which ends with <code>NSData</code>. Then use UserDefaults save the <code>NSData</code>. </p>
<p>When I need the data, I read out the <code>NSData</code>, and use <code>NSKeyedUnarchi... |
mod_rewrite generating errors in log <p>On my site I have mod_rewrite rules to make the URLs more search engine friendly, and it all works fine on the frontend, but I'm getting errors in the error log like this</p>
<pre><code>[Thu Jan 22 22:51:36 2009] [error] [client {IP ADDRESS HERE}] File does not exist: /{some rew... | <p><a href="http://httpd.apache.org/docs/2.2/mod/core.html#options" rel="nofollow"><code>MultiViews</code></a> could cause this. If it is enabled, Apache tries to find a file similar to the requested URI before passing the request along to mod_rewrite. So try to disable it:</p>
<pre><code>Options -MultiViews
</code><... |
examples of both good and bad application user interface design? <p>I'm a blind student who's taking a required UI class. One of the assignments is to take screen shots of both a good and bad application user interface and comment on what's good and bad about it. I'll have a reader help describe the interface to me but... | <p>An interface experience for a Blind person is a relevant aspect of UI design. If I were in your position I wouldn't focus so much on the visual aspect of user interfaces. Go from your personal experience. What is an application that you, as a blind person had a great degree of difficulty using? What applications are... |
ASP.NET MVC and Automatic RESTful Features <p>Does ASP.NET MVC have anything like the RESTful out-of-the-box features like Ruby on Rails 2.0?<br />
For example: <a href="http://www.viget.com/extend/curl-and-your-rails-2-app/" rel="nofollow">cURL and Your Rails 2 App</a></p>
<p>I think this is the built in REST access ... | <p>I think the closest you'll come to this that I know of right now is some of the work Rob Conery is doing like this:</p>
<p><a href="http://blog.wekeroad.com/blog/subsonic-mvc-scaffold-addin/" rel="nofollow">http://blog.wekeroad.com/blog/subsonic-mvc-scaffold-addin/</a></p>
<p>It's not exactly what you're asking fo... |
Java and unix <p>I want to delete the old log files in log directory.
To delete the log files which are more than 6 months,
I have written the script like</p>
<p>find /dnbusr1/ghmil/BDELogs/import -type f -mtime +120 -exec rm -f {} \;</p>
<p>By using this script i can able to delete the old files. But how to invoke t... | <p>If portability is an issue, preventing you from running with Runtime.exec(), this code is quite trivial to write in Java using File and a FilenameFilter.</p>
<p>Edit: Here is a static method to delete a directory tree... you can add in the filtering logic easily enough:</p>
<pre><code>static public int deleteDirec... |
How to read or capture Ctrl+some key or Alt+some key in C? <p>For example I want to do some thing when some combination of <kbd>Ctrl</kbd> key with any other key is pressed (or it may be <kbd>Alt</kbd> key).Then from the standard input how to read that key combination in C program as an input.
<p>I tried with simple <... | <p>The short answer: In a platform specific way.</p>
<p>The long answer: C's Input/Output concept is that of the streams standard output and standard input. The getchar() function that you mentioned above simply reads from the standard input stream. C doesn't have any notion of keyboards, despite keyboards being a com... |
Can anybody provide XMLTextReader Custom Logic to read large XML fast...? <p>I want a help that i need a custom logic to read large XML of size 1GB.</p>
<p>Thanks
sivaram</p>
| <p>the following code snippet might help you:</p>
<pre><code>private void readXML() {
XmlReaderSettings settings = new XmlReaderSettings();
//configure xml reader settings...
using(XmlReader reader = XmlReader.Create("file.xml", settings)){
while (reader.Read()){
//read xml content..
... |
Usage of __slots__? <p>What is the purpose of <a href="https://docs.python.org/3/reference/datamodel.html#slots"><code>__slots__</code></a> in Python â especially with respect to when would I want to use it and when not?</p>
| <p>Quoting <a href="http://code.activestate.com/lists/python-list/531365/">Jacob Hallen</a>:</p>
<blockquote>
<p>The proper use of <code>__slots__</code> is to save space in objects. Instead of having
a dynamic dict that allows adding attributes to objects at anytime,
there is a static structure which does not a... |
Ruby on rails application root <p>How do I change a rails app so that a controller foo appears as the application root? </p>
<p>In other words, right now all the urls look like host.com/foo/... and I'd like to get rid of the foo and have simply host.com/... </p>
| <p>In routes.rb, add:</p>
<pre><code>map.root :controller => 'foo'
</code></pre>
<p>Full details in the <a href="http://api.rubyonrails.org/" rel="nofollow">API</a>.</p>
|
cool project to use a genetic algorithm for? <p>I'm looking for a practical application to use a genetic algorithm for. Some things that have thought of are:</p>
<ul>
<li>Website interface optimization</li>
<li>Vehicle optimization with a physics simulator</li>
<li>Genetic programming</li>
<li>Automatic test case gene... | <p>One topic with lots of possibilities is to use evolutionary algorithms to evolve strategies for game playing. People have used evolution to generate strategies for poker, checkers/draughts, Go and many other games. The <a href="http://jgap.sourceforge.net/">J-GAP</a> people have used genetic programming to evolve ... |
Running a managed application 2nd time shows different performance than 1st <p>I have a benchmarking application to test out the performance of some APIs that I have written. In this benchmarking application, I am basically using the QueryPerformanceCounter and getting the timing by dividing the difference of QPC value... | <p>Running an application brings its executable and other files from the hard drive into the OS's disk cache (in RAM). If it is run again soon afterwards, many of these files are likely to still be in cache. RAM is much faster than disk.</p>
<p>And of course one disk may be faster than another.</p>
|
How to remove the linefeed or newline from a text file or cdr file including the spaces? <p>This is my situation, I was able to remove the spaces using trim or replace. But it does not remove the linefeed or newline at the end of each file. How can I remove the spaces and linefeed in C#?</p>
<p>Thanks in advance.</p>
| <p>You can call Trim method with all characters that you want to be removed like:</p>
<pre><code>line = line.Trim(' ','\r','\n');
</code></pre>
|
How do I set tab size in the WPF RichTextBox <p>The WPF RichTextBox can be set to accept tabs in its input. It renders the result as a 4 character indent. I'd like to change that size. How can I change the default?</p>
| <p>There is currently no support for this, but they are considering it for future release. Frustrating answer - I know!</p>
<p>Source: <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c610a492-cae8-444a-a657-05559da61fe3/" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c610a49... |
Incorrect answer in dll import in Python <p>In my Python script I'm importing a dll written in VB.NET.
I'm calling a function of initialisation in my script. It takes 2 arguments: a path to XML file and a string. It returns an integer - 0 for success, else error. The second argument is passed by reference. So if succes... | <p>Python strings are immutable. There is no way the string can be changed inside the function.</p>
<p>So what you really want is to pass a <em>char buffer</em> of some sort. You can create those in python using the <code>ctypes</code> module. </p>
<p>Please edit the question and paste a minimal snippet of the code s... |
How do I edit contacts from the front end in Joomla 1.5x? <p>I'd have thought this would be a native feature (seeing as joomla allows you to connect contacts with user accounts) but we can't find any way to do this! </p>
<p>Does anyone know of any extensions/modules that would allow this?</p>
<p>I'm not so hot on PHP... | <p>This is an old thread, but since it is still opened maybe you haven't found a solution yet. I faced the same problem myself and I think having the ability to manage contacts from the frontend is an essential feature for Joomla! to become more usable as a simple webapp creation tool.</p>
<p>Anyway, there are a coupl... |
How do I create email with css and images from Rails? <p>How do you create and send emails from Rails application, that contain images and proper formatting? like the ones you get from facebook and like.</p>
| <p>Assuming you know how to send normal plain-text emails from Rails using ActionMailer, to get <code>HTML</code> emails working you need to set a content type for your email.</p>
<p>For example, your notifer might look like this:</p>
<pre><code>class MyMailer < ActionMailer::Base
def signup_notification(recipie... |
SQL 2005: Agent job step output file naming <p>Does anyone know, please, if there's a way to specify "this machine" in a file path that SQL Server will like?</p>
<p>I have an Agent job I want to script onto all my servers. It outputs to a file on the local machine so I want to script the file name as </p>
<pre><code>... | <p>have you tried @@SERVERNAME?</p>
<pre><code>SELECT @@SERVERNAME
</code></pre>
<p>Or you can use this, the second one you can use if you have multiple instances of SQl server running</p>
<pre><code>SELECT serverproperty('MachineName'),serverproperty('Instancename')
</code></pre>
|
Javascript String.replace(/\$/,str) works weirdly in jsp file <p>For simplicity, i have the following file named test.jsp:</p>
<pre><code><script language="javascript">
alert("a$b".replace(/\$/g,"k"));
</script>
</code></pre>
<p>I put this file in my local server, then display it using firefox: <a hr... | <p>JSP 2.0 Spec says: "When EL evaluation is disabled, \$ will not be recognized as a quote, whereas when EL evaluation is enabled, \$ will be recognized as a quote for $." (JSP.3.3.2)</p>
<p>Whether EL Evaluation is enabled or disabled depends on many things:</p>
<ul>
<li>if application server supports JSP 2.0 (Tomc... |
How to pass an array size as a template with template type? <p>My compiler behaves oddly when I try to pass a fixed-size array to a template function. The code looks as follows:</p>
<pre><code>#include <algorithm>
#include <iostream>
#include <iterator>
template <typename TSize, TSize N>
void ... | <p>Hmm, the Standard says in <code>14.8.2.4 / 15</code>:</p>
<blockquote>
<p>If, in the declaration of a function template with a non-type template-parameter, the non-type template-parameter is used in an expression in the function parameter-list and, if the corresponding template-argument is deduced, the template-a... |
Interface to a webservice? <p>I have two webservices that have exactly the same methods and signatures but point at different servers (specifically the Virtual Earth production and staging environments). I wish to switch between using the production and staging services on the basis of a config setting and don't want t... | <p>If I understand you right, you have ONE webservice which is deployed in production and staging environments. In this case the only thing you have to do is to switch between them via the Url property.</p>
|
How to change the Auto Growth size? MS SQL Server 2005 <p>In MS Sql server 2005, by default 1MB Auto Growth is there, How can i change it to whatever i need.?</p>
<p>Thanx,
Ambanna</p>
| <p>In SQL Server Management Studio, right click on the database.<br />
Go to Properties.<br />
Then go to the Files section.<br />
Click on either the data or log autogrowth column (Click the ...)<br />
Then change it to whatever you want it to be. </p>
|
What could possibly cause JQuery's selector to break? <p>I am trying to get an element using JQuery's selector, but it does not find it even though the element actually exists. Moreover, I can actually find the element using getElementById.</p>
<p>For example:</p>
<p>$('#outputDiv') gives me a null value. But documen... | <p>Check that jQuery is actually loaded. Have you tested with Firebug or another debugger? Are javascript errors reported? Do you use another library that uses $ as an alias?</p>
|
Use of GetGuiResources <p>Is it a good idea to use <code>GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS)</code> at the start of <code>WinMain</code>, and before the last return to detect GDI leaks or, more specifically, objects I forgot to release?<br/>Also I'm currently wondering why the first call in my program r... | <p>In most situations, it's enough to use <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" rel="nofollow">process explorer</a>. Keep the window open showing the GDI handles of your process (right-click on the columns, choose "Select Columns" and then check the "GDI Objects" checkbox in the "Proce... |
making a constant heading - css problem <p>I have an AJAX application which has used CSS divs to create panels on the screen, which are loaded separately and in succession, depending on what was loaded before it. The bottom "panel" is a table showing a list or records from a database. At the top of the database is the ... | <p>I assume you mean to be able to scroll the table without moving the header?</p>
<p>I think your easiest option is the CSS <a href="http://www.w3schools.com/Css/pr_pos_overflow.asp" rel="nofollow"><code>overflow</code> property</a>.</p>
<pre><code><style type="text/css">
div#dblist {
overflow: scroll;
... |
Testing for a deadlock with nUnit <p>I'm new to unit testing and nUnit (2.48). I'd like to write a test method where the failure case is that it deadlocks. Is this possible? Obviously nUnit doesn't know by default how long the method should take to execute, so would I have to write code to do the work on a separate thr... | <p>Well its certainly possible to test for a deadlock by running your code on another thread and seeing if it returns in a timely fashion. Here's some (very basic) example code:</p>
<pre><code>[TestFixture]
public class DeadlockTests
{
[Test]
public void TestForDeadlock()
{
Thread thread = new Thre... |
Does IL Merge work with .NET Compact Framework <p>Does anyone have experience using IL Merge and the .NET CF? Does IL Merge work with CF? Are there any known problems?</p>
| <p>Yes, IL merge does support the Compact Framework platform. By default it will attempt to target the desktop CLR. You must pass the path to the Compact framework install to the /targetplatform parameter though. </p>
<p>For Example</p>
<p>ilmerge /t:winexe /targetplatform:v2,"C:\Program Files\Microsoft.NET\SDK\Com... |
Should I avoid Alternative Control Syntax? <p>As a mostly self-taught programmer, I have never really had anyone explain why certain things should or should not be used. One example (which I picked up years ago and use quite often) is the alternative control structure syntax:</p>
<pre><code>x = (y == true) ? "foo" : "... | <p>As a fellow mostly self-taught programmer, I can only give you my opinion, without any special authority behind it.</p>
<p>I find that the ternary conditional operator (?:) is perfectly acceptable when you're using it for an expression with no side-effects. As soon as you start using it to represent a decision to d... |
How to unit test library that relies on Session object <p>I have several asp.net mvc websites consuming the same controller and model.<br />
This common logic is put in seperate libraries.
These libraries use the HttpContext.Current.Session. How can I make these unit testable?
I read about the StateValue but can't comp... | <p>You can use mock helpers such as seen <a href="http://dotnetslackers.com/articles/aspnet/ASPNETMVCFrameworkPart2.aspx" rel="nofollow">here</a></p>
|
In JQuery is there way for slideDown() method to scroll the page down too? <p>The slideDown applied to a div does the slideDown but doesn't scroll the page down and the div slided down div remains hidden from view. Is there a way to scroll the page down as well so the user can view the div?</p>
| <p>Quick demo <a href="http://jsbin.com/agahi">here</a></p>
<p>Basically all you need is</p>
<pre><code> $('html, body').animate({
scrollTop: $('#yourDiv').offset().top
}, 3000);
</code></pre>
|
ASP.Net Membership.DeleteUser <p>In testing, the user on a db i've used was a big jefe. In production, he only has Execute.</p>
<p>When I called,</p>
<pre><code>Membership.DeleteUser(user)
</code></pre>
<p>In testing, it worked.
I try the same in production, and I get this:</p>
<blockquote>
<p>The DELETE stateme... | <p>After a little inspection I found the issue is this line in the aspnet_Users_DeleteUser stored procedure:</p>
<pre><code>IF ((@TablesToDeleteFrom & 1) <> 0 AND
(EXISTS (SELECT name FROM sysobjects WHERE (name = N'vw_aspnet_MembershipUsers') AND (type = 'V'))))
</code></pre>
<p>There are 3 other simil... |
How can I set the focus of a ListBox in XAML? <p>I have this ListBox:</p>
<pre><code><ListBox Name="lbColor">
<ListBoxItem Content="Blue"/>
<ListBoxItem Content="Red"/>
<ListBoxItem Content="Orange"/>
</ListBox>
</code></pre>
<p>This code pre-selects the choice alright, but d... | <p>You can use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.uielement.focus.aspx" rel="nofollow">Focus</a> method:</p>
<pre><code>public Window1()
{
InitializeComponent();
lbColor.SelectedIndex = 1;
lbColor.Focus();
}
</code></pre>
|
Partial Classes, LINQ, Interfaces and VB.NET <p>Okay, I have ran in to a problem with VB.NET. So all those defenders of VB.NET please can you help me out? Here is my issue: I am using LINQ to Entities, it also works with LINQ to SQL, I build my edmx file I then create a Partial Publc Class of the same name as one of th... | <p>A little bit of indirection in the partial class should do the trick...</p>
<pre><code>Public Property AssetId() As Int32 Implements IAsset.AssetId
Get
Return Id1
End Get
Set(ByVal value As Int32)
Id1 = value
End Set
End Property
</code></pre>
<p>The property that implements the int... |
SORTING Hierarchical Queries in SQL Server 2005 <p>I have following issue: I have a table for maintaining the hierarchical data. I'd like to use CTE from SQL 2005.</p>
<pre><code>WITH tree (id, parentid, code, name) AS
(
SELECT id, ofs.ParentID, ofs.code, ofs.name
FROM OrganizationFeatures ofs
WHERE ofs... | <p>To get the concatenated values, you need to do it in the with.</p>
<p>To sort, you need to add an order by in the last select.</p>
<pre><code>WITH tree (id, parentid, code, name) AS
(
SELECT id, ofs.ParentID, ofs.code, ofs.name
FROM OrganizationFeatures ofs
WHERE ofs.ParentID IS NULL
UNION ALL
... |
How to transfer databases and site contents <p>I own a website with 20 GB data on it Now I decided to change the Hosting compnay .
I'm Moving to Russian VPS so is there a way to transfer the contents of my website to the Russian VPS without uploading them again .</p>
<p>Is there a service that does this.
I heard that ... | <p>You can log in to one of your old host using an SSH connection, then connect from there to your new host, again using an SSH connection, and then upload all files from your first server to the second. For databases, do a data dump on your first server, and through the SSH connection, run the data dump against a data... |
Ruby string mutability <p>This may be a bit of a nooby question, I have been trying to get better at ruby recently, and started reading the fantastic <a href="http://oreilly.com/catalog/9780596516178/">The Ruby Programming Language</a>. Something that was mentioned is that string literals are considered mutable, so in ... | <p>Not really sure what exactly your question is, but consider the following code:</p>
<pre><code>10.times { puts "abc".object_id }
</code></pre>
<p>This prints out 10 different id's. Why? Just because you know this string wont change doesn't mean Ruby does. If you think that <code>"abc"</code> should only be created... |
ASP.NET TempData persists between requests <p>I am using temp data as follow in my controllers - very simple, when there is a problem:</p>
<pre><code>TempData("StatusMessage") = "You have no items set to Auto-Ship."
</code></pre>
<p>Then on every page I have a user control as follows:</p>
<pre><code><div class="e... | <p>The <em>sole purpose</em> of TempData is to persist until the next request. Stuff you do not want to persist until the next request should go into ViewData, instead.</p>
<p>Realistically, this means that TempData is only safe to use when redirecting. When not redirecting, the "next request" could be anything.</p>
|
Correct way to use Actions to create menus, toolbars, and other components in Java <p>The naive way of writing building a menu in a Java Swing app is to do something like:</p>
<pre><code>JMenu fileMenu = new JMenu("File");
JMenuItem openItem = new JMenuItem("Open...");
openItem.addActionListener(new ActionListener() {... | <p>Applications that I have developed that need to use that same actions across menus, toolbars, and other buttons have been done using Swing Application Framework.</p>
<p><a href="https://appframework.dev.java.net/" rel="nofollow">Swing Application Framework</a></p>
<p>This framework will allow you to have a resourc... |
Possible to Geo-tag Photos using iPhone ImagePicker? <p>When calling the ImagePicker to take a picture the user is not prompted to allow their location to be used to geo-tag the photo as with the native Camera app. Is it possible to turn on or build geo-tagging into the ImagePicker?</p>
| <p>Well, you could simply get the photo via the ImagePicker, then prompt the user to approve getting their location (something you have to do anyway) and then store both image and location in your own object.</p>
<p>I don't believe the Picker by itself embeds lat/long in the image. That's likely something happening el... |
Export Excel range/sheet to formatted text file <p>I have been tasked with creating a reusable process for our Finance Dept to upload our payroll to the State(WI) for reporting. I need to create something that takes a sheet or range in Excel and creates a specifically formatted text file.</p>
<p><strong><em>THE FORMAT... | <p>Using VBA seems like the way to go to me. This lets you write a macro that takes care of all of the various formatting options and should, hopefully, be simple enough for your finance people to run themselves.</p>
<p>You said you need something that takes a sheet or range in Excel. The first column never changes so... |
How do you create a daemon in Python? <p><a href="http://www.google.co.uk/search?q=python+daemon">Searching on Google</a> reveals x2 code snippets. The first result is to <a href="http://code.activestate.com/recipes/278731/">this code recipe</a> which has a lot of documentation and explanation, along with some useful d... | <p>There are <strong>many fiddly things</strong> to take care of when becoming a <a href="http://www.python.org/dev/peps/pep-3143/#correct-daemon-behaviour">well-behaved daemon process</a>:</p>
<ul>
<li><p>prevent core dumps (many daemons run as root, and core dumps can contain sensitive information)</p></li>
<li><p>b... |
How to Select Cell Based from Macro <p>This should be simple, not sure why I am having trouble with this.....
In a data input range that a user is entering data there is a "left" and a "right" side of the form. Not all the data in any given row has to be filled in. I want to create a macro (and assign it to a hot key I... | <p>In this case column "x" is actually column E:</p>
<pre><code>Sub ToColE()
Const colE = 5
Dim offset As Integer
offset = colE - ActiveCell.Column
ActiveCell.offset(rowOffset:=0, columnOffset:=offset).Activate
End Sub
</code></pre>
|
Why is the destructor ignored in this code? <p>The following code demonstrates a weird problem I have in a Turbo C++ Explorer project. One of the three stack objects in D::D() is not destroyed after going out of scope. </p>
<p>This only happens if compiled in release mode, the auto_ptrs a_ and b_ are of different type... | <p>This appears to be a compiler bug. I just ran the same sample in VS2008SP1 and got the expected output. </p>
|
Tool for diagnosing memory leaks in .NET (ASP.NET Application) <p>we need a tool to detect easily memory leaks in an ASP.NET Application. We have an application, which consumes lot of memory.</p>
<p>Thanks</p>
| <p>Using <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" rel="nofollow">WinDbg</a> is not as easy as using dotTrace but it can help you to discover lots of oddities in your application. Other than that you can find invaluable information about debugging ASP.Net applications on Tess Ferrandez's <... |
Replicating C++'s RAII in C# <p>I'm rolling my own logger class, and want to represent the heirarchy of logs as the app moves through different phases:</p>
<pre><code>log start
loading
loaded 400 values
processing
couldn't process var "x"
</code></pre>
<p>etc.</p>
<p>In C++ (yes I know), I'd... | <p>You can get the behavior you are asking about if you use the <a href="http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx" rel="nofollow">using</a> statement with an IDisposable-class.</p>
<p>Do something like this:</p>
<pre><code>public class LogContext: IDisposable
{
private readonly Logger _logger;
... |
Route files with vbscript from a .net handler back to asp.dll <p>We are migrating from asp classic to .net. Unfortunately they named all of the .asp files as .aspx so that they wouldn't lose page rank when they moved to .net. This means that IIS maps all .aspx files to asp.dll.</p>
<p>After changing the mapping back I... | <p>IMHO you would be better off to use the ATL Server support libraries and make an ISAPI filter.See: <a href="http://msdn.microsoft.com/en-us/library/2chz4bx6" rel="nofollow">http://msdn.microsoft.com/en-us/library/2chz4bx6</a>(VS.80).aspx</p>
<p>Plus you really don't want to hit the aspnet_isapi.dll unless you know ... |
Using Apache proxy to foward traffic to tinyproxy <p>I need to find a way to proxy some traffic on port 80 to tinyproxy running on a separate port. We have a client working behind a very strict firewall with only port 80 open (and cannot get to sites like meebo.com, etc). I was hoping I could create a CNAME to our doma... | <p>I don't think it's going to be possible.</p>
<p>ProxyPass is for opaque proxying of web-servers - not redirecting to a proxy. But it might have worked except that AFAIK VirtualHost can only be identified by the Host: header in the http request - so only works for the real request.</p>
<p>In other words - the clien... |
.NET Library to access the COM Port? <p>Is there a library that would allow me to send and receive data on a Serial COM port?</p>
| <p>See <a href="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx" rel="nofollow"><code>System.IO.Ports</code></a></p>
|
How to force ADO.NET Entity Framework to regenerate code? <p>I've run into a snag with a ADO.NET Entity Framework model and a ADO.NET Data Service that is making it available. The model and data service are compiling without any problems or warnings when they come out of source control. However when I run the service... | <p>Right click on the EDMX file and select Run Custom Tool.</p>
<p>There is also a command line code generation tool called <em>edmgen</em> (available from a VS Command Prompt).</p>
|
Should MVC Controller be in separate DLL? <p>I've created a .NET winforms MVC. The Controller and View are in the same EXE. Model is in a set of DLLs that get used by several groups. The MVC is very explicit. Model knows nothing of Controller and Controller knows nothing of View. I'm thinking to put the Controller... | <p>Separation of controllers and views are an abstract concept. There's no strict rule that you should physically keep them separate (just like tiers in a three-tier application). However there might be some advantages in either approach.</p>
<p>Separating assemblies has the following benefits:</p>
<ul>
<li>Reduces t... |
What's the best way to trim whitespace from a string in Cocoa Touch? <p>I'm looking to determine whether a string value from a user input (UITextField) is "blank" if it's not nil. Checking if <code>[textField.text isEqualToString:""]</code> isn't quite enough because I want to avoid any blank/whitespace input (like sa... | <p>You're using whitespaceAndNewlineCharacterSet, good. But instead of using scanUpToCharactersFromSet, why not use stringByTrimmingCharactersInSet? Something like this...</p>
<pre><code>strResult = [strResult stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
</code></pre>
<p>EDIT:... |
How do I get PropertyChanged events to bubble up? <p>I have a hierarchy of objects (objects A, B), each of which implements <code>INotifyPropertyChanged</code> such that...</p>
<p>A has a member of type B,
B has a member of C, C is of type bool</p>
<p>When C changes, its <code>PropertyChanged</code> event gets fired,... | <p>What you are looking for is a Routed Event see:-</p>
<p><a href="http://www.silverlightshow.net/items/Routed-Events-in-Silverlight.aspx" rel="nofollow">http://www.silverlightshow.net/items/Routed-Events-in-Silverlight.aspx</a></p>
|
In Java, how can I construct a "proxy wrapper" around an object which invokes a method upon changing a property? <p>I'm looking for something similar to the <a href="http://en.wikipedia.org/wiki/Proxy_pattern" rel="nofollow">Proxy pattern</a> or the <a href="http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html... | <p>If with "properties" you mean JavaBean properties, i.e. represented bay a getter and/or a setter method, then you can use a dynamic proxy to intercept the set method.</p>
<p>If you mean instance variables, then no can do - not on the Java level. Perhaps something could be done by <a href="http://java-source.net/ope... |
Should Exception Messages be Globalized <p>I'm working on a project and I'm just starting to do all the work necessary to globalize the application. One thing that comes up quite often is whether to globalize the exception messages, but ensuring that string.Format uses CultureInfo.CurrentCulture instead of CultureInfo.... | <p>Exception messages should rarely be displayed directly to the user. You need to think of the consumer for each string. Obviously pieces of text in the user interface need internationalizing, but if an exception message is <em>only</em> going to be seen by support (or is going to be visible to the user and then email... |
Best Practice for Subversion and Image Uploads <p>Running an ASP.Net website and using TinyMCE for content management. Users need to be able to upload images for content. The images will be shown in website content (news, articles, etc) but won't otherwise be referenced by anything aside from their content.</p>
<p>S... | <p>The content is not a part of the application just the instance you have running so it should be added to your backup not your SVN repository. I only add images to SVN if there are apart of the application it self.</p>
|
What version of CE is Window Mobile 6.5 built on? <p>Windows Mobile 5 was based on CE 5.0.</p>
<p>Windows Mobile 6 was based on CE 5.2.</p>
<p>Does anyone know what version of CE is used by Windows Mobile 6.5?</p>
| <p>This <a href="http://forum.xda-developers.com/showthread.php?p=3204746" rel="nofollow">source</a> indicate that WM6.5 is also based on CE 5.2 (specifically 5.2.21139).</p>
|
Convert Pixels to Inches and vice versa in C# <p>I am looking to convert pixes to inches and vice versa. I understand that I need DPI, but I am not sure how to get this information (e.g. I don't have the <code>Graphics</code> object, so that's not an option).</p>
<p>Is there a way?</p>
| <p>On a video device, any answer to this question is typically not very accurate. The easiest example to use to see why this is the case is a projector. The output resolution is, say, 1024x768, but the DPI varies by how far away the screen is from the projector apeture. WPF, for example, always assumes 96 DPI on a vide... |
boost vs ACE C++ cross platform performance comparison? <p>I am involved in a venture that will port some communications, parsing, data handling functionality from Win32 to Linux and both will be supported. The problem domain is very sensitive to throughput and performance. </p>
<p>I have very little experience with... | <p>Neither library should really have any overhead compared to using native OS threading facilities. You should be looking at which API is cleaner. In my opinion the boost thread API is significantly easier to use.</p>
<p>ACE tends to be more "classic OO", while boost tends to draw from the design of the C++ standard ... |
The best way to clean your plugins out of eclipse 3.2 <p>Since the configuration manager and update manager for eclipse 3.2 is devoid of nice options for REMOVING or DELETING all my plugins it can be cumbersome to deal with needing to get your plugins in order. Just getting your dependencies worked out can be a nightma... | <p>Eclipse 3.2 has "uninstall" feature for plugins under Help->Software updates->Manage configuration.</p>
<p>Eclipse 3.4 has the same functionality under Help->Software updates->Installed software</p>
|
Web frameworks <p>Ruby On Rails, Django or ASP.NET MVC.</p>
<p>Which is better? What are the pro's and con's?</p>
<p>Just curious as to your opinion, please no flames.</p>
| <p><strong>Disclaimer: These are only my opinions not facts</strong></p>
<p>Depends on your Needs.</p>
<p><strong><a href="http://onstartups.com/home/tabid/3339/bid/160/Reasons-Why-Your-Startup-Should-Use-Ruby-On-Rails-RoR.aspx" rel="nofollow">Rails +</a></strong></p>
<ul>
<li>big community </li>
<li>quick to get up... |
Defining an Entity Framework 1:1 association <p>I'm trying to define a 1:1 association between two entities (one maps to a table and the other to a view - using DefinedQuery) in an Entity Framework model.
When trying to define the mapping for this in the designer, it makes me choose the (1) table or view to map the as... | <p>You have to select the table, that cotains the foreign key. The next step is to remove that foreign key from the entity, as it is already expressed using the relation you just created.</p>
<p>Example:</p>
<pre><code>table A
-------
A_ID int
B_ID int
table B
-------
B_ID int
</code></pre>
<p>In this case, you wo... |
Neural Network Structure <p>I am currently building a Neural Network library. I have constructed it as an object graph for simplicity. I am wondering if anyone can quantify the performance benefits of going to an array based approach. What I have now works very good for building networks of close to arbitrary complexi... | <p>People have started using GPGPU techniques in AI, and having your neural net in matrix form could leverage the much faster matrix ops in your typical graphics card.</p>
|
Visual Studio 2005 Search Memory <p>I don't think this exists, but I'll throw this out there anyway. Is it possible, while debugging, to search for a value in memory?</p>
<p>For example, if I have a string "uniqueString" cached somewhere in memory, but I don't know under which variable it's stored--can I do a search ... | <p>windbg will let you do the search directly. 's' is the command you're looking for, here's a very good <a href="http://www.software.rkuster.com/windbg/cmd.htm" rel="nofollow">cheat sheet</a>. sos extension lets you scan for string objects too in managed code though the s command should find them too (must use unicode... |
Halting in non-Turing-complete languages <p>The halting problem cannot be solved for Turing complete languages and it can be solved trivially for some non-TC languages like regexes where it always halts. </p>
<p>I was wondering if there are any languages that has both the ability to halt and not halt but admits an alg... | <p>The <a href="http://en.wikipedia.org/wiki/Halting_problem">halting problem</a> does not act on languages. Rather, it acts on machines
(i.e., programs): it asks whether a given program halts on a given input.</p>
<p>Perhaps you meant to ask whether it can be solved for other models of
computation (like regular expre... |
What are the dimensions, file types, and ppi resolution of an iOS app icon? <p>What are the specifications for the icons required by Apple for a custom iPhone application published?</p>
<blockquote>
<p>57x57, PNG, No Transparency, No Layers, 72 PPI</p>
<p>512x512, TIFF or JPEG, No Transparency, No Layers, 72 PP... | <p>The icon should be a 57x57 pixel PNG. The PNGs generated by Apple have a PPI of 72.01 so I guess something in that range will work fine. Don't have a very high PPI else images are not rendered properly. </p>
<p>If you want to use a custom icon and not let the iPhone to apply the gloss to your icon, add a key to inf... |
Shared Library Discovery <p>I am using C++ on Linux. I want to dynamically bind a collection of unknown shared libraries. I need my code to detect all the public functions exposed by the shared library and the string names of those functions. How do I accomplish this task?</p>
| <p>AFAIK, there is no glibc function to enumerate all the public interface functions for a .so file. You can refer to libelf to read all symbols from a dynamic file. Libelf is here <a href="http://www.mr511.de/software/" rel="nofollow">http://www.mr511.de/software/</a>. After you find a symbol, you can use dlopen and d... |
Writing to an iframe from NSTextView <p>I have built a web based WYSIWYG editor, which Im accessing programatically from my cocoa application. At the moment I'm able to run scripts and retrieve the HTML from the iFrame in the editor, but I'm unable to send text from an NSTextView to the iFrame. Any ideas?</p>
<p>The e... | <p>I'm not an expert in this area but I have written sample code in the past that did something similar to this. The approach I took was the following: in your Cocoa class where you want to update the text insert code similar to</p>
<pre><code>WebScriptObject *webScriptObject = [_webView windowScriptObject];
id resul... |
Operator overload <pre><code>class test {
public:
test &operator=(const test & other){} // 1
const test & operator+(const test& other) const {} // 2
const test & operator+(int m) {} //3
private:
int n;
};
int main()
{
test t1 , t2, t3;
// this works fine t1 = t2.operator+(t3) , ca... | <p>Because object returned by t2+t3 is const, and you cannot call its non-const function (3).</p>
<p>It works fine in case of "t1 = t2 + 100 +t3;", because object returned by t2+100 is const too, but you are calling its const function (2), which is ok.</p>
|
Changing the browser preference from JavaScript <p>I'm having a problem with cookies. If the browser has cookies disabled, the cookie gets rejected. Is there a way to enable cookies on the client's browser that is compatible with Internet Explorer, Firefox, Opera and Chrome?</p>
| <p>If a user has chosen to disable cookies, who are you to override that choice?<br />
The best thing to do is notify the user that they need to enable cookies for your script/site to work and provide a link to some instructions on how to do so.<br />
Or find a different way to achieve what you are trying to do</p>
|
Converting UTF-8 to WIN1252 using C++Builder 5 <p>I have to import some UTF-8 encoded text-file into my C++Builder 5 program.
Are there any components or code samples to accomplish that?</p>
| <p>You are best off reading all the other questions on SO that are tagged unicode and c++. For starters you should probably look at <a href="http://stackoverflow.com/questions/433301/portable-and-simple-unicode-string-library-for-c-c">this one</a> and see whether library in the accepted answer (<a href="http://utfcpp.s... |
directx mouse click simulation <p>How can I simulate the mouse click in a directx application?
mouse_event and PostMessage with WM_LBUTTONDOWN don't work...</p>
<p>so it must be something to do with the DirectInput</p>
<p>I haven't found out nothing useful with google, so you may be knowing the answer...</p>
<p>than... | <p>Try <a href="http://www.autoitscript.com/" rel="nofollow">AutoIt</a> it is perfect for sending a click to a particular control. The </p>
<pre><code>ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )
</code></pre>
<p>command can do exactly what you want. The directx control will detect t... |
ACL for a network device <p>I need to implement ACL based authentication mechanism for a device. This device can be accessed through various interfaces like web pages, TL1 (basically through some command prompt) etc.</p>
<p>I need to keep ACL logic centralized so that request from any interface can be authenticated. <... | <p>Your question is misleading. What you ask, has in most cases nothing to do with the ACLs of the filesystem objects in linux.</p>
<p>I'm assuming your cgi is a single file, written in c++.</p>
<p>You will have to use some local data storage solution. In your place I used sqlite, or some other sql-based solution.</p... |
Mercurial: multiline commit message on the command line? <p>How can I specify a multiline commit message for mercurial on the command line?</p>
<pre><code>hg commit -m "* add foo\n* fix bar"
</code></pre>
<p>does not work. The log shows:</p>
<pre><code>changeset: 13:f2c6526e5911
tag: tip
date: Fri ... | <blockquote>
<p>Mercurial: multiline commit message on
the command line?</p>
</blockquote>
<p>Hit enter.</p>
<pre><code>$ hg commit -m "Did some work
> Now I'm done"
</code></pre>
<p>One of the things is that only the first line shows up in hg log:</p>
<pre><code>$ hg log
changeset: 0:d2dc019450a2
tag: ... |
Php By Reference <p>Can someone please explain what the "&" does in the following:</p>
<pre><code>class TEST {
}
$abc =& new TEST();
</code></pre>
<p>I know it is by reference. But can someone illustrate why and when I would need such a thing? Or point me to a url where this is explained well. I am unable t... | <p>As I understand it, you're not asking about PHP references in general, but about the <code>$foo =& new Bar();</code> construction idiom.</p>
<p>This is only seen in PHP4 as the usual <code>$foo = new Bar()</code> stores a <em>copy</em> of the object. This generally goes unnoticed unless the class stored a refer... |
WPF databinding: database or objects? <p>I'm trying to create this:</p>
<p>Tag1 has the ordered list of objects: O1, O3, O2.
Tag2 has the ordered list of objects: O1, O4.</p>
<p>Every time I click a tag, I want to see the list of objects. So clicking Tag1 would show in a listbox:</p>
<ul>
<li>O1</li>
<li>O3</li>
<li... | <p>One option would be to create an object that contains a dataset (System.Data namespace). Inside the dataset it would have 3 tables that would be linked using defined foreign keys the same as if it was in a database. These can later be stored to XML if need be.</p>
<p>Your object would then have to expose a dataview... |
What do you suggest on how to stop hit counter for the same IP in asp.NET website? <p>As you can see on the question, what is your advice about stoping hit counter for the same ip in ASP.NET web site ?</p>
<p>Im my real estate project i increase the view count of a property when it is viewed. But i just want to increa... | <p>If it's a website you can be a little more accurate counting unique visitors by dropping a cookie containing the date & time. Check the cookie, if it exists and the date is today don't add one to the counter.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.