input
stringlengths
51
42.3k
output
stringlengths
18
55k
Optimizing a non-tail-recursive function <p>I have this function whose essential operations are outlined as follows:</p> <pre><code>function render($index) { foreach($things[$index] as $key =&gt; $data) { echo '&lt;div&gt;'; /* irrelevant operations */ if(isset($data['id'])) { e...
<p>It's highly doubtful that you have to worry. If you're nesting divs deep enough that the call stack fills up, recursion depth is the least of your worries.</p>
Extended auto suggest functionality <p>I have been able to get the jQuery autosuggest working without any problems, and I was just wondering if the results can be based on a combination of 2 form fields?</p> <p>Let me try and explain a little better! I have a form with a keyword text entry box and a select list with a...
<p>You can combine the value of the dropdown with what the user types into the textbox and submit it as one string to your PHP/ASP server-side code. For example, something like this:</p> <pre><code>$("#textbox").change(fetchKeywords); function fetchKeywords() { var string=$("#textbox").val() + "||" + $("#select")...
Defining a table with sqlalchemy with a mysql unix timestamp <p>Background, there are several ways to store dates in MySQ.</p> <ol> <li>As a string e.g. "09/09/2009".</li> <li>As integer using the function UNIX_TIMESTAMP() this is supposedly the traditional unix time representation (you know seconds since the epoch pl...
<p>I think there is a couple of issues with the type decorator you showed.</p> <ol> <li><code>impl</code> should be <code>sqlalchemy.types.Integer</code> instead of <code>DateTime</code>.</li> <li>The decorator should allow nullable columns.</li> </ol> <p>Here's the what I have in mind:</p> <pre><code> import dateti...
School Locator by Address API? <p>Does anyone know of an API or web site where if you enter in a home address, and it will return the listing of what elementary, middle/jr high, and high school that home is zoned too?</p> <p>I've found some for particular states and some large cities but nothing at a national listing ...
<p>I know this <a href="http://schoolandhousing.com" rel="nofollow">school locator</a> supports <a href="http://schoolandhousing.com" rel="nofollow">find school by address</a> or find school by API score. It mainly covers California area. If you look for houses in that area, you can give it a try.</p>
Store data in C# source files vs. XML etc...? <p>This is a C# question.</p> <p>I was just wandering if anyone tried storing their data (like config files for example), in the *.cs file, instead of XML?</p> <p>I really hate XML. The whole idea of parsing html-like structure every time you need some data seems stupid.<...
<p>I've been working in the game industry for years, and we use XML because it's got the best tool support. Yaml or Ini files are used for configs, but game data is stored in XML. Of course we normally have tools that convert XML into binary code, for shipping games, but during development and custom game tools develop...
color dialog box <p>I need to get the colors which added in custom color box in colordialog window.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.colordialog.customcolors.aspx" rel="nofollow">ColorDialog.CustomColors</a> property</p> <p><a href="http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/19cf2bdd-7e97-4642-8272-a125fb668179/" rel="nofollow">Here's an example of how ...
Selecting an object given a div name stored in a string <p>This is a simple question that hopefully has a similar simple answer to it as well.</p> <p>If the <strong>id</strong> of a div selector is stored in a string, how can I select the div object dynamically.</p> <p>This is what I currently do, and I am convinced ...
<p>I assume you mean the <strong>id</strong> of the div, which is actually different to the <strong>name</strong>, but what you've got there is accurate and not that intrusive. I'd stick with that.</p>
Changing the default modal result of a form.showModal <p>In my Delphi application I have a custom Yes, No, Cancel dialogue, which will be called from the main form to confirm saving the changes made to the current file edited. This would normally be achieved by messageDlg() but I wanted this dialogue to have customised...
<p>You need to make sure that the Cancel property of the "No" button is False, and that the Cancel property of the "Cancel" button is True.</p>
How much support does GWT have for Java layout managers? <p>This seems to be a question where the answer is implicit, hence I can't find anything explicit.</p> <p>Does Google Web Toolkit only support custom layout managers, or a sub-set of the Java layout managers?</p> <p>For example, is it <em>possible</em> to take ...
<p>GWT layout support is done through subclasses of 'Panel'. Some of them like 'DockPanel' behave a little bit like Swing layouts (BorderLayout) but there's no way you'll ever be able to take Swing code and compile it into GWT.</p> <p>This is a common mis-understanding when it comes to GWT. It's written in Java solely...
How to deal with ThreadPool and member variables? <p>I am a bit new to ThreadPool in .NET. I was wondering, if I can only send one object to my callback method, how am I able to access the class member variable to call its methods? (see customClass in CallBack()) </p> <p>And how would I load the data from customClas...
<pre><code>class Program { static void Main(string[] args) { CustomClass customClass = new CustomClass(); ThreadPool.QueueUserWorkItem(x =&gt; CallBack(customClass, "Hello")); Console.Read(); } private static void CallBack(CustomClass custom, string text) { customClass.SaveData(text); } } ...
Is it OK to be able to paste text in a password box? <p>What do you web developers think? Should we disable pasting in masked password boxes in our web applications or not. Could this be a security hole or cause confusion or unwanted results? This is probably a question about user experience and not so much about progr...
<p>Pasting is <strong>perfectly OK</strong> actually disabling sometimes can cause bigger issues. Most of the users use keepass or similar applications to store strong passwords.</p> <p>If <strong>you force people to type every time this can force them to choose weaker passwords.</strong></p>
Does anyone know how to open a JSR-82 application in Windows Vista? <p>I have a host device that connects to anything running JSR-82. The problem is that I don't have a mobile device that runs JSR-82 applications. I wish I could simply connect to my host device within windows. Is this possible?</p> <p>(I am currently ...
<p>If you know what protocol the host device is speaking, you could write your own client using regular desktop Java and the <a href="http://bluecove.org/" rel="nofollow">Bluecove</a> implementation of JSR-82. </p>
Python Beginner: How to Prevent 'finally' from executing? <p>The function code:</p> <pre><code># Connect to the DB try: dbi = MySQLdb.connect(host='localhost', \ user='user', \ passwd='pass', \ db='dbname', \ po...
<p>Use <code>else:</code> instead of <code>finally:</code>. See the <a href="http://docs.python.org/tutorial/errors.html#handling-exceptions">Exception Handling</a> part of the docs:</p> <blockquote> <p>The <code>try ... except</code> statement has an optional else clause, which, when present, must follow all except...
intellisense jquery + external js in expression web? <p>Can anyone tell me what i am doing wrong? I am trying to get intellisense in expression web 2 for external js and jquery</p> <p>I am able to do it in visual studio 2008</p> <p>I have searched google but can't seem to find the way of doing it</p> <p>Any ideas?</...
<p>I know that there was a <a href="http://code.msdn.microsoft.com/KB958502" rel="nofollow">hotfix</a> you had to install for VS2008 to get intellisense to work with jQuery. The hotfix allows VS to parse the VS-annotated versions of the files for intellisense hints. I don't think that a similar hotfix exists for Expres...
In MySQL how do retrieve multiple values from a Search form with three fields? <p>I have a two tables:</p> <ol> <li>Clients</li> <li>Cities</li> </ol> <p>Then in the search form I have three fields:</p> <ol> <li>A text input form to fill with the name of the client</li> <li>A select box to choose the city where the...
<p>Perhaps your database structure could be altered to help you. For example, I assume you have a relationship between Cities and Clients. It sounds like Businesses is something like "Tech" or "Search" in which case could you have multiple clients with the same Business? Could be worth porting businesses to a separate ...
Deleting a char array <p>this question is related to <a href="http://stackoverflow.com/questions/763213/what-would-this-code-do-memory-management">this one</a>. Given this code</p> <pre><code>char *p = new char[200]; delete[] p; </code></pre> <p>what would happen if you set <code>p[100] = '\0'</code> before deleting ...
<p>The code:</p> <pre><code>char *p = new char[200]; p[100] = '\0'; delete[] p; </code></pre> <p>is perfectly valid C++. delete does not know or care about null-terminated strings, so your error must have had some other cause.</p>
Zend Framework: How to unset data rows in a Zend_Db_Table_Rowset object <p>I would like to iterate over the data rows stored in a Zend_Db_Table_Rowset object and then drop/unset some of the rows, if they don't fulfil certain criteria.</p> <p>I could use toArray() to get only the data rows from the object and then it w...
<p>Example method for your <a href="http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.extending.row-rowset">custom rowset class</a>:</p> <pre><code>public function removeFromRowset($id) { foreach ($this-&gt;_rows as $i =&gt; $v) { if ($v-&gt;id == $id) { // found Row we want to remove ...
Learning resources to transerfer my MS SQL Server knowledge into MySQL <p>I'm an experienced MS SQL Server developer <br/> But with my first MySQL project I got problems with very simple issues <br/> So can anyone suggest good resources helping me transfer my MS SQL Server knowledge into MySQL<br/> I'm not looking for...
<p>Here's a good place to start: <a href="http://dev.mysql.com/tech-resources/articles/migrating-from-microsoft.html" rel="nofollow">Migrating From MS SQL to MySQL</a></p>
MS compiler optimization that replaces variables in a function? <p>I'm not sure how to explain the behavior I'm seeing, but here goes.</p> <p>I have a function foo that takes three parameters, a pointer, an int, and another pointer. When I break-point inside foo, I can clearly see that all the variables are the value...
<p>You're debugging optimized code. Local variables can't be trusted - the compiler is free to reuse their space, cache them in a register, and so on.</p> <p>What you're probably seeing is B is cached in a register and its stack location is being reused for some other variable.</p> <p>Similar question here: <a href=...
Why did my use of the read command not do what I expected? <p>I did some havoc on my computer, when I played with the commands suggested by vezult <a href="http://stackoverflow.com/questions/625656/favourite-command-line-trick/627870#627870">[1].</a> I expected the one-liner to ask file-names to be removed. However, it...
<p>What happened there is that <code>read</code> reads from <code>stdin</code>. When you put it at the end of a pipe, it read from that pipe.</p> <p>So your find becomes</p> <pre><code>file1 file2 </code></pre> <p>and so on; <code>read</code> reads that and replaces <code>x</code> successively with <code>file1</cod...
Delphi: Required package not found <p>I'm trying to build 3 packages, A, B and C. A defines some base classes that are used in B and C. I've got all 3 of them in the same project group, all set up to output to the same custom BPL output folder. This folder is in the search path for B and C. But when I go to build B...
<p>Either the package can't be found, or the compiler is confused. In the later case, a restart sometimes helps. Then a manual build from all packages in order.</p> <p>If it really can't be found, check if all package (bpl and dcp) and dcu files are available. You need both.</p>
PHP: Get text separated by commas <p>I have a multidimensinal array.. Something like this for example:</p> <pre><code>Array ( [0] =&gt; Array ( [title] =&gt; Star Trek - Viaje a las estrellas [country] =&gt; Venezuela, Spain, long title, poster title ) [1] =&gt; Array ...
<p>Try using <a href="http://php.net/explode" rel="nofollow"><code>explode()</code></a> on the country element. You can use a separator of <code>", "</code>, since these are comma-separated values.</p> <p>One way to do it (which is similar to how others have suggested) would be:</p> <pre><code>// Assuming that $data ...
Best tutorial for the classes in System.Collections.Generic and System.Collections.Specialized namespaces? <p>I am looking for a book or article that goes into great level of detail on the generic Collections in .NET comparing performance and providing good advice on when to use the different collections. I am interest...
<p>Um...look for a decent data structures book for starters, I suppose. They're not too different from the containers you see elsewhere. After that, just read the MSDN documentation on the various classes in there. They do a pretty good job of spelling out the differences.</p>
Catching back button navigation event <p>I have a nav based app. Once a row is clicked in a tableview, I push a UIWebView. The UIWebView has web links in it. The user clicks a link, which renders the external webpage. This all happens within my app. The top nav bar hasn't changed with the clicking of a link that r...
<p>You can be notified of navigation controller changes, but I don't believe you can prevent them from happening (UINavigationControllerDelegate protocol).</p> <p>One way to solve this is to set up an object to be the webview's delegate (UIWebViewDelegate protocol) and implement:</p> <pre><code>- (BOOL)webView:(UIWe...
What are the disadvantages of having many indices? <p>I recently sped up a complicated query by an order of magnitude by giving SQLite a good index to work with. Results like this make me wonder if I should index a lot of other fields that are commonly used for JOINs or ORDER BY clauses. But I don't want to get overzea...
<p>Indexes slow down inserts and updates (which can become a really serious issue with locking) and cost disk space. That's pretty much it.</p>
How do I insert an image name into a database? <p>I succeed to upload and image and resize it. Now I want to insert my image's name into the database.</p> <p>I'm using SQL Server. The table is named <code>images</code> and has two columns, an integer <code>imageid</code> and <code>imagename</code> as <code>string(inva...
<p>First you need to know your Connection String. since the code is referencing the SQLClient I'll assume you are using SQL Server so you should look <a href="http://www.connectionstrings.com/sql-server-2005#1" rel="nofollow">here</a>. Next you'll want to use the ExecuteNonQuery method of the SQLCommand object. I've p...
A list of string replacements in Python <p>Is there a far shorter way to write the following code?</p> <pre><code>my_string = my_string.replace('A', '1') my_string = my_string.replace('B', '2') my_string = my_string.replace('C', '3') my_string = my_string.replace('D', '4') my_string = my_string.replace('E', '5') </cod...
<p>Looks like a good opportunity to use a loop:</p> <pre><code>mapping = { 'A':'1', 'B':'2', 'C':'3', 'D':'4', 'E':'5'} for k, v in mapping.iteritems(): my_string = my_string.replace(k, v) </code></pre> <p>A faster approach if you don't mind the parentheses would be:</p> <pre><code>mapping = [ ('A', '1'), ('B', ...
Unable to find a directory when I know just its name by Find? <p>I am trying to find the directory called macports by Find. I do not know where it is in my computer.</p> <p>I have tried unsuccessfully</p> <pre><code>find --mindepth 777 macports </code></pre> <p><strong>How can you find the directory?</strong></p>
<pre><code>find / -name macports -type d </code></pre>
ActiveRecord does not work on App Engine - What's the alternative? <p>Early reports of JRuby on Google App Engine indicate that <strong>ActiveRecord does not work</strong>. </p> <p>It was my understanding that this was the only way to talk to the database in Rails. </p> <p>Is this not the case? And, if not, <strong>w...
<p><strong>Edit:</strong> Looks like somebody created a <a href="http://jruby-rack.appspot.com/" rel="nofollow">sample JRuby-Rails application</a> - this should be an easy starting point. Sample code is <a href="http://github.com/nicksieger/jruby-rack/tree/master/examples/rails" rel="nofollow">here</a>.</p> <p>It app...
How to create a custom GDI device? <p>Is it possible to create a custom GDI device in user mode? The idea is to create a device context (HDC) which we can pass to an opaque component, so that when the component calls GDI functions like TextOut we can get the actual text string.</p>
<p>I have not used GDI much, but I've heard that <a href="http://msdn.microsoft.com/en-us/library/dd145051%28VS.85).aspx" rel="nofollow">metafiles</a> record the drawing and can be played back. You might be able to get the text string from it.</p> <p>I've looked at it more, and you can create a GDI with <code>CreateE...
How do I Make Firefox Print a Background-Color Style? <p>I have some simple CSS:</p> <pre><code>#someElement { background-color:black; color:white; } </code></pre> <p>It looks ok in the browser, but when I go to print it in Firefox it comes out as black text on a white background. I imagine this is some sort...
<p>Its a browser setting. There is nothing you can do in your CSS. In Windows - <code>File &gt; Page Setup... &gt; Print Background</code>.</p>
HTML Sanitization in C++ <p><strong>Is there any available C++ (or maybe C) function/class/library with only purpose to sanitize a string that might contain HTML?</strong></p> <p>I find a lot of source code for sanitizing in C# or other languages more used in web application but nothing in C++. </p> <p>I'll try to im...
<p><a href="http://tidy.sourceforge.net/" rel="nofollow">HTML Tidy</a> is written in c, but there are bindings for practically every language/platform, <a href="http://users.rcn.com/creitzel/tidy.html#cplusplus" rel="nofollow">including c++</a>.</p>
How does FormView EditTemplate update values in ObjectDataSource UpdateParameters under the hood? <p>I have a FormView bound to an ObjectDataSource.</p> <p><strong>* ObjectDataSource definition (omitted portion of it for simplicity)*</strong></p> <pre><code>&lt;asp:ObjectDataSource ID="odsHousehold" runat="...
<p>"how does the FormView know which UpdateParameter to populate with which EditTemplate TextBox when the Update button is clicked?"</p> <p>I believe the simple answer is: it knows because of the Bind statements you put in the TextBox controls. E.g. txtAddress has "Bind("Address")" so when the update is called, it h...
How can you export your .bashrc to .zshrc? <p>I am trying to move to zsh from Bash.</p> <p>I put my .bashrc directly to my .zshrc, and it caused a lot of errors when I try to use Bash again.</p> <p><strong>How can you export your .bashrc to .zshrc?</strong></p>
<p>While lhunath's answer pushed me in the right direction, zsh does not seem to source <code>.profile</code> automatically. Lot's of good info on this topic can be found on <a href="http://superuser.com/questions/187639/zsh-not-hitting-profile">this superuser post</a>.</p> <p>The adaption I'm using is putting common ...
SQLite Performance Benchmark -- why is :memory: so slow...only 1.5X as fast as disk? <h2>Why is :memory: in sqlite so slow?</h2> <p>I've been trying to see if there are any performance improvements gained by using in-memory sqlite vs. disk based sqlite. Basically I'd like to trade startup time and memory to get extrem...
<p>It has to do with the fact that SQLite has a page cache. According to the <a href="http://www.sqlite.org/compile.html">Documentation</a>, the default page cache is 2000 1K pages or about 2Mb. Since this is about 75% to 90% of your data, it isn't surprising that the two number are very similar. My guess is that in ad...
How to render WPF animation as a video frame by frame? <p>I've created a nice effect that I like in WPF, I'd like to be able to "record" this effect. But it is choppy during run-time.</p> <p>Is there a way I can convert it to a frame-by-frame process and save it as a video myself instead of trying to record it during ...
<p>Have you looked at using <a href="http://msdn.microsoft.com/en-us/library/aa969775.aspx" rel="nofollow">RenderTargetBitmap</a> to render your Visual as a bitmap? You might have to play with the animation's timing or hook into the OnRender event, but that will let you capture your control as an image.</p> <p>To expa...
Can you set a contact's image in AddressBook programmatically on the iPhone? <p>I'd like to be able to set a contact's default image programmatically on the iPhone. Does the API currently allow for that? I've found you can toggle several properties for the person, and create new contacts. I can't seem to find anywhere ...
<p><a href="http://developer.apple.com/iphone/library/documentation/AddressBook/Reference/ABPersonRef%5FiPhoneOS/Reference/reference.html#//apple%5Fref/c/func/ABPersonSetImageData" rel="nofollow">ABPersonSetImageData</a> is what you are looking for.</p>
Code Randomization <p>I am trying to build a ReTrust system which requires that DLL files be transferred from one system to another. Thus to just add a bit of complexity, I would like to Randomize the code - i.e change the code in a way that every time I have to send a DLL, it will be different then the one sent previo...
<p>You could preprocess the source code files before compilation to add a random amount of random code that doesn't actually do anything. It would be simple enough to add innocuous comments in the real source code where you wanted your junk code to be inserted. As far as what you do when you are not trying to do anyt...
Pointer Issues <p>Anyone know how to store pointers in a multi-dimensional array? I think that might be the problem that i am having in main:</p> <pre><code>// main.cpp #ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;string&gt; #endif #include "Word.h" using nam...
<p>Please post minimal code which can reproduce your problem. It looks quite hazy right now. I suppose there are a lot of problems with this code </p> <pre><code> inFile &gt;&gt; tmpArray; // prime the eof flag. while ( !inFile.eof() ) { inFile &gt;&gt; tmpArray; ...
Get perforce data into a .NET application <p>I'm curious as if anyone has used any method of getting data from perforce into a managed language. I've found a few sample applications out there, and I'm hoping someone here has had success in doing this and could offer some advice.</p> <p>Thanks!</p>
<p>We have in our application using the <a href="http://sourceforge.net/projects/p4dotnet/" rel="nofollow">P4.NET library</a>. It works OK, however we wrapped it as the interface was difficult to work with. P4.NET is not supported by Perforce and is probably missing a few features.</p> <p>I have considered running SWI...
CSS Footer which works in IE and firefox <p>Hi guys I'm trying to add a css footer but can't it to work right. For now I'm tweaking it like crazy and if it appears fine in firefox it gets all messed up in Internet Explorer 7 ahd sometimes is halfway up teh page :(. Is there any good example out there for a css based fo...
<p>I'd try the <a href="http://ryanfait.com/sticky-footer/" rel="nofollow">CSS Sticky Footer</a>.</p>
How to achieve modal dialogs from NotifyIcon context menu? <p>I've got a shell tray icon with an attached context menu. The problem I'm having is that calling ShowDialog() from a context menu Clicked handler does not result in a modal dialog.</p> <p>It's easy to reproduce this with a default C# project. Simply add t...
<p>I would suggest doing two things before you attempt to display a modal message box:</p> <ol> <li>Make your icon's owner-window visible.</li> <li>Give it focus.</li> </ol> <p>Once you've done that, the <code>this</code> in the MessageBox.Show becomes a legal "modality parent". </p> <p>Heck, it even makes more sens...
How does software like Spy++ get the information? <p>I'm working on a software for test automation. To get it working it need's to "have a look" on the desktop and all open windows. It needs to know which windows are open and what controls they consist of. So it has to do something similar to what Spy++ is doing (Spy++...
<p>You can use <a href="http://msdn.microsoft.com/en-us/library/ms633497.aspx" rel="nofollow">EnumWindows</a> to get all top level windows. Within the <code>lpEnumFunc</code> you can call <a href="http://msdn.microsoft.com/en-us/library/ms633500(VS.85).aspx" rel="nofollow" title="FindWindowEx">FindWindowEx</a> to get c...
Multiple java Applets handling <p>I'm creating a simple java game Applet that has multiple Panels, The main game Panel has 4 JButtons that lead to the rest of the Panels when they are clicked.</p> <p>when the program runs, the four Panels are initialized 1st inside the init(), and inside each Panel initialization, I m...
<p>First, ensure all creation is performed not in init(), but in the EDT, see <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/applet.html#thread" rel="nofollow">the tutorial</a>. If you have an ampty start() method I'd recommend you use invokeLater in the init() (instead of the tutorial recommendati...
Code generation in Maven <p>I want to autogenerate some java classes from interfaces. My first thought was to write a code generator, and integrate it as a maven plugin.</p> <p>I was thinking of creating a maven plugin with a codegen goal that is called during the build process.</p> <p>So if I choose this route, how ...
<p>Sources should go in {project.build.directory}/generated-sources/[plugin-id]/</p> <p>Most plugins take configuration passed through the plugin configuration section in the pom. You can use default values as well, or an annotation and classpath scanning.</p> <p>A plugin like the <a href="http://mojo.codehaus.org/js...
Serializing vs Database <p>I believe that the best way to save your application state is to a traditional relational database which most of the time its table structure is pretty much represent the data model of our system + meta data.</p> <p>However other guys in my team think that today it's best to simply serialize...
<p>You didn't say what kind of data it is -- much depends on your performance, simultaneity, installation, security, and availability/centralization requirements. </p> <ul> <li><p>If this data is very large (e.g. many instances of the objects in question), a database can help performance via its indexing capabilities...
web service reference in DLL <p>hope someone can help with something that is really budding me.</p> <p>i have a smart client, a couple of web services and some DLL's. the dll's are essentially forms and controls. the dll's reference the web services within themselves.</p> <p>the problem i have is how to change the re...
<p>The DLLs will use the app.config file of their host application. For example if your smart client is called MySmartClient, then you could use MySmartClient.exe.config the same way you would use web.config to define web service urls.</p>
What is the most obfuscated code you've had to fix? <p>Most programmers will have had the experience of debugging/fixing someone else's code. Sometimes that "someone else's code" is so obfuscated it's bad enough trying to understand what it's doing.</p> <p>What's the worst (most obfuscated) code you've had to debug/fi...
<p>PHP OSCommerce is enough to say, it is obfuscated code...</p>
VB.net 2008 Property Array <p>Hi can anyone help here? I am currently learning VB.net but for a project I need to create and array and pass it using a property. The data to be passed will be a train's destination, the time its due and the expected time of the train. I was wondering if someone could simplly explain how ...
<p>If you want to provide multiple values to a control, one clean way to do this is to have separate properties, one for each value, instead of trying to pass them all in one array. Another clean way to do this is to create a new class (type) that combines all these values into one structure, and expose a single prope...
Using JSON in Javascript to obtain results from Google Search Ajax API <p>I am trying to obtain the url from the innerHTML of a web page using javascript.</p> <p>This is what I'm doing:</p> <pre><code>var goog = newTabBrowser.contentDocument.getElementsByTagName("pre")[0].innerHTML; alert(goog.responseData.results...
<p><code>innerHTML</code> returns a string—not an object structure. You will probably have to use <code>eval</code> or a JSON parsing library (depending on how secure the JSON data is) to convert it from a string into a JavaScript object.</p> <p>For example, (using the <a href="http://www.json.org/js.html" rel="nofo...
best practice Treeview populating from differents kinds of objects <p>I would like to populate a Treeview.</p> <p>Here is what I have in DB :</p> <p>table : Box BoxID BoxName</p> <p>table Book : BookID BookName BoxID (fk Box.BoxID)</p> <p>table Chapter: ChapterID ChapterName BookID (fk Book.BookID)</p> <p>As you m...
<p>Here is what I have for the moment </p> <p>I get the list of box with a linq (dbml) request.</p> <pre><code>List&lt;Box&gt; MyListofBox = getMyListofBox(); Treenode tnBox = null; Treenode tnBook =null; foreach(Box b in MyListofBox ) { tnBox = new TreeNode(); tnBox.tag = b.BoxID; tnBox.text = b.BoxName;...
Stuck using jQuery UI Tabs <p>I've got some three html tables which i wanted to put into tabs, thanks to this previous question.</p> <p>All three tables can be ajax'd but i want to show the first table and ALSO allow the first table to be ajaxable.</p> <p>Lastly, i need to have the option for the user to SEARCH in th...
<p>You have to have an <code>a</code> tag inside the <code>li</code>'s. <code>li</code>'s don't have the <code>href</code> attribute.</p> <pre><code>&lt;li&gt;&lt;a href="ajax/data_a"&gt;Title 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="ajax/data_b"&gt;Title 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tab-3"&gt;Sea...
Representing the board in a boardgame <p>I'm trying to write a nice representation of a boardgame's board and the movement of players around it. The board is a grid of tiles, players can move up, down, left or right. Several sets of contiguous tiles are grouped together into named regions. There are walls which bloc...
<p>I'd say use a tree structure representing each possible move. You can use a <a href="http://en.wikipedia.org/wiki/Minimax" rel="nofollow">Minimax</a>-type algorithm to figure out what move the computer should take.</p>
SQL 2005 SMO - find referencing table <p>I need to change some primary keys from non-clustered to clustered but I can't drop the constraint because it is referenced from other foreign keys.</p> <p>How can I find the tables that reference a primary key in the parent table as part of a foreign relation without looping t...
<p>Ok I think I found it.</p> <pre><code>table.Columns[0].EnumForeignKeys() </code></pre> <p>or directly</p> <p>table.EnumForeignKeys()</p> <p>I was expecting a property instead of a function. I am pretty sure behind the scenes it does what cmsjr suggested.</p>
Calculating a T-SQL Query Parameter at Load Time <p>I'm trying to SELECT records out of an Events Database (with an EventDate field as Date) that have a EventDate that is in the current month.</p> <p>I have functions for calculating the first day of the month:</p> <pre><code>public string GetFirstofMonth(DateTime dt)...
<p>This can be done by handling the SqlDataSource's "Selecting" event as follows:</p> <pre><code>&lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" OnSelecting="SqlDataSource1_Selecting" ConnectionString="&lt;%$ ConnectionStrings:MeetingsConnectionString %&gt;" SelectCommand="SELECT * FROM [Events] WHERE [Eve...
How to fetch data from a Microsoft Access database through JDBC and insert the table as a test field in an Applet <p>I have made a small letter game as a Java Applet. I have made a Microsoft Access Database through JBDC for the high scores.</p> <p>I have managed to insert values (scores) into the database, but I am ha...
<p>If you've connected successfully then </p> <pre><code> connection=DriverManager.getConnection("jdbc:odbc:databaseName"); </code></pre> <p>should return you a connection object and <em>not</em> throw a SqlException.</p> <p>So I would first check that the above is in fact the case.</p> <p>Note that an applet can...
Explain CPU cache paging in FreeBSD, specifically paging queues <blockquote> <p>FreeBSD implements page coloring with paging queues. The queues are arranged according to the size of the processor’s L1 and L2 caches; and when a new page needs to be allocated, FreeBSD tries to get one that is optimally al...
<p>Operating systems have to manage the sizes of CPU caches in order to reduce <a href="http://en.wikipedia.org/wiki/Cache_miss" rel="nofollow">cache misses</a> (also explains page colouring). More simply, the data stored in the caches (in units called pages) must be carefully selected based on how often it is used, wh...
Pitch Detection In Mac OS X <p>I don't suppose anyone is aware of any libraries that allow you to detect the current pitch (that is, in notes) received by the microphone in Mac OS X? I'm assuming it'd be a mixture of Objective-C and some provided lib. Or else in Java for multi-platform goodness?</p>
<p>There are some code snippets here that describe auto-correlation for pitch.</p> <p><a href="http://www.iwillapps.com/wordpress/?p=212" rel="nofollow">http://www.iwillapps.com/wordpress/?p=212</a></p> <p><a href="http://www.iwillapps.com/wordpress/?p=214" rel="nofollow">http://www.iwillapps.com/wordpress/?p=214</a>...
Vista glass border effect in Java Swing/AWT <p>I'm trying to create an overlay with a Vista Aero Glass -like background in place of a normal window. Part of my answer seems to be <a href="http://stackoverflow.com/questions/54926/java-make-a-jpanel-not-draw-its-background">here</a>, but I'm wondering how to get a blur e...
<p>I don't have a solution to hand but you can definitely overlay a color in the blurring stage. Everything you'll ever need to know about Swing effects and Swing image effects is in the excellent <a href="http://filthyrichclients.org/" rel="nofollow">Filthy Rich Clients</a>. The answer to your question is definitely i...
Why there's no configuration file at all for dependency injection with Google Guice? <p>I am checking out <a href="http://code.google.com/p/google-guice/">Google Guice as DI framework</a> but I am a bit puzzled: why there's no configuration file at all?</p> <p>I found a partial explanation on <a href="http://stackover...
<p>The configuration is in the code instead of config files, which is a valid decision for many scenarios.</p> <p>Yes, it means that you have to rebuild (possibly just the modules) if you want to release a different way of plumbing your application - although of course you could still get some configuration values fro...
Mixing security logic with models in Ruby on Rails? <p>Is it bad design to mix code that deals with security logic in the model?</p> <p>Example for editing a page in the before_save callback</p> <ul> <li>The current user is grabbed from the <code>current_user</code> method in the Controller layer.</li> <li>Throw exce...
<p>The model in an MVC framework is supposed to completely contain all of your business logic. In a well designed MVC application, you should, in theory at least, be able to re-use your models in a different context without having to re implement any of your business logic.</p> <p>In every case I can think of author...
Updating a dll in the GAC that contains aspx pages for a Web application <p>Forgive me coder for I have sinned. I put some code into a dll in the GAC, and now I am confused about how the GAC is really working with IIS.</p> <p>In our intranet environment I have several related web applications (about 10). Each applic...
<p>Looking at your question, it seems you wish to use a higher version of your assembly when deployed.</p> <p>In that case, this <a href="http://msdn.microsoft.com/en-us/library/eftw1fys%28VS.71%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/eftw1fys%28VS.71%29.aspx</a> might help.</p>
Will Internet Explorer 8 solve many of the browser incompatibility issues? <p>IE 6 and 7 didn't follow many of the w3 standards, like event handling, making it necessary to write code for the standards compliant browsers, and then write MORE code for Internet Explorer. Will IE 8 take us out of this dark age and stabili...
<p>Every new release of IE gets us a little closer, but it's more about abandonment of old browsers than releasing of new ones. IE35 might be available, but if IE6 still has a 20% market share, we haven't actually progressed. Campaigns like <a href="http://ie6update.com/" rel="nofollow">this one</a> which help educate ...
Why is Valgrind stating that my implementation of std::map<T, T> produces a memory leak? <p>Valgrind is outputting the following:</p> <pre><code>==14446== 2,976 (176 direct, 2,800 indirect) bytes in 2 blocks are definitely lost in loss record 23 of 33 ==14446== at 0x4C2506C: operator new(unsigned long) (in /usr/lib...
<p>It's probably because of a pool allocator. From Valgrind FAQ:</p> <blockquote> <p>My program uses the C++ STL and string classes. Valgrind reports 'still reachable' memory leaks involving these classes at the exit of the program, but there should be none.</p> <p>First of all: relax, it's probably n...
.net - Problems with Array.Sort and Array.BinarySearch - culture and globalization <p>I need to sort an array containing a list of words and search the same using binarysearch. For certain reasons, the word-list must always be sorted using the sorting-rules of "en-US" i.e. American Regional Settings. The code will run ...
<p>Well, the answer to both is to implement a comparer. Create a class that implements the <code>IComprarer(Of String)</code> interface and has it's own <code>CultureInfo</code> object that it uses to compare the strings:</p> <pre><code>Public Class StringComparerEnUs Implements IComparer(Of String) Private _cu...
Are there any real issues in Silverlight 3 beta? <p>In my silverlight application I am trying to get the actual dimensions of a png image that I am loading into an image control. </p> <p>After scowering through the internet for a while I learned that in silverlight 3 there is an attributes called PixelHeight and Pixel...
<p>Even though Silverlight 3 is expected to be backwards compatible to Silverlight 2, expect to run into some issues. The conversion wizard does a good job but you cannot completely trust it.</p> <p>why don't you try it and see if you it is seemless in your case?</p>
Adding SWF to HTML based AIR App <p>I have a little HTML based Adobe AIR project I'm playing with and I'd like to add an existing SWF to the project. Now, I can see it running via the trace/log messages coming through from the SWF, but I can't seem to call any function within the SWF. I've read that the ExternalInter...
<p>Using a compiled swf has sandboxing issues.</p> <p>Maybe you can make use of LocalConnection? <a href="http://blog.everythingflex.com/2008/01/11/more-fun-with-air-localconnection-source-included/" rel="nofollow">Here is an example</a>.</p>
Same connection even though the ODBC data source has changed <p>I have a .Net service that has a list of strings containing ODBC connections and I use these in a loop to check multiple databases for tasks to process (eg. polling).</p> <p>However if i change where an ODBC connection points to..by changing its default d...
<p>If your settings are stored in the app.config, here is a question that might help:</p> <p><a href="http://stackoverflow.com/questions/436700/is-switching-app-config-at-runtime-possible">http://stackoverflow.com/questions/436700/is-switching-app-config-at-runtime-possible</a></p>
DDD: Organizing 100s of properties on an Entity <p>How would you organize an entity that has 100s of properties? One could go as far to say 100s of properties, with a few Value Objects (as a few of the properties have 2 or 3 properties of their own). But the point is, how to handle the large number of properties.</p>...
<p>This is a tough problem. You've got an aggregate root with lots of branches. But it sounds as if your users only work with certain collections at certain times. You could try pruning the tree a bit. </p> <p>For instance, in your Car example, if your users are comparing the rankings of different cars, you could trea...
Including an image in a firefox extension <p>Hey, I would like to use an image in firefox extension I am developing. Can someone tell me how to include the image. I used the following but it did not work.</p> <pre><code> var divTag = content.document.createElement("img"); divTag.id = "div1"; divTag.src="chro...
<p>Can't you just use the relative path?</p> <pre><code>divTag.src="image1.gif"; </code></pre> <p>I just looked at some plugins i have installed and they use the same <strong>chrome://</strong> syntax you used. </p> <ul> <li>Did you double check your the file path? </li> <li>Are you positive you can embed a gif? It ...
Handler not yet determined error <p><br /></p> <p>I don’t know anything about deploying a website, so I probably made some stupid mistake. </p> <p>Anyways, I opened IIS 7 manager, created new virtual directory ( via Add Application ) and pointed it to physical directory where Visual studio saved my Web project. But...
<blockquote> <p>error code:0x8007000d</p> </blockquote> <p>I started playing with permissions and all the stuff about access issues to web.config or applicationhost.config anyway those did not change the error.</p> <p>while I was playing with my web.config I deleted rewrite tags from my config file and error change...
scrollTo doesn't scroll to correct position <p>I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking on it and another contracts), but it doesn't scroll to the right position. </p> <p>Here is a demo: <a href="http://www.pelmeshkin.com/temp/scrolltoaccoridon/" rel="nofollow">pe...
<p>Because it's calculating the position based on the location before the animation occurs. Not sure how you would go about dealing with this to be honest except maybe to tinker with the internal calculate which probably isn't a simple matter.</p>
Does Perl 6 make any promises about the order alternations will be used? <p>Given an alternation like <code>/(foo|foobar|foobaz)/</code> does Perl 6 make any promises about which of the three will be used first, and if it does where in the documentation does it make that promise?</p> <p>See the related question <a hre...
<p>To put it only a few words: the alternatives should be matched (at least notionally) in parallel, and the longest match wins. If you want sequential alternations, you can use the double bar ||, which promises a left-to-right order just like | does in Perl 5 regexes.</p>
displaying random row from last 100 entries? <p>I'm currently displaying a random row from all the entries and that works fine. </p> <pre><code>SELECT * FROM $db_table where live = 1 order by rand() limit 1 </code></pre> <p>now, i'd like to limit it to the last 100 entries in the db.</p> <p>every row in the db has a...
<p>This is what I came up with off the top of my head. I've tested it and it works in SQLite, so you shouldn't have much trouble with MySQL. The only change was that SQLite's random function is random() not rand():</p> <pre><code>SELECT * FROM (SELECT * FROM $db_table ORDER BY $timestamp DESC LIMIT 100) ORDER BY ran...
Does Entity Framework/LINQ to SQL Data Binding use reflection? <p>Forgive me if this has been asked before; I did a search but couldn't find anything that specifically answered this question, but I'd be happy to be referred.</p> <p>I'm taking a peek at both the Entity Framework and LINQ to SQL, and while I like the sy...
<p>The Expression API that underpins LINQ etc is founded on reflection (<code>MemberInfo</code>), not the component-model (<code>PropertyDescriptor</code> etc) - so there is not a huge requirement for <code>ITypedList</code>. Instead, the contents are inferred from the <code>T</code> in <code>IQueryable&lt;T&gt;</code>...
Empty string in number formatting <p><a href="http://img99.imageshack.us/img99/1398/assignment.jpg" rel="nofollow">This</a> is my assignment: </p> <p>Here are my questions:</p> <ol> <li>How can I fix this error: </li> </ol> <blockquote> <p>Exception in thread "main" java.lang.NumberFormatException: empty String ...
<p>The best solution is:</p> <ul> <li>study your course material</li> <li>start with a subset of the problem like just reading the file.</li> <li>test it</li> <li>loop over: <ul> <li>continue to improve and enhance the program until it fulfills all the requirements.</li> <li>test it</li> </ul></li> <li>hand it in</li>...
How to get ELMAH to work with ASP.NET MVC [HandleError] attribute? <p>I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn't log any errors when they occur.</p> <p>As I am guessing its because ELMAH only logs unhandled errors...
<p>You can subclass <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.handleerrorattribute.aspx"><code>HandleErrorAttribute</code></a> and override its <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.handleerrorattribute.onexception.aspx"><code>OnException</code></a> member (no need to cop...
NHibernate Mapping Entity from Fields in same table <p>I have a Member Table with fields <br>MemID - Primary Key <br>Business_Name <br>Business_Address <br>Business_Phone</p> <p>I need to make an Employer Class which has properties that come from the same Members Table. <br>EmployerName <br>EmployerAddress <br>Employe...
<p>I'm not sure if this is what you're looking for, but you could try the "component" mapping. This allows you to have a nested class within the same table.</p> <p>Search google for "nhibernate component" - it appears that the hibernate.org site is still down (!), but you might be able to get the component info from ...
When I try to make php with --with-gd, I get an error that "configure: error: libpng.(a|so) not found." What's wrong? <p>So far, I've made sure I've installed libpng and libjpeg with DarwinPorts (I'm running on OS X Leopard), but that doesn't seem to do the trick. I've read in a number of places that you need the deve...
<p>This error indicates that the libpng.so or libpng.a file could not be found. These files are created when libpng is compiled.</p> <p>I don't know much about the Mac OS X way of installing things, but if you want to do it the Mac OS X way, you'll probably need to find and install that libpng-devel package.</p> <p>...
How can I locally manage C manuals? <p>My Googling results in a huge amount of unnecessary results with C. My hope is to get the best C manuals local. I find the reference useful <a href="http://www.acm.uiuc.edu/webmonkeys/book/c_guide/" rel="nofollow"> here.</a> I would like to make my own notes and removal to the man...
<p>I am not sure the author would like you copying their work. So my answer does not apply to your question about managing the manual locally. One thing you can do is to use <a href="http://www.makeuseof.com/tag/web-annotation-tools-research-annotate-collaborate/" rel="nofollow">web annotation tools</a> to manage you...
NHAML Radio Button Syntax <p>Does anyone know the correct syntax for a selected radio button in NHAML? </p> <p>This is my current NHAML code: %input{type="radio", name="Relocation", value="Yes"}</p> <p>The help would be greatly appreciated.</p> <p>Thanks!</p>
<p>The latest version of NHaml (<a href="http://code.google.com/p/nhaml/" rel="nofollow">2.0 Beta 2</a>) changes the way it handles attributes. Don't use commas:</p> <pre><code>%input{type="radio" name="Relocation" value="Yes"} </code></pre>
Blackberry - run a JAD file on the simulator <p>I have a jad file for a BB app which I want to run on the simulator. When I do a "Load Java Program" it looks for a cod file.</p> <p>How can I run a JAD file on a BB simulator?</p>
<p>Open the BlackBerry browser, enter the web link to the JAD file in there and your application will be installed on your BlackBerry simulator.</p>
Ruby on Rails on Windows XP CTRL+C in console not stopping mongrel <p>I am currently in the process of learning Ruby on Rails. I have been following the <a href="http://buildingwebapps.com/course">Learning Rails</a> podcast and screencasts. </p> <p>I've run into a problem, well more of an annoyance. Every time the scr...
<p>Use <kbd>Ctrl</kbd>+<kbd>Pause/Break</kbd> instead. It will stop the server.</p> <p><img src="http://i.stack.imgur.com/TJ4WE.jpg" alt="enter image description here"></p>
How do you support adding items to nested flowlayoutpanels? <p>I have a flowlayoutpanel (flowParent) on a form that hosts a list of flowlayoutpanels (flowchild1, flowchild2, etc).</p> <p>from the form level, how do i add an item to flowchild1. essentially, how do i reference the child flowlayoutpanel?</p>
<p>You can either retain the reference when you add that panel to the outer panel, or use Container.getComponent(int).</p>
WMI Win32_Process.Create fails with Insufficient Privs <p>I'm trying to run a simple cmd utility on a remote Windows server from within a vbscript by invoking the <a href="http://msdn.microsoft.com/en-us/library/aa394372%28VS.85%29.aspx" rel="nofollow">Win32_Process</a> class, like so:</p> <pre><code>serverIP = "10.0....
<p>I had the similar problem. The suggestion from <a href="http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/305557c4-df94-4d92-85bf-a049c83f120c" rel="nofollow">http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/305557c4-df94-4d92-85bf-a049c83f120c</a> helped me. Shor...
Save last working directory on Bash logout <p>Is it possible to save the last working directory when you do an "exit" in bash. So, the next time you login, it will be at the directory you were at when you last logged out.</p>
<p>Save the last working directory in ~./.bash_logout into a hidden file:</p> <pre><code>pwd &gt; ~/.lastdirectory </code></pre> <p>Read this file in ~/.bashrc with</p> <pre><code>[ -s ~/.lastdirectory ] &amp;&amp; cd `cat ~/.lastdirectory` </code></pre>
Problem with pulling out icons from resource bundle in Flex <p>I'm having trouble with getting icons from resource bundle in Flex. Here's the scenario:</p> <p>Directory structure looks like this:</p> <pre><code> -ResourceManagerTest -resources -icons -icon1.png -icon2.png -icons.propertie...
<p>Firstly it looks like you are not including the resource bundle in your build. You're probably going to need something like </p> <pre><code>&lt;mx:Metadata&gt; [ResourceBundle("RegistrationForm")] &lt;/mx:Metadata&gt; </code></pre> <p>in the MXML or just </p> <pre><code>[ResourceBundle("RegistrationForm"...
which namespace does element belong to in XML? <p>Suppose I have the following XML document, which has no default namespace defined, and "Information" element is not prefixed with any namespace prefix. My questions are, 1. what is the namespace element "Information" belong to? 2. is there any way to apply XML schema ch...
<p>From the <a href="http://www.w3.org/TR/REC-xml-names/#defaulting">specification</a>:</p> <blockquote> <p>If there is no default namespace declaration in scope, the namespace name has no value. The namespace name for an unprefixed attribute name always has no value. In all cases, the local name is local part (whic...
Using BitmapFrame for metadata without locking the file <p>I've found the common way to get image metadata in WPF is to create a <code>BitmapFrame</code> object and inspect the Metadata property on it. However I can't seem to create a <code>BitmapFrame</code> object that fulfills these two requirements:</p> <ol> <li>D...
<p>Have you tried using a converter approach? For example, my <a href="http://intuipic.codeplex.com" rel="nofollow">Intuipic</a> application does this. See <a href="http://intuipic.codeplex.com/SourceControl/changeset/view/7348#114513" rel="nofollow"><code>BitmapFrameConverter</code></a> for details on loading without ...
How can I make Perl's a2p support gawk? <p>I have some awk scripts that use gawk from cygwin. Now I need to pass these scripts to colleagues that don't have cygwin installed, but do have Perl. I was hoping I can just use a2p that is included in cygwin, but it fails with errors like the following:</p> <pre><code>Undefi...
<p>The <code>gensub()</code> function isn't supported by <code>a2p</code>. If you modify your code to use <code>gsub()</code> instead then it should compile.</p> <p>Alternatively, you could add a <code>gensub()</code> subroutine to the end of the translated Perl program to simulate the <code>gensub()</code> functional...
Are there any studies for or against frequent password changes? <p>I'm looking for studies on the security effect of frequent password changes, looking at the security benefits / problems from having a mandatory password change every one or two months or similar.</p> <p>Does anyone know of any? </p>
<p><a href="https://cryptosmith.com/password-sanity/exp-harmful/" rel="nofollow">Here</a> is a research article on password policy. It mentions the frequency at which people should change their passwords and some other really interesting stuff. Below is an extract.</p> <blockquote> <p>Some experts say that periodic ...
Attributes vs comments <p>What advantages do attributes have over the use of comments (or xml comments at the signature level)? I do remember seeing a thread in the C# section of this site somewhere, but I can't find it now.</p> <p>Also, is it possible to apply an attribute to a specific parameter in a method (this wa...
<p>Comments are just for the benefit of developers, so that they can see what classes and methods are about.</p> <p>Attributes are useful to the solution you are developing as you can use then to describe how to work with the class you are adding attributes to.</p> <p>Yes you can use attributes against parameters, bu...
iPhone Unable to receive data using UDP recvfrom <p>I am writing an application which is continuously sending and receiving data. My initial send/receive is running successfully but when I am expecting data of size 512 bytes in the recvfrom I get its return value as -1 which is "Resource temporarily unavailable." and e...
<p>Read <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man2/recvfrom.2.html" rel="nofollow">the manpage</a>:</p> <blockquote> <p>If no messages are available at the socket, the receive call waits for a message to arrive, unless the socket is nonblocking (see <a href="http://developer.app...
Windows Service or Scheduled Task, which one do we prefer? <p>If we need to write a program that works periodically, which way do we prefer? Writing a windows service or writing a console application which works as scheduled task?</p>
<p>I would suggest running the process as a scheduled task if you can, and writing a service only if you need to. Services are quite a bit more difficult to write (correctly), and if you're running your process on a schedule of any sort, you're much better off using the windows scheduler than attempting to build a sche...
SQL Server 2005 Replication, transactional with updateable subscription error <p>Several days ago i setup some replication for our SQL Server 2005 database, the type of replication was a transactional with updateable subscription.</p> <p>The replication are working fine, lately i test the upgradeable subscription feat...
<p>Sorry no GUI solution, I would run </p> <p><code>sp_link_publication.</code></p> <p>This link</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms174991.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms174991.aspx</a></p> <p>Explains the parameters</p> <p>Hope that helps</p>
Zend_Rest_Server + Zend_Rest_Client, variable not read <p>What i am trying to do is pass $rest->apikey to my Zend_Rest_Server. The empAction creates the array needed by my Zend_Rest_Server. But in getByShortname($id,$apikey), I cannot read the $apikey. They query to check the API key does not return any results.</p> <...
<p>Source: <a href="http://framework.zend.com/manual/en/zend.rest.client.html" rel="nofollow">http://framework.zend.com/manual/en/zend.rest.client.html</a> Section 44.2.3. Request Arguments</p> <pre><code>$client = new Zend_Rest_Client('http://example.org/rest'); $client-&gt;arg('value1'); $client-&gt;arg2('value2');...
Where should I put my ISV project files for CRM? <p>I need my project to run in a multi-tenancy environment. Following the SDK, I put the aspx files in C:\Inetpub\wwwroot\ISV\MyProject. I then put the DLLs in C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembly.</p> <p>When I view my page in CRM I get:</p> <pr...
<p>I think the best practice for developing CRM extensions meant to be accessed by regular CRM users (ie = each with his/her own CAL) is to store the pages in a folder under the [Installation folder]\CRMWeb\ISV folder. The corresponding dlls though should be placed in the [Installation folder]\CRMWeb\bin folder. For me...
WinForm application and MS Office references <p>In our WinForms project, we need to give a facility to import data from Excel sheets. </p> <p>There are ways to refer MS Office files (here Office 2003) in your project references. </p> <p>Each time there is slight difference in build environment the project reference b...
<p>This is a big issue with Office, we had it too (Office 2003 vs. Office 2007)</p> <p>We had two solutions:</p> <ul> <li><p>Created a gateway library that was precompilled and referenced that instead of the real Excel dll.</p></li> <li><p>Used an external Excel library like <a href="http://www.codeproject.com/KB/off...
Exchange WS 'The specified object was not found in the store.' error <p>We're using Exchange 2007 WS to process mail folders and are hitting various problems if we try and forward a message we've already received. Our process is:</p> <ul> <li>Windows Service monitors mailbox folder, on finding a new mail we process th...
<p>Are you saving the Message ID of the newly found message or the message once it has been moved to the 'Processed' folder? The id will change when it moves to a new folder.</p> <p>The method recommended in the book <a href="http://www.microsoft.com/learning/en/us/books/10724.aspx" rel="nofollow">Inside Microsoft Ex...
Explorer thumbnails (winXP) <p>I have a file format I need to be able to show in explorer thumbnails. Since the target system is windows XP, the Vista PreviewHandler API will not be suitable. Ill be using c++.</p> <p>How would I do it?</p>
<p>You'll need to register a shell extension for your file type. The extension contains code that extracts/generates the thumbnail by implementing the IExtractImage interface. </p> <p>See: <a href="http://msdn.microsoft.com/en-us/library/bb761848%28VS.85%29.aspx" rel="nofollow">IExtractImage Interface on MSDN</a></p>