input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Rails Routes and Different XML Templates <p>My application needs to provide the same data in XML to 2 different providers that have specific formatting requests.</p>
<p>What's the best way to setup my routes so that I can have the following:</p>
<pre><code>http://www.site.com/posts/provider1.xml
http://www.site.com/p... | <p>In your routes.rb file, try</p>
<pre><code>map.xml_posts 'posts/:provider.xml', :controller => 'posts', :action => 'xml_data'
</code></pre>
<p>You can then access <code>params[:provider]</code> in your controller's xml_data method to decide on the formatting.</p>
|
Very large uploads with PHP <p>I want to allow uploads of very large files into our PHP application (hundred of megs - 8 gigs). There are a couple of problems with this however.</p>
<p>Browser:</p>
<ul>
<li>HTML uploads have crappy feedback, we need to either poll for progress (which is a bit silly) or show no feedba... | <p>upload_max_filesize can be set <a href="http://us2.php.net/manual/en/ini.core.php#ini.sect.file-uploads">on a per-directory basis</a>; the same goes for post_max_size</p>
<p>e.g.:</p>
<pre><code><Directory /uploadpath/>
php_value upload_max_filesize 10G
php_value post_max_size 10G
</IfModule>
</cod... |
Can I use JAVAC to compile a project with multiple files and directories? <p>I'm working on a very large project that has associated class files in multiple directories, all stemming from the root dir \src.</p>
<p>I'm trying to compile a file in src\solution\ (called Console.java) that uses imports from other director... | <p>I would look at using <a href="http://ant.apache.org/">Ant</a> to create a build script. It's a little bit of work now but it'll pay off over the lifetime of your project.</p>
|
How Long Does it Take to Learn Java for a Complete Newbie? <p>I have absolutely no programming experience but need to learn Java - enough to take a J2ME fasttrack course. I only have 10 weeks. Can I do this? What's your advice about the best resources I can use ?(currently using Sun's Java Tutorials). </p>
| <p>10 weeks? Apparently you can do it in 24 hours!</p>
<p><a href="http://rads.stackoverflow.com/amzn/click/0672328445">http://www.amazon.com/Sams-Teach-Yourself-Programming-Hours/dp/0672328445</a></p>
<p>EDIT:</p>
<p>Okay, so only 1 person found my answer amusing, but not amusing enough to upvote. The real questio... |
How do I debug properly using Eclipse and Pydev? <p>I have got Pydev configured properly so it runs my app, however when I want to inspect/trace my code by setting up breakpoints the debugger does not kick in (can't trace). Does anyone got any idea what's going on here?</p>
| <p><code>--noreload</code> option is crucial, otherwise server will fork and your breakpoint won't trigger.</p>
|
Spring frame work Wraps Checked Exceptions inside RuntimeExceptions <p>have this method call
->
simpleJdbcTemplate.queryForInt(sql,null);
->
queryForInt() method in the springs SimpleJdbcTemplate throws a DataAccessException which is a runtime exception. i want to propegate exceptions to the view tier of the... | <p>Just because Spring throws a runtime exception doesn't mean you cannot catch it. If you want to do something special for DataAccessExceptions, you can certainly do that:</p>
<pre><code>try {
// query logic
} catch (DataAccessException ex) {
// handle the exception
}
</code></pre>
<p>If you're using Spring... |
Access denied Tortoise SVN 64 bits <p>I was using tortoise svn 32 bits in XP without problems. </p>
<p>Now, I installed Windows Vista 64 bits and Tortoise SVN 64 bits. </p>
<p>When I try to do an <code>SVN Update</code>, I got the error</p>
<blockquote>
<p>Can´t open file C:....svn\lock: Access denied. </p>
</blo... | <p>Since you reinstalled your Windows, maybe the Access-Rights are configured wrong, so that an unknown SID is the owner or has read/write permission.</p>
<p>Maybe check your the file permissions of your local SVN files and make sure that your current user / your Tortoise process has the access rights to change these ... |
Does WCF FaultException<T> support interop with a Java web service Fault <p>I have written a java axis2 1.4.1 web service and .net 3.5 WCF client and I am trying to catch the wsdl faults thrown. </p>
<p>Unlike .net 2.0 the .net 3.5 claims to support <code>wsdl:fault</code> and the service reference wizard does generat... | <p>WCF should work with axis2 exceptions. I had it working, but I don't remember all the details.</p>
<p>When you use SOAP monitor or something like that, what do you see in the fault message body?</p>
|
How do you select latest entry per column1 and per column2? <p>I'm fairly new to mysql and need a query I just can't figure out. Given a table like so:</p>
<pre><code>emp cat date amt cum
44 e1 2009-01-01 1 1
44 e2 2009-01-02 2 2
44 e1 2009-01-03 3 4
44 e1 2009-01-07 5 9... | <p>This <em>should</em> work, but I haven't tested it.</p>
<pre><code>SELECT orders.* FROM orders
INNER JOIN (
SELECT emp, cat, MAX(date) date
FROM orders
GROUP BY emp, cat
) criteria USING (emp, cat, date)
</code></pre>
<p>Basically, this uses a subquery to get the latest entry for each emp and cat, then... |
Conditional compile when running in Simulator as opposed to on a device <p>Is there a compiler directive I can use to compile a different line of code when targetting the simulator as opposed to my device. Something like:</p>
<pre><code># IF SIMULATOR
[self.imagePicker setSourceType:UIImagePickerControllerSourceTypePh... | <pre><code>#if TARGET_IPHONE_SIMULATOR
[self.imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
#else
[self.imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
#endif
</code></pre>
|
Collision-Detection methods in C++ <p>I am new to c++ and I have been practicing collision in a small game program that does nothing and I just can't get the collision right</p>
<p>So I use images loaded into variables</p>
<pre><code>background = oslLoadImageFile("background.png", OSL_IN_RAM, OSL_PF_5551);
sprite = o... | <p>I'd suggest making a function solely for the purpose of bounding box colision detection.
It could look like </p>
<pre><code>IsColiding(oslImage item1, oslImage item2)
{
/* Perform check */
}
</code></pre>
<p>in which you perform the check if there is a collision between image 1 and image 2.
As for the algori... |
Silverlight: Determine whether DataContext is inherited or not <p>At runtime in a generic fashion (i.e. iterating UIElements) can I determine if a given FrameWorkElement has a non-inherited DataContext property set? I want a list of elements where DataContext was explicitly set, not inherited from higher up in the cha... | <p>Definitely! Just compare the FrameworkElement Parent's DataContext using an equality operator.</p>
<p>It might not help in a situation where a child control has the DataContext set to the same exact item as the parent, but it would help in most scenarios.</p>
|
Monitoring a sub-process / can I get TotalProcessorTime for a Process group? <p>Is there a way to get the <strong>Process.TotalProcessorTime</strong> that reflects a process <em>PLUS</em> any processes that it has spawned?</p>
<p>Alternatively, how can I verify that the process (or it's descendants) are still "activel... | <p>You can use a performance counter to retrieve the parent process like this:</p>
<pre><code>PerformanceCounter pc = new PerformanceCounter("Process",
"Creating Process Id", " windbg");
Process p = Process.GetProcessById((int)pc.RawValue);
</code></pre>
<p>Having that information you can monitor processes in th... |
WCF service documentation <p>What is the best way to document/publish information on a WCF service in a technical product document that both programmers as well as non-programmers will look at? Also, what is the best tool for publishing. </p>
| <p>That's a thorny issue at best! :-)</p>
<p>You could export your WCF service description to a WSDL file and enrich it with <code><xs:documentation></code> and <code><xs:annotation></code> elements, and then convert that to a readable HTML document using an XSLT transformation - but that's less than great... |
VSTO 2007: how do I determine the page and paragraph number of a Range? <p>I'm building an MS Word add-in that has to gather all comment balloons from a document and summarize them in a list. My result will be a list of ReviewItem classes containing the Comment itself, the paragraph number and the page number on which ... | <p>Try this for page number:</p>
<pre><code>Page = c.Scope.Information(wdActiveEndPageNumber);
</code></pre>
<p>Which should give you a page number for the end value of the range. If you want the page value for the beginning, try this first:</p>
<pre><code>Word.Range rng = c.Scope.Collapse(wdCollapseStart);
Page = r... |
How to refactor multiple similar Linq-To-Sql queries? <p><strong>Read before downvoting or closing:</strong> This almost exact duplicate of a <a href="http://stackoverflow.com/questions/863169/how-to-refactor-multiple-similar-linq-queries">previous question of mine</a> exists with the solely purpose to rephrase the pre... | <p>Absolutely. You'd write:</p>
<pre><code>public IQueryable<A> First10(Expression<Func<A,bool>> predicate)
{
return db.TableAs.Where(predicate).Take(10);
}
</code></pre>
<p>(That's assuming that <code>TableA</code> is <code>IQueryable<A></code>.)</p>
<p>Call it with:</p>
<pre><code>var ... |
Can CSS frameworks (ie: 960gs or Blueprintcss) be used without margins? <p>I don't see the point of using either <a href="http://960.gs" rel="nofollow">http://960.gs</a> or <a href="http://blueprintcss.org" rel="nofollow">http://blueprintcss.org</a> if they enforce margins other than for pretty magazine layouts/marketi... | <p>I use this technique as my ultimate CSS layout technique:</p>
<p><a href="http://www.codeofficer.com/blog/entry/css_grid_frameworks_960gs_without_margins/" rel="nofollow">http://www.codeofficer.com/blog/entry/css_grid_frameworks_960gs_without_margins/</a></p>
<p>I had the same issue once, and since I use that one,... |
Convert base64 encoded string to java byte array <p>I am writing a decryption class (AES/CBC/PKCS7Padding) where the encrypted data is coming from C#. I want to take the following string (which is base64 encoded):</p>
<p>usiTyri3/gPJJ0F6Kj9qYL0w/zXiUAEcslUH6/zVIjs=</p>
<p>and convert it to a byte array in java to pas... | <p>You don't have to worry about byte signedness because base64 encoded data never uses more than 6 bits in each byte (that's why it's called base 64, because you only use 64 characters which is 6 bits, to represent part of a data byte).</p>
<p>If your concern is the resulting data (3 data bytes for every 4 base64 cha... |
Easy way to handle developemnt/production URLs in flex air app <p>Easy way to handle developemnt/production URLs in flex air app? I want to point to my local box for testing, but when I launch I want it to automatically point to the production URL.</p>
| <p>I suggest either using a configuration file or changing your hosts file to point domains to localhost or dev servers on your development machine. With the latter option you always use your production URLs in code, but your dev machine will resolve those domains to your local machine because it checks the hosts file ... |
FireFox capture autocomplete input change event <p>I'm trying to subscribe to change events on an input tag for an ajax auto complete form. These change events are not firing when the user clicks an autocomplete suggestion from FireFox.</p>
<p>I've seen fixes for IE, but not FireFox. You can view this behavior <a href... | <p>Firefox 4+ fire 'oninput' event when autocomplete is used.<br>
Here's some jQuery to make this more actionable: </p>
<pre><code>$('#password').bind('input', function(){ /* your code */});
</code></pre>
|
2nd column is tucking below the 1st column, what are common causes of this? <p>My HTML is too eleborate to post here.</p>
<p>I have a 2 column layout, the 1st column is 160px and the 2nd column is much bigger.</p>
<p>For some reason the 2nd column is tucking below the 1st column.</p>
<p>What are common causes for th... | <p>Assuming both columns are floated (left), the second column will tuck underneath the first one if:</p>
<ul>
<li>It has <code>clear:left;</code> assigned to it</li>
<li>itâs too wide for the available space</li>
</ul>
<p>If the problem is occurring in IE 6, it might be the <a href="http://www.positioniseverything... |
Replace Module Text in MS Access using VBA <p>How do I do a search and replace of text within a module in Access from another module in access? I could not find this on Google. </p>
<p>FYI, I figured out how to delete a module programatically:</p>
<p>Call DoCmd.DeleteObject(acModule, modBase64)</p>
| <p>I assume you mean how to do this programatically (otherwise it's just ctrl-h). Unless this is being done in the context of a VBE Add-In, it is rarely (if ever) a good idea. Self modifying code is often flagged by AV software an although access will <em>let</em> you do it, it's not really robust enough to handle it, ... |
Storing strings and integers in a single GWT array <p>It seems like this should be relatively simple, but apparently not so much. I can't figure out for the life of me how to store strings and integers in an array in GWT. What data type do you use? If I use JsArrayString, it throws an <code>IllegalArgumentException<... | <p>Now this is possible using <code>JsArrayMixed</code>.</p>
|
Unit of Measure Conversion Library <p>What is the best/most elegant way to abstract out the conversion of units of measures in the client, based on a user-preferred unit of measure setting?</p>
<p>For example, let's say user A's preferred unit of measure is "metric", while user's B's preference is "imperial".</p>
<p>... | <p>Here's a little script I threw together just for the heck of it. It handles all the SI conversions for grams, bytes, meters and liters, and also I've added ounces and pounds as an example of non-SI units. To add more, you'll need to:</p>
<ol>
<li>Add the base type to the "units" list for items that follow SI or </l... |
Timing concurrent processes in bash with 'time' <p>Is there a simple way to do the equivalent of this, but run the two processes concurrently with <code>bash</code>?</p>
<pre><code>$ time sleep 5; sleep 8
</code></pre>
<p><code>time</code> should report a total of 8 seconds (or the amount of time of the longest task)... | <pre><code>$ time (sleep 5 & sleep 8 & wait)
real 0m8.019s
user 0m0.005s
sys 0m0.005s
</code></pre>
<p>Without any arguments, the shell built-in <code>wait</code> waits for all backgrounded jobs to complete.</p>
|
Naming enum types <p>If you have a set of related words (e.g. Row & Column or On & Off), how do you find the collective word that describes those words? Specifically, how do you name an enum?</p>
<p>If I have "Red", "Green" and "Blue", a sensible enum name might be "Color". Values of "On" and "Off" might hav... | <p>Try using a name which indicates what the enum is used for, e.g </p>
<pre><code>public enum CountMethod
{
Row,
Column
}
</code></pre>
|
generic code snippets / templates in eclipse <p>I'm currently evaluating eclipse after using textmate for all my development for many years. what i miss in eclipse and what I can't find any solution for are some kind of generic templates:</p>
<p>I'm using PDT for my JavaScript and PHP development, and it supports code... | <p>If you have the web tools (WTP) plugins installed you should have a Snippets view which is an editor-independent place for collecting reusable code snippets. You can create and place your snippets in there and can separate them using 'drawers'. Double clicking or dragging a snippet item will insert it in the active ... |
Using BeautifulSoup to find a HTML tag that contains certain text <p>I'm trying to get the elements in an HTML doc that contain the following pattern of text: #\S{11}</p>
<pre><code><h2> this is cool #12345678901 </h2>
</code></pre>
<p>So, the previous would match by using:</p>
<pre><code>soup('h2',text=... | <pre><code>from BeautifulSoup import BeautifulSoup
import re
html_text = """
<h2>this is cool #12345678901</h2>
<h2>this is nothing</h2>
<h1>foo #126666678901</h1>
<h2>this is interesting #126666678901</h2>
<h2>this is blah #124445678901</h2>
"""
soup = Beau... |
webrick server / ie6 truncating javascript files in development mode <p>I'm using webrick to run my rails app in development mode. The page includes 4-5 javascript files, which are also being served by the same webrick instance.</p>
<p>When I load the page on ie6, it appears the javascript files are getting truncated... | <p>The empty <code>Content-Length</code> header may be the culprit. I would focus my efforts on finding out why no content length is being returned by Webrick.</p>
|
oracle objects and collections <p>Just wanted to know if anyone is really using Objects and Collections in Oracle ? Is this something that should be avoided ?</p>
<p>eg</p>
<pre><code>create type t_person as object (
id integer,
first_name varchar2(30),
last_name varchar2(30)
);
</code></pre>
| <p>If you are seriously into PL/SQL programming, you can hardly live without collections and objects. That said, I keep my database tables "clean", i.e. all columns contain atomic values, no nested tables etc.</p>
|
NullReferenceException was unhandled, Object Reference not set to an instance of an object <p>Whenever I run my program, I get: NullReferenceException was unhandled, Object Reference not set to an instance of an object.</p>
<p>When I start the program, I have a form appear called MaxScore where the user enters the max... | <p>Well if this is the line that's causing the problem:</p>
<pre><code>myGameCountLbl.Text = maxGames.ToString();
</code></pre>
<p>then either <code>myGameCountLbl</code> is null, or <code>maxGames</code> is. Given that <code>maxGames</code> is a decimal, that suggests that <code>myGameCountLbl</code> is null.</p>
<... |
Is it possible to write multiple iterators for a type in C#? <p>So for a type like:</p>
<pre><code>CoolCollection<T>
</code></pre>
<p>you could have:</p>
<pre><code>foreach (T item in coolCollection)
{
...
}
foreach (CoolNode node in coolCollection)
{
...
}
</code></pre>
<p>If this isn't possible, ma... | <p>Just make <code>CoolCollection<T></code> explicitly implement <code>IEnumerable<CoolNode<T>></code> as well as <code>IEnumerable<T></code>. (I'm guessing it's really <code>CoolNode<T></code>, but if not, just take the extra <code><T></code> out everywhere.)</p>
<p>This will let ... |
Disable Magnifying Glass in UITextField <p>Is there a way to prevent the user from moving the cursor in a UITextField? I'd like it to stay at the end of the string.</p>
| <p>This is an old question, but I was looking for an answer to the same question, and found a solution.</p>
<p>It is actually quite simple to prevent the user from moving the cursor. Just subclass UITextField and provide the following implementation of <code>caretRectForPosition:</code></p>
<pre><code>- (CGRect)caret... |
Is it a good idea to use varargs in a C API to set key value pairs? <p>I am writing an API that updates a LOT of different fields in a structure.</p>
<p>I could help the addition of future fields by making the update function variadic:</p>
<pre><code>update(FIELD_NAME1, 10, FIELD_NAME2, 20);
</code></pre>
<p>then la... | <p>Generally, no.</p>
<p>Varargs throws out a lot of type-safety - you could pass pointers, floats, etc., instead of ints and it will compile without issue. Misuse of varargs, such as omitting arguments, can introduce odd crashes due to stack corruption, or reading invalid pointers.</p>
<p>For instance, the followin... |
logging to custom event log (C# app, but using win32 API) <p>Due to a limitation in the .NET EventLog class, I have some code using PInvoke that logs to the Application log. The code works without a problem.</p>
<p>But now, I'd like to log to a custom event log. So, I tried changing the 2nd parameter of the RegisterEv... | <p>You have to create a source called MyApp and map it to your log "CompanyX".</p>
<p>This article goes into detail for creating an Event Source w/ .Net Framework BCL. </p>
<p><a href="http://msdn.microsoft.com/en-us/library/5zbwd3s3.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/5zbwd3s3.aspx</a></p>
... |
How can I programmatically remove the 2 connection limit in WebClient <p>Those "fine" RFCs mandate from every RFC-client that they beware of not using more than 2 connections per host...</p>
<p>Microsoft implemented this in WebClient. I know that it can be turned off with </p>
<p>App.config:</p>
<pre><code><?xml ... | <p>for those interested:</p>
<p><code>System.Net.ServicePointManager.DefaultConnectionLimit = x</code> (where x is your desired number of connections)</p>
<p>no need for extra references</p>
<p>just make sure this is called BEFORE the service point is created as mentioned above in the post.</p>
|
Merging Treenodes <p>Does anyone know of an algorithm that will merge treenodes in the following way?</p>
<pre><code>treeA
\ child a
\node(abc)
\ child b
\node(xyz)
+
treeB
\ child a
\node(qrs)
\ child b
\node(xyz)
... | <p>Well, once I actually took the time to think about it, the solution turns out to be far more simple than I anticipated. (I've posted the critical part of the code below)</p>
<pre><code> private TreeNode DoMerge(TreeNode source, TreeNode target) {
if (source == null || target == null) return null;
... |
What has .Render() on SSRS2000 WebService been replaced with on SSRS2008? <p>We've recently upgraded one of our SSRS2005 servers to SSRS2008 and have found that all of our applications that utilized the reporting services web service for producing reports no longer works.</p>
<p>The first issue is that the web service... | <p>Here are a couple of articles on migrating from SSRS 2005 to SSRS 2008</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/ms143674.aspx" rel="nofollow">Upgrading Reports</a></li>
<li><a href="http://technet.microsoft.com/en-us/library/ms143251.aspx" rel="nofollow">Reporting Services Backward Compatibi... |
How to implement Dispose in a COM object <p>I have written a COM component in unmanaged C++ to provide customers access to our database. When using it from an unmanaged language the database connections are correctly cleaned up as the objects go out of scope. I recently tried using it from VB.NET and discovered that ... | <p>Madness lies that way. You'll be better off wrapping your COM objects in type safe .Net wrappers that implement IDisposable (if you like), or use the normal methods of .Net garbage collection to clean themselves up.</p>
|
Crystal Reports text cuts off last line in Details section <p>I have a Crystal Report 11 file that is a letter. The first Details section contains a large text box that has print date, address block, and the salutation line. Every once in a while, the last line of the text box gets cut off so that the salutation isn't ... | <p>Normally this should be working if you check the "Can Grow" option in the common tab of the "Format Field/Text" settings. With that option checked it shouldn't matter which height you set.</p>
|
html table syntax validation <p>This should be an easy one.</p>
<p>I have a table like so:</p>
<pre><code><table>
<tr>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</code></pre>
<p>My firefox 3... | <p>If you want to use uneven amounts of rows/columns, you <strike>need to</strike> should use <a href="http://www.w3schools.com/tags/att%5Ftd%5Fcolspan.asp" rel="nofollow">rowspan and/or colspan attributes</a> to indicate this.
eg:</p>
<pre><code><table>
<tr><td></td><td></td><td... |
Samba Error: "Incorrect Function" <p>I've been setting up a samba share on a Redhat box, and am able to connect to it from the local machine. From an XP machine however, I'm only able to successfully connect to the root of the share (e.g. "\machine"). Connecting to the actual shared folders (e.g. "\machine\share") ge... | <p>It looks like the windows machine was caching authentication information, and not updating it as the samba server's authentication mode was changed. This meant that once I'd failed to connect to the samba server (due to bad settings on the server side), connections would continue to fail even when the server settin... |
Is this the right place to call the RSS building function? <p>Is this the right place to call the function that builds the RSS? its for a reddit type of site.</p>
<pre><code>function save() {
/*
Here we do either a create or
update operation depending
on the value of the id fiel... | <p>Probably not. There may be times when you want to save an article object without updating your RSS feed -- e.g. you might import an archive of articles at some point. As such, whatever is responsible for calling save() should call createRSS() itself immediately afterward.</p>
<p>e.g.</p>
<pre><code>function crea... |
Memory Efficient Methods To Find Unique Strings <p>I have a data set that looks like this:</p>
<pre><code>000 100 200 300 010 020 030 001 002 003
001 101 201 301 011 021 031 000 002 003
002 102 202 302 012 022 032 001 000 003
003 103 203 303 013 023 033 001 002 000
010 110 210 310 000 020 030 011 012 ... | <p>This depends a bit on the characteristics of your dataset. In the worse case, where all strings are unique, you will need either O(n) memory to record your seen-set, or O(n^2) time to re-scan the entire file on each word. However, there are improvements that can be made.</p>
<p>First off, if your dataset only consi... |
Visual studio forgets window settings and makes a mess <p>I have this problem where I open Visual Studio and the internal windows are scattered all over the place. None of them are docked; some that should be visible have become invisible and vice versa. I then have to spend ages getting the windows back where I like t... | <p>Sounds like there is definitely a problem with Visual Studio retaining your settings between round-trips and possibly your Visual Studio settings profile in general.</p>
<p>The solution I'd recommend is firstly to reset all settings, secondly customize things to your personal preference and finally take a backup of... |
In what circumstances can a compiler change the execution order of programme statements? <p>If this is <a href="http://stackoverflow.com/questions/865871/will-30-goto-10-always-go-to-10-closed">not a real question</a> then feel free to close ;)</p>
| <p>Not only the compiler can reorder execution (mostly for optimization), most modern processors do so, too. Read more about execution reordering and <a href="http://en.wikipedia.org/wiki/Memory%5Fbarrier#Out-of-order%5Fexecution%5Fversus%5Fcompiler%5Freordering%5Foptimizations" rel="nofollow">memory barriers</a>.</p>
|
MySQL versus PDO <p>I'm fairly new to PHP and have built a medium sized website using standard MySQL database calls. However, I have recently learned about PDO and I am hoping to find out from the community if it is worth switching from MySQL over to PDO. For security I have been using <code>mysql_real_escape_string</c... | <p>PDO has the following advantages over the mysql_* functions:</p>
<ul>
<li>It's cross database, meaning it's the same interface for different relational databases.</li>
<li>It helps protect against SQL injections.</li>
<li>It's much cleaner (uses an object-oriented approach).</li>
</ul>
<p>This question has been as... |
Qt: how to set main window's initial position? <p>I think the normally window manager determines the initial position of the QMainWindow position on the desk top. I want to set the initial position myself. How is this done with Qt on Windows?</p>
| <p>You can restore the window geometry with <a href="http://qt-project.org/doc/qt-5/qwidget.html#restoreGeometry">restoreGeometry()</a>, and the state of docked elements with <a href="http://qt-project.org/doc/qt-5/qmainwindow.html#restoreState">restoreState()</a>, during the construction of your MainWindow...</p>
<pr... |
How do you get the IP address from a request in ASP.NET? <p>I have been trying to figure this out but cannot find a reliable way to get a clients IP address when making a request to a page in asp.net that works with all servers.</p>
| <p>One method is to use Request object:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
lbl1.Text = Request.UserHostAddress;
}
</code></pre>
|
best free wiki that supports wysiwyg <p>i have a small group of programmers and we want to start using a WIKI. we want it wysiwyg because we have our analysts and users adding and editing pages as well. </p>
<p>we are looking for free and we want to host it ourselves on windows preferrably and simple to use as possi... | <p>I think your best choice would be mindtouch deki wiki <a href="http://www.mindtouch.com/">http://www.mindtouch.com/</a></p>
<p>foswiki ( <a href="http://foswiki.org">http://foswiki.org</a> ) is nice too, but for your use case (windows) will be harder to set up.</p>
<p>Also mediawiki (the engine behind wikipedia) m... |
How to clean this Sql data up? <p>this is a follow on question to a <a href="http://stackoverflow.com/questions/834247/need-some-help-trying-to-do-a-simple-sql-insert-with-some-simple-data-checking">previously asked question</a>. </p>
<p>I have the following data in a single db table.</p>
<pre><code>Name ... | <p>For the first query, you want rows that answer to both of the following criteria:</p>
<ol>
<li>The <code>Name</code> in the row appears in the table in the same row in which <code>LeftId</code> and <code>RightId</code> are both NULL.</li>
<li>The <code>Name</code> in the row appears in the table in same row where a... |
.net compact framework: Avoid program being started twice concurrently <p>How can I avoid that a user starts the same program twice?
The current implementation tries to do that using "FindWindow", but since it takes some time before the program opens the first window, users regulary manage to start the program twice, ... | <p>You have to use a named mutex so it can be used across processes. For whatever (stupid) reason, the CF designers figured CF developers would never need such a thing, so you have 2 options:</p>
<ol>
<li>P/Invoke CreateMutex and the associated clean up stuff</li>
<li>Use an already written implementation like the SD... |
Architectural design documentation strategies <p>I am trying to document a software project up to the current stage. The readership would involve myself (in a future time), other developers (currently and in the short-term future), as well as end users. Therefore, the documentation has descriptions of design requiremen... | <p>Any low level diagrams automatically generated from source code are going to be useless. They'll be <em>more</em> obscure than your code, have a messy visual layout, and soon be out of date. Future developers will distrust them and look at the code instead, so you're better off investing the extra effort into refac... |
How to check value transition in Django (django-admin)? <p>I have a status field which has 3 values: pending, activated
and rejected. If I am changing the value of status I want to
have a check that activated cannot be changed to pending. I
do not want to write stored-procs for this. Can I have the
previous value in Dj... | <pre><code>def clean_status(self):
status = self.cleaned_data.get('status')
if status == 'pending':
if self.instance and self.instance.status == 'activated':
raise forms.ValidationError('You cannot change activated to pending')
return status
</code></pre>
<p>This method is to be added ... |
Is it possible to programmatically disable the Caps Lock key on Windows? <p>The Caps Lock key is driving me nuts - I never use it intentionally, but sometimes accidentially press it instead of TAB. My current solution is to remove the button with a screwdriver (no damage, can be placed back if ever needed).</p>
<p>Is ... | <p>To just remap Caps lock (without installing software) on a Windows 2000 or Windows XP machine, I adapted the information found at <a href="http://stackoverflow.com/questions/229633/how-to-globally-map-altgr-key-to-alt-key">How to globally map AltGr key to Alt key?</a> as follows. Mapping Caps to null is one of the ... |
Drag a WPF Form around the desktop <p>i am trying to make a c# WPF form where i can drag it around the screen by clicking on it and moving with the mouse. the forms characteristics include being completely transparent and containing only one image. This being said the window style is none and it is not displayed in the... | <p>You can use the Window.DragMove method in the mouse down event of the window.</p>
|
Passing a **Class as an argument <p>I'm trying to declare a method in main.h like this:</p>
<pre><code>void buildGraph(int gNum, Graph** gArray);
</code></pre>
<p>Where Graph is a class and I'm trying to pass a pointer to an array of pointers to Graph objects.</p>
<p>I get the error message: "Graph has not been decl... | <p>It's likely that you have more than one graph.h file in the filesystem and the wrong one is included. If it's because of accidential copying remove the unneeded copies, if it's because of collision with C++ standart library or other libraries headers you should rename you header files to prevent such collisions in f... |
download window java <p>I am reading file through serialport, I want file transfer window wich should not have any connection to parent window,and reading process should go on backside</p>
| <ul>
<li>Open a new <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html" rel="nofollow">JFrame</a> for the window</li>
<li>Do the downloading in a <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html" rel="nofollow">separate Thread</a></li>
<li>Use a <a href="h... |
Is there a way to use C++ for iPhone development? <p>Sorry if this is mentioned somewhere, couldn't find any info about it. Post a comment if you find a duplicate.</p>
<p>This is not about whether it's possible at all to compile a C++ program for the iPhone (which I suppose is possible).</p>
<p>Basically the question... | <p>Well I think that this blog here: <a href="http://iphonedevelopertips.com/cpp/c-on-iphone-part-1.html" rel="nofollow">http://iphonedevelopertips.com/cpp/c-on-iphone-part-1.html</a></p>
<p>will help you :-)</p>
|
Why doesn't font-size work in IE7 <p>I have to following code fragment, and no matter what I set the font-size to, IE7 doesn't listen at all! All other browsers are working fine. Any ideas?</p>
<pre><code><html>
<head>
<title>Test</title>
<style type="text/css">
* {margi... | <p>It should work on every (decent) browser including IE 7.</p>
<p>I imagine it is an accessibility setting with your Browser, possibly:</p>
<p>Tools -> Options -> General tab -> Accessibility -> "Ignore font sizes specified on pages".</p>
|
facebook API from Silverlight <p>Does anyone have a sample showing how to query Facebook user photos from Silverlight?</p>
| <p>Did you try the <a href="http://www.codeproject.com/KB/WPF/WPFacebook.aspx" rel="nofollow">WPF Facebook example</a> on CodeProject? Shouldn't be too different from Silverlight.</p>
|
Confusion with WPF MVVM <p>I have downloaded the document about MVVM from CodePlex, but I don't understand this diagram.</p>
<p><img src="http://img194.imageshack.us/img194/3959/diagram.png" alt="alt text" /></p>
<p>In the document, ContactView never sets its DataContext to ContactViewModel, so I don't understand why... | <p>You should read <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="nofollow">this article</a> by Josh Smith, everything will seem much clearer afterwards...</p>
|
j2me networking, threads and deadlocks <p>The simple piece of midlet code (class Moo) below (after the excerpts) deadlocks (At least I assume it deadlocks after reading this post on threads <a href="http://developers.sun.com/mobility/midp/ttips/threading3/index.html">here</a>).</p>
<p>I have reproduced the relevant e... | <blockquote>
<p>Where can I get the sources for
j2me system classes (I want to check
out the implementation of Connection
classes)?</p>
</blockquote>
<p>You cant. Its actually vendor dependent. The way in which Nokia handles this situation may be different from Motorola.</p>
<p>The lesson you have to learn is... |
is there any replacement of Access? <p>I am a programmer, and my father uses Access to collect the patients information (my father is a doctor),</p>
<p>He wants me to teach him how to use it.</p>
<p>I don't like Access (I'm a linux guy), and I cannot find any replacement of it. Do you guys know of any? (it must be ea... | <p>Maybe you need to be a bit more pragmatic about this.</p>
<p>I'm not a fan of Access either, but if your father already understands it and he already has the system in place, you need to ask the question, why change? If it aint broke don't try to fix it.</p>
<p>You may find that a few simple changes in the existin... |
Creating a wrapper for a C library in Python <p>I'm trying to create a wrapper of my own for FLAC, so that I can use FLAC in my own Python code.</p>
<p>I tried using ctypes first, but it showed a really weird interface to the library, e.g. all the init functions for FLAC streams and files became one function with no r... | <blockquote>
<p>Python has no way to store pointers, and thus I can't store the pointer to the stream decoder</p>
</blockquote>
<p><strong>ctypes</strong> has pointers, and ctypes can be used to wrap existing C libraries. Just a tip, you will need to wrap/rewrite all relavent C structures into ctypes.Structure.
Ta... |
Parse quoted text from within batch file <p>I would like to do some simple parsing within a batch file.</p>
<p>Given the input line:</p>
<pre><code>Foo: Lorem Ipsum 'The quick brown fox' Bar
</code></pre>
<p>I want to extract the quoted part (without quotes):</p>
<pre><code>The quick brown fox
</code></pre>
<p>Usi... | <p>Something like this will work, but only if you have one quoted string per line of input:</p>
<pre><code>@echo OFF
SETLOCAL enableextensions enabledelayedexpansion
set TEXT=Foo: Lorem Ipsum 'The quick brown fox' Bar
@echo %TEXT%
for /f "tokens=2 delims=^'" %%A in ("abc%TEXT%xyz") do (
set SUBSTR=%%A
)
@echo %... |
International Fonts Display Issue with UTF-8 <p>We have developed a PHP-MySQL application in two languages - English and Gujarati. The Gujarati language contains symbols that need unicode UTF-8 encoding for proper display.</p>
<p>The application runs perfectly on my windows based localhost and on my Linux based testin... | <p>Since you've stated that it is working in your development environments and not on your clients, you might want to check the clients Apache's <a href="http://httpd.apache.org/docs/2.0/mod/core.html#AddDefaultCharset" rel="nofollow">AddDefaultCharset</a> and set this to UTF-8, if it's not already. (Assuming that the... |
Serial input through Parallel port <p>Can any ony kindly explain that how we can take serial data as input from parallel port using c#.
Or the serial communication through parallel port.</p>
| <p>It is not clear from your question if you are looking for a software or hardware solution. AN external serial to paralell converter (hardware) provides the simpliest solution.</p>
<p>If you are looking for a software only solution, you want to do "<a href="http://en.wikipedia.org/wiki/Bit-banging" rel="nofollow">bi... |
listbox selected item should highlight with some color <p>I have a <code>ListBox</code> with some images. I want to hightlight the selected item with some color. I am using <code>WwrapPanel</code> to display images horizontally with a <code>ScrollViewer</code>. Is there any way to solve my problem?</p>
| <p>You should use a ItemContainerStyle with a trigger on the IsSelected property, and in the Trigger you put a setter on the Background property</p>
|
What is the best way to insert macros, snippets or code blocks into XAML view? <p>I would like to make a time-saving <strong>snippet to pop in blocks of XAML</strong> like this and then just change the values (like you can in code with e.g. <strong>"cw"-TAB or "foreach"-TAB</strong>):</p>
<pre><code><Style x:Key="F... | <p>I'm getting snippets to work in XAML, but they work in the typical XML way, that is you have to type in the brackets around the snippet name.</p>
<p>Not as nice as the code-behind w/Intellisense, but it works OK. Never tried Texter, that may work better...</p>
|
SSIS web service task, can't execute web service <p>Hi
I have a web service that is called from my ssis.</p>
<p>Used to work fine in test mode, when moved to live environment I get the error :</p>
<p>[Web Service Task] Error: An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServi... | <p>To help diagnose this, you might try using a script task and adding a Service Reference or Web Reference to the web service. Call the service within a try/catch block and log ex.ToString() if you get an exception. That way, you'll be sure to have all the details, and you can post them here in an edit to your questio... |
How to force logout of all users on VSS? <p>VSS is resuming it's sabotage of my repository again. The repair command won't let me repair, the lock VSS doesn't seem to affect currently logged in users-- and it isn't a user, its claiming the only person logged in is admin (via the VSS admin tool!) and I have already clos... | <p>In computer management, close all the sessions and open files. It's drastic, but that is the only way I found to fix it. You also might want to close the share temporarily.</p>
|
Problems with mixing form and mysql database query <p>I have the following form, which I have reduced as much as I can, without being sure where the problem is coming from. I am trying to insert the form values into a database.</p>
<p>However, when trying to use the form below, it spits out:</p>
<p>Query was empty</p... | <p>Is there a typo here:</p>
<pre><code>$statusQuery = "INSERT INTO STATUS VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
if ($statusInfo = $con->prepare($userQuery)) {
</code></pre>
<p>Shoudn't the second line be $statusQuery also?</p>
|
How to find out the key field for a nhibernate object <p>Say I have the following query</p>
<pre><code>ICriteria query = session.CreateCriteria(typeof(T));
</code></pre>
<p>How can I find out the key field of T so that I can add an expression like so</p>
<pre><code>query.Add(Expression.In(keyField, someListOfObjects... | <p>Use NH's meta data</p>
<pre><code>var meta = factory.GetClassMetadata(typeof(T));
query.Add(Expression.In(meta.IdentifierPropertyName, someListOfObjects.ToArray()));
</code></pre>
|
What are Windows "USER objects" <p>I'm trying to track down an issue in our MFC code that looks like a resource limitation issue. Memory and CPU look fine. According to the processes tab on the Task manager our GDI objects look in line with other applications, but our USER objects appear to be a factor of 10 greater ... | <p>Here is a "classic" MSDN article: <a href="http://msdn.microsoft.com/en-us/library/ms810501.aspx" rel="nofollow">Give Me a Handle, and I'll Show You an Object</a></p>
<p>Last time I was tracking down Windows object leaks (which i suspect you have) <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.as... |
Problem using py2app with the lxml package <p>I am trying to use 'py2app' to generate a standalone application from some Python scripts. The Python uses the 'lxml' package, and I've found that I have to specify this explicitly in the setup.py file that 'py2app' uses. However, the resulting application program still won... | <p>Found it. py2app has a 'frameworks' option to let you specify frameworks, and also dylibs. My setup.py file now looks like this:</p>
<pre><code>from setuptools import setup
DATA_FILES = []
OPTIONS = {'argv_emulation': True,
'packages' : ['lxml'],
'frameworks' : ['/usr/local/libxml2-2.7.2/lib/... |
Reading binary file defined by a struct <p>Could somebody point me in the right direction of how I could read a binary file that is defined by a C struct?
It has a few #define inside of the struct, which makes me thing that it will complicate things.<br />
The structure looks something like this: (although its larger a... | <p>Reading a binary defined by a struct is easy.</p>
<pre><code>Format myFormat;
fread(&myFormat, sizeof(Format), 1, fp);
</code></pre>
<p>the #defines don't affect the structure at all. (Inside is an odd place to put them, though).</p>
<p>However, this is not cross-platform safe. It is the simplest thing that... |
SQL Script to alter ALL Foreign Keys to add ON DELETE CASCADE <p>I have a SQL 2005 database with approx 250 tables.</p>
<p>I want to temporarily enable ON DELETE CASCADE to all of the Foreign Keys so that I can do a bulk delete easily.</p>
<p>I then want to turn off ON DELETE CASCADE on all Foreign Keys.</p>
<p>The ... | <p>Here's a script I used for a similiar purpose. It does not support composite foreign keys (which use more than one field.) And it would probably need some tweaking before it will work for your situation. <i>EDIT: In particular it does not handle multi-column foreign keys correctly.</i></p>
<pre><code>select
Dro... |
SQL Server <p>hi guys i took a database snapshot .Then if i make a changes then that changes will reflect the base database or snapshot database? </p>
<p>When i take a database snapshot does it create a another database? </p>
| <p>I think you may be misunderstanding what's happening here. The point of taking a snapshot is that you can roll back all your changes to that snapshot. </p>
<p>This is similar to if you took a snapshot of your wife while she's young. As she gets older, she'll get wrinkles, grey hair etc. but the snapshot won't ch... |
i want to know what are all the triggers available for treeview <p>i want to know what are all the triggers available for treeview.I want to change the color of selected item in treeview. Any answers plzz..</p>
| <p>You can see a list of all the WPF treeview's members on MSDN:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview_members.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview_members.aspx</a></p>
|
Options to Replicate Microsoft SQL Server Database to MySQL/PostgreSQL on Linux <p>I need to replicate data from Microsoft SQL Server to MySQL or PostgreSQL. The data includes images stored in BLOB columns.</p>
<p>Could you please comment on your experiences with the following strategies and suggest others I may have... | <p>Looking at SQL Server Replication Technologies you can use Non-SQL Server Subscribers although only Oracle and DB2 are officially supported at this time, custom solutions have been implemented successfully.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms151835.aspx" rel="nofollow">http://msdn.microsoft.c... |
Good examples of python-memcache (memcached) being used in Python? <p>I'm writing a web app using Python and the web.py framework, and I need to use memcached throughout.</p>
<p>I've been searching the internet trying to find some good documentation on the <a href="http://www.tummy.com/Community/software/python-memcac... | <p>It's fairly simple. You write values using keys and expiry times. You get values using keys. You can expire keys from the system.</p>
<p>Most clients follow the same rules. You can read the generic instructions and best practices on <a href="http://www.danga.com/memcached/">the memcached homepage</a>.</p>
<p>If yo... |
error handling in nant build scripts <p>I am writing a NAnt build script which is responsible for deploying some files to an iss server. As part of this I would like to add error handling to my scripts - something which I haven't used before. </p>
<p>Introducing error handling inevitably leads to thoughts about the st... | <p>Not sure if this helps but how about using the try/catch blocks instead around any fragile code?</p>
<p><a href="http://nantcontrib.sourceforge.net/release/0.85/help/tasks/trycatch.html" rel="nofollow">http://nantcontrib.sourceforge.net/release/0.85/help/tasks/trycatch.html</a></p>
|
c# to vb conversion object initalization <p>I am trying to pick up on VB.net and have been programming in c# for a while. I have grasped pretty much most of vb.net but running into some issues with this conversion for object initialization:</p>
<pre><code>CustomerParameters customerParameters = new CustomerParameters
... | <pre><code>Dim cp As New CustomerParameters() With { _
.FirstName = "C First Name", _
.LastName = "C Last Name" _
}
</code></pre>
|
How to get case-insensitive elements in XML <p>As far as I know XML element type names as well as attribute names
are case sensitive.</p>
<p>Is there a way or any trick to get case insensitive elements?</p>
<p><strong>Clarification</strong>:
A grammar has been defined via XSD which is used for some clients to upload... | <p>If I understand your problem correctly then the case errors can only be corrected between the creation and the upload by a 3rd party parsing tool.</p>
<p>i.e. XML File > Parsed against XSD and corrected > Upload approved</p>
<p>You could do this at run-time by developing a container application for your clients to... |
ListView scrollbar messes up my layout <p>I have a WPF ListBox that typically shows 4 or 5 items. For my application that means I almost never have to display a scrollbar (there is enough space).</p>
<p>However, in case there are more items in the list, I need to show the vertical scroll bar, but as a result my conte... | <p>What about wrapping it with a ScrollViewr?</p>
<pre><code><ScrollViewer VerticalScrollBarVisibility="Auto">
<!-- your ListBoxHere -->
</ScrollViewer>
</code></pre>
|
sending and receiving broadcast messages <p>Guys I need some help here..
I am doing a project in c# where the data needs to be sent as a datagram and receive data too which is broadcast.</p>
<p>The following is the code:</p>
<pre><code> public void StartUdpListener(Object state)
{
receivedNotification ... | <p>Why don't you set up your own broadcaster and listener in separate instances.</p>
<p><a href="http://www.codeproject.com/KB/IP/socketsincsharp.aspx" rel="nofollow">This is a great article on socket programming in c#</a></p>
|
Culture name is not supported <p>I'm receiving "culture name 'uploads' is not supported" when my ASP.NET application start. Where do I have to view/debug to toggle the error?</p>
<p>A full-text search for "uploads" returns 0 entries in my project.</p>
| <p>I've deleted this folder and it solved the problem:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8dfb04ef\44bf70fb\uploads</p>
|
Ajax - How refresh <DIV> after submit <p>How can I refresh just part of the page ("DIV") after my application releases a submit?
I'm use JQuery with plugin ajaxForm.
I set my target with "divResult", but the page repeat your content inside the "divResult".
Sources:</p>
<pre><code> <script>
$(docum... | <p>To solve this using jquery I would try this;</p>
<pre><code>$(document).ready(function() {
$("#formSearch").submit(function() {
var options = {
/* target:"#divResult", */
success: function(html) {
$("#divResult").replaceWith($('#divResult', $(html)));
},
url: "http://localhost:8081/sniper/estab... |
Move WCF service from test console app to IIS <p>I've been building a WCF app behind 3 projects (contract,implementation,client) I've hosted my service as a console app with basic HTTP binding. I'm now ready to move it to IIS. However, the tutorial for creating a .svc file shows it actually implementing the contract - ... | <p>I normally add the SVC file in, and the ServiceHost will point to the same class that you would when you create a new instance of a ServiceHost from Code.</p>
<p>So your CommandLine host might look like:</p>
<pre><code>using (ServiceHost serviceHost = new ServiceHost(typeof(CoolService.CoooolEndpoint)))
{
</code><... |
WCF: Why isn't HttpResponse getting logged here? <p>I am trying the samples from the Learning WCF book and trying to inspect the HTTP request/response. I can see the HTTP Request headers in MS TraceViewer but strangely not the response headers. (only envelope). If you notice something amiss, could you please let me kno... | <p>Are you doing streaming on the response side? That would explain it - when you use streaming, only headers will be logged (not the streamed data).</p>
<p>Marc</p>
|
Primary key composed <p>Customer customer = new Cliente(4); </p>
<p>In the code an object customer is created locating through IdCliente = 4 </p>
<p>How would to create an object customer that possesses a primary key composed, to idEmpresa and idCliente? </p>
| <p>I think you're asking if you can load an subsonic object that has a composite key. </p>
<pre><code>Customer customer = new SubSonic.Select()
.From(Customer.Schema)
.Where(Customer.IdEmpresaColumn).IsEqualTo(idEmpresa)
.And(Customer.IdClienteColumn).IsEqualTo(idCliente)
.ExecuteSingle();
</code></pre>
<p>Pl... |
Currency Mask <p>I need to create a currency mask. I did lines of command and it's works fine, but when i set the value in textfield, occurred infinit loop. I monitoring the textfield with Editing Changed behavior, to catch each caracter that the user set, but when i try to change the text value, the infinity loop happ... | <p>Are you setting the text in the textFieldDidChange? Because if you do, the textFieldDidChange notification is going to fire again and the text is set again and the notification will fire again and so on...</p>
<p>I tried doing this as well. The only solution I could come up with is formatting your text when the use... |
asp.net Ajax timer control <p>i have a page with a timer control. when the page is loaded, it fires a function.
my issue is that the title of the page appears initially, but after the timer control function finished, the string in the title disappears.
I commented everything out of the timer function and the title in ... | <p>If you're using ASP.NET AJAX and programatically define the page title (as opposed to statically having it defined in your .aspx page), then you must re-define it again in your partial page update. It's just the way asp.net ajax works.</p>
|
Interrupt system shutdown in Adobe Air <p>I'm trying to get my Air app to display the NativeWindow to the user (the app is normally hidden down in the system tray) when the system is shutdown. I'm using the following code currently which works nicely if the exit button is pressed, but it doesn't work when the system is... | <p>Unless you can access the APIs for the platform in the ActionScript, there is no real way to do it.</p>
|
SQL Server 2008 Change Data Capture, who made the change? <p>I asked a question on SOF a week or so ago about auditing SQL data changes. The usual stuff about using triggers came up, there was also the mention of CDC in SQL Server 2008. </p>
<p>I've been trying it out today and so far so good, the one thing I can't se... | <p>I altered the CDC table directly using:
<strong>ALTER TABLE cdc.dbo_MyTable_CT ADD UserName nvarchar(50) NULL DEFAULT(SUSER_SNAME())</strong></p>
<p>BTW you don't need the date info since it's already in the start and end LSN fields.</p>
<p>My only problem is that my users login via a Windows Group which allows th... |
How do I prevent DLL injection <p>So the other day, I saw this:</p>
<p><a href="http://www.edgeofnowhere.cc/viewtopic.php?p=2483118">http://www.edgeofnowhere.cc/viewtopic.php?p=2483118</a></p>
<p>and it goes over three different methods of DLL injection. How would I prevent these from the process? Or at a bare minimu... | <p>The best technical solution would be to do something that causes the loader code to not be able to run properly after your process initializes. One way of doing this is by taking the NT loader lock, which will effectively prevent any loader action from taking place. Other options include patching the loader code d... |
Copying data between Oracle schemas using SQL <p>I'm trying to copy data from one Oracle schema (<code>CORE_DATA</code>) into another (<code>MY_DATA</code>) using an <code>INSERT INTO (...)</code> SQL statement.</p>
<p>What would the SQL statement look like?</p>
| <p>Prefix your table names with the schema names when logged in as a user with access to both:</p>
<pre><code>insert into MY_DATA.table_name select * from CORE_DATA.table_name;
</code></pre>
<p>Assuming that the tables are defined identically in both schemas, the above will copy all records from the table named table... |
My fulltext index option in sqlserver2008 is greyed out? <p>My fulltext index option in sqlserver2008 is greyed out?</p>
<p>Is it a seperate install?</p>
| <p>You can enable it by executing <a href="http://crazzycoding.blogspot.com/2010/12/sql-server-why-full-text-indexing.html">sp_fulltext_database</a> command.</p>
<p>Thanks,</p>
<p>Ashish Chotalia</p>
|
Encrypt/Decrypt ECB/PKS5/Blowfish between AS3Crypto & Javax.Crypto fails with padding error <p>I have a secret key that was sent to me as a file so I can encrypt some xml data using Blowfish. How do I access the key so that I can use it with AS3Crypto? I assume I need to Embed it using the [Embed] meta tag. It's mimeTy... | <p>Dunno if you're still unsure about how to embed binary data, but you're right about using the <code>[Embed]</code> tag (it's certainly one good way of doing it).</p>
<p>I often embed like this:</p>
<pre><code>[Embed(source="myKeyFile.key", mimeType="application/octet-stream")]
private const _KeyFile:Class;
private... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.