instruction stringlengths 21 27.8k | chosen stringlengths 18 28.2k | rejected stringlengths 18 33.6k | __index_level_0__ int64 0 50k |
|---|---|---|---|
<p>I'm currently developing a little hobby project to display health information in a game on my G15 keyboard through VB.NET.</p>
<p>When I use ReadProcessMemory via an API call, it keeps returning zero. The MSDN documentation referred me to use the Marshal.GetLastWin32Error() call to find out what is wrong and it ret... | <p>First, your method signature is wrong, Single=Float while the original parameter is of the LPBUF type.</p>
<p>Use this method signature:</p>
<pre><code><DllImport("kernel32.dll", SetLastError=true)> _
Public Shared Function ReadProcessMemory( _
ByVal hProcess As IntPtr, _
ByVal lpBaseAddress As IntPtr, _
<... | <p>Thank you arul, I have sort of fixed my problem.</p>
<pre><code>Dim address As Integer
address = &HA90C62&
Dim floatvalueinmemory() As Byte
Dim proc As Process = Process.GetCurrentProcess
For Each proc In Process.GetProcesses
If proc.MainWindowTitle = "3D Pinball for Windows - Space Cadet" Then
... | 45,137 |
<p>I'm writing a small article on humanly readable alternatives to Guids/UIDs, for example those used on TinyURL for the url hashes (which are often printed in magazines, so need to be short).</p>
<p>The simple uid I'm generating is - 6 characters: either a lowercase letter (a-z) or 0-9. </p>
<p>"According to my calc... | <p>Why do you want to use a random function? I always assumed that tinyurl used a base 62 (0-9A-Za-z) representation of a sequential Id. No clashes and the urls are always as short as possible. </p>
<p>You would have a DB table like</p>
<pre><code>Id URL
1 http://google.com
2 ...
... ...
156 ...
... ...
</code><... | <p>Why not just use a hashing algorithm? and use a hash of the url?</p>
<p>if you are using random numbers chances are you will get clashes because they are indeterminate.</p>
<p>hashes arent proovably unique but there is a fairly good chance that the hash of a string will be unique.</p>
<p><strong>Correction</stron... | 23,149 |
<p>I have a .csv file that is frequently updated (about 20 to 30 times per minute). I want to insert the newly added lines to a database as soon as they are written to the file.</p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx" rel="nofollow noreferrer">FileSystemWatcher</a>... | <p>I've written something very similar. I used the FileSystemWatcher to get notifications about changes. I then used a FileStream to read the data (keeping track of my last position within the file and seeking to that before reading the new data). Then I add the read data to a buffer which automatically extracts com... | <p>off the top of my head, you could store the last known file size. Check against the file size, and when it changes, open a reader.</p>
<p>Then seek the reader to your last file size, and start reading from there.</p>
| 11,203 |
<p>I am getting some errors thrown in my code when I open a Windows Forms form in Visual Studio's designer. I would like to branch in my code and perform a different initialization if the form is being opened by designer than if it is being run for real. </p>
<p>How can I determine at run-time if the code is being exe... | <p>To find out if you're in "design mode":</p>
<ul>
<li>Windows Forms components (and controls) have a <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.component.designmode.aspx" rel="noreferrer">DesignMode</a> property.</li>
<li>Windows Presentation Foundation controls should use the <a href="ht... | <pre><code> /// <summary>
/// Whether or not we are being run from the Visual Studio IDE
/// </summary>
public bool InIDE
{
get
{
return Process.GetCurrentProcess().ProcessName.ToLower().Trim().EndsWith("vshost");
}
}
</code></pre>
| 9,921 |
<p>What is the best way to write data to the text console at arbitrary locations on the screen and with custom fore/background colors?</p>
| <p>Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor.</p>
<p>Note these were added to the .NET Framework in version 2.0. Prior to that you would have needed PInvoke.</p>
| <p><a href="http://www.nullify.net/ViewArticle.aspx?article=269" rel="nofollow noreferrer">This posting</a> shows how to use Console class methods to create a progress bar on the console - it might be a good example to refer to....</p>
| 24,295 |
<p>I'm relatively new to Javascript and was wondering if there's a quick way to shuffle content that is contained in multiple <code><div></code> tags. For example</p>
<pre><code><div id='d1'>
<span>alpha</span>
<img src='alpha.jpg'>
</div>
<div id='d2'>
<span>beta... | <p>are you ok with using a javascript library like <a href="http://jquery.com" rel="noreferrer">jQuery</a>? here's a quick jQuery example to accomplish what you're after. the only modification to your HTML is the addition of a container element as suggested:</p>
<pre><code><div id="shuffle">
<div id='d1'&... | <p>I would suggest you randomize the content, not the actual Divs themselves. You could accomplish this by putting the content in separate html pages - no header info or body, just the content. </p>
<p>Then use a function on page load to randomly assign which div gets what content and use this to change the DIV's cont... | 40,685 |
<p>I'm currently using the awesome attachment-fu plugin for a Rails app, but as a novice developer, I've never encountered a scenario like the one I've found myself in.</p>
<p>Essentially, I'm using the attachment-fu plugin on two levels.</p>
<ol>
<li>Is for user avatars in the user class.</li>
<li>Is to allow file a... | <p>Is "outsourcing" avatar support entirely to <a href="http://en.gravatar.com/" rel="nofollow noreferrer">Gravatar</a> an option? There are some Rails plugins that will display avatars hosted by Gravatar. You might not need to re-invent the wheel there.</p>
| <p>Couldn't you use <a href="http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations" rel="nofollow noreferrer">Polymorphic Associations</a>?</p>
<p>I'm about to hit this in my app with attachment_fu, so I'm not exactly sure on attachment_fu, but for the old school <a href="http://wiki.rubyonrails... | 4,032 |
<p>Why does my D2009 exe produce emails with attachments named ATTnnnnn.DAT when the same source code compiled in D2007 produces emails with attachments correctly named with the original file name? </p>
<p>I am using the respective Indy libraries that come with D2007 and D2009. Not having the original file name on th... | <p>I have found the problem - please see the adug.com.au mailing list for exact
details of the solution, but in summary -- the version of Indy that comes
with D2009 (version 10.2.5) has 2 errors in the IdMessageClient.pas unit in
two lines that set the name= and filename= in the attachment part processing
(one line... | <p>I'm afraid you might just need to trace down into the indy code. Indy has had a number of bugs in the past so this might be the cause. If you trace in you should find it pretty quickly.</p>
| 11,767 |
<p>Presuming I have a class named <code>A</code>, and I want to use the decorator design pattern. Correct me if I'm wrong, but for that to work , we'll need to create a decorator class, say <code>ADecorator</code>, which will hold a reference to an <code>A</code> instance, and all the other decorators will extend this ... | <p>The decorator pattern is used to add capabilities to objects dynamically (that is, at run time). Normally the object will have its capabilities fixed when you write the class. But an important point is that the functionality of the object is extended in a way that is transparent to the client of the object because i... | <p>In some languages (like Ruby or JavaScript) you could just add new functionality to an A instance. I notice that your question is tagged Java, so I assume that you are asking why you can't do this in Java. The reason is that Java is statically typed. An A instance can only ever have the methods that class A defin... | 34,514 |
<p>Considering a large system with hundreds of assemblies, what is the easiest way to determine which other projects in the large system depend on a specific assembly when there isn't any way to create a single visual studio solution that contains all the projects?</p>
| <p>I would say that <a href="http://www.ndepend.com/" rel="nofollow noreferrer">NDepend is the easiest way to determine the dependencies of a .Net Assembly</a>, regardless of complexity:</p>
<blockquote>
<p>NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze cod... | <p>Configure the operating system to index your source code and search the content for the angle brackets that indicate a reference. Problem is that the path in the reference might be different depending on where the refering projects reside in relation to the one you are looking for so some regular expression might be... | 39,335 |
<p>After working for a while developing games, I've been exposed to both variable frame rates (where you work out how much time has passed since the last tick and update actor movement accordingly) and fixed frame rates (where you work out how much time has passed and choose either to tick a fixed amount of time or sle... | <p>It seems that most 3D developers prefer variable FPS: the Quake, Doom and Unreal engines both scale up and down based on system performance.</p>
<ul>
<li>At the very least you have to compensate for too fast frame rates (unlike 80's games running in the 90's, way too fast)</li>
<li>Your main loop should be paramete... | <p>My experience is fairly limited to somewhat simple games (developed with SDL and C++) but I have found that it is quite easy just to implement a static frame rate. Are you working with 2d or 3d games? I would assume that more complex 3d environments would benefit more from a variable frame rate and that the diffic... | 7,661 |
<p>Almost 5 years ago Joel Spolsky wrote this article, <a href="http://www.joelonsoftware.com/articles/Unicode.html" rel="nofollow noreferrer">"The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)"</a>.</p>
<p>Like many, I read it carefully, real... | <p>Since I read the Joel article and some other I18n articles I always kept a close eye to my character encoding; And it actually works if you do it consistantly. If you work in a company where it is standard to use UTF-8 and everybody knows this / does this it will work.</p>
<p>Here some interesting articles (besides... | <p>I spent a while working with search engine software - You wouldn't believe how many web sites serve up content with HTTP headers or meta tags which lie about the encoding of the pages. Often, you'll even get a document which contains both ISO-8859 characters and UTF-8 characters.</p>
<p>Once you've battled through ... | 8,357 |
<p>I was asked to build a java system that will have the ability to load new code (expansions) while running.
How do I re-load a jar file while my code is running? or how do I load a new jar?</p>
<p>Obviously, since constant up-time is important, I'd like to add the ability to re-load existing classes while at it (if... | <p>Reloading existing classes with existing data is likely to break things.</p>
<p>You can load new code into new class loaders relatively easily:</p>
<pre><code>ClassLoader loader = URLClassLoader.newInstance(
new URL[] { yourURL },
getClass().getClassLoader()
);
Class<?> clazz = Class.forName("mypacka... | <p>I googled a bit, and found this code <a href="https://community.oracle.com/message/5531305#5531305" rel="nofollow noreferrer">here</a>:</p>
<pre><code>File file = getJarFileToLoadFrom();
String lcStr = getNameOfClassToLoad();
URL jarfile = new URL("jar", "","file:" + file.getAbsolutePath()+"!/");
URLClass... | 23,660 |
<p>I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using <code>#define</code> constants like <code>M_PI</code>, or hard-coding the number in.</p>
<p>The program below tests the various ways I know of. The inline assembly version is... | <p>The <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method" rel="noreferrer">Monte Carlo method</a>, as mentioned, applies some great concepts but it is, clearly, not the fastest, not by a long shot, not by any reasonable measure. Also, it all depends on what kind of accuracy you are looking for. The fastest π I k... | <h2>Better Approach</h2>
<p>To get the output of standard constants like <strong>pi</strong> or the standard concepts, we should first go with the builtins methods available in the language that you are using. It will return a value in the fastest and best way. I am using python to run the fastest way to get the value... | 2,238 |
<p>I'm dealing with a large group of entities that store locations. They are displayed on a map. I'm trying to come up with an efficient way to group near located entities into one entity when viewed from a higher location. So, for example, if you are very high, when looking down, you will see one entity that represent... | <p>You could use a regex against every key in the hashtable. This is very dirty but it works:</p>
<pre><code> static void Main(string[] args)
{
Hashtable myhashtable = new Hashtable();
myhashtable.Add("Teststring", "Hello");
myhashtable.Add("1TestString1", "World");
myhashtable.... | <p>Using LINQ:</p>
<pre><code>Dim myhashtable As New Hashtable
myhashtable.Add("Teststring", "Hello")
myhashtable.Add("1TestString1", "World")
myhashtable.Add("2TestString2", "Test")
For Each i As String In From Element In myhashtable.Cast(Of DictionaryEntry)() Let k = DirectCast(Element.Value, String) Wh... | 43,106 |
<p>Is there any (relatively) easy way to implement server-side paging using DevExpress controls (either Win- or Web-ones) without using an XPO data source? By server-side paging I mean control retrieving only the records it needs to display from the database, not the whole table.</p>
| <p>You must create custom paging control (Don' t use DevEx' s paging).
Send current page and page size to procedure as parameter or use directly in your query.</p>
<p>How to use this value sample in MS SQL is this link :
<a href="http://msdn.microsoft.com/en-us/library/ms186734.aspx" rel="nofollow">http://msdn.microso... | <p>If your data source is LINQ-capable, recent DevExpress versions should be able to do the right thing.</p>
<p>Otherwise, you need to implement IListServer. I'm struggling with the same thing right now, so this is not exactly an "answer". I have not found a working example, but there's some useful information in thei... | 48,478 |
<p>Well... simple question, right? But with no so simple answers.
In firefox i use firebug console (profile) but... what to do in other browsers? Like Internet Explorer / Opera / Safari (on windows)</p>
| <p>You may use JavaScript optimizers</p>
<ul>
<li><a href="http://js-optimizer.sourceforge.net/" rel="nofollow noreferrer">http://js-optimizer.sourceforge.net/</a></li>
<li><a href="http://www.xtreeme.com/javascript-optimizer/" rel="nofollow noreferrer">http://www.xtreeme.com/javascript-optimizer/</a></li>
</ul>
| <p>Try out Firebug Lite. I am not sure whether it will solve your purpose fully. </p>
<p><a href="http://getfirebug.com/lite.html" rel="nofollow noreferrer">http://getfirebug.com/lite.html</a></p>
| 23,976 |
<p>whether command line or GUI, I'd be interested in testing every of them.</p>
| <p>Your question is very generic and all the answers above assumed various things. When it comes to BizTalk monitoring its means different things to different people. Your BizTalk administrator might monitor the overall health of the BizTalk environment by opening the BizTalk Administration console. BizTalk Admin conso... | <p>Do you mean monitor the status of each app? The only monitoring tools I know of are the ones from Microsoft <a href="http://msdn.microsoft.com/en-us/library/aa577454.aspx" rel="nofollow noreferrer">here</a></p>
<p>If you want to monitor what the Biztalk app is doing, you'll need to put logging code into the app its... | 12,686 |
<p>I have the following one route, registered in my global.asax.</p>
<pre><code>routes.MapRoute(
"Home", // Unique name
"", // Root url
new { controller = "Home", action = "Index",
tag = string.Empty, page = 1 }
);
</code></pre>
<p>kewl. when I start the site, it correctly picks up this route.</p... | <p>Well the reason it returns null is because there is no route with a "page" route data. </p>
<p>Could you expand a little bit on what you are trying to achieve? If you want to redirect to a page with the url /page/2 or /?page=2 , then you should be using RedirectToRoute or RedirectToAction: </p>
<pre><code>return R... | <p>You should check out Phil's Route Tester:</p>
<p><a href="http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx" rel="nofollow noreferrer">ASP.NET Routing Debugger</a></p>
| 34,252 |
<p>How do I create, execute and control a winform from within a console application?</p>
| <p>The easiest option is to start a windows forms project, then change the output-type to Console Application. Alternatively, just add a reference to System.Windows.Forms.dll, and start coding:</p>
<pre><code>using System.Windows.Forms;
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Applic... | <p>Its totally depends upon your choice, that how you are implementing.<br/>
a. Attached process , ex: input on form and print on console <br/>
b. Independent process, ex: start a timer, don't close even if console exit.</p>
<p>for a,</p>
<pre><code>Application.Run(new Form1());
//or -------------
Form1 f = new Form1... | 35,055 |
<p>I'm signing PDF's using iText. I'm including a graphic in the signature. This works, but the green checkmark (or yellow question mark) that shows when the document is verified interferes with the graphic I inserted, making the end result look ugly.</p>
<p>It either shows up above or below the signature graphic, but... | <p>sorry but I don't understand this. You want a valid signature but no possibility to see that the signature is valid? Doesn't make sense to me. </p>
<p>Anyway, I think the green checkmark is rendered by Adobe Reader so you will have no chance to remove it.</p>
| <p>The trick to get around this is to remove the existing signature block and apply your image in its place. Then, sign the PDF with an invisible signature. This will still allow the user to open the signature sidebar to verify that the signature is valid.</p>
| 48,031 |
<p>Everything inherits from object. It's the basis of inheritance. Everything can be implicitly cast up the inheritance tree, ie.</p>
<pre><code>object me = new Person();
</code></pre>
<p>Therefore, following this through to its logical conclusion, a group of People would also be a group of objects:</p>
<pre><code>L... | <p>OK, everyone who has used generics in .net must have run into this at one point or another.</p>
<p>Yes, intuitively it should work. No, in the current version of the C# compiler it doesn't.</p>
<p>Eric Lippert has a really good explanation of this issue (it's in eleven parts or something and will bend you mind in pl... | <p>With linq extension methods you can do</p>
<pre><code>IEnumerable<object> things = people.Cast<object>();
List<object> things = people.Cast<object>().ToList();
</code></pre>
<p>Otherwise since you are strongly typing the list the implicit conversion isn't allowed.</p>
| 13,535 |
<p>How do I get the id of my Java process? </p>
<p>I know there are several platform-dependent hacks, but I would prefer a more generic solution.</p>
| <p>There exists no platform-independent way that can be guaranteed to work in all jvm implementations.
<code>ManagementFactory.getRuntimeMXBean().getName()</code> looks like the best (closest) solution, and typically includes the PID. It's short, and <em>probably</em> works in every implementation in wide use.</p>
<p>O... | <p>This is what I used when I had similar requirement. This determines the PID of the Java process correctly. Let your java code spawn a server on a pre-defined port number and then execute OS commands to find out the PID listening on the port. For Linux</p>
<pre><code>netstat -tupln | grep portNumber
</code></pre>
| 5,642 |
<p>I'm using <a href="http://www.zend.com/en/products/studio/" rel="nofollow noreferrer">Zend Studio</a> to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?</p>
<p>I have several helper apps to make my application run. It would be rea... | <p>I was able to get <a href="http://thenazg.blogspot.com/2008/12/remote-cli-debugging-via-eclipse-pdt.html" rel="nofollow noreferrer">remote CLI debugging working in Eclipse</a>, using xdebug, though I've not tried it with the zend debugger. I would assume this should work the same with ZSfE, if that's the "Zend Stud... | <p>Haven't tried, but you can set the QUERY_STRING environment variable to the one that toggles the Zend debugger on.</p>
<p>Per <a href="http://greg.chiaraquartet.net/archives/16-Incredible-Zend-ZDE-debugging-trick-for-debugging-CLI-apps.html" rel="nofollow noreferrer">this article</a>.</p>
<pre><code>export QUERY_S... | 4,489 |
<p>I need to know where i can get a free version of C and C++ compilers for Windows Vista. Many of the versions i have tried are not working in fullscreen mode.</p>
| <p>Please take a look at <a href="http://www.microsoft.com/express/" rel="noreferrer">visual studio 2008 express edition</a>.</p>
<p>It is a freeware IDE and compiler from Microsoft for C#, VB.Net, C++, SQL, and web. </p>
<p>The Express line is a lightweight version of Microsoft Visual Studio 2008 product.</p>
<p>I ... | <p>I would recommend trying out the on of thew Microsoft Visual Express packages. <a href="http://www.microsoft.com/express/" rel="nofollow noreferrer">http://www.microsoft.com/express/</a>.</p>
<p>I found them very good for trying things out especially for a single developer who is not too concerned about deployment ... | 14,654 |
<p>This is the XML I am creating in JavaScript:</p>
<pre><code><root>
<GradeValueSet>
<GradeValueSetMaster SetId="0" SetName="wrwr" SetComments="werwrwr" mode="add"/>
<DetailInfo>
<ChildInfo Name="This sfsf" Weightage="24"/>
<ChildInfo Name="45654" Weightage="67"/>
</Detai... | <p>you might want to try saving the data as plain text from the aspx page to ensure the ONLY the xml is coming through.</p>
<p>Depending on how you are sending the data to the page, there could be extra information which is not part of the xml. Saving the data as plain text just to test this will show exactly what dat... | <p>Sorry forgot to add the sending XML in previous post</p>
<p><root>
<GradeValueSet>
<GradeValueSetMaster SetId="0" SetName="wrwr" SetComments="werwrwr" mode="add"/>
<DetailInfo>
<ChildInfo Name="This sfsf" Weightage="24"/>
<ChildInfo Name="45654" Weightage="67"/>
</Detail... | 29,990 |
<p>I've been told that the java class TreeMap uses an implementation of a RB tree. If this is the case, how does one do an inorder, preorder and postorder tree-walk on a TreeMap?</p>
<p>Or is this not possible?</p>
| <p>You wouldn't be able to do this with the TreeMap implemented in the Collections library. Here's an implementation of a <a href="https://www.java-tips.org/java-se-tips-100019/24-java-lang/1904-red-black-tree-implementation-in-java.html" rel="nofollow noreferrer">Red-Black Tree</a> in Java that you can look at though... | <p>AFAIK the TreeSet/TreeMap classes don't actually expose any of their internals and merely conform to the Set/Map interface. The iterator is only guaranteed to go in an ascending order.</p>
<p>I am a little perplexed as to why you would want to scan these nodes in an inorder since the goal of these trees is not to r... | 43,610 |
<p>Is it any compilator option of flag?</p>
| <p>You can if you setup an external tool pointing to MsBuild to build the solution with the multiple process flag /m.</p>
<p>Scott Hanselman wrote a <a href="http://www.hanselman.com/blog/FasterBuildsWithMSBuildUsingParallelBuildsAndMulticoreCPUs.aspx" rel="noreferrer">nice post</a> on how to accomplish this, so I won... | <p>MSDN answers your question:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb383805.aspx" rel="nofollow noreferrer">Using Multiple Processors to Build Projects</a></p>
| 7,505 |
<p>Do you suggest <a href="http://www.mapstraction.com/" rel="nofollow noreferrer">Mapstraction</a> (library) as a layer to access Google maps? </p>
<p>Is it an actively maintained project? Do I stand to again/ lose anything by using this library apart from the primary reason that its provider independent?</p>
| <p>Have used this for a pretty major product, easy to use and extend.
Well recommended so that mapping product can be swapped out in the future if needs be.</p>
<p>Cheers,</p>
<p>Rob</p>
| <p>you might also look at <a href="http://openlayers.org/" rel="nofollow noreferrer">http://openlayers.org/</a></p>
| 22,572 |
<p>Does anyone have a definitive answer to whether <a href="http://msdn.microsoft.com/en-us/library/ms162557.aspx" rel="nofollow noreferrer">Sql Server Management Objects</a> is compatible with Sql Server 7.0?
The docs state:</p>
<blockquote>
<p>Because SMO is compatible with SQL Server version 7.0, SQL Server 2000,... | <p><em>you can use SMO to connect to SQL Server versions 7, 2000, and 2005, but SMO does not support databases set to compatibility levels 60, 65, and 70.</em></p>
<p>for SQL Server 7.0 the compatibility level is 70</p>
<p>Obviously this is conflicting information...I assume if your compatibility level of your DB is ... | <p>Sorry for the late answer... there is <a href="http://msdn.microsoft.com/en-us/library/ms162130(SQL.90).aspx" rel="nofollow noreferrer">partial support</a> for SQL 2000 and SQL 7</p>
| 5,349 |
<p>I would like to include some code coverage into our nightly build process. We're using CruiseControl, Ant, and Buckminster. Buckminster drives checkout from multiple repositories, and the PDE building and packaging of the product.</p>
<p><strong>Has any one any experience integrating code coverage into an RCP headl... | <p>Cobertura seemed to be able to do the job for us. </p>
<p>Once the unit tests were running (a question all to itself), I was able to:</p>
<ul>
<li>instrument the bundles as standalone Jars.</li>
<li>re-run the unit tests with a cobertura on the parent class loader class path. </li>
</ul>
<p>The trick here is to u... | <p>EclEmma now has a additional component called "EclEmma Equinox Runtime" that provides headless code coverage analysis for any OSGi/Equinox application:</p>
<p><a href="http://www.eclemma.org/devdoc/headless.html" rel="nofollow noreferrer">http://www.eclemma.org/devdoc/headless.html</a></p>
| 36,669 |
<p>I'm looking for libraries to:</p>
<ul>
<li>read and write meta data (for example ID3v2 tags in mp3 and all)</li>
<li>convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...</li>
<li>digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT... | <p>JLayer should do everything you need. It's not dead, it's just stable. The author finished it up quite a long time ago and the MP3 format has not seen much change since. You'll notice that his <a href="http://www.javazoom.net/mp3spi/mp3spi.html" rel="noreferrer">MP3SPI</a> codebase is a little more recent. What MP3S... | <p>You should try to looking into <a href="http://code.google.com/p/gstreamer-java/" rel="nofollow noreferrer">gstreamer-java</a>, I've had success with playing media via it and it should be possible to convert audio files with it. There is also <a href="http://jffmpeg.sourceforge.net/" rel="nofollow noreferrer">JFFMpe... | 11,157 |
<p>When starting a new project that required the use of membership providers I found that I could not connect to a remote database that contained the membership database.</p>
<p>I ran aspnet_regsql and was able to create the membership database on the remote server but when I go to ASPNET Configuration (cassini develo... | <p>After much searching I found that the default Membership Provider specified in machine.config (c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG) was always pointing to a SQL Server running on the localhost.</p>
<p>Instead of modifying machine.config there is a way to set it up in the projects web.config:</p>
<... | <p>Here is the solution:</p>
<p>step 1: Launch Visual Studio command prompt
Type: aspnet_regsql
Specify your server: if sqlexpress then server = hostname\sqlexpress
<strong><em>*</em>**<em>*</em>**<em>*</em>***</strong>*Use Windows Authentication</p>
<p>step 2: Copy this to web config.Dont specify username or passwo... | 44,965 |
<p><strong>In Oracle I can declare a reference cursor...</strong></p>
<pre><code>TYPE t_spool IS REF CURSOR RETURN spool%ROWTYPE;
</code></pre>
<p><strong>...and use it to pass a cursor as the return value...</strong></p>
<pre><code>FUNCTION end_spool
RETURN t_spool
AS
v_spool t_spool;
BEGIN
... | <p>Mysql has an implicit cursor that you can magically return from a stored procedure if you issue a select.</p>
<p>Here's an example:</p>
<pre><code>CREATE PROCEDURE `TEST`()
MODIFIES SQL DATA
BEGIN
SELECT * FROM test_table;
END;
</code></pre>
<p>and in your java code:</p>
<pre><code>String query = "{CALL TEST()... | <p>fill a temporary table in a procedure and just read the temporary table... :)</p>
| 34,510 |
<p>I have a simple query:</p>
<pre><code>SELECT u_name AS user_name FROM users WHERE user_name = "john";
</code></pre>
<p>I get <code>Unknown Column 'user_name' in where clause</code>. Can I not refer to <code>'user_name'</code> in other parts of the statement even after <code>select 'u_name as user_name'</code>?</p... | <p>SQL is evaluated backwards, from right to left. So the where clause is parsed and evaluate prior to the select clause. Because of this the aliasing of u_name to user_name has not yet occurred.</p>
| <p>I had the same problem, I found this useful.</p>
<pre><code>mysql_query("SELECT * FROM `users` WHERE `user_name`='$user'");
</code></pre>
<p>remember to put $user in ' ' single quotes.</p>
| 18,547 |
<p>I am developing a website that relies much on XML data. The web site has an interface where user can update data. The data provided by user will be updated to the respective XML file. However, the changes is not reflected until after 1 or 2 minutes.</p>
<p>Anyone knows how to force the browser to load the latest XM... | <p>You can add a random (or sequential) number to the url that you change with every update.</p>
| <p>Use "Pragma: no-cache" header in HTTP response.</p>
<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9" rel="nofollow noreferrer">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9</a></p>
| 10,978 |
<p>I've been creating snapins with the new MMC 3.0 classes and C#. I can't seem to find any examples of how to get rid of the "Console Root" node when creating the *.msc files. I looked through the examples in the SDK, but I can't seem to find anything for this.</p>
<p>I have seen other snapins that do what I want, bu... | <p>If I've understood you correctly, this isn't specific to MMC3, but it did take me a while to realise. Right-click on the node, and click <code>New Window from Here</code>. Then switch back to the Console Root window, and close it (Ctrl+F4).</p>
<p>Inside the .msc, it's //View/BookMark/@NodeID, which needs to be "... | <p>As far as I know, MMC always shows the Console Root. Even if you open it with no snap-in, you will still see the Console Root. Snap ins are only added under it, and several could be loaded at the same time and they would all be under the console root which is simply the root of the tree.</p>
| 14,931 |
<p>I have just upgraded our company's domain controller from NT 4.0 to Windows 2008 Server. I used the in-place upgrade path, going first from NT 4.0 to Windows 2003 Server and then 2003 Server to 2008 Server. The orginal NT 4.0 domain was name <em>Company</em>. The new domain is <em>Company</em>.local. I have confirme... | <p>The security warning is very likely a red herring. We can go into why it's coming up, but I'm more interested in talking about the script executing during logon first.</p>
<p>Logon to a client computer with a user account that should be executing the script and run the "Resultant Set of Policy" tool (from a blank M... | <p>I recently had the exact same issue. I did find that the script ran, but "invisible". there is a option on the GPO to run scripts "visibly" by going to "Administrative Templates", "System", "Scripts"</p>
| 35,823 |
<p>I'm getting an Exception while trying to insert a row in oracle table.
I'm using ojdbc5.jar for oracle 11
this is the sql i'm trying </p>
<pre><code>INSERT INTO rule_definitions(RULE_DEFINITION_SYS,rule_definition_type,
rule_name,rule_text,rule_comment,rule_message,rule_condition,rule_active,
rule_type,current_valu... | <p>In Oracle Metalink (Oracle's support site - Note ID 736273.1) I found that this is a bug in JDBC adapter (version 10.2.0.0.0 to 11.1.0.7.0) that when you call preparedStatement with more than 7 positional parameters then JDBC will throw this error.</p>
<p>If you have access to Oracle Metalink then one option is to ... | <p>Without seeing the code, the only thing I can think of is to check that each connection is being accessed in a thread safe manner. The Oracle drivers are usually pretty solid. The only time I've seen weird internal errors like that is when you've got more than one thread accessing the same connection instance and do... | 35,052 |
<p>I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is <a href="https://superniftyserver.com/lawson/portal" rel="noreferrer">https://superniftyserver.com/l... | <p>If you can't get an answer on the RewriteRule syntax, here are two other options for you: Write an custom iRule on BigIp (see <a href="http://devcentral.f5.com/" rel="noreferrer">F5 DevCentral</a>) that looks for 301 responses and convert them to SSL; let the URL pass into your WebSphere server and do a programmati... | <pre><code>LoadModule rewrite_module modules/mod_rewrite.so
</code></pre>
<p>make sure that line is somewhere in you httpd.conf file</p>
| 19,216 |
<p>I'd love to learn Cocoa, it seems like the best systems language for Mac OS X.</p>
<p>Can you recommend any useful ways to learn the language? Books, websites, example projects or even classes to take?</p>
| <p>Andy Matuschak has a great <a href="http://andymatuschak.org/articles/2007/09/09/getting-started-with-cocoa-a-friendlier-approach/" rel="noreferrer">blog post</a> that leads you through several good Cocoa tutorials, explaining why you are reading each one.</p>
<p><a href="http://www.cocoadevcentral.com/" rel="noref... | <p>Buy a book, open XCode, and <em>write</em>. Seriously, writing is <em>the best way</em> to learn Cocoa. In addition, I recommend <a href="https://rads.stackoverflow.com/amzn/click/com/0321213149" rel="nofollow noreferrer" rel="nofollow noreferrer">Cocoa Programming for Mac OS X</a>!</p>
| 9,342 |
<p>We have been given the directive to make sure that when we develop we are running out of the administrator and poweruser groups to prevent security holes. What are the steps to take to make this possible, but still be able to debug, code, and install when needed? </p>
<p>We develop ASP.NET as well as VB.NET appli... | <p>I have been developing a web application in a team of 5+ developers using ASP.NET 2.0 using Visual C# 2005 and Visual Web Developer 2005 for 6+ months. It was an internal application for our client and was targeted at Internet Explorer 6.0. I have been always using a non-administrator account on my machine and have ... | <p>Beware, there seems to be a lot of <a href="http://msdn.microsoft.com/en-us/vs2005/aa972193.aspx" rel="nofollow noreferrer">issues with running VS as non-admin</a>. </p>
| 15,657 |
<p>I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property b... | <p>I may have found a workaround for this.</p>
<p>My ToolStrip was placed directly on the TabPage, docked to Top. However, I found <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=117176&wa=wsignin1.0" rel="noreferrer">a thread on Microsoft Connect</a> that described the sa... | <p>Open the designer code and explicitly set the control's visible property to true.</p>
<p><strong><em>Nick Hanshaw</em></strong></p>
| 8,142 |
<p>I am working on a 2D scrolling game for iPhone. I have a large image background, say 480×6000 pixels, of only a part is visible (exactly one screen’s worth, 480×320 pixels). What is the best way to get such a background on the screen?</p>
<p>Currently I have the background split into several textures (to get around... | <p>That's the fast way of doing it. Things you can do to improve performance:</p>
<ul>
<li>Try different texture-formats. Presumably the SDK docs have details on the preferred format, and presumably smaller is better.</li>
<li>Cull out entirely offscreen tiles yourself</li>
<li>Split the image into smaller textures</l... | <p>The quick solution:</p>
<ul>
<li><p>Create a geometry matrix of tiles (quads preferably) so that there is at least one row/column of off-screen tiles on all sides of the viewable area.</p></li>
<li><p>Map textures to all those tiles.</p></li>
<li><p>As soon as one tile is outside the viewable area you can release t... | 26,771 |
<p>I have a contract in the offering from a client to develop an intranet application for capturing/manipulating/displaying a fairly complex set of marketing data. I've done this sort of thing before so the analysis, database etc. holds no issues for me, but the client would most likely prefer ASP.NET as they have som... | <p>Since you're an experienced coder, I would suggest simply diving in and you'll pick it up as you go. From your list of skills, it is most like Delphi (Event-Driven programming).</p>
<p><a href="http://www.codeproject.com" rel="nofollow noreferrer">http://www.codeproject.com</a> is very helpful and has many article... | <p><a href="http://www.asp.net/" rel="nofollow noreferrer">asp.net</a> is a great site with tons of resources and <a href="http://www.asp.net/learn/videos/#howdoi" rel="nofollow noreferrer">videos</a> for getting started. I'd download VS Express and start cranking through the videos.</p>
| 20,805 |
<p>Check it out: this little .NET Console Program yields interesting results...notice how I'm converting a float to an integer in two different ways:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CastVsConvert
{
class Program
{
static vo... | <p>Its not a bug, <code>cast</code> truncates, <code>convert</code> rounds.</p>
<p>See <a href="https://stackoverflow.com/questions/104063/systemconverttoint-vs-int">this</a></p>
| <p>There's an extra, hidden cast that's probably causing this. For example, if you use this instead of a recalculation:</p>
<pre><code>int newWidthConvert = Convert.ToInt32(newWidth);
</code></pre>
<p>You'll get the same result. What's happening becomes more clear when you use Reflector to peek at <code>Convert.ToI... | 32,480 |
<p>NHibernate is not really a good fit for our environment due to all the dependencies. (Castle, log4net etc.)</p>
<p>Is there a good lightweight alternative?</p>
<p>Support for simple file based databases such as Access/SQLite/VistaDB is essential.</p>
<p>Ideally, something contained in a single assembly that only ... | <p>Massive - <a href="https://github.com/robconery/massive" rel="noreferrer">https://github.com/robconery/massive</a></p>
<p>or </p>
<p>PetaPoco - <a href="https://github.com/toptensoftware/petapoco" rel="noreferrer">https://github.com/toptensoftware/petapoco</a> </p>
<p>Both are a single .cs file with no dependenci... | <p>LINQ to SQL could be good alternative to "heave" ORM systems if you'll use it properly.</p>
| 11,591 |
<p>I am trying to install the ibm_db gem so that I can access DB2 from Ruby. When I try:</p>
<pre><code>sudo gem install ibm_db
</code></pre>
<p>I get the following request for clarification:</p>
<pre>
Select which gem to install for your platform (i486-linux)
1. ibm_db 0.10.0 (ruby)
2. ibm_db 0.10.0 (mswin32)
3... | <p>You can use a 'here document'. That is:</p>
<pre><code>sudo gem install ibm_db <<heredoc
1
heredoc
</code></pre>
<p>What's between the \<\<\SOMETHING and SOMETHING gets inputted as entry to the previous command (somewhat like ruby's own heredocuments). The 1 there alone, of course, is the selection o... | <p>@<a href="https://stackoverflow.com/questions/103918/automate-a-ruby-gem-install-that-has-input#104102">John Topley</a></p>
<p>I already tried gem help install, and --platform is not an option, both in help and in practice:</p>
<pre>
$ sudo gem install ibm_db --platform ruby
ERROR: While executing gem ... (Option... | 12,951 |
<p>How do you plot bar charts in gnuplot with text labels?</p>
| <p>Simple bar graph:</p>
<p><img src="https://i.stack.imgur.com/xsRfu.png" alt="bar graph"></p>
<pre><code>set boxwidth 0.5
set style fill solid
plot "data.dat" using 1:3:xtic(2) with boxes
</code></pre>
<p>data.dat:</p>
<pre><code>0 label 100
1 label2 450
2 "bar label" 75
</code></pre>
<p><strong>If yo... | <p>You can directly use the style histograms provide by gnuplot. This is an example if you have two file in output:</p>
<pre><code>set style data histograms
set style fill solid
set boxwidth 0.5
plot "file1.dat" using 5 title "Total1" lt rgb "#406090",\
"file2.dat" using 5 title "Total2" lt rgb "#40FF00"
</co... | 42,454 |
<p>I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production.</p>
<p>In one <a href="https://blog.stackoverflow.com/2008/06/podcast-8/">podcast</a> Joel said that he had some problems with MySQL and the data wasn't con... | <p><strong>A note to future readers:</strong> The text below was last edited in August 2008. That's nearly 11 years ago as of this edit. Software can change rapidly from version to version, so before you go choosing a DBMS based on the advice below, do some research to see if it's still accurate.
Check for newer answer... | <p>MySQL is a <a href="http://en.wikipedia.org/wiki/Relational_database_management_system" rel="nofollow noreferrer">relational database management system</a> while PostgreSQL is an <a href="http://en.wikipedia.org/wiki/Object-relational_database_management_system" rel="nofollow noreferrer"><strong>object</strong>-rela... | 4,703 |
<p>I'm writing an application that monitors a directory for new input files by polling the directory every few seconds. New files may often be several megabytes, and so take some time to fully arrive in the input directory (eg: on copy from a remote share).</p>
<p>Is there a simple way to detect whether a file is curr... | <p>The safest method is to have the application(s) that put files in the directory first put them in a different, temporary directory, and then move them to the real one (which should be an atomic operation even when using FTP or file shares). You could also use naming conventions to achieve the same result within one ... | <p>What is your OS. In unix you can use the "lsof" utility to determine if a user has the file open for write. Apparently somewhere in the MS Windows Process Explorer there is the same functionality.</p>
<p>Alternativly you could just try an exclusive open on the file and bail out of this fails. But this can be a litt... | 44,655 |
<p>i am trying to compile this very simple piece of code</p>
<pre><code>class myList
{
public:
std::vector<std::string> vec;
class Items
{
public:
void Add(std::string str)
{
myList::vec.push_back(str);
};
}items;
};
int main()
{
myList newList;
ne... | <p>Add a couple of constructors and a pointer to the parent class.</p>
<pre><code>#include <string>
#include <vector>
class myList
{
public:
std::vector<std::string> vec;
myList(): items(this) {} // Added
class Items
{
public:
Items(myList *ml): self(ml) {} // Added
... | <p>You can simplify this by the following construct:</p>
<pre><code>typedef std::vector<std::string> myList;
</code></pre>
<p>Really why don't you use the STL vector directly?
This way you get all the standard algorithms work with the
data.</p>
| 29,330 |
<p>I do not want TortoiseSVN to alert me with sounds - e.g. when it fails to update.</p>
<p>How do I turn off sounds in TortoiseSVN?</p>
| <p>Right click > TortoiseSVN > Settings > System Sounds..</p>
<p>Scroll down to the bottom.</p>
| <p>You can do this from the Sounds panel in Control Panel.</p>
| 5,502 |
<p>Although a DataTable is a memory hog, wouldn't a DataTable be the best choice to implement and IdentityMap if the set of objects is very large since retrieval time is O(1)?</p>
<p><strong>Update</strong></p>
<p>If I decide to use IDictionary, do I sacrifice speed when retrieving my objects?</p>
| <p>Any of <code>Dictionary<,></code>, <code>SortedList<,></code> or <code>SortedDictionary<,></code> would be obvious choices - but note tha sorting becomes an issue here... <code>Dictionary<,></code> doesn't guarantee any particular order; the other two order by the keys rather than insertion o... | <p>I'd be more inclined to use a custom class backed by a Dictionary<T,T> than a DataTable. Presumably this would be built on top of a data access layer that could use LINQ or DataTables, etc. to access the relational data, but if the object is available in the custom map, you would at least avoid having to reco... | 34,776 |
<p>We happily use SVN for SCM at work. Currently I've got our binary assets in the same SVN repository as our code. SVN supports very large files (it transmits them 'streamily' to keep memory usage sane), but it makes everything SLOOWWWWW. I'm ok with slow asset versioning, but slow text operations isn't really acce... | <p>You didn't say what optimizations you use already. If you are using bsdfs, see whether switching to fsfs improves performance. If you have a large number of revisions, switch to a more recent version on the server, and convert the repository to the 1.5 format.</p>
| <p>probably the best answer you're going to get is to put your binary files into a separate directory and use the Spare Directory features to manage them - ie do not check out the files until you need them. Then all operations will occur on the source files and not the binaries.</p>
<p>Alternatively, you can use the s... | 34,674 |
<p>I would like to filter an array of items by using the <code>map()</code> function. Here is a code snippet:</p>
<pre><code>var filteredItems = items.map(function(item)
{
if( ...some condition... )
{
return item;
}
});
</code></pre>
<p>The problem is that filtered out items still uses space in th... | <p>You should use the <code>filter</code> method rather than map unless you want to mutate the items in the array, in addition to filtering.</p>
<p>eg.</p>
<pre><code>var filteredItems = items.filter(function(item)
{
return ...some condition...;
});
</code></pre>
<p>[Edit: Of course you could always do <code>sou... | <p>following statement cleans object using map function.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var arraytoclean = [{v:65, toberemoved:"gronf"}, {v:12, toberemoved:n... | 3,070 |
<p>Want my FireFox at work to be in sync with my FireFox at my home. Is there a way to simply export all extensions and settings?</p>
| <p>Try <a href="http://mozbackup.jasnapaka.com/" rel="nofollow noreferrer">MozBackup</a> </p>
| <p>Since extensions are stored in your profile, you could just make a copy of it to a Flash drive or something.</p>
| 24,084 |
<p>I have a time represented as the number of seconds elapsed since midnight, January 1, 1970, UTC (the results of an earlier call to time()). How do I add one day to this time?</p>
<p>Adding 24 * 60 * 60 works in most cases, but fails if the daylight saving time comes on or off in between. In other words, I mostly wa... | <p>use <em>gmtime()</em> to convert the <i>time_t</i> to a <em>struct tm</em></p>
<p>add one to the day (<i>tm_mday</i>)</p>
<p>use <em>mktime()</em> to convert the <em>struct tm</em> back to a <i>time_t</i></p>
<p>see <a href="http://www.cplusplus.com/reference/clibrary/ctime/" rel="noreferrer">time.h</a> for more ... | <p>I always had the best result with keeping the timestamps UTC and convert them to the specified timezone (including daylight saving) when you want to display the values. </p>
<p>This saves a lot of hassle like this (and makes your program independent of time zones.</p>
| 39,987 |
<p>I've been thinking a lot lately about a music-oriented project I'd like to work on. Kind of like a game... kind of like a studio workstation (FL Studio, Reason).</p>
<p>I guess the best way to describe it would be: like "Guitar Hero", but with no canned tracks. All original music--composed by you, on the fly--but t... | <p>Have you checked out <a href="http://www.jfugue.org/" rel="noreferrer">JFugue</a>? It's an "open-source Java API for programming music without the complexities of MIDI".</p>
<p><strong>Additional information:</strong> Found a couple of other resources referenced in the <a href="http://www.jfugue.org/jfugue-chapter1... | <p><a href="http://code.compartmental.net/tools/minim/" rel="nofollow">minim</a> isn't exactly a java synth, but it is a processing lib and I imagine that it should be pretty easy to use with vanilla java too.</p>
| 17,330 |
<p>For a system I need to convert a pointer to a long then the long back to the pointer type. As you can guess this is very unsafe. What I wanted to do is use dynamic_cast to do the conversion so if I mixed them I'll get a null pointer. This page says <a href="http://publib.boulder.ibm.com/infocenter/lnxpcomp/v7v91/ind... | <p><code>dynamic_cast</code> can be used only between classes related through inheritance. For converting a pointer to long or vice-versa, you can use <code>reinterpret_cast</code>. To check whether the pointer is null, you can <code>assert(ptr != 0)</code>. However, it is usually not advisable to use <code>reinterpret... | <p>As soon as you decided to cast a pointer to a long, you threw type safety to the wind.</p>
<p>dynamic_cast is used to cast up & down a derivation tree. That is, from a base class pointer to a derived class pointer. If you have:</p>
<pre><code>class Base
{
};
class Foo : public Base
{
};
class Bar : public... | 40,090 |
<p>When I try to create a Excel or Word workbook project in VS, I get the message: </p>
<blockquote>
<p>A compatible version of Microsoft
Office is not installed on this
computer. You must install the
version of Office that is compatible
with your project. In addition,
repair the version of the Visual
... | <p>Office 2k3 Standard is not compatible with VSTO; upgrading from 2k3 standard has likely left something in your registry. </p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/3f12200d-f685-4bc9-bff0-d380067f515a" rel="nofollow noreferrer">This thread</a> suggests that even moving to 2k7 doesn'... | <p>I was also having the same prob but I installed office2003 sp3 and now its working fine</p>
| 49,982 |
<p>I've been looking into <a href="http://www.osgi.org/Main/HomePage" rel="noreferrer">OSGi</a> recently and think it looks like a really good idea for modular Java apps.</p>
<p>However, I was wondering how OSGi would work in a web application, where you don't just have code to worry about - also HTML, images, CSS, th... | <p>You are very right in thinking there are synergies here, we have a modular web app where the app itself is assembled automatically from independent components (OSGi bundles) where each bundle contributes its own pages, resources, css and optionally javascript.</p>
<p>We don't use JSF (Spring MVC here) so I can't co... | <p>Have a look at RAP! <a href="http://www.eclipse.org/rap/" rel="nofollow noreferrer">http://www.eclipse.org/rap/</a></p>
| 15,330 |
<p>Given a FieldInfo object and an object, I need to get the actual bytes representation of the field. I know that the field is either <code>int,Int32,uint,short</code> etc.</p>
<p>How can I get the actual byte representation? BinaryFormatter.Serialize won't help, since it'll give me more information than I need (it a... | <p>Use BitConverter.GetBytes()</p>
<p>You'll first have to convert the value to it's native type, than use BitConverter to get the bytes:</p>
<pre><code>byte[] Bytes;
if (valType == typeof(int))
{
int intVal = (int) GetFieldValue(....);
Bytes = BitConverter.GetBytes(intVval);
}
else if (valType == typeof(lo... | <p>Do you mean the definitive in-memory representation? BitConverter.GetBytes (with an overload suitably chosen by reflection) will return you <em>a</em> byte representation, but not necessarily what it is currently in memory.</p>
<p>Perhaps if you give more information about why you want this, we'll be better able to... | 27,904 |
<p><strong>UPDATE</strong> </p>
<p>I have combined various answers from here into a 'definitive' answer on a <a href="https://stackoverflow.com/questions/1747235/weak-event-handler-model-for-use-with-lambdas/1747236#1747236">new question</a>.</p>
<p><strong>Original question</strong></p>
<p>In my code I have an even... | <p>I know that this question is ancient, but hell - I found it, and I figure that others might as well. I'm trying to resolve a related issue, and might have some insight. </p>
<p>You mentioned Dustin Campbell's WeakEventHandler - it indeed cannot work with anonymous methods by design. I was trying to fiddle something... | <p>Building further on <a href="https://stackoverflow.com/questions/371109/garbage-collection-when-using-anonymous-delegates-for-event-handling/1447619#1447619">Egor's</a> answer, I wanted to try and build a version where I didn't have to determine in advance <em>which</em> event I want to attach to.</p>
<p>I've only ... | 48,496 |
<p>I have 3 projects in my solution that I want to deploy. Is there a nice and quick way of using Visual Studio's setup projects to deploy all three apps using one MSI and letting the user decide which apps he wants to install during the install process? </p>
<p>I have setup projects for the 3 individual apps, I al... | <p>OK, this is what I ended up doing. I build my three MSI and then a small splash screen app that gives a checkbox for each app. When the user clicks install on that splash screen it calls msiexec using the /qb- option to present a minimized install on all the selected applications in sequence.</p>
<p>I then use SF... | <p>I think you want to use the Windows Installer conditions. They are explained in this <a href="http://msdn.microsoft.com/en-us/library/k3bb4tfd%28vs.80%29.aspx" rel="nofollow">Walkthrough on MSDN.</a> Go down to the section labeled: To add the samples to the installer</p>
| 26,988 |
<p>Is it possible to create Eclipse plugins that auto-discover eachother?</p>
<p>I am developing a set of plugins that need to operate in two primary situations:</p>
<ul>
<li>individually</li>
<li>in concert with each other.</li>
</ul>
<p>When run individually, the plugins should "just work" but when in concert, the... | <p>The answer should be through <a href="http://www.infoq.com/news/2008/01/eclipse-osgi-comparison" rel="nofollow noreferrer">Declarative Service</a>, which combines the advantages of both eclipse xml extensions and osgi POJO services. Something that is implicitly dynamic like osgi services, but loaded “on demand” like... | <p>Well, the OSGI Service Registry can accomplish the sharing of pojo based services at runtime, not the plugins themselves. There are several options to facilitate this, such as coding directly to the OSGI API, Declarative Services, Spring DM and iPojo (I am sure there are others as well).</p>
<p>You may want to che... | 26,224 |
<p>in my application (c# 3.5) there are various processes accessing a single xml file (read and write) very frequently. the code accessing the file is placed in an assembly referenced by quite a couple of other applications. for example a windows service might instanciate the MyFileReaderWriter class (locatied in the p... | <p>To start with, make sure that all access to the XML Document is done through a single instance.</p>
<p>Then put a lock mechanism (that wait for unlock) at the beginning of the function that access it and unlock it at the end.</p>
| <p>What do you mean the data is critical? Is the XML file not exclusively used by your application?</p>
<p>As simple (and maybe good enough) way to lock IO access to the file would be to create a static factory class that provides a "read write token" object that each I/O operation would have to have a lock on.</p>
<... | 28,402 |
<p>I understand that by simply adding a script to the end of the body tag of a html document one makes it processable by Google analytics. My question is, is this likely to have much effect on performance (download time and server load)? Let's assume a static page of say 100k served by IIS. Thanks.</p>
| <p><a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55621" rel="nofollow noreferrer">Will my website's appearance or performance be affected by Google Analytics?</a></p>
<blockquote>
<p>The appearance of your website will
never be affected by your use of
Google Analytics - we don't... | <p>Personally I really can't see that there would be much of a difference at all, your browser would cache it after the first request and use it there after on each other page.</p>
<p>The script is loaded at the very bottom of the page as well so everything else should already be loaded.</p>
| 48,920 |
<p>I have an ASP.NET web application which does the following:</p>
<ol>
<li>Reads an Excel file.</li>
<li>The excel file will have an image URL located in it that points to somewhere on the internet.</li>
<li>The program reads each image URL and store it into a temporary folder in the web server.</li>
<li>The applicat... | <p>Try setting the access permissions to "Full control" for the .Net user from where you are reading/saving the files.</p>
| <p>the error is pretty obvious there Access to the path 'bin\myprojname.pdb\' is denied. the user the web console process is running under (not the user you created in the webconsole, the actual windows user), most likely "Network Service" doesnt have permissions to that folder.</p>
<p>You can either - Right click on ... | 43,240 |
<p>I'm connecting to an AS/400 stored procedure layer using the IBM iSeries Access for Windows package. This provides a .NET DLL with classes similar to those in the <code>System.Data</code> namespace. As such we use their implementation of the connection class and provide it with a connection string.</p>
<p>Does anyo... | <p>Snippet from some Delphi source code using the Client Access Express Driver. Probably not exactly what you are looking for, but it may help others that stumble upon this post. <strong>The <code>DBQ</code> part is the default library, and the <code>System</code> part is the AS400/DB2 host name.</strong></p>
<pre><co... | <p>Are you using the Catalog Library List parameter for OLE DB? This is what my connection string typically looks like:</p>
<pre><code><add name="AS400ConnectionString" connectionString="Data Source=DEVL820;Initial Catalog=Q1A_DATABASE_SRVR;Persist Security Info=False;User ID=BLAH;Password=BLAHBLAH;Provider=IBMDASQ... | 10,988 |
<p>On my Ender 3 v2 printer I recently and consistently get some knocking.
This happens in only two scenarios.</p>
<p>First, it now occurs all the time when printing the initial test strip gets near the top (high Y value), and knocks several times.</p>
<p>Secondly, it occurs if the model (sliced with Cura) has a high Y... | <p>Embarassingly, I discovered that the cable to the heatbed was sometimes caught between the on/off switch and the adjacent power plug. So, for high Y values the cable was very tight and the bed could not be moved. Presumably the "knocking" came from the Y-axis motor. The problem was fixed by attaching this ... | <p>Your bed has become unleveled or skewed in Y direction.</p>
<p>When the nozzle is closer to the bed the extruder has to push harder to get the same filament flow through a smaller space, the stresses the extruder to a point that the stepper skips or grinds the filament. This is generally described as a knocking soun... | 2,186 |
<p>How do I split a list of arbitrary length into equal sized chunks?</p>
<hr />
<p><sub>See <a href="https://stackoverflow.com/q/434287">How to iterate over a list in chunks</a> if the data result will be used directly for a loop, and does not need to be stored.</sub></p>
<p><sub>For the same question with a string in... | <p>Here's a generator that yields evenly-sized chunks:</p>
<pre><code>def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
</code></pre>
<pre><code>import pprint
pprint.pprint(list(chunks(range(10, 75), 10)))... | <p>using List Comprehensions of python</p>
<pre><code>[range(t,t+10) for t in range(1,1000,10)]
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
[11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
[21, 22, 23, 24, 25, 26, 27, 28, 29, 30],....
....[981, 982, 983, 984, 985, 986, 987, 988, 989, 990],
[991, 992, 993, 994, 995, 996, 997, 998,... | 40,269 |
<p>I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like
PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit (<a href="http://en.wikipedia.org/wiki/DESede" rel="no... | <p>Use <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" rel="nofollow noreferrer">Advanced Encryption Standard</a> (AES). It supports Key lengths of 128, 192, or 256 bits.</p>
<p>The <a href="http://www.hoozi.com/Articles/AESEncryption.htm" rel="nofollow noreferrer">algorithm</a> is simple. The Sun ... | <p>I'm not a crypto expert by any means (so take this suggestion with a grain of salt), but I have used <a href="http://en.wikipedia.org/wiki/Blowfish_(cipher)" rel="nofollow noreferrer">Blowfish</a> before, and I think you can use it for what you need. There is also a newer algorithm by the same guy called <a href="h... | 7,171 |
<p>Does VbScript have a native implementation for Regex? I need to validate e-mail addresses on an old ASP application.</p>
<p>Any pointers would be great.</p>
| <p>This example is by AlexCuse from <a href="http://wiki.lessthandot.com/index.php/Using_Regular_Expressions_For_Pattern_Matching_in_Access" rel="nofollow noreferrer">LessThanDot</a></p>
<pre><code>Function ValidEmail(ByVal emailAddress)
'this function will use regular expressions to check an '
'email address for va... | <p>Like other said, yes. I just wanted to put you at the devguru <a href="http://www.devguru.com/Technologies/vbscript/quickref/vbscript_list.html" rel="nofollow noreferrer">vbscript</a> docs, I find they tend to be the good place to get quick vbscript answers. This is there section on the <a href="http://www.devguru... | 47,142 |
<p>I have an asp:calendar on my view page and as I hover over it..it shows a javascript postback status bar. but I have an asp:button also on the same page and when I hover over it. The action from the controller is in the status bar..because I have an onClick attribute for the button that triggers an action on the se... | <p>The ASP.NET Server Side controls aren't really meant to play well with MVC. The Server Side controls combine the View and the Controller in one package, whereas MVC Seperates them.</p>
<p>The other reason the Calendar control won't work is that it relies on the postback model, which doesn't work in MVC.</p>
<p>I w... | <p>You could try <a href="http://basecalendar.codeplex.com/" rel="nofollow noreferrer">BaseCalendar</a>, it doesn't rely on or use postbacks. </p>
| 46,615 |
<p>Visual Studio seems to be modifying a list of .vsmdi files in my .sln <strike>every time</strike> sometimes when I run a unit test. This is annoying because my source control client thinks the .sln file needs to be checked in even though I don't want to check it in. Is there any way to keep Visual Studio from mungin... | <p>I don't believe a solution exists. A good Connect case, that does a better job of documenting the issue and a repro case, is <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=350583" rel="nofollow noreferrer">this one</a>. At the very bottom of the page a commenter proposes a ... | <p>Edit: Oops, was confused about the "list of vsmdi files" thing. Suggestion wouldn't have worked.</p>
| 19,358 |
<p>I've been tasked with redesigning part of a ms-sql database structure which currently involves a lot of views, some of which contain joins to other views. </p>
<p>Anyway, I wonder if anyone here could recommend a utility to automatically generate diagrams to help me visualise the whole structure.</p>
<p>What's the... | <p>I am a big fan of Embarcadero's <a href="http://www.embarcadero.com/products/er-studio" rel="nofollow noreferrer">ER/Studio</a>. It is very powerful and produces excellent on-screen as well as printed results. They have a free trial as well, so you should be able to get in and give it a shot without too much strif... | <p>If you are talking about MS SQL Server tables, I like the diagram support in SQL Server Management Studio. You just drag the tables from the explorer onto the canvas, and they are laid out for you along with lines for relationships. You'll have to do some adjusting by hand for the best looking diagrams, but it is ... | 2,611 |
<p>Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input.</p>
| <p>Some differences:</p>
<ul>
<li>CLR (.NET) stored procedures</li>
<li>SSIS instead of DTS</li>
<li>Management Studio instead of Enterprise Manager, with more functions (2008 version is even better)</li>
<li>VS integration</li>
<li>better replication</li>
<li>SMO and AMO (extensions to handle the server from applicat... | <p>It depends if you're talking about just the DB engine or the product as a whole. SQL Server 2000 didn't have anything like Analysis services and Reporting services. As for the DB engine - if you use it for a simple application, I don't think you should bother. Also, I think the SQL Express edition introduced in 2005... | 11,626 |
<p>I'd like to create a hotkey to search for files <strong>under a specific folder</strong> in Windows XP; I'm using AutoHotkey to create this shortcut.</p>
<p>Problem is that I need to know a command-line statement to run in order to open the standard Windows "Find Files/Folders" dialog. I've googled for a while and ... | <h2>Use <a href="http://www.locate32.net/" rel="noreferrer">Locate32</a></h2>
<p>This isn't the exact answer to your question, but you could use <a href="http://www.locate32.net/" rel="noreferrer"><strong>Locate32</strong></a> instead of the Windows search facility. It has a whole suite of command-line options plus ha... | <p>Why don't you try bashing F3? :)</p>
| 12,101 |
<p>What are some resources that will help get me up and running quickly with the Excel interop in C#?</p>
| <p>The article <a href="http://msdn.microsoft.com/en-us/library/aa537184(office.11).aspx" rel="noreferrer">Understanding the Excel Object Model from a Visual Studio 2005 Developer's Perspective</a> by Ken Getz covers the Excel object model in detail. Code examples are in both VB.NET and C#.</p>
<p>Some important cavea... | <p>MSDN has a wealth of information...</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx</a></p>
| 21,178 |
<p>I think it's associating my Web Service's CS files with the related ASMX files. But whatever's happening, I can't double-click to open the CS files - I have to "view Code" or it opens in the designer. </p>
<p>Anyone know how to turn off this automatic behavior? I just want to edit the code!</p>
| <p>Try right-clicking, select "Open with...", mark "CSharp Editor" and select "Set as Default".</p>
<p>That works for avoiding the WinForms Designer.</p>
| <p>In the Solution Explorer view, click the "Show All Files" icon. This will put "+" symbol next to each of your files. Click the + and it will expand to show the .CS file which holds the ASMX's code. At this point, double click that file instead.</p>
| 10,476 |
<p>I have an application that I want to export high-resolution (or rather, high pixel density?) images for printing - for example, I want images that print at 250 dots per inch (DPI), instead of the default, which I understand to be 72 DPI.</p>
<p>I'm using a BufferedImage with a Graphics2D object to draw the image, t... | <p>Kurt's answer showed the way, still it took me quite some time to get it run, so here is the code that sets DPI when saving a PNG. There is a lot to do to get the proper writers and such...</p>
<pre><code> private BufferedImage gridImage;
...
private void saveGridImage(File output) throws IOException {
outpu... | <p>i am using this code for tiff file in my project and it works well..</p>
<pre><code>import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Li... | 41,645 |
<p>I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful?</p>
| <p>A functor is pretty much just a class which defines the operator(). That lets you create objects which "look like" a function:</p>
<pre><code>// this is a functor
struct add_x {
add_x(int val) : x(val) {} // Constructor
int operator()(int y) const { return x + y; }
private:
int x;
};
// Now you can use it ... | <p>To add on, I have used function objects to fit an existing legacy method to the command pattern; (only place where the beauty of OO paradigm true OCP I felt ); Also adding here the related function adapter pattern.</p>
<p>Suppose your method has the signature:</p>
<pre><code>int CTask::ThreeParameterTask(int par1, i... | 46,549 |
<p>I'm about to deal with managing and running my first Internet connected Apache webserver and I was wondering if there are any sys admins and developers out there that would like to share some of their knowledge regarding security and optimization tips for running Apache webserver.</p>
<p>Maybe you can share your to... | <h2>Basic</h2>
<ol>
<li><strong>Be sure to have the latest stable version installed</strong>. Running old or unstable version of Apache could expose your system to security flaws or untested solutions</li>
<li><strong>Be sure only the intended requests are actually processed</strong>. You should consider <em>who</em> h... | <p>If you're running a standard LAMP (Linux, Apache, MySQL, PHP/PEARL/PYTHON) environment: Put MySQL on another machine than Apache. Will be a little slower with only a few concurrent processes (due to network latency), but will be MUCH faster with many concurrent processes.</p>
| 20,646 |
<p>I'm looking for ideas and opinions here, not a "real answer", I guess...</p>
<p>Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and all was bliss...</p>
<p>Now, in .Net (at least for... | <p>No, there's no direct equivalent, but if you're using v3.5 of the Framework, you can add this functionality quite easily using an extension method. For example:</p>
<pre><code>Imports System.Runtime.CompilerServices
Public Module Extensions
<Extension()> _
Public Sub SetTag(ByVal ctl As Control, ByVal ta... | <p>You can use asp:Hidden controls to store data between posts. Like will says, there's no sense to have a tag property if you lose it's value.</p>
| 22,133 |
<p>We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit</p>
<p>So now we'll need to translate all European characters to the near... | <p>The <a href="http://billposer.org/Software/uni2ascii.html" rel="noreferrer">uni2ascii</a> program is written in C, but you could probably convert it to Java with little effort. It contains a large table of approximations (implicitly, in the switch-case statements).</p>
<p>Be aware that there are no universally acce... | <p>This is what seems to work:</p>
<pre><code>private synchronized static String utftoasci(String s){
final StringBuffer sb = new StringBuffer( s.length() * 2 );
final StringCharacterIterator iterator = new StringCharacterIterator( s );
char ch = iterator.current();
while( ch != StringCharacterIterator.DONE... | 36,205 |
<p>In earlier versions of MS-DOS - I want to say version 7, but I could be wrong - there was a <code>deltree</code> command, which recursively deleted all subdirectories and files from a given path. </p>
<p><code>deltree</code> no longer exists, but <code>del</code> didn't seem to inherit the ability to delete a tree... | <p>As others have mentioned, the <code>rd</code> command has the <code>/s</code> switch to recursively remove sub-directories. You can combine it with the <code>/q</code> switch to forcibly delete a sub-directory (and its contents) without prompting as so</p>
<pre><code>rd /s /q c:\foobar
</code></pre>
<p>What everyb... | <p>Use this:</p>
<pre><code>cd (your directory here)
del *.* /f /s /q
</code></pre>
| 44,002 |
<p>I would like a "system" that monitors a process and would kill said process if:</p>
<ul>
<li>the process exceeds some memory requirements</li>
<li>the process does not respond to a message from the "system" in some period of time</li>
</ul>
<p>I assume this "system" could be something as simple as a monitoring pro... | <p>For the first requirement, you might want to look into either using <code>ulimit</code>, or tweaking the kernel OOM-killer settings on your system.</p>
<p>Monitoring daemons exist for this sort of thing as well. <a href="http://god.rubyforge.org/" rel="noreferrer">God</a> is a recent example.</p>
| <p>Are the monitored processes ones you're writing, or just any process?</p>
<p>If they're arbitrary processes then it might be hard to monitor for responsiveness. Unless the process is already set up to handle and respond to events that you can send it, then I doubt you'll be able to monitor them. If they're proces... | 22,758 |
<p>I'm working on a Facebook FBML controls library and would like to create my FBML controls somewhat patterned like the ASP.NET WebControls library. I have a base class that handles rendering by default; here's my render method:</p>
<pre><code>
protected override void Render(HtmlTextWriter writer)
{
... | <p>This should get you going - it will render as <code><fb:name uid="00101010101"/></code>. You could also override the RenderBeginTag, RenderContents, RenderEndTag. Depending on what you are doing there may be some other things going on in RenderControl that you need. You could also look into using a ControlAdap... | <p>if you use Visual studio go by these steps:</p>
<blockquote>
<p>Tools ---> Options ---> Text Editor ---> HTML ----> Formatting --->
remove Auto insert close tag</p>
</blockquote>
| 33,476 |
<p>I have tree tables, Customer, Invoice and InvoiceRow with the standard relations. </p>
<p>These I have to export in one fixed field length file with the first two characters of each row identifying the row type. The row types have different specifications.</p>
<p>I could probably do it with a nested loop in a scri... | <p>Your gut feeling on doing this using a Script Destination component is correct. Unfortunately, this scenario doesn't jive with SSIS well. I don't consider this a beginner package. If you must use SSIS then I'd start by inner joining all the data so there is one row for each InvoiceRow, containing the data needed ... | <p>Process your three tables so that the outputs are all appropriate for your output file (including the row type designator). You'll have to do this in three separate flow paths in your data flow, then bring the rows together in a Union All data flow element. From there, process them as needed to create your output fi... | 26,232 |
<p>Database? Page variables? Enum?</p>
<p>I'm looking for opinions here. </p>
| <p>The ASP.NET Sitemap feature is built for that and works well in a lot of cases. If you get in a spot where you want your <a href="http://weblogs.asp.net/jgalloway/archive/2008/01/26/asp-net-menu-and-sitemap-security-trimming-plus-a-trick-for-when-your-menu-and-security-don-t-match-up.aspx" rel="nofollow noreferrer">... | <p>IF the menu is dynamic <em>per-user</em> then you'll have to hit the database for each user. From then on I would probably store it in session to avoid future round-trips to the database.</p>
<p>If it's dynamic, but the entire site sees the same items, then put it in the database and cache the results</p>
| 7,772 |
<p>I'm dynamically generating an asp form, and I would like to add the <strong>label</strong> and <strong>input</strong> elements inside a list.</p>
<p>For example, I would like to end up with something like:</p>
<pre><code><ul>
<li><label for="input"/><input id=input"/></li>
</ul>... | <p>The System.Web.UI.HtmlControls namespace has some useful controls.</p>
<p>In your aspx:</p>
<pre><code><asp:PlaceHolder ID="PlaceHolder1" runat="server" />
</code></pre>
<p>In your code behind:</p>
<pre><code>HtmlGenericControl list = new HtmlGenericControl("ul");
for (int i = 0; i < 10; i++)
{
Html... | <p>You could probably do something like this using a Repeater. </p>
<pre><code><asp:Repeater ID="rpt" runat="server">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li>
<label for='<%# string.Format("ctrl-{0}", Container.ItemIn... | 32,321 |
<p>In spring you can initialize a bean by having the applicationContext.xml invoke a constructor, or you can set properties on the bean. What are the trade offs between the two approaches? Is it better to have a constructor (which enforces the contract of having everything it needs in one method) or is it better to h... | <p>I'm not sure there is a "best" way to initialize a bean. I think there are pros and cons to each, and depending on the situation, one or the other might be appropriate. This certainly isn't an exhaustive list, but here are some things to consider.</p>
<p>Using a constructor allows you to have an immutable bean. ... | <p>The tradeoffs:</p>
<p>Constructor:
Benefits:
Can be very simple, esp. with three or less properties to initialize.
One-shot, no/minimal extra configuration to worry about.</p>
<p>Drawbacks:
Multiple constructors must be created for several situations
Constructors aren't inherited, so classes must call super() and ... | 25,909 |
<p>My boss asked me to setup a <a href="http://en.wikipedia.org/wiki/Apache_Subversion" rel="nofollow noreferrer">Subversion</a> server for him to use so that he can share all his documents across different machines in sync and still be able to access them when there is no Internet connection.</p>
<p>I have this up fo... | <p>Using TortoiseSVN</p>
<ul>
<li>Right-click and <strong>select TortoiseSVN -> Settings</strong></li>
<li>Select <strong>Set file dates to the "last commit time"</strong></li>
</ul>
<p>I think that will work for you.</p>
| <p>The last time I checked there was no way in Subversion to preserve the original file's timestamp.</p>
| 14,798 |
<p>I am trying to execute a stored procedured from a linked database in MS SQL 2005. The linked database is a db2 database on a iseries server. I am using the iSeries IBMDASQL service provider. I am able to query the stored procedure without problems using a simple vbscript and ado. When I try to execute the same s... | <p>Turns out that there are a number of issues with the IBMDASQL provider that I was using. Believe it or not it is faster and more reliable to use the Microsoft OLE DB Provider for ODBC Drivers. After creating a new linked server with this provider, all of my earlier sql attempts worked properly.
Cheers!</p>
| <p>Try using <a href="http://msdn.microsoft.com/en-us/library/ms188427(SQL.90).aspx" rel="nofollow noreferrer">OPENQUERY</a>. <a href="http://blogs.conchango.com/jamespipe/archive/2007/06/28/SQL-Server-2005_3A00_-Passing-variables-into-an-OPENQUERY-argument.aspx" rel="nofollow noreferrer">This blog posting</a> shows a... | 42,639 |
<p>Screenshot of the problem:</p>
<p><img src="https://i.stack.imgur.com/qutvW.jpg" alt="http://i36.tinypic.com/dfxdmd.jpg"></p>
<p>The yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (... | <p>Try this. Seems to work in Firefox/Mac</p>
<pre><code>#header {
height: 42px;
}
#logo {
width: 253px;
height: 42px;
background: #00ffff;
float: left;
}
#nav {
width: 100%;
border-bottom: 2px solid #3edff2;
height: 42px;
}
#nav ul {
list-style-type: none;
margin: 0;
paddi... | <p>Bottom left? If so - start by setting <code>clear: both;</code> on your #nav block.</p>
<p>Other than that, I don't really understand your question - can you make a jpg of how you'd like it to look?</p>
| 47,612 |
<p>I have a page with 3 layers, one for navigation, one for database records and one for results. When I click on a database record, the results are displayed in the result layer via ajax. For navigation, the links will simply be different queries. I am wondering if it would make sense to have each different query be s... | <p>As well as the missing <code></script></code>,</p>
<p><code>child1.document.write('.$row2["ARTICLE_DESC"].')</code>
should be</p>
<p><code>child1.document.write(' . json_encode($row2["ARTICLE_DESC"]) . ');</code></p>
<p>The <a href="http://www.php.net/json_encode" rel="nofollow noreferrer"><code>json_encode... | <p>Your <code><script></code> tag is never closed and your <em>JavaScript</em> instructions are not ended with semicolons. It might be the source of the problem.</p>
| 42,822 |
<p>I was looking through a thread dump of a java process, and notice some threads blocked by signal dispatcher.</p>
<p>What is signal dispatcher? What does it do?</p>
| <p>I found an article about this on IBM developerWorks. When the OS raises a signal to the JVM, the signal dispatcher thread will pass the signal to the appropriate handler</p>
<p><a href="https://web.archive.org/web/20090214230330/http://ibm.com:80/developerworks/java/library/i-signalhandling" rel="nofollow noreferre... | <p>I found an article about this on IBM developerWorks. When the OS raises a signal to the JVM, the signal dispatcher thread will pass the signal to the appropriate handler</p>
<p><a href="https://web.archive.org/web/20090214230330/http://ibm.com:80/developerworks/java/library/i-signalhandling" rel="nofollow noreferre... | 29,173 |
<p>I'm completely new to AIR but what I'm trying to do feels like it should be quite easy.</p>
<p>I want my AIR app to execute (launch) an SWF in the standalone Flash Player (just like if I were to double click it). </p>
<p>Please note that I don't want the AIR app to embed the SWF. Just run it.</p>
<p>Can this be d... | <p>The AIR-Runtime is (still) not able to launch external Applications, except Acrobat Reader for PDFs and the default Browser (you can let the browser display the swf). </p>
<p>I think you need some of this Frameworks:</p>
<ul>
<li><a href="http://aperture.fluorinefx.com/" rel="nofollow noreferrer">FluorineFx Apertu... | <p>Thanks for the this, running it through a browser might be my solution then. FYI I'm using AIR to write some settings to a local text file that the SWF then can read.</p>
| 19,535 |
<p>I'm trying to create a webapplication where I want to be able to plug-in separate assemblies. I'm using MVC preview 4 combined with Unity for dependency injection, which I use to create the controllers from my plugin assemblies. I'm using WebForms (default aspx) as my view engine.</p>
<p>If I want to use a view, I'... | <p>Essentially this is the same issue as people had with WebForms and trying to compile their UserControl ASCX files into a DLL. I found this <a href="http://www.codeproject.com/KB/aspnet/ASP2UserControlLibrary.aspx" rel="noreferrer">http://www.codeproject.com/KB/aspnet/ASP2UserControlLibrary.aspx</a> that might work f... | <p>An addition to all you who are still looking for the holy grail: I've come a bit closer to finding it, if you're not too attached to the webforms viewengine.</p>
<p>I've recently tried out the Spark viewengine. Other than being totally awesome and I wouldn't go back to webforms even if I was threathened, it also pr... | 4,013 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.