input
stringlengths
51
42.3k
output
stringlengths
18
55k
Deleting a Content Type in SharePoint <p>I'm trying to delete a content type from SharePoint, but it keeps giving me the message:<br /> "The content type FOO BAR is part of an application feature."<br /> I have deactivated the feature, retracted the solution and deleted the package from the solution store, the content ...
<p>I just ran into the same issue and the problem appears to be that although the solution was retracted and deleted, the feature was never uninstalled.</p> <p>The resolution is to: 1. redeploy the offending solution. 2. activate and then deactivate the feature. 3. go through the steps uninstalling the feature and ...
How to login to website using webbrowser control <p>I need to programmtically key in the username, password for a website using Webbrowser control in Visual Basic 6.0 application (please note it is not .Net application) and also click on Login button.</p> <p>Also I am not trying to hack or spam. The requirement is par...
<p>You can use the Document property of the WebBrowser control to interact with the HTML page. In your case, it would depend on the structure of the web site, but you should be able to do something like this (untested)</p> <pre><code>With webBrowser.Document.forms(1) .getElementByName("username").value = "usernam...
Web Application Deployment architecture recommendations <p>We will be developing 3 asp.net web applications. Each of them will have it's own database. We don't want these applications to share resources because they're from different departments.</p> <p>What is the recommended hardware setup that will allow us to have...
<p>I generally just have 6 boxes set up. 2 each for development, staging, and production...and then of course production can scale out from there. Then I use cruise control to push my code from one environment to the next. You don't need physically separate environments to run your 3 different applications.</p> <p>...
Removing all event handlers in one go <p>Problem: I have a document class which contains a list of objects. These objects raise events such as SolutionExpired, DisplayExpired etc. The document needs to respond to this.</p> <p>Documents can sometimes exchange objects, but a single object should never be 'part' of more ...
<p>You can use Delegate.RemoveAll(). (The part you're interested in is in button2_Click)</p> <pre><code>public void Form_Load(object sender, EventArgs e) { button1.Click += new EventHandler(button1_Click); button1.Click += new EventHandler(button1_Click); button2.Click += new EventHandler(button2_Click); Tes...
How do I write Visual Basic Code to read the input from a barcode scanner? <p>I want to write software in visual basic that reads the barcode of various items into my program. Any suggestions for how to do this?</p>
<p>If you have a hardware barcode scanner to hand it will almost certainly imitate a keyboard, and send the barcode as keystrokes (no special code required, just a textbox and it will put it in there once it is focused).</p> <p>If you go to the manufacturers website, you will find exactly what it does, and even specia...
iOS Private API Documentation <p>Is there a web site or project documenting private APIs for the iPhone SDK?</p>
<p>here are searchable archives from iPhone OS 2.2.1 to iOS 9.2</p> <p><a href="https://github.com/nst/iOS-Runtime-Headers">https://github.com/nst/iOS-Runtime-Headers</a></p>
Mac OS X / Open terminal with specified windows <p>Is it possible to open a terminal window with 3 tabs. Each tab should have different path.</p> <p>Example:</p> <pre><code>Tab1: /etc Tab2: /bin Tab3: /www/ tail -f file.txt </code></pre>
<p>This is absolutely possible, but it will take some work on your part. The first thing you need is to set up each window/tab you want in your Settings:</p> <p><a href="http://i.stack.imgur.com/r1p9Q.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/r1p9Q.jpg" alt="Settings"></a></p> <p>I have 4 tabs that I op...
XCode compiler warning: 'foo' may not respond to -bar <p>I'm trying to get my head around Objective-C for the iPhone. My app is compiling and running just fine so far, but I'm getting a compiler warning that I cannot get rid of.</p> <p>Header for one class: (snipped)</p> <pre><code>@interface PersonDetailViewControll...
<p>Apparently you have <code>personDetailViewController</code> declared as <code>UIViewController</code>? You can cast the controller explicitly:</p> <pre><code>[(PersonDetailViewController*)personDetailViewController setPerson:person]; </code></pre> <p>But boy this is ugly. It would be better to simply declare the <...
How do I bind a database field to an HTML TITLE element in ASP.NET 2.0? <p>I know how to do this in MVC:</p> <pre><code>&lt;title&gt; &lt;%= Model.Title %&gt; &lt;/title&gt; </code></pre> <p>I also know how to bind a SQLDataSource or ObjectDataSource to a control on a form or listview.</p> <p>But how do I render a f...
<p>You can use the <code>Page.Title</code> property to set the title in code behind.</p> <p>Once you've run your SelectCommand or equivalent on your data source, just simply assign Page.Title a value from the result set.</p> <p>Alternately, you can use the aspx page itself, and just inside the html assign a text stri...
Redirect doesn't work after using AjaxContext <p>In my controllers init() method I call the AjaxContext-Helper and set it for some methods/actions in that controller. Like so:</p> <pre><code>public function init() { $ajaxContext = $this-&gt;_helper-&gt;getHelper('AjaxContext'); $ajaxContext-&gt;addActionContex...
<p>Ok. Hopefully I understand your goal.</p> <p>First of all, there is no <code>redirector</code> method directly on an instance of <code>Zend_Controller_Action</code>.</p> <p>So, this:</p> <pre><code>$this-&gt;redirector-&gt;gotoSimple('manage', 'team', null, array('id' =&gt; $teamID)); </code></pre> <p>Should be ...
Is it ok to use "classic" malloc()/free() in Objective-C/iPhone apps? <p>I've been playing around with iPhone development for a while, and although it feels a bit awkward when you're a "hard core" .NET developer, it's not all that bad once you get used to it.</p> <p>In every book I read about Objective-C, there's only...
<p>There's an Objective-C wrapper around raw memory which I like to use a lot for similar tasks: <code>NSMutableData</code>. It has the benefit of giving you retain/release ownership plus it can grow the array easily (without having you to do the realloc yourself).</p> <p>Your code would look like:</p> <pre><code>NSM...
Jabber-net integration <p>I'd like to ask your help regarding having a Google Talk Bot that will communicate with my code on my server.</p> <p>I have downloaded Jabber-Net from code.google.com, but the examples there are not enough... I am new to these technologies, and have no clue about:</p> <ol> <li>How will clien...
<p><a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=346" rel="nofollow">Here's a recent post</a> that shows an example of replying to incoming messages on Gtalk using .NET</p>
Exclude Xenu's Link Sleuth from Google Analytics <p>I've just added the Google Analytics tracking to my website (cca 350 static HTML pages).</p> <p>I realized that I run Xenu's Link Sleuth to check my links pretty often, nearly after each change in my HTML files. I guess such checking will be counted as regular access...
<p>Does Link Sleuth run JavaScript? If not, it won't do anything to Google Analytics.</p> <p>From what I can see <a href="http://home.snafu.de/tilman/xenulink.html#FAQ" rel="nofollow">on the FAQ</a>, Link Sleuth will only run JavaScript if you tell it to, and then only links that match your regular expression. Just do...
Interaction between DLLs <p>I have a DLL, say A, which implements general algorithms to solve mathematical equations. I have another DLL, say B, which implements mathematical equations DLL B uses DLL A in order to solve it’s equations but DLL B must be able to execute a given equation from DLL A (DLL A implements som...
<p>There is no reason that DLL A needs to know explicitly about DLL B, it just needs an interface to be able to evaluate equations that it has been given to solve.</p> <p>The interface could be specified by a function signature, a pointer to a suitable function would passed by B to A, or it could be presented as an ab...
svn+apache per directory access control - disable root from modifying permissions file <p>I currently have an svn server running on a machine to which multiple users have root access. For the svn repository I want to use per-directory access control. So I user the mod_dav module with apache and specify permissions in /...
<p>You can set it to be readonly, then users will need to set rw before modifying. That will deal with accidents, but not with determined users. As soon as user is root all bets are off.</p>
Make two servers talk to each other <p>I have application written in GWT and hosted on Google AppEngine/Java. In this application user will have an option to upload video/audio/text file to the server. Those files could be big, up to 1gb or so and because GAE/J does not support large file I have to use another server t...
<p>Actually before that maybe you can try using first approach via by-passing cross-domain security of browsers using iframe. There are some ready to use components for this but for your problem which of them can be usable I don't know. Just google for these components...</p>
Understanding NFS <p>HI</p> <p>I would like to understand the NFS filesystem in some detail. I came across the book NFS illustrated, unfortunately it is only available as google books so some pages are missing. Has someone maybe another good ressource which would be a good start to understand NFS at a low level? I am ...
<p>This is documentation how NFS implemented in the Linux kernel</p> <p><a href="http://nfs.sourceforge.net/" rel="nofollow">http://nfs.sourceforge.net/</a></p> <p>Other resources are RFC documents</p> <p><a href="http://tools.ietf.org/" rel="nofollow">http://tools.ietf.org/</a></p>
Additional Dependencies / DLL / Library <p>I am working on OpenCV library, this library is written in C++, i have written a simple win32 application. I have some simple functionalities implemented in it. This functionality needs additional libraries and i am using Project->Properties->Configuration properties -> Linker...
<p>Please see:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx</a></p> <p>And:</p> <p><a href="http://jdebp.eu/FGA/dont-put-your-dll-in-the-system32-directory.html" rel="nofollow">http://jdebp.eu/FGA/don...
Clean up repetitive setup and cleanup Java(JDBC) code <p>I've too many methods that repeatedly do something like</p> <pre><code>Statement stmt = null; ResultSet rstmt = null; try { stmt = conn.createStatement(); rstmt = stmt.executeQuery(...); while (rstmt.next()) { //handle rows } } catch (SQLE...
<p>Have a look at <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/simple/SimpleJdbcTemplate.html" rel="nofollow">SimpleJDBCTemplate</a> in Spring Framework. This does exactly what you want. </p> <p>If you don't want to introduce an external framework then just use it for som...
boost::shared_ptr and multithreaded access <p>I'm trying to implement a multithreaded framework, in which output objects are created at the end of every frame that my networking thread runs, so that another thread can, at the beginning of its frame, obtain the most recent "completed output" pointer and know that it has...
<p>Probably the best resource here is <a href="http://www.boost.org/doc/libs/1%5F39%5F0/libs/smart%5Fptr/shared%5Fptr.htm#ThreadSafety" rel="nofollow">the documentation</a>:</p> <blockquote> <p>Thread Safety</p> <p>shared_ptr objects offer the same level of thread safety as built-in types. A shared_ptr inst...
Is there an easy way of locating a particular table when using the dbml design view in Visual Studio? <p>If you have a load of tables in your design view, its hard to find a particular one, is there an easy way?</p>
<p>Yes, if you have the Properties window visible when the dbml file is open, simply navigate the tables using the dropdown menu at the top of the Properties window.</p> <p><img src="http://imgur.com/x6wPn.jpg" alt="alt text" /></p>
Objects mapping to tables <p>For a program with an OO front-end and a SQL back-end, can one have each parent class map to its own table and each child class map to it's own table, then use joins in queries to allow returning all the child class's attributes? If so, is it advisable?</p>
<p>Sure, you can do that with an <a href="http://en.wikipedia.org/wiki/Object-relational%5Fmapping" rel="nofollow">ORM</a> tool like <a href="https://www.hibernate.org/343.html" rel="nofollow">Hibernate</a> or <a href="http://msdn.microsoft.com/en-us/library/aa697427%28VS.80%29.aspx" rel="nofollow">Entity Framework</a>...
Subsonic in a VS2008 Add-In woes <p>I am writing a VS2008 add-in that connects to a remote database blah blah.</p> <p>I am having a problem with the app.config in this project. When I use SubSonic in my code, it moans that is cannot find the SubSonicServer section. This is because the .config file cannot be found. Thi...
<p>My suggestion would be to not use the app.config file and inject the parameters at runtime.</p> <p>I use this approach in my Subsonic 2.2 project:</p> <p><a href="http://www.digvijay.eu/digvijay.eu/post/2008/10/31/SubSonic-Trick-Specify-connection-string-at-runtime!.aspx" rel="nofollow">http://www.digvijay.eu/digv...
How to let iText library support asia character? <p>right now i use iText to create a signature. and when i use .setReason to put the reason of the signature. It appears that it didn't support chinese. Can anyone help me to solve this ? Thanks in advance! Regards,</p>
<p>Just Set a ASia Font, then it works</p>
MinGW - Update GCC version 3.4.5 to version 4.4 <p>I've successfully installed MinGW from the directions located <a href="http://www.mingw.org/wiki/Getting_Started" rel="nofollow">here</a> (Automated Install). But, I wanted to get the GCC version updated to 4.4. Do I simply overlay the files in my installation director...
<p>I've personally just dropped the new compiler files in, and it works like a charm (I've done it with 4.3.0 to be exact), although I can't guarantee that this is a should-do solution.</p> <p>I'm talking of course about files that can be downloaded from <a href="https://sourceforge.net/projects/mingw/files/" rel="nof...
How to implement authorization checks in ASP.NET MVC based on Session data? <p>This will be my first ASP.NET MVC application with forms authentication so I am trying to make sure I don't miss anything. The scenario is this: Public / Secured Areas.</p> <p>Within the private area it is even further limited to specific a...
<p>Well it looks like I went with a custom AuthorizeAttribute. It was actually very simple. Here is the code:</p> <pre><code>namespace MyApp.Custom.Security { public class Secure : AuthorizeAttribute { /// &lt;summary&gt; /// Checks to see if the user is authenticated and has a valid session ...
SQL Scripting Tool That Beats MS Query Analyzer? <p>I'm using MS Query Analyzer (as part of SQL Server 2000) to write T-SQL scripts to pull data out of a DB. This involves querying some tables, iterating through the results (using a cursor), some basic processing of the results and putting the processed data into anoth...
<p>I've tried this and personally think that is a better offer than Microsoft one, plus its free!</p> <p><a href="http://www.albahari.com/queryexpress.aspx" rel="nofollow">http://www.albahari.com/queryexpress.aspx</a></p> <p>Hope it serves!</p>
Is there a set of stubs/mocks for JDBC available anywhere? <p>For the past few years I've continuously struggled with unit testing database code and all the pain that comes with it. I found this existing thread which I found very enlightening:</p> <ul> <li><a href="http://stackoverflow.com/questions/145131/whats-the-b...
<p>I don't know if you have seen it or not but there's <a href="http://mockrunner.sourceforge.net/" rel="nofollow">MockRunner</a>. It provides many classes that implement the interfaces of JDBC (as well as other J2EEclasses). Here's <a href="http://mockrunner.sourceforge.net/doc/api/com/mockrunner/mock/jdbc/package-t...
PHP - extract() type <p>PHP's <a href="http://ca.php.net/manual/en/function.extract.php" rel="nofollow"><code>extract()</code></a> function can take on one of several <code>extract_types</code>. But what's the difference between <code>extr_prefix_same</code> and <code>extr_prefix_if_exists</code>? The manual makes it s...
<p>When using <code>EXTR_PREFIX_IF_EXISTS</code>, if the variable doesn't already exist then the prefixed version won't be created either. In this example:</p> <pre><code>function test() { $a = 12345; extract(array('a' =&gt; 1, 'b' =&gt; 2, 'c' =&gt; 3), EXTR_PREFIX_IF_EXISTS, 'my_'); var_export(get_defi...
Synchronising databases SQL Server via C# <p>How do I synchronise a database on one server to the other? I need to do it via C#, not scripts. I was planning to use ADO.NET to retrieve the schema and dataset from one database, but how do I sync it in code?</p> <p>Thanks</p>
<p>There are various options available to you:</p> <ol> <li>SSIS to Export/Import data between System1 &amp; System2</li> <li>Mirroring to copy data between System1 &amp; System2</li> <li>Replication to keep System2 in sync with System1</li> <li>Scripts for Database Backup/Restore between servers using C# to be the IO...
C++ Auto Class Implementation in Editor <p>Much of my time spent developing C++ applications is wasted implementing class definitions. By that I mean the prototyping of classes then creating their respective implementations.</p> <p>For example:</p> <pre><code>#ifndef FOO_H #define FOO_H class Foo { public: Foo (c...
<p>In Visual Studio there are tools to add functions and variable. Tools automates the process in question. But I never use them :)</p> <p>In the <a href="http://www.wholetomato.com/products/featureRefactoring.asp" rel="nofollow">Visual Assist X</a> there is the <a href="http://www.wholetomato.com/products/features/c...
tkMessageBox <p>Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox??</p>
<p>By 'activate', do you mean make it so the user can close the message box by clicking the close ('X') button?</p> <p>I do not think it is possible using <code>tkMessageBox</code>. I guess your best bet is to implement a dialog box with this functionality yourself.</p> <p>BTW: What should <code>askquestion()</code> ...
Passing by ref? <p>I am still confused about passing by ref.</p> <p>If I have a Cache object which I want to be accessed/available to a number of objects, and I inject it using constructor injection. I want it to affect the single cache object I have created. eg.</p> <pre><code>public class Cache { public void Re...
<p>No you do not need to use the ref keyword in this situation.</p> <p>Cache is a class, it is a reference type. When a reference is passed into a method, a copy of the reference (not the object itself) is placed into your parameter. Both references, inside and outside, of the method are pointing to the same object on...
How do I pass the selected item's ID from a ListView to an AlertDialog in Android? <p>Here's the scenario: I have a ListActivity, and long-pressing on an item brings up a context menu. One item in the context menu is "delete", and that brings up a confirmation box (and AlertDialog). When the user presses OK in the conf...
<p>Since you only have one user who can only make one long keypress at a time in your application (if I understood the documentation right), why would storing the id in a field of your own be bad? Sounds like a perfectly reasonable way to do it.</p>
Gmail Syntax Highlighter <p>I sent my code to my friend over Gmail but as you guess, the code is not highlighted in Gmail. Is there solution to highlight code that is sent over Gmail?</p>
<p>Paste your code to an online (maybe offline) syntax highlighter, like <a href="http://tohtml.com/">http://tohtml.com/</a> . Then copy/paste it to gmail &amp; send.</p>
stringstream extraction not working <p>I seem to be having a problem with extracting data from a stringstream. The start of my extraction seems to be missing the first two characters.</p> <p>I have something similar to the following code:</p> <pre><code> std::stringstream ss( std::stringstream::in | std::strings...
<p>Try:</p> <pre><code> // add data to stream ss &lt;&lt; bValid &lt;&lt; " "; ss &lt;&lt; dValue &lt;&lt; " "; ss &lt;&lt; dTime &lt;&lt; " "; </code></pre>
Zend Framework: Set Default Response Section <p>I'm not 100% sure how to phrase this question so please help me if you can.</p> <p>I have a system with modules that can be installed. I check if each module has a MenuController and if so I push an action onto the stack. The problem becomes that in each MenuController, ...
<p>in MenuController use <code>$this-&gt;_helper-&gt;viewrenderer-&gt;setResponseSegment('sth');</code> in preDispatch() :)</p>
Filtering items in InlineFormset <p>I am currently using inlineformset_factory to get a formset with Holidays for a Person, but I only want to display the Holiday objects that are in the future.</p> <pre><code>HolidaysFormset = inlineformset_factory(Person, Holiday) </code></pre> <p>Within the Person class, it is eas...
<p>One solution is to provide a new FormSet Base class, with the <code>.get_queryset()</code> method overridden.</p> <pre><code>class BaseFutureHolidaysFormSet(BaseInlineFormSet): def get_queryset(self): return BaseInlineFormSet.get_queryset(self).filter( finish__gte=datetime.date.today(...
NHibernate Cascade=save-update"? <p>Disclaimer: I am an NHibernate noobie so hopefully this question makes sense. I have a many-to-many relationship between two classes something like…</p> <pre><code>public class Entity1 { public virtual Guid EntityId { get; set; } public virtual IList&lt;Entity2&gt; Entity2...
<p>Yes. It sounds like 'save-update' is what you want.</p> <p>I never found a great explanation of each cascade option in the documentation, but have used this <a href="http://ayende.com/Blog/archive/2006/12/02/NHibernateCascadesTheDifferentBetweenAllAlldeleteorphansAndSaveupdate.aspx">blog post</a> by Ayende as refer...
Escaping only what is necessary, is that possible? <p>I am working with a team of developers on a website. The website will be using classes. I am in charge of creating the data access layer for the classes. There is an understanding that all user input will be escaped upon retrieval (from the post or get). Having litt...
<p>There is no way you could add an automatic decision to escape or not if you don't know if the input has been escaped. You can attempt to analyze it but it will never be good and you will encounter double backslash pairs and such.</p> <p>Take the decision once that data sent to your access layer should be clean and ...
Implementing own Session Management in PHP <p>What options are there to implement an own session management in PHP?</p> <p>Is there a nice way to implement a component which performs all session tasks? How can i construct a class which receives the HTTP Request and Response during one request process? I only found th...
<p>No, I'm sorry to say, there is no interface to switch the built in 'modules' to your own. There are some hooks ( e.g: <code>session_save_handler(), set_error_handler()</code> ), and that's unfortunately it.</p> <p>The $_SESSION is a 'super global' and should IMO not be set directly either way if you're working on a...
How to test if a file is fully copied in .NET <p>I am monitoring a folder for new files and need to process them. The problem is that occasionally file opening fails, because system has not finished copying it.</p> <p>What is the correct way to test if the file is finished copying?</p> <p>Clarification: I don't have ...
<p>I think the only sure way to do this is by trying to open the file exclusively and catching a specific exception. I usually hate using exceptions for normal application logic, but I'm afraid for this scenario there's no other way (at least I haven't found one yet):</p> <pre><code>public bool FileIsDone(string path)...
Python Printing StdOut As It Received <p>I'm trying to run wrap a simple (windows) command line tool up in a PyQt GUI app that I am writing. The problem I have is that the command line tool throws it's progress out to stdout (it's a server reset command so you get "Attempting to stop" and "Restarting" type output.</p>...
<p>Interactive communication through stdin/stdout is a common problem.</p> <p>You're in luck though, with PyQt you can use QProcess, as described here: <a href="http://diotavelli.net/PyQtWiki/Capturing%5FOutput%5Ffrom%5Fa%5FProcess" rel="nofollow">http://diotavelli.net/PyQtWiki/Capturing_Output_from_a_Process</a></p>
Develop a fast search functionality in a big forum? <p>I am building a forum from scratch in PHP. I have used the most of phpBB:s database structure.</p> <p>But now I am thinking about the search functionality?, what is a good design to be able to search really fast in all posts. I guess there must be some better way ...
<p><a href="http://framework.zend.com/manual/en/zend.search.lucene.html" rel="nofollow">Zend Lucene</a> is a powerful way to add search to a PHP site.</p> <p>Here's an article about how to do exactly that: <a href="http://devzone.zend.com/article/91" rel="nofollow">Roll Your Own Search Engine with Zend_Search_Lucene</...
Can't assign TreeNode to Treeview.SelectedNode <pre><code> private void WalkerRefreshNode(bool refreshAllNodes) { TreeNode selectedNode = tree.SelectedNode; TreeNode bufferedNode = (TreeNode)selectedNode.Clone(); if (SelectedNode.Tag != null) { DataRow tag = (DataRow)...
<p>In order to completely replace a <code>TreeNode</code> you will need to remove the old node from the parent node's <code>Nodes</code> collection, and insert the new one in the same location:</p> <pre><code>private void ReplaceNode(TreeNode oldNode, TreeNode newNode) { int index = oldNode.Index; TreeNodeColl...
Postgres: SQL to list table foreign keys <p>Is there a way using SQL to list all foreign keys for a given table? I know the table name / schema and I can plug that in.</p>
<p>You can do this via the information_schema tables. For example:</p> <pre><code>SELECT tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_c...
Caching Proxy Design Advice <p>I'm relatively new to proxies.<br /> I am currently required to design a caching proxy for work.<br /> We have a webservice which serves up data based on calls to it, naturally.<br /> I am required to create a proxy for a rich client application that caches the results of these calls.<br ...
<p>First, I've used System.Web.Caching.Cache in Winforms and Service solutions and never had a problem with it. I recommend mitigating against the disclaimer by testing to ensure the cache works and doesn't leak resources, but none of my testing ever showed this happening.</p> <p>Alternatively there is a caching solut...
How can I translate a shell script to Perl? <p>I have a shell script, pretty big one. Now my boss says I must rewrite it in Perl. Is there any way to write a Perl script and use the existing shell code as is in my Perl script. Something similar to <a href="http://search.cpan.org/perldoc/Inline::C">Inline::C</a>.</p> <...
<p>I'll answer seriously. I do not know of any program to translate a shell script into Perl, and I doubt any interpreter module would provide the performance benefits. So I'll give an outline of how I would go about it.</p> <p>Now, you want to reuse your code as much as possible. In that case, I suggest selecting pie...
MS Project library <p>Does anybody know of a good library for reading/modifying ms project files? </p>
<p>For me the COM interface also worked like a charm. There are a few traps, take care of the CultureInfo of your thread, set it to "en-US", there seems to be a similar issue as the LCID bug in Excel. Also call the methods of the COM from one single thread.</p> <p>I had a look at your profile and could not judge if yo...
vector -> Usage of member functions begin() and end() vs the operator[] <p>While using the vector why do we sometime use the operator[] like homework[mid] but other times use homework.begin(). Also, homework.end() not homework[end], but that's like begin. Is it just accessing the elements differently? It's more confusi...
<p>vector::operator[] retrieves the Nth element of the vector. Such an operator is defined only for select STL container classes.</p> <p>vector.end() is a method returning an iterator. Iterators are special entities for working with STL containers, vector included. vector::end() points onto the element immediately fol...
Rearrage column order in sql server <p>How to rearrange column order in sql server ?</p> <p>right now my column is showing like below when i physically right click and take properties: in sql server 2005</p> <pre><code>colA1 colA2 colA3 colA4 colB1 colB2 colB3 colA5 colA6 </code></pre> <p>Since i know these columns ...
<p>Moving columns involves a lot of DDL, and doesn't actually do anything.</p> <p>If the table is currently empty, fine... but if it has lots of data, this can be <strong>very</strong> painful. And if the table is currently replicated: even worse.</p> <p>IMO, you should just handle this in the <code>SELECT</code> sta...
Excluding a single project file from an SVN repository <p>I have a django project that I have been working on as a solo developer, and have been using TortoiseSVN to keep the code managed in a repository on a work server. I work on this on a local installation of django etc.</p> <p>There is now a second person who wil...
<p>In TortoiseSVN, when you try to commit your files, in the file list dialog, right click the file and look for the Ignore option. You can ignore by complete filename or extension.</p> <p>If the file is already in the repository, and you want to remove it from there and ignore it, you can simply right-click the file ...
What date format is "ds1248083197360"? <p>As the question states, what date format is "ds1248083197360" ? Is this a standard date format or a custom one to an application?</p> <p><strong>ds1248083197360</strong> is <strong>20/07/2009</strong> (or in US format, <strong>07/20/2009</strong>)</p>
<p>this might be miliseconds after 1.january year 1970 GMT 00:00. In this case, your example is 20.07.2009 10:46:37,360</p>
memcache entities without ReferenceProperty <p>I have a list of entities which I want to store in the memcache. The problem is that I have large Models referenced by their ReferenceProperty which are automatically also stored in the memcache. As a result I'm exceeding the size limit for objects stored in memcache. ...
<p>For large entities, you might want to manually handle the loading of the related entities by storing the keys of the large entities as something other than a ReferenceProperty. That way you can choose when to load the large entity and when not to. Just use a long property store ids or a string property to store key...
Meaning of attributes and parameters in HTML Flash tag? <p>In the below code, what are all the parameters and attributes used, why are all these used and what's their meaning here?</p> <p>What parameters and attributes are recommended and what are not to use with a Flash tag in a HTML page?</p> <pre><code>&lt;object ...
<p>The Adobe website has clear and concise explanations of all of these tags, including which are optional and which are required.</p> <p><a href="http://kb2.adobe.com/cps/127/tn%5F12701.html">http://kb2.adobe.com/cps/127/tn_12701.html</a></p>
VC++ error - cannot open file "odbccp32.libcomctl32.lib" <pre><code>Compiling... StdAfx.cpp Compiling... MotleyFool.cpp StockBar.cpp EditQuote.cpp MFToolbar.cpp ReflectionWnd.cpp Generating Code... Linking... LINK : fatal error LNK1104: cannot open file "odbccp32.libcomctl32.lib" Error executing link.exe. MotleyFool.d...
<pre><code>odbccp32.libcomctl32.lib </code></pre> <p>is space missing ?</p> <pre><code>odbccp32.lib comctl32.lib ^ </code></pre>
Problems adding a DelegateControl to the BlackBand.Master in MOSS 2007 <p>I have a custom feature which adds a few controls into the AdditionalPageHead DelegateControl. This works fine on any sites which use our default.master. However the project requires the use of a publishing site which has a master page derived ...
<p>The answer was that I was approaching the solution to my problem incorrectly.</p> <p>To fix this I opened SharePoint designer at my site collection root and clicked on _catalogs/masterpage. Then I made a copy of BlackBand.master in the masterpage catalog. Opened it and added my line of code. Saved it and then se...
How much load can a standard Jira on Tomcat installation take? <p>We are running Jira on a 4 way 32 bit RHEL box with 4 GB RAM with no problems so far. However we anticipate an increase in the number of users and would like to know the maximum no. of simultaneous requests that a Tomcat-Jira server can handle. (The Jira...
<p>As a consultant and Atlassian partner, I see many different JIRA installations. Most have 10K issues, some have 200K issues or more. It's rarely the hits/day that are the limit. Usually you'll find your database config is the culprit or sometimes the number of users managed by JIRA - over 8K users with JIRA 3.13.x c...
Multiple Flv Component playback - through a for loop - rewind issues AS3 Flash CS4 <p>I am building a "video wall" app in flash AS3. I am importing a movie clip with a flvPlayback component nested within, then Adding it to the display list 12 times in a for loop (which is based on the length of an xml file.) The xml fi...
<p>Don't worry chaps... using the "event.target.play()" is triggered when each video finishes, and rewinds them all nicely.</p> <p>Sorry.</p> <p>Jono</p>
how do you increase the height of an html textbox <p>How do you increase the height of an textbox? (along with its font size)</p>
<p>I'm assuming from the way you worded the question that you want to change the size after the page has rendered?</p> <p>In Javascript, you can manipulate <a href="https://developer.mozilla.org/en/DOM/CSS">DOM CSS properties</a>, for example:</p> <pre><code>document.getElementById('textboxid').style.height="200px"; ...
PHP- Getting yesterdays data from the database <p>I want to get yesterdays entries in the database. Any ideas on what query I should run? Its been blowing my mind for the last hour!</p> <p>mysql_query("SELECT <code>id</code> , <code>fullname</code> , <code>address1</code> , <code>address2</code> , <code>citytown</cod...
<p>What about using the function <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function%5Fdate-sub" rel="nofollow"><code>date_sub</code></a> ?</p> <p>For instance, to get yesterday (same time than now) :</p> <pre><code>select date_sub(now(), interval 1 day); </code></pre> <p>And to get...
notify an object when a thread starts <p>i have an object A which should be notified (A::Notify() method) when some thread starts or dies.<br /> Lets say this thread dynamically loads some DLL file of mine (i can write it).<br /> I believe i should write the dllMain function of this DLL, however i'm not sure how to get...
<p>A DLL is loaded once in every process. Once loaded, its DllMain is automatically called whenever a thread is created in the process. Assuming A is a global variable, you can do the following:</p> <ol> <li>After you first load the DLL, call an exported function that will set a global pointer to A in the DLL</li> <li...
Overridable Methods In Constructors -Help to Fix <p>Im attempting to use fxCop on a C# Project as kind of basis for C# coding standards.</p> <p>The project Im using is called S#arp Architecture and is freely available here: <a href="http://code.google.com/p/sharp-architecture/" rel="nofollow">S#Arp Arch</a></p> <p>No...
<p>This is easy: "don't <em>do</em> that". Instead:</p> <pre><code>private string _description; public Region(string description) { Check.Require(!string.IsNullOrEmpty(description)); _description = description; } protected Region() { } [DomainSignature] public virtual string Description { get {return _de...
Is it possible to fetch a https page via an authenticating proxy with urllib2 in Python 2.5? <p>I'm trying to add authenticating proxy support to an existing script, as it is the script connects to a https url (with urllib2.Request and urllib2.urlopen), scrapes the page and performs some actions based on what it has fo...
<p>You may want to look into <a href="http://code.google.com/p/httplib2/" rel="nofollow">httplib2</a>. One of the <a href="http://code.google.com/p/httplib2/wiki/Examples" rel="nofollow">examples</a> claims support for SOCKS proxies if the <a href="http://socksipy.sourceforge.net/" rel="nofollow">socks</a> module is in...
Force Mime Type in Browser (with Javascript) <p>[I imagine that this is impossible due to security concerns, but:]</p> <p>Is it possible to force the browser to handle a file with a certain mime type <strong>without controlling the server?</strong> I'm serving up files from file:// (on the client's machine itself) and...
<p>Nope, this is impossible, except maybe with IE and an ActiveX, but I seriously suggest you not to use it.</p>
parts of page loaded with ajax dont work with functions <p>I have a table like this</p> <pre><code> &lt;tr&gt; &lt;td&gt;No.&lt;/td&gt; &lt;td&gt;Username&lt;/td&gt; &lt;td&gt;Password&lt;/td&gt; &lt;td&gt;Usage Left&lt;/td&gt; &lt;td&gt;%&lt;/td&gt; &lt;td&gt;Valid Until&lt;/td&gt; &lt;td&gt;Days Left&lt;/t...
<p>sounds like you need to use <a href="http://docs.jquery.com/Events/live" rel="nofollow"><code>live()</code></a> instead of <a href="http://docs.jquery.com/Events/bind" rel="nofollow"><code>bind()</code></a> to bind an event handler to the newly added row</p>
Best website to store programming scripts online <p>I want a website where-in it will store all my (quick)scripts online. Sometimes I will writing a couple of python scripts to get this done like, getting the list of recent files added, getting the list of added files on a day, or something even more simpler. So I want...
<p>I would use any version control system for it.</p> <ol> <li>A private local svn repository (not really a website)</li> <li><a href="http://github.com/" rel="nofollow">Github</a></li> </ol>
How to detect that a given PE file (exe or dll) is 64 bit or 32 bit <p>I need to detect whether a given .dll or .exe file is 32 bit or 64 bit</p> <p>At the moment I have only one solution: read the PE Header from the specified file and take the 'Machine' field from there.</p> <p>( Specification: <a href="http://downl...
<p><a href="http://msdn.microsoft.com/en-us/library/aa364819%28VS.85%29.aspx">GetBinaryType(...)</a> returns <code>SCS_32BIT_BINARY</code> for a 32-bit Windows-based application and <code>SCS_64BIT_BINARY</code> for a 64-bit Windows-based application.</p>
What network library on what IRQL? <p>I somewhat confused because I've read that "everything" should be possible at IRQL_PASSIVE, but I am not so sure whether this includes winsock2 or other userland libraries. My normal understanding would be to use the WSK interface. But it would be much more comfortable if I could u...
<p>You cannot access (most) user land libraries from kernel mode. Either you get an kernel mode interface for that library, or you have to use a user mode service (inverted calls).</p> <p>Winsock has a kernel interface, See this <a href="http://msdn.microsoft.com/en-us/library/aa504195.aspx" rel="nofollow">MSDN articl...
convert jquery greybox into favelet <p>Hi anyone can help me with converting this into a bookmarklet to load an external site in a iframe inside an overlay like how it is done on <a href="http://jquery.com/demo/grey/" rel="nofollow">http://jquery.com/demo/grey/</a></p> <p>thnx</p>
<p>I would put all your actual code in an external file that you just load. See <a href="http://paulisageek.com/nodeSelector/" rel="nofollow">http://paulisageek.com/nodeSelector/</a>.</p> <p>The bookmarklet code is : </p> <pre><code>javascript:( function() { var s=document.createElement("script"); ...
UIViewController remove from superview after receiving nsnotification <p>i'm trying to remove a UIViewController from the superview after receiving a notification but it doesn't work.</p> <p>in my appDelegate i do something like this:</p> <pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)application{ ...
<p>Since it looks like you are trying to implement some sort of splash screen, consider using a UINavigationController to present the splash. What you are doing is adding a view controllers view as a subview of UIWindow yet no one is managing your view controller. This is not how you should be doing things.</p> <p>UIW...
How to create mailboxes in Domino Server? <p>I want to create a mailbox for each user in a Domino server. In order to maintain different mailboxes for different user. And storing their respective mails in it. example:</p> <p>User: A Mailbox: Amailbox storing mails of user A </p>
<p>If there already exist Person documents in the Name &amp; Address Book (NAB) for the users, but the users do not have a mail database already, then you should be able to do this from C#, using the Notes/Domino COM classes.</p> <p>For a given user, you will want to dop at least the following:</p> <p>(1) create a ne...
error when using object: "lvalue required as left operand of assignment" <p>I'm getting a strange error when assigning a value to one of my objects. As best as I can figure out, the compiler thinks I'm assigning to a read only variable. It gives me "lvalue required as left operand of assignment" on the myPlace.public...
<p>CLLocation an immutable class with respect to latitude and longitude. So you cannot modify its latitude. You have to create a new object:</p> <pre><code>[[CLLocation alloc] initWithLatitude:latitude longitude:longitude]; </code></pre> <p>Being immutable is the whole meaning of having such an initializer.</p>
What are the major differences between making cool stuff with OpenGL ES VS making it with Flash? <p>I am digging into OpenGL ES on the iPhone, and I have still no big idea about OpenGL ES and Flash.</p> <p>About Flash I only know it is capable of making really nice animations and transitions. For best example, lets lo...
<p>first of all, there is no flash player for the iPhone ... so yeah, that's not really an option ... but there is a flash like alternative ... have a look at <a href="http://gamehaxe.com/2009/05/22/haxe-on-iphone-simulator/" rel="nofollow">this post</a> ... and at <a href="http://haxe.org" rel="nofollow">haXe</a> ...<...
Can I forget all my UIKit and Core Animation knowledge when I decide to do everything in OpenGL ES? <p>I was reading that OpenGL ES can work together with Core Animation. So I wonder if I can re-use some of my hard-worked knowledge on Core Animation when I start doing OpenGL ES stuff...</p>
<p>You're pretty much on your own when you decide to use OpenGL. The only thing you're going to use your EAGLView for is to get the touch events.</p> <p>Now the Quartz stuff is still useful - to draw 2d graphics at runtime and display them in your OpenGL code as textures. But Core Animation isn't useful at all. </p> ...
Caching not working with IIS? <p>All,</p> <p>I have an ASP.NET(C#) that functions as expected with the integrated debugger/web server. However when I move it over to a IIS server it appears as though the cache object is not being set. Can anyone offer any help?</p> <p>Here is the class that sets the cache and subse...
<pre><code>pcs.values["txtName"] </code></pre> <p>That's null and it's already gone from Cache when you're trying to receive it. Your code seems to cache some per-request data obtained from users' input and there's nothing to guaranty the availability of that data in your cache.</p> <p>Every cache access should be pr...
AJAX modal dialog, fire onload if referer == <whatever> <p>I'm trying to change my index.html to show a modal window if the referer to my site == (eg, if they come from Google, show a "Welcome Googler" dialog box with an image inside of it).</p> <p>I'm using FancyBox, but I'm not married to it.</p> <p>Any suggestion...
<p>You're going to need a couple things: document.referrer, and jQuery UI. jQuery UI makes dialog boxes trivially easy. </p> <p>You can find an in depth example from the <a href="http://jqueryui.com/demos/dialog/" rel="nofollow">documentation page</a> but for the most part, this is what you are going to need:</p> <p...
Resizing a char[x] to char[y] at runtime <p>OK, I hope I explain this one correctly. I have a struct:</p> <pre><code>typedef struct _MyData { char Data[256]; int Index; } MyData; </code></pre> <p>Now, I run into a problem. Most of the time MyData.Data is OK with 256, but in some cases I need to expand the amou...
<p>You can use a flexible array member</p> <pre><code>typedef struct _MyData { int Index; char Data[]; } MyData; </code></pre> <p>So that you can then allocate the right amount of space</p> <pre><code>MyData *d = malloc(sizeof *d + sizeof(char[100])); d-&gt;Data[0..99] = ...; </code></pre> <p>Later, you can ...
Extract All Characters after last occurrence of a pattern C# <p>The strings are of the following pattern</p> <pre><code>1.0.0.0 1.0.0.1 1.0.0.2 ... ... ... </code></pre> <p>I am looking for a code which will read the last created string and increment the last numeral by 1 and save it as a new string.</p> <p>How do I...
<p>You can split the string into the components, parse the last one so that you can increase it, and put them together again:</p> <pre><code>string[] parts = version.Split('.'); parts[3] = (Int32.Parse(parts[3]) + 1).ToString(); version = String.Join(".", parts); </code></pre> <p>Another method that may be slightly m...
Listing builtin functions and methods (Python) <p>I have came up with this:</p> <pre><code>[a for a in dir(__builtins__) if str(type(getattr(__builtins__,a))) == "&lt;type 'builtin_function_or_method'&gt;"] </code></pre> <p>I know its ugly. Can you show me a better/more pythonic way of doing this?</p>
<p>There is the <a href="http://docs.python.org/library/inspect.html" rel="nofollow"><code>inspect</code> module</a>:</p> <pre><code>import inspect filter(inspect.isbuiltin, (member for name, member in inspect.getmembers(__builtins__))) </code></pre> <p>Edit: reading the documentation a little more closely, I came u...
How to Return Errors from an ASMX Web Service? <p>My web service method returns a collection object, this will serialize nicely, thanks to the way C# web services work!</p> <p>But if my code throws an uncaught exception, I want to instead return a custom error object.</p> <p>Is this possible using C# ASP.NET v2?</p> ...
<p>Yes, this is possible.</p> <p>What you'll need to look into is the <a href="http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapexception%28VS.71%29.aspx" rel="nofollow">SoapException class</a>, and specifically the <a href="http://msdn.microsoft.com/en-us/library/system.web.services.protocols...
Dragging dnd items generates "this.manager.nodes[i] is null" <p>I use Dojo 1.3.1, essentially under FF3.5 for now.</p> <p>I have a dnd source which is also a target. I programmatically add some nodes inside, by cloning template items. The aim for the user is then to use dnd to order the items. It is ok for one or two ...
<p>OK, it seems that, finally, simply using :</p> <pre><code>actionList.insertNodes(false, [ actNode ]); </code></pre> <p>instead of </p> <pre><code>actionList.insertNodes(true, [ actNode ]); </code></pre> <p>fixed the pb .</p>
SQL Server BETWEEN problem <p>I have a table mapping postal code ranges to contacts. Postal codes are saved in multiple formats for different countries.</p> <p>Table postcode-range:</p> <pre> FROM-CODE TO-CODE CONTACT-ID COUNTRY-CODE 12000 12999 18 fr BT000000 BT9ZZZZZ 34 ...
<p>'12' &lt; '120' &lt; '12000'</p> <p>If you change your from and to codes to '12' and '12999' for 'fr' your query as written will work, although it would include patterns such as '121AB' which presumably isn't a valid French post code. You could include other validation such as testing that the string contains only ...
How does Google use HTML tags to enhance the search engine? <p>I know that Google’s search algorithm is mainly based on pagerank. However, it also does analysis and uses the structure of the document <code>H1</code>, <code>H2</code>, <code>title</code> and other HTML tags to enhance the search results.</p> <p><stron...
<p>I think it's called <a href="http://www.tyssendesign.com.au/articles/faqs/what-is-semantic-mark-up/">"Semantic Markup"</a></p> <blockquote> <p>[...] semantic markup is markup that is descriptive enough to allow us and the machines we program to recognize it and make decisions about it. In other words, markup mean...
SimpleXML, associative arrays, and XPath <p>I have a question about xpath and arrays. What I was wondering was if it is possible to use xpath on some simpleXML and have it return an associative array of node names and their values. For example, say I have the following XML:</p> <pre><code>&lt;element1 page="1"&gt;bla...
<p>I don't think you can fetch that into that kind of array (you would need to tell PHP what tags, child nodes, attributes, etc to put there), but you can fetch DOMNode elements using the <a href="http://php.net/manual/en/class.domxpath.php" rel="nofollow">DOMXPath class</a>, which gives you a <a href="http://php.net/m...
Will a task be completed faster if it is the active window? <p>I have heard a myth that a job will finish faster if it is kept as the active window, and not in the background or minimized. </p> <p>Is there any truth to this? Does the CPU put precedence to tasks where this happens?</p> <p>Thanks,</p>
<p>On Windows the foreground application gets a priority boost. This is to help it maintain responsiveness to the user and makes sure that when it's ready to run after waiting for some I/O event, it'll get to run next, ahead of most other applications that might be waiting to run.</p> <p>There is also a potential for...
F# Add an element to a sequence <p>a simple question I cannot find an answer to: how to add an element to a sequence? Eg I have a seq and a newElem XElement I'd like to append to it.</p> <p>Thanks</p>
<p>Seq.append:</p> <pre><code>&gt; let x = { 1 .. 5 };; val x : seq&lt;int&gt; &gt; let y = Seq.append x [9];; // [9] is a single-element list literal val y : seq&lt;int&gt; &gt; y |&gt; Seq.to_list;; val it : int list = [1; 2; 3; 4; 5; 9] </code></pre>
Unresolved External Symbol <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix">What is an undefined reference/unresolved external symbol error and how do I fix it?</a></p> </bl...
<p>The missing symbol is <code>__imp__htonl@4</code>, which is a C++ mangled name for htonl, which is a function that converts a long value from host to network order. The @4 is used to mangle the input parameters and is part of C++ support for overloaded functions to allow the linker to resolve the right function w/o...
Android AppWidget maps activity problem <p>Right.</p> <p>So I have an app widget.</p> <p>It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map.</p> <p>So - I make a new activity as below:</p> <pre><code>package com.android.driverwidget; import java.util.List; im...
<p>Fix your manifest by adding/moving</p> <pre><code>&lt;uses-library android:name="com.google.android.maps" /&gt; </code></pre> <p>into <em>application</em>.</p>
Inverted beta in MySQL <p>I need to implement an inverted beta function in MySQL (similar to <a href="http://support.microsoft.com/kb/828299" rel="nofollow">Excel's BETAINV</a>).</p> <p>There is some related material is available on Wolfram MathWorld's <a href="http://mathworld.wolfram.com/BetaDistribution.html" rel="...
<p>Look at the <a href="http://www.netlib.org/cephes/" rel="nofollow">cephes</a> library, specifically <code>cprob.tgz</code>. Be warned that the licensing situation of that code seems to be unclear. The source code just says "free", which was a problem for <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=2875...
getting started with osgi + felix <p>Which packages of <a href="http://felix.apache.org/site/index.html" rel="nofollow">Felix</a> do I need to get started? There are a zillion of them on the <a href="http://felix.apache.org/site/downloads.cgi" rel="nofollow">downloads page</a>.</p> <p>(p.s. is the name a reference to ...
<p>You just need to download the "main" distribution at:<br /> <a href="http://apache.mirror.clusters.cc/felix/felix-1.8.0.tar.gz">http://apache.mirror.clusters.cc/felix/felix-1.8.0.tar.gz</a> (it is the first download link)</p> <p>Unzip it, enter in the felix-1.8.0 directory and type<br /> $ java -jar bin/felix.jar</...
inline generic delegate (not the normal Action<T> Func<T, TResult>) <p>Is it possible to write an inline generic method? For example, how can I translate the below method into an inline delegate.</p> <pre><code>public TUser Current&lt;TUser&gt;() where TUser : User { return getCurrentUser() as TUser; } </code></p...
<p>You can use a lambda expression in C# 3.0:</p> <pre><code>Func&lt;User&gt; userFunc = () =&gt; getCurrentUser() as User; </code></pre> <p>or</p> <pre><code>Func&lt;User&gt; userFunc = Current&lt;User&gt;; </code></pre>
jgrowl on iis5 <p>for some reason jGrowl does not want to work on my IIS 5 (live) server, but works perfectly on my IIS 6 (staging) server. has anyone else experienced this problem or is it just my setup?</p> <p>on iis5 i'm getting an "Object doesn't support this property or method" error</p>
<p>jGrowl (and jQuery) don't run on the servers, they run on the clients. Because of that, I'm thinking your problem is elsewhere. You could back up, and try the following code to be sure jQuery and jGrowl are functioning properly.</p> <pre><code>$(function(){ $.jGrowl("I work!"); }); </code></pre> <p>Also, if you ...
JQuery click function not firing intermittently <p>Wow, this one has me tearing my hair out.</p> <p>I'm tracking links in JQuery. </p> <pre><code>$(".hdr a[id]").mousedown(function(e){ var h = this; var url = "/g/click/" + this.id; $.get(url); }); </code></pre> <p>It appears that sometimes the browser ...
<p>Sounds like the same problem I was having when I asked: <a href="http://stackoverflow.com/questions/523312/post-doesnt-have-time-to-run">$.post() doesn't have time to run?</a> The solution for me was to add the following into the mix:</p> <pre><code>$.ajaxSetup({async: false}); </code></pre> <p>No longer doing asy...
When restoring a backup, how do I disconnect all active connections? <p>My SQL Server 2005 doesn't restore a backup because of active connections. How can I force it?</p>
<p>You want to set your db to single user mode, do the restore, then set it back to multiuser: </p> <pre><code>ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK AFTER 60 --this will give your current connections 60 seconds to complete --Do Actual Restore RESTORE DATABASE YourDB FROM DISK = 'D:\BackUp\YourBaackUpFil...
System.InvalidOperationException: Collection was modified <p>I am getting a following exception while enumerating through a queue:</p> <blockquote> <p>System.InvalidOperationException: Collection was modified; enumeration operation may not execute</p> </blockquote> <p>here is the code excerpt:</p> <pre><code>...
<p>I think I had a similar exception when using a <code>foreach</code> loop on a Collection where I tried to remove items from the Collection (or it may have been a List, I can't remember). I ended up getting around it by using a <code>for</code> loop. Perhaps try something like the following:</p> <pre><code>for (in...
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll <p>I have the below sub which checks all of a node's child nodes in a Windows form treeview when the node is checked. I get the error stated in the subject whenever I click it, but this only happens when settings the checked propert...
<p>What's happening is that within the AfterCheck event you're 'Checking' a tree node, which fires the AfterCheck event, in which you 'Check' a node, which fires the AfterCheck event, in which you 'Check' a node, which fires the AfterCheck event, in which you 'Check' a node, which fires the AfterCheck event, in which y...
Cassini service keeps crashing <p>I'm running XP home which doesn't support IIS. Therefore i'm running Cassini. </p> <p>It usually works well. How ever i've notice in the last 2 weeks it crashes. I'm guessing there is some conflict. Perhaps something i've installed recently tho i can't work out what. </p> <p>How can ...
<p>if you run:</p> <pre><code>netstat -a -n -o </code></pre> <p>you will get a list of what is running on each port.</p> <p>This list includes the PID (process id) you can then use task manager to find which process is on port 80.</p>
How does a system's TCP/IP stack differentiate between multiple programs connecting to the same address and port? <p>Suppose two web browsers are running on the same computer and are accessing the same website (in other words, accessing the same IP address on the same port). </p> <p>How does the operating system reco...
<p>The two programs are not actually accessing the "same port." For purposes of TCP, a connection is defined by the tuple (src_ip,src_port,dst_ip,dst_port).</p> <p>The source port is usually ephemeral, which means it is randomly assigned by the OS. In other words:</p> <p>Program A will have:</p> <p>(my_ip, 10000, ...
how to detect search engine visites on my site? like phpBB <p>Is there any way to detect search engines or crawlers on my site. i have seen in <strong>phpBB</strong> at the admin we can see and allow search engines and also we can see the last visit of the bot(like Google Bot).</p> <p>any script in PHP? Not Google An...
<p>You can go by either IP addresses or the 'User-Agent' string that the bot or web browser sends you. </p> <p>When Googlebot (or most other well-behaving robots) visit your website, they'll send you a $_SERVER['HTTP_USER_AGENT'] variable which identifies what they are. Some examples are: </p> <p>Googlebot/2.1 (+<a h...