input
stringlengths
51
42.3k
output
stringlengths
18
55k
How do you create entity diagrams in Visual Studio? <p>How do you create those entity/class diagrams in Visual Studio 2008?</p>
<p>To begin, open a project in Visual Studio and follow these steps:</p> <ul> <li>In the Solution Explorer window, right click the project and select “Add -> New Item”.</li> <li>From the Add New Item dialog box, highlight “Class Diagram” and give it a name.</li> <li>Press the Add button. The Class Diagram file...
ASP MVC View Content as JSON <p>I have a MVC app with quite a few Controller Actions that are called using Ajax (jQuery) and return partial views content which updates a part of the screen. But what I would rather do is return JSON something like this.</p> <pre><code>return Json(new { Result = true, Message ...
<p>Here is the answer! It is slight change from <a href="http://thriftybliss.spaces.live.com/blog/cns!58DA805F37F31F20!170.entry" rel="nofollow">Martin From's</a> method and it seems to work. If there are things missing please can people contribute any code changes in the comments section. Thanks.</p> <p>From you con...
iphone maps help needed <p>I need you help. I saw one application myhomes for iphones. link for that app is from myhomes.com. they are using map in which markers are there when you click on marker one button is displayed(that is really a thaught for me how to disply a button in objective c when we click on marker in w...
<p>Please see the MapKit component documentation included with the iPhone 3.0 SDK.</p>
Is there a good ActiveX/COM component to "print" to PDF? <p>Clutching at straws here, I think I remember seeing a solution to this somewhere but can't find it now.</p> <p>The issue is that I need a Windows application (not .Net) to be able to generate PDFs. The "standard" solution is to use something like <a href="ht...
<p>You might want to look at BullZip (google it because I cannot add hyperlinks yet). We recently had Jody Meyer present this tool at the Detroit Area Fox User Group (previously shown at the Grand Rapids Area Fox User Group too). It was a great session.</p> <p>She showed how to use the COM object to automate a ton of ...
Tips on managing large amounts of code? <p>My project seems to be getting bigger and bigger and some of my classes are thousands of lines long. It's too hard to search through them every time I want to make changes.</p> <p>I find JavaScript is not as easy to lay out cleanly as some other programming languages. So when...
<p>Breaking up JS into separate files has some major drawbacks, chiefly that you're forcing web browsers to make a separate request for each file.</p> <p>Have you taken a look at leaving all of your files separated out, but making a single-file "bundle" for each project containing only the necessary files? This can b...
Rails dashboard design: one controller action per div <p>I am implementing a dashboard as a relative Rails newbie (more of an infrastructure guy). The dashboard will consist of multiple pages, each page of which will contain multiple charts/tables/etc. For modularity, I want it to be as easy as possible to add new ch...
<h2>Version 1:</h2> <p>Simple method that I've actually used in production: iframes.</p> <p>Most of the time you don't actually care if the page renders all at once and direct from the server, and indeed it's better for it to load staggered.</p> <p>If you just drop an iframe src'd to the controller's show action, yo...
Python Getting date online? <p>How can I get the current date, month &amp; year online using Python? Thanks!</p> <p>EDIT-By this I mean, rather than getting it from the computer's date-visit a website &amp; get it, so it doesn't rely on the computer.</p>
<p>So thinking about the "would be so trivial" part I went ahead and just made <a href="http://just-the-time.appspot.com/">a google app engine web app</a> -- when you visit it, it returns a simple response claiming to be HTML but actually just a string such as <code>2009-05-26 02:01:12 UTC\n</code>. Any feature request...
JAR file not opening on a Mac <p>I have been trying to open a JAR file on my Mac with no success. It says the JAR file could not be opened and asks me to look for any error messages in my console. Here are the console messages. I suspect the prob is in the first line itself, but I am not from a software background, so ...
<p>I'm guessing that the JAR requires Java 6; most Macs only have Java 5 installed.</p>
Isn't C++'s inline totally optional? <p>I have a class that had an inline member, but I later decided that I wanted to remove the implementation from the headers so I moved the members body of the functions out to a cpp file. At first I just left the inlined signature in the header file (sloppy me) and the program fail...
<p>Indeed, there is this one definition rule saying that an inline function <em>must</em> be defined in every translation unit it is used. Gory details follow. First <code>3.2/3</code>:</p> <blockquote> <p>Every program shall contain exactly one definition of every non-inline function or object that is used in that ...
Get installed applications in a system <p>How to get the applications installed in the system using c# code?</p>
<p>Iterating through the registry key "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" seems to give a comprehensive list of installed applications.</p> <p>Aside from the example below, you can find a version using Linq <a href="http://www.debugrelease.com/2008/08/29/get-a-list-of-installed-applications-using-lin...
How to defer to the "default" HttpHandler for ASP.NET MVC after handling a potential override? <p>I need to implement a custom handler for MVC that gives me the first look at URLs requests to determine if it should rewrite the urls before submitting the URL to the routing engine. Any pattern is a candidate for the redi...
<p>You would need to:</p> <ol> <li>Not use the standard MapRoute extension method in global.asax (this is what sets up the route handler).</li> <li>Instead, write your own route subtype, <a href="http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx" rel="nofollow" title="ASP.NET MVC Domain Rou...
Objective-C asynchronous callback from <p>I'm trying to make a class that handles some NSURLConnection and authentication stuff and then makes a callback to downloadFinished when it has completed the didReceiveData event. How exactly does that work in Objective-C? Thanks! </p> <pre><code>#import "fetch.h" ... - (IB...
<p>There's a good example of this in the <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html" rel="nofollow">Using NSURLConnection</a> section of the URL Loading System guide.</p>
Using the ClassLoader method to retrieve all resources under classes as Input Streams <p>My problem is one that you would think is quite common, but I haven't so far managed to find a solution.</p> <p>Building a Java web app under Tomcat 5.5 (although a requirement is that it can be deployed anywhere, like under a Web...
<p>As far as I am aware, there is no such ability, since the classloader only attempts to load things it is asked for. It doesn't pre-fetch all items on the classpath, or treat them as a directory structure.</p> <p>The way I would solve the problem is create a directory listing in a text file of all relevant resources...
multiline uibutton <p>How to set a multiline as title of a <code>UIButton</code> in iPhone programming ?</p>
<pre><code>someButton.lineBreakMode = UILineBreakModeWordWrap; </code></pre> <p>Be sure to try to get in the habit of consulting the documentation before posting a question. Apple's documentation is pretty comprehensive, and things like this generally get covered.</p>
Why does my co-worker see a different Project file (*.csproj) using Visual Source Safe <p>I met a problem which is very strange, my company uses Visual Source Safe<br /> to control version,but I found that my team's different member see the same .csproj file in VSS is not the same, it's very strange,can you help me? th...
<p>He needs to do a get latest, try build tree option to get to your development folder. He might be getting files to the wrong folder, thus his files are not updated. Try verifying your working folder is set correctly. </p>
How can I convert from an array of struct to array of Point3D? <p>I want to convert an array of struct to array of Point3D. The code snippet is as follows :</p> <p>class Mymesh { public MeshGeometry3D Mesh3D // Properties tanimlaniyor { get { return GetMesh3D(); } }</p> <pre><code>public struct m...
<p>To be able to construct a Point3D you need to use one of its constructors.<br /> From <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.media3d.point3d.aspx" rel="nofollow">this documentation</a> it seems that Point3D has a constructor that takes the 3 coordinates so you can change this:</p> <pr...
Rewriting a midsize application in OO <p>What are some apraoches i can take to rewrite fairly large procedural php <em>roughly 2000 lines of code</em> app as an oo app. And should i even try to do so, or should i build on top of the existing app? I wrote it when i was learning programming and i now i want to expand it...
<p>There is no silver bullet. However, you could do a lot worse than picking up this book: <a href="http://rads.stackoverflow.com/amzn/click/0131177052" rel="nofollow">http://www.amazon.co.uk/Working-Effectively-Legacy-Robert-Martin/dp/0131177052</a></p>
Can't get YUI Autocomplete to work <p>I've spent the last several hours reading through YUI docs and code and I'm not able to get this working.</p> <p>My remote data source is XML. I have a local proxy acting to retrieve the remote data.</p> <p>I've confirmed via Firebug that as I am typing in the input field, the re...
<p>It's hard to know for sure without seeing your full implementation, but you might try turning off "applyLocalFilter". In other words, change this line:</p> <pre><code>autosearch.applyLocalFilter = true; // pass results thru filter </code></pre> <p>to this instead:</p> <pre><code>autosearch.applyLocalFilter = fal...
Experiences with D-programming-language <p>Has someone here ever had experience with the <a href="http://en.wikipedia.org/wiki/D_%28programming_language%29">D programming language</a>? </p> <p>It seems to have many nice features but will it ever reach the popularity of those currently widespread languages like C++, Ja...
<p>I spent a few days playing with D to see how it compares to C++ and java. It is positioned as another way to achieve the same things C++ does, but without all the undefined behaviour, and with the addition of a garbage collector, foreach loop, and some other modern niceties. It compiles to native code so you get acc...
How can I use a session in an ASP class file? <p>I'm binding a menu from a database. In the SQL query, I am passing </p> <pre><code>where userid="System.Web.HttpContext.Current.Session["uid"].ToString()" </code></pre> <p>It is working, but for every login it is the same.</p> <p>What can I do, please?</p>
<p>The code snippet you have seems a little off in that you have wrapped everything in quotes the line should be along the lines of </p> <p>C#</p> <pre><code>string sql = "select a,b,c from XXX where userid=" + System.Web.HttpContext.Current.Session["uid"].ToString(); </code></pre> <p>VB</p> <pre><code>Dim sql As S...
jQuery to Prototype convert: Dynamically SlideUp div on mouseover <p>I use this jQuery code to slide up a div over its wraper div dynamically:</p> <pre><code>jQuery.fn.masque = function(classSelector) { $(this).hover(function(){ $(this).find(classSelector).stop().animate({height:'88px',opacity: '0.8'},400)...
<p>The main problem is that scriptaculous doesn't have stop(): you have to hold the effect somewhere.</p> <p>Maybe it would be</p> <pre><code>Element.addMethods({ masque: function(selector) { this.observe('mouseover', function() { if(this._masqueEffect !== undefined) { this._ma...
Suggestions for Security Design for Access Control List in database? <p>I have users for my application with access control list (these are both tables/schema/objects). Currently these are read from the database, Boolean values are used to indicate what they can view/manipulate. However, anyone can still go to the data...
<p>Something like </p> <pre><code>table users username: string password_hash: hex acl: bit array </code></pre> <p>username is the username, password_hash is the hash of the password, with a grain of salt. It's wrong to store a plain password, but you already knew that, didn't you?</p> <p>ACL is declared as a string ...
C#: Why is my Process that is running Java.exe working perfectly, but the window isn't returning ANY output? <p>I created a Process that is targeted to the Java.exe file. The process should run a Java.jar server file, and continue to run giving output feedback until the server crashed or I forcefully close it down. Eve...
<p>Are you sure it writes to stdout? Have you tried checking stderr? (<code>RedirectStandardError</code>/<code>StandardError</code>/<code>ErrorDataReceived</code>/<code>BeginErrorReadLine</code>).</p> <p>If it writes directly to the display buffer (instead of stderr/stdout) then it might not be possible without a <str...
How can I make an view-based application that does not use a nib file? <p>I've choosen the "view-based" application template in Xcode. The myProjectViewController.m has the following code:</p> <pre><code>/* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ ...
<p>You may wish to refer to <a href="http://stackoverflow.com/questions/809898/loading-a-view-controller-view-hierarchy-programatically-in-cocoa-touch-without/812094#812094">my answer</a> to <a href="http://stackoverflow.com/questions/809898/loading-a-view-controller-view-hierarchy-programatically-in-cocoa-touch-withou...
how to find the execution path of a installed software <p>How can i find the execution path of a installed software in c# for eg media player ,vlc player . i just need to find their execution path . if i have a vlc player installed in my D drive . how do i find the path of the VLC.exe from my c# coding </p>
<p>Using C# code you can find the path for some excutables this way:</p> <pre><code>private const string keyBase = @"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"; private string GetPathForExe(string fileName) { RegistryKey localMachine = Registry.LocalMachine; RegistryKey fileKey = localMachine.OpenSub...
Update using LINQ to SQL <p>How can I update a record against specific id in LINQ to SQL?</p>
<p>LINQ is a query tool (Q = Query) - so there is no magic LINQ way to update just the single row, except through the (object-oriented) data-context (in the case of LINQ-to-SQL). To update data, you need to fetch it out, update the record, and submit the changes:</p> <pre><code>using(var ctx = new FooContext()) { ...
Accessing REMOTE_USER from PHP/CakePHP <p>I'm developing a CakePHP site for which I've just enabled VAS authentication using a .htaccess file:</p> <pre><code>AuthType VAS AuthVasUseBasic On AuthVasRemoteUserMap local Require valid-user </code></pre> <p>I'd expect to be able to find out who was logged in by using <c...
<p>Apache is adding those REDIRECT_ prefixes so that scripts can better handle what has happened. For my application I have written a function to deal with this. In my case it's a method on a class, but you can easily turn it into a global function.</p> <pre><code>class MyClass { /** @var integer How deep the redi...
What is the advantage of having this/self pointer mandatory explicit? <p>What is the advantage of having <a href="http://en.wikipedia.org/wiki/This%5F%28computer%5Fscience%29"><code>this</code>/<code>self</code>/<code>me</code></a> pointer <strong>mandatory</strong> explicit?</p> <p>According to <a href="http://en.wik...
<p>In addition to member variables and method parameters you also have local variables. One of the most important things about the object is its internal state. Explicit member variable dereferencing makes it very clear where you are referencing that state and where you are modifying that state.</p> <p>For instance, i...
Covert NSString to NSDate in a different timezone <p>I am trying to convert a string to date in a separate time zone from the current system time zone. I have set the time zone of the dateformatter to this timezone. But the NSDate I get is always in my current time zone.</p> <p>For instance, my current time zone is PD...
<p><code>NSDate</code> stores only the seconds since 00:00:00 01 Jan. 2001. The description of NSDate will use your current time zone (if try to debug with NSLog for example). </p> <p>You must get the default time zone with </p> <pre><code>[NSTimeZone defaultTimeZone] </code></pre> <p>and then calculate the offset b...
Jquery delayed css div position <p>I am trying to make my menu bar partially hide after a timeout of about 5 seconds of inactivity. The menu is positioned 20px from the top of the page and the basic idea is that a small section of the menu will still be visible once it has moved up to allow the user to hover over this ...
<p>You should use the <code>mouseout</code> event of the <code>div</code> that represents the menu to implement a function like this:</p> <pre><code>var waitingForMenuToHide = false; function myOnMouseOut() { waitingForMenuToHide = true; setTimeout(function() { if (waitingForMenuToHide) { ...
Changing the polling interval on BizTalk MSMQ receive adapter <p>Is there some setting that affects the polling interval in a BizTalk MSMQ receive adapter?</p> <p>I've read the section in Professional BizTalk 2006 that <em>"this is set to 1/2 second and is not configurable"</em>, but the delay on my test box seems to ...
<p>It doesn't appear to be possible to configure the polling interval for the MSMQ receive adapter. </p> <p>With regards to the delay in polling of 10 seconds, is it possible that the Host/Host Instance under which the adapter is running could be heavily loaded, hence the delay? </p>
How to disable ellipsis of cell texts in a WindowsForms DataGridView? <p>I have a DataGridView in readonly mode in a .NET 3.5 (Visual Studio 2008) WinForms application.</p> <p>The cells' width is very small. Some of the cells contain a short number. Now, even with a small font, sometimes the number is shown with an el...
<p>handle the DataGridView control's CellPainting event. Check the following link :</p> <p><a href="http://msdn.microsoft.com/en-us/library/hta8z9sz.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/hta8z9sz.aspx</a></p> <p>Note that when you draw the text itself you need to customize the StringFormat - <...
Any good regular expression creator software or online tools to create Regular expressions <p>Does anyone have any good link to a website or a good tool to create regular expressions rather than break your head to create one. The tool should be able to create regular expressions by simply selecting some sort of pattern...
<p>Here is a good online regex tool: <a href="http://www.gskinner.com/RegExr/">www.gskinner.com/RegExr/</a></p>
Possible: Program executing Qt3 and Qt4 code? <p>Maybe its a very dumb question but I hope you can give me some answers.</p> <p>I have a commercial application which uses Qt3 for its GUI and an embedded Python interpreter (command line) for scripting. I want to write a custom plugin for this application which uses Qt4...
<p>See <a href="http://labs.trolltech.com/forums/topic/414" rel="nofollow">this thread</a> on a Trolltech forum. (Well actually that's about Qt3 plugins in a Qt4 app but I suspect the answer is much the same). </p> <p>Update: link now a dud, but the <a href="http://web.archive.org/web/20090112213159/http://labs.trollt...
Nice way to do this in modern OO C-like language? <p>I have <code>Tile</code>s which represent the tiles in a game's 2-dimensional world. The tiles can have walls on any number of their 4 sides. I have something like this at the moment:</p> <pre><code>interface Tile { boolean isWallAtTop(); boolean isWallAtR...
<p>Go go gadget bitmasks. Use a 4 bit mask for each tile, stating which side has a wall.</p> <pre><code>A B C D </code></pre> <p>Bit A indicates a wall on the top, B the right, C the bottom, D the left. Define constants to help you that you can just logically intersect with the mask, i.e.</p> <pre><code>if (tile.Wal...
Reading from Excel (Range into multidimensional Array) C# <p>How would I read from an Excel sheet and load the marked selection (Area) into an multidimensional array? A column in Excel could itself be a multi dimensional array since it would contain more than just one value.</p> <p>The idea (not sure how good or bad ...
<p>You can read the value of Range as array:</p> <pre><code>using (MSExcel.Application app = MSExcel.Application.CreateApplication()) { MSExcel.Workbook book1 = app.Workbooks.Open( this.txtOpen_FilePath.Text); MSExcel.Worksheet sheet = (MSExcel.Worksheet)book1.Worksheets[1]; MSExcel.Range range = sheet.Ge...
java logger to one file over several classes and packages <p>I'm trying to figure out how to use the java.util.logging features. All of the tutorials show how to log to a log file from the main class, but I cannot figure out how I can log to one file in various classes. I have a web service and a web service client a...
<p>That’s what the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/package-summary.html" rel="nofollow">JDK logging framework</a> has <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/Handler.html" rel="nofollow">Handlers</a> for. Add a <a href="http://java.sun.com/j2se/1.5.0/docs/...
How do I list available methods on a given object or package in Perl? <p>How do I list available methods on a given object or package in Perl?</p>
<p>There are (rather too) many ways to do this in Perl because there are so many ways to do things in Perl. As someone commented, autoloaded methods will always be a bit tricky. However, rather than rolling your own approach I would suggest that you take a look at <a href="http://search.cpan.org/~adamk/Class-Inspector...
Currency xml feeds with lots of currencys <p>I am seeking an XML feed with currency data. It should be free and updated daily. I have Googled all day for this with no success. If somebody knows of one, please share info.</p>
<p>The European Central Bank (ECB) has the most reliable free feed that I know of. It contains approx 28 currencies and is updated at least daily.</p> <p><a href="http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml">http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml</a></p> <p>For more formats and tools see th...
Can I do delayed execution in ASP? Or: please offer any help on improving performance of an old ASP site <p>I'm trying to improve the performance of a website written in classic ASP.</p> <p>It supports multiple languages the problem lies in how this was implemented. It has the following method:</p> <pre><code>GetTran...
<p>I don't think you can do delayed execution in Classic ASP. As for suggestions on improving the performance. You can have a class like this :</p> <pre><code>Class TranslationManager Private Sub Class_Initialize End Sub Private Sub Class_Terminate End Sub Private Function Exi...
Crystal Reports - Row headers for mutli-column data <p>Please help!</p> <p>I need to produce a Crystal Report with multiple data columns, but need to show row headers as well.</p> <p>e.g.</p> <pre><code>(Fieldname) (DataColumn1) (DataColumn2) (DataColumn3) Animalname Elephant ...
<p>If the table columns are name and size, you vertically arrange the details fields like...</p> <pre><code>name {name_field} size {size_field} </code></pre> <p>but i think the problem with that is when you "format with multiple columns" it would turn into this...</p> <pre><code>name {name_field} name {name_fie...
Different animations for Jquery ui tabs <p>I'm using jquery ui tabs widget. I've not used a jquery theme as i prefer to do my own css and stuff. I've got it working, but what i'd like is to have a different animation effect for the tab content when a different tab is clicked. What i'd like is for the new tab content to...
<p>Not sure which version you use, but with 1.7.1 here is how to do it:</p> <pre><code>$("#tabs").tabs({ fx: { height: 'toggle', duration: 'slow' } }); </code></pre>
how do you pass a variable' value inside prototype's $() utility method? <pre><code>function insertChildDiv(parentId) { var ChildComment = new Element('div', {'class':'padding'}); ChildComment.update('testing'); $().insert(ChildComment); } </code></pre> <p>i want the value of parentId inside the $() in the line ...
<p>$() accepts a string or a DOM element as parameter</p> <p>Edited to reflect edits in original Q.</p> <p>$(parentId) will work as long as the id is valid. </p> <p>the id passed to the function is "123456" and the id you're looking for is "123456more". Also, what you're passing is an integer (123456) not a string. ...
Attaching and Detaching events to/from Virtual Earth maps <p>I don't <em>think</em> this is particularly quirky, but in an attempt to control my JavaScript code (if it <em>is</em> possible to really control JavaScript ;-) ) I have been wrapping all of my client-side JavaScript in lovely objects. Or as lovely as I can m...
<p>Well obviously you could store the function:</p> <pre><code>var obj = this; var func = function(event){ obj.onClickMap(event); } _map.AttachEvent("onclick", func); </code></pre> <p>And then detach:</p> <pre><code>_map.DetachEvent("onclick", func); </code></pre> <p>Does that help?</p>
Watin - Watin.Core.Exceptions.ElementNotFoundException <p>I have code that runs that gives me the error : Could not find a 'INPUT (text password textarea hidden) or TEXTAREA' tag containing attribute name with value <strong>________</strong> (It's testing a website) </p> <p>It says it can't find a <p> </p> <p>What...
<p>The WatiN codebase isn't that complex. Download it and run it in debug mode and see where it breaks when the exception is thrown, then you can examine the context surrounding the error.</p>
Python MS Word <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/188444/reading-writing-ms-word-files-in-python">Reading/Writing MS Word files in Python</a> </p> </blockquote> <p>I'm looking into a requirements management system (like requiste pro - Rational Ro...
<p>First, get it out of native Word (<code>.doc</code>) format.</p> <ul> <li><p>Do a "Save As XML" and insist your users work with that file instead of the <code>.doc</code> file. They'll hardly notice the difference -- except that the file is bigger.</p> <p>Use <a href="http://codespeak.net/lxml/" rel="nofollow">lx...
Cancelling a long running regex match? <p>Say I'm running a service where users can submit a regex to search through lots of data. If the user submits a regex that is very slow (ie. takes minutes for Matcher.find() to return), I want a way to cancel that match. The only way I can think of doing this is to have another ...
<p>From Heritrix: (<a href="http://crawler.archive.org">crawler.archive.org</a>)</p> <pre><code>/** * CharSequence that noticed thread interrupts -- as might be necessary * to recover from a loose regex on unexpected challenging input. * * @author gojomo */ public class InterruptibleCharSequence implements Cha...
C# Charting - Reasonble Large Data Set and Real-time <p>I'm looking for a C# WinForms charting component, either commercial or open source, that can handle relatively large data sets and be reasonable scalable with regards to chart rendering and updates. The number of data sets to be displayed would be around 30. There...
<p>I have used <a href="http://sourceforge.net/projects/zedgraph/" rel="nofollow">ZedGraph</a> in the past for realtime stock charts with large histories.</p> <p>It can be a little slow if the chart is very complex but found it to be very good and easy to expand (as open source) to do whatever custom formatting you ne...
How to control over browser back button <p>I want a confirmation window on click of a browser back button. If I press yes then the previous page will get load ortherwise I will remain in the same page?</p> <p>Any suggestion is highly appreciated.. But please be on track.. my question is straight forward</p> <p>thx in...
<p>Why do you want to do that? </p> <p>You can prevent them from leaving the page by using Javascript, but if you can't use that, it's not possible to do anything about it.</p> <p>Generally you should use the unload event in the body (in jQuery for instance, just add </p> <pre><code>jQuery(window).unload(function(ev...
jquery assign onclick for li from a link <p>I have a list of items</p> <pre><code>&lt;ul class="list"&gt; &lt;li&gt; &lt;a href="#Course1" class="launch" onclick="alert('event 1')"&gt;event 1&lt;/a&gt; &lt;/li&gt; &lt;li class="alt"&gt; &lt;a href="#Course2" class="launch" onclick="alert('e...
<p>building on <a href="http://stackoverflow.com/users/72859/thomas-stock">@Thomas Stock's</a> <a href="http://stackoverflow.com/questions/910850/jquery-assign-onclick-for-li-from-a-link/910877#910877">answer</a> the following code prevents double execution on clicking on link instead of li. (got it from <a href="http:...
Change text box quantity, change picture upon hover with jQuery/Javascript <p>I would like to do 2 things in jQuery or Javascript,</p> <ol> <li><p>Change with quantity in a text box with up and down arrows. The default qty is 1, and I want to increment by 1 when a user clicks the up arrow, and vice versa.</p></li> <li...
<p>I would recommend using <a href="http://docs.jquery.com/Events/click" rel="nofollow"><code>click()</code></a> command for changing the value in a textbox and the <a href="http://docs.jquery.com/Events/hover" rel="nofollow"><code>hover()</code></a> command for changing the arrow to another picture (color)</p> <p>for...
Search Twitter tweets by #topic with distinct user <p>What is a good way to show the most-recent tweets on a #topic by distinct users? For example, if five users have written a combined total of twenty tweets on #example, but one zealot has the fifteen most recent, I want only his latest.</p> <p>Duplicate-elimination...
<p>There's no way to do this with the Twitter Search API - you'll need to pull down the feed and do your own post-processing on it.</p>
Storing information on points in a 3d space <p>I'm writing some code (just for fun so far) in Python that will store some data on every point in a 3d space. I'm basically after a 3d matrix object that stores arbitary objects that will allow me to do some advanced selections, like:</p> <ul> <li>Get the point where x=1,...
<p>Well ... If you expect to really <em>fill</em> that space, then you're probably best off with a densely packed matrix-like structure, basically <a href="http://en.wikipedia.org/wiki/Voxel" rel="nofollow">voxels</a>.</p> <p>If you don't expect to fill it, look into something a bit more optimized. I would start by lo...
How can I bind events to strongly typed datasets of different types? <p>My application contains several forms which consist of a strongly typed datagridview, a strongly typed bindingsource, and a strongly typed table adapter.</p> <p>I am using some code in each form to update the database whenever the user leaves the ...
<p>This demontrastes how you can use an "MustInherit" base class for your typed datasets for the purpose of accessing unexposed properties.</p> <p>Set this as the "BaseClass" for each of your typed TableAdapters, replacing "System.ComponentModel.Component". By using "MustInherit/MustOverride" ("Abstract" in C#) you ca...
Is there any HTML URL encoding function freely available on web?? (Implementation in C) <p>I want to use URL encoder for my C program. I am wondering if there is any freely available URL encoding function implemented in C (on the web)??? I tried searching it, but couldn't get one :(</p>
<p>I find the <a href="http://www.faqs.org/rfcs/rfc1738.html" rel="nofollow">standard for URL's</a> isn't that hard. You can even limit yourself to HTTP URL's in most cases. It's pretty straight-forward to create your own urlencoder.</p>
Set the maximum recursion depth while serializing a Django model with Foreign key to JSON <p>I have a Django model created for Google's App Engine,</p> <pre><code>Model A(): propA = ReferenceProperty(B) Model B(): propB = ReferenceProperty(C) Model C(): propC = ReferenceProperty(B) </code></pre> <p>I have wri...
<p>Just modify your functions to take a 'depth' argument. Any time you follow a ReferenceProperty, call the function with depth one less than the depth that was passed in. If a function is called with depth==0, return None, or whatever other placeholder value is suitable in your case.</p>
Find a Control inside ASP:Repeater <p>I am trying to access a control inside a Repeater. The control is inside the &lt;ItemTemplate> tag. I am using FindControl but it's always coming out Null. What am I doing wrong?</p>
<p>My guess is that FindControl can only be used in record-level events such as ItemDataBound:</p> <pre><code>protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { (ControlTypeCast) e.Item.FindControl("myControl")).SomeProperty = "foo"; } </code></pre>
Visual Studio Debugger Not Attaching when at the Root of a website <p>I am having a problem with my Visual Studio 2008 debugger not attaching to the root of the default website when I run from within the environment.</p> <p>I have a .NET 3.5 Web Application project running on VS 2008 SP1. I have set the project to "Us...
<p>The problem I was having was related to the fact that I had a tag in my web.config that surrounded my tag. This evidently causes the debugger to attach and then error out immediately without any sort of warning or error. Here is the article I used to figure this out:</p> <p><a href="http://www.west-wind.com/Web...
Configure Visual Studio to publish the WCF service app on build <p>I have created a WCF application (the one with .svc file). When I build this project, only bunch of DLLs are created but to be able to host it in IIS, I have to use publish option (right click the project and publish). This generates DLLs, copies app.co...
<p>You could also look at adding a <a href="http://msdn.microsoft.com/en-us/library/bb552362.aspx" rel="nofollow">Web Application Project</a> and couple it with a <a href="http://weblogs.asp.net/scottgu/archive/2008/01/28/vs-2008-web-deployment-project-support-released.aspx" rel="nofollow">web deployment project</a> th...
Is there anyway to monitor one single (class) of object in terms of cache? <p>I am trying to determine which implementation of the data structure would be best for the web application. Basically, I will maintain one set of "State" class for each unique user, and the State will be cached for some time when the user logi...
<p>What exactely are you trying to measure here? If you just want to get the size of your in-memory <em>State</em> instances at any given time, you can use an application-level counter and add/substract every time you create/remove an instance of <em>State</em>. So you know your State size, you know how many State inst...
The whole index.php?=<filename>.exe <p>I've never really understood on how to do it. I want to where where I can type my address, followed by /index.php?=&lt;a file that is on the FTP>.exe. From there, I would be direct to a page that has a download now button and maybe something like a ad.</p> <p>Anyone have any tuto...
<p>Im gonna bite ...</p> <p>The PHP script ensures the file is not accessible from the outside, and only on a per-request basis with possible authentication. When you see:</p> <pre><code>download.php?file=sdjasdk.exe </code></pre> <p>The download script looks a bit like:</p> <pre><code>&lt;?php if( $_SESSION['a...
WCF and Fluent NHibernate: how can i keep "clean" classes? <p>i'm investigating Nhibernate, jquery and WCF at the same time for a in-house project, and i was wondering why i couldn't have "clean" data classes. </p> <p>From what i've read, a very good point in the nhibernate world is that my business class won't be lin...
<p>I suggest you use DTOs to send over the wire - then you can decorate the DTOs with the necessary attributes.</p> <p>This means, of course, that you must somehow map your domain classes to the DTOs and vice versa. If the mapping is trivial (+some other cases that satisfies some conventions), you can use <a href="htt...
Dynamic form submission using javascript - how to elegant code? <p>Here is the problem: </p> <p>My page displays a set of items. Each item has a check box associated to it (which is part of a form). User might check any of these check boxes and press 'Delete' button. The same page also has a 'Upload' button which woul...
<p>It sounds like you may need two different forms, for the two different actions.</p>
How can I make Perl wait for child processes started in the background with system()? <p>I have some Perl code that executes a shell script for multiple parameters, to simplify, I'll just assume that I have code that looks like this:</p> <pre><code>for $p (@a){ system("/path/to/file.sh $p&amp;"); } </code></pre> ...
<p>Using fork/exec/wait isn't so bad:</p> <pre><code>my @a = (1, 2, 3); for my $p (@a) { my $pid = fork(); if ($pid == -1) { die; } elsif ($pid == 0) { exec '/bin/sleep', $p or die; } } while (wait() != -1) {} print "Done\n"; </code></pre>
How could this C fragment be written more safely? <p>I have the following C code fragment and have to identify the error and suggest a way of writing it more safely:</p> <pre><code>char somestring[] = "Send money!\n"; char *copy; copy = (char *) malloc(strlen(somestring)); strcpy(copy, somestring); printf(copy); </c...
<p>I can't comment on the responses above, but in addition to checking the return code and using <code>strncpy</code>, you should never do:</p> <pre><code>printf(string) </code></pre> <p>But use:</p> <pre><code>printf("%s", string); </code></pre> <p>ref: <a href="http://en.wikipedia.org/wiki/Format_string_attack" r...
ASP.Net Repeater control <p>I've been trying everything I know to change the color of a row in an asp:repeater control. What I'm trying to do is this: Based on a value, I want to be able to set the color of a record in the repeater control. I've tried DIV tags, can't make it work. How do I go about this? Thaks</p>
<p>Use the &lt;%# %> databinding syntax within the ItemTemplate to do conditional formatting:</p> <pre><code>&lt;asp:Repeater runat="server" ID="rpt"&gt; &lt;ItemTemplate&gt; &lt;div class="&lt;%# Container.ItemIndex % 2 ? "even" : "odd" %&gt;"&gt; &lt;/div&gt; &lt;div class="&lt;%# Eval("PropertyOfDataS...
Warning about hiding member variables? <p>The following code snippet has a memory leak that I spent too much time chasing down. The problem is that inside Foo(), the local variable x_ hides the member variable x_. It's quite annoying too, because the compiler could have warned me about it. Is there a flag in GCC for ...
<p>Use -Wshadow.</p> <p>By the way, neither -W nor -Wall enables -Wshadow.</p> <p>It's nice to have the compiler help avoid this kind of problem, but that won't even be necessary if you use conventions that help avoid creating it in the first place, such reserving names of the form <code>x_</code> for member variable...
Password Strength Visualizer - Html & Javascript/Ajax <p>I'm looking for a simple Password Strength Visualizer (like gmail's when you create a new account). I want to show the user how good their password is visually.</p> <p>Does anyone have some source code they'd like to share? :)</p>
<p>Choose the one you like most:</p> <p><a href="http://www.webresourcesdepot.com/10-password-strength-meter-scripts-for-a-better-registration-interface/" rel="nofollow">10 Password Strength Meter Scripts For A Better Registration Interface</a></p>
How do I define my own SelectableChannel? <p>How would I define a new type of <code>java.nio.channels.SelectableChannel</code> (say for serial ports)?</p>
<p>My understanding is that the java implementation is based on the unix <code>select()</code> c function (I seem to remember that the Windows implementation was slightly different)</p> <p>Depending on OS (and JVM args!) different native OS functions are called, but what they have in common is that it's native code - ...
No line numbers on exceptions from assembly generated by CompileAssemblyFromSource <p>My application has a scripting feature where I compile an in-memory assembly from the user's script using CodeDomProvider.CompileAssemblyFromSource. It's similar to what's described in <a href="http://stackoverflow.com/questions/61418...
<p>We worked around this by writing the source out to a temporary file and then using that file to compile the code rather than an in-memory string. This provided us with meaningful debug information that we otherwise couldn't get.</p>
Does malloc lazily create the backing pages for an allocation on Linux (and other platforms)? <p>On Linux if I were to <code>malloc(1024 * 1024 * 1024)</code>, what does malloc actually do?</p> <p>I'm sure it assigns a virtual address to the allocation (by walking the free list and creating a new mapping if necessary)...
<p>Linux does deferred page allocation, aka. 'optimistic memory allocation'. The memory you get back from malloc is not backed by anything and when you touch it you may actually get an OOM condition (if there is no swap space for the page you request), in which case <a href="http://linux-mm.org/OOM%5FKiller">a process ...
Python Best Practices: Abstract Syntax Trees <h2>Modifying Abstract Syntax Trees</h2> <p>I would like to be able to build and modify an <code>ast</code> and then optionally write it out as python byte code for execution later without overhead.</p> <p>I have been hacking around with the <a href="http://docs.python.org...
<p>Other than the manual and the source code, you are on your own. This subject and python bytecode are very undocumented.</p> <p>Alternatively you could try using this python bytecode library which I have heard good thing about but haven't tried it yet:</p> <p><a href="http://code.google.com/p/byteplay/" rel="nofoll...
How to split text I want from a file? <p>Hi This is Wht I got in a file:</p> <pre>AT+CMGL="ALL" +CMGL: 6123,"REC READ","+923315266206" B confident dat GOD can make a way wen der seems 2 b no way. Even wen your mind may waver, GOD is working bhind d scenes on yur behalf. Have a faith-filled day +CMGL: 6122,"REC R...
<p>Read the file with a StreamReader and use the ReadLine method, that will read the file one line at a time.</p> <pre><code>using (StreamReader reader = File.OpenText(fileName)) { while (!reader.EndOfStream) { string line = reader.ReadLine(); // do something with the line } } </code></pre>...
How do I add a user to AD using System.DirectoryServices.AccountManagement? <p>Using the .net 3.5 framework and C# I'm trying to add a new user to AD from C# and can't find any examples. I see that the PrincipalCollection object has an overloaded 'add' method but can't seem to figure out how it works. Can anyone help...
<p>You can add a user like this:</p> <pre><code>using (var context = new PrincipalContext(ContextType.Domain)) using (var user = new UserPrincipal(context) { UserPrincipalName = "username", Enabled = true }) { user.SetPassword("password"); user.Save(); } </code></pre> <p>Re: security you can set the a...
Sorting projects in a solution <p>This ones really an annoyance on my end and searching hasn't resulted in a clear fix yet.</p> <p>The same .sln file for Visual Studio 2008 is ordering projects in a different way. In my office, I have both my Web Projects at the top and my 3 Websites below (seems to be default alphabe...
<p>Just a thought, but have you ever used Solution Folders to organize your solutions? I have a common ordering that I like my projects to be listed in, so I started creating root solution folders that start with a number, and inside of them I added child solution folders that group each project by a particular kind. F...
Make Java EE InitialContext find a qualified hostname? (against JBoss EJB server) <p>How do I use a fully qualified host name for the "java.naming.provider.url" property in the "env" parameter passed into (Java EE) InitialContext class. Whether I pass in an IP address, or a fully qualified (host.domain...) host name, ...
<p>Upon closer inspection, this is a duplicate of:</p> <p><a href="http://stackoverflow.com/questions/840292/jboss-unknownhostexception-when-on-different-network">http://stackoverflow.com/questions/840292/jboss-unknownhostexception-when-on-different-network</a></p> <p>The EJB client fails to access the JBoss EJB serv...
ExitProcess from the OnShow event of MainForm in Delphi <p>I have an application that on startup checks some conditions and launches an external program in the OnShow event of the Main Form. The problem is that if there is an error when launching the external program, I want the application to terminate immediately. Bu...
<p>By the time <code>OnShow</code> has fired, you're too far into the program to decide that you don't really want the program to run. You should make that determination sooner. <code>OnShow</code> is not the place to decide that the form shouldn't be shown.</p> <p>This is the sort of thing you should check before you...
Is there a way to convert a VML document to a bitmap image? <p>I've been looking for a long time for a way to have a bitmap from a VML document. In fact, I working on a few libs that use the tag, so I have no problem for anything except for IE (of course) because I'm using ExCanvas in IE, but I'd like to have a bitmap...
<p>You could use something like <a href="http://cutycapt.sourceforge.net/" rel="nofollow">CutyCapt</a> to allow the browser to render it and capture that to an image.</p>
making a video play continuously even when changing html page with javascript and without frames <p>I would like to have a video play continuouly even when html page changes.The new google videos page works this way. My page utilizes javascript.</p>
<p>You can only continue to play video if you are changing portions of the DOM, not if the location of the page changes.</p>
upload_max_filesize not changing <p>I am trying to increase the value of upload_max_filesize to 10485760 (10M).</p> <p>I am using:</p> <pre><code>ini_set('upload_max_filesize',10485760); </code></pre> <p>This is always returning false and the upload_max_filesize continues to be 2M. I am using php 5.2.8 on windows an...
<p>The upload_max_size setting will be checked <em>before</em> your PHP script starts running. So by the time you change the setting, the upload already failed.</p>
Throw Exceptions with custom stack trace <p>Is it possible to throw an exception (could be any exception) with a customized stack trace?</p> <p>As a concrete example: lets say I have a set of some small static utility methods which might throw exceptions. However I would like the exception to appear to have originated...
<p>The StackTrace property is virtual - create your own derived Exception class and have the property return whatever you want.</p>
XDocument can't load xml with version 1.1 in C# LINQ? <p>XDocument.Load throws exception, when using XML file name of xml with version 1.1 instead of 1.0</p> <p>Any clean solutions to resolve the error (No regex) and load the document?</p>
<p>Initial reaction, just to confirm that I can reproduce this:</p> <pre><code>using System; using System.Xml.Linq; class Test { static void Main(string[] args) { string xml = "&lt;?xml version=\"1.1\" ?&gt;&lt;root&gt;&lt;sub /&gt;&lt;/root&gt;"; XDocument doc = XDocument.Parse(xml); ...
Unable to install Meld by MacPorts <p>I found that other people too have had trouble in installing Meld to Mac by MacPorts.</p> <p>I run</p> <pre><code>sudo port install meld </code></pre> <p>I get</p> <pre><code>sudo port install meld ---&gt; Activating shared-mime-info @0.60_0 Error: Target org.macports.activ...
<p>As rspeed said, you probably had a bad install or upgrade that created that file. Alternately, you installed something outside of macports into the /opt/local tree (though I'm not sure how you would have ended up doing that). I recommend just doing a force activate of the shared-mime-info port, then trying to reinst...
Django object multiple exclude() <p>Is there a way to do a query and exclude a list of things, instead of calling exclude multiple times?</p>
<p>Based on your reply to Ned, it sounds like you just want to exclude a list of tags. So you could just use the <code>in</code> filter:</p> <pre><code>names_to_exclude = [o.name for o in objects_to_exclude] Foo.objects.exclude(name__in=names_to_exclude) </code></pre> <p>Does that do what you want?</p>
How can we improve our deployment and build systems? <p>We have 4 different environments:</p> <ul> <li>Staging</li> <li>Dev</li> <li>User Acceptance</li> <li>Live</li> </ul> <p>We use TFS, pull down the latest code and code away.<br /> When they finish a feature, the developers individually upload their changes to St...
<p>If it would be good for you, you could become the <a href="http://www.martinfowler.com/articles/continuousIntegration.html" rel="nofollow">Continuous Integration</a> champion of your company. You could do some research on a good process for <a href="http://msdn.microsoft.com/en-us/library/ms364045.aspx" rel="nofoll...
Invalid or expired security context token in WCF web service <p>All,</p> <p>I have a WCF web service (let's called service "B") hosted under IIS using a service account (VM, Windows 2003 SP2). The service exposes an endpoint that use WSHttpBinding with the default values except for maxReceivedMessageSize, maxBufferPo...
<p>10 mins is the default receive timeout. If you have an idled proxy for more than 10mins, the security session of that proxy is aborted by the server. Enable logging and you will see this in the diagnostics log of the server. The error message you reported fits for this behavior. Search your system diagnostic file fo...
Zend_Form decorators ordering (Errors before form element issue) <p>I have the following Zend_Form code to apply to form element decorators:</p> <pre><code>$decorators = array( 'ViewHelper', 'Description', array('break' =&gt; 'HtmlTag', array('tag' =&gt; 'br', 'openOnly'=&gt;true)), array...
<p>Try the following, don't know if it'll work, since I don't have my laptop at the moment:</p> <pre><code>array('Errors', array('class' =&gt; 'formErrors', 'placement' =&gt; 'prepend')) </code></pre>
Is it any good to define trivial inlined methods twice based to debug / release -state of the project? <p>I've always wondered, if it's good or bad practice to define trivial method twice, depending <br>if the project's on debug / release -state. This is for inlining them. For instance, Foo.h:</p> <pre><code> class Fo...
<p>It's a waste of time, for several reasons.</p> <p>The inline keyword is a <em>hint</em> that the compiler may ignore at will. Just like it is free to inline even if the keyword is not specified. So whether or not you add it probably won't change anything for the compiler</p> <p>Further, any functions defined insid...
How to make QA test my web service instead of forcing me to test their web service client? <p>I work on a number of web services and virtually every time I produce a major build, QA starts throwing up bugs that I frequently find have nothing to do with the server side code, but rather with their crap client library. I...
<p>This probably has more to do with your work policies and procedures than with programming.</p> <p>But in the simplest form, the burden of proof is on QA, and you are innocent until proven guilty. If QA throw a bug at you, they should do so with the maximum available data, proving that there indeed is a bug and not ...
Svn Move does not show up in context menu <p>I've committed changes and updated and my directory looks good to go. But when I right-click a file I want to move into another folder, I see all options such as svn delete, etc. except for svn move. I can't figure out why I do not see the move option.</p>
<p>If you want to move a file, you can just right-click and drag the file to the new location. You will get a menu when you release the file from which you can choose from svn move and svn copy.</p>
What dissasembler do you recomend? <p>I'm into hacking challenges (like rankk.com) and some of the challenges require disassembly and little modifications of PE files.</p> <p>I'm looking for a disassembler/debugger that is able to dump the strings, walk the assembler code and allow modifications.</p> <p>My knowledge ...
<p>IDA, nothing else comes even close. <a href="http://www.hex-rays.com/idapro/">IDA Pro</a></p>
Grails Acegi Plugin - PersonController.groovy - Please explain! <p>What does person.properties = params do?</p>
<p>Well, the short answer is that it matches any key in the params map with the properties of the person object, assigning the value in the params map to the property that matches.</p> <p>example: Let's say params.id=156 and person has a member property named id. After this call, person.id would equal 156.</p> <p>S...
Unable to convert dot-files to non-dotfiles safely <p>I run unsuccessfully in Mac</p> <pre><code>mv .* * </code></pre> <p>and</p> <pre><code>mv .* ./* </code></pre> <p>My files disappeared into thin air.</p> <p><strong>How can you convert dot-files to non-dotfiles safely?</strong></p>
<pre><code>for i in `ls -d .*`; do mv $i "`echo $i | sed 's/^.//'`"; done </code></pre> <p>or, much easier,</p> <pre><code>rename 's/^.//' `ls -d .*` </code></pre> <p>if your system have got it.</p> <p>In zsh, you could just use .* safely, but in bash you'll have to use <code>ls -d .*</code></p>
Replace each RegExp match with different text in ActionScript 3 <p>I'd like to know how to replace <strong>each match</strong> with a <strong>different</strong> text? Let's say the source text is:</p> <pre><code>var strSource:String = "find it and replace what you find."; </code></pre> <p>..and we have a regex such a...
<p>You could also use a replacement function, something like this:</p> <pre><code>var increment : int = -1; // start at -1 so the first replacement will be 0 strSource.replace( /(\b_)(.*?_ID\b)/gim , function() { return arguments[1] + "replacement_" + (increment++).toString(); } ); </code></pre>
Using subprocess to run Python script on Windows <p>Is there a simple way to run a Python script on Windows/Linux/OS X?</p> <p>On the latter two, <code>subprocess.Popen("/the/script.py")</code> works, but on Windows I get the following error:</p> <pre><code>Traceback (most recent call last): File "test_functional.p...
<p>Just found <code>sys.executable</code> - the full path to the current Python executable, which can be used to run the script (instead of relying on the shbang, which obviously doesn't work on Windows)</p> <pre><code>import sys import subprocess theproc = subprocess.Popen([sys.executable, "myscript.py"]) theproc.co...
C++ Intellectual Property Protection/Anti-Reversing <p>I've seen a lot of discussion on here about copy protection. I am more interested in anti-reversing and IP protection.</p> <p>There are solutions such as Safenet and HASP that claim to encrypt the binary, but are these protected from reversing when used with a va...
<p>hire some of the people I've worked with over the years, they will completely obfuscate the source code!</p>
Disclosure Indicator disappears? <p>I have a <code>UITableView</code> which is using custom <code>UITableViewCell</code>s to display some information. I'd like to add a <code>UITableViewCellAccessoryDisclosureIndicator</code> to the cells.</p> <p>Every method that I try successfully adds the chevron, but once the tabl...
<p>It could happen because you are setting your accessory type outside of the cached cell test:</p> <pre><code> static NSString *CellIdentifier = @"UIDocumentationCell"; cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFram...
How to enable GUI behaviors for sorting a JTable when SQL does the sorting? <p>How do I enable JTable icons and behaviors for sorting table rows by a column, without letting it use a comparison predicate to do the sorting? That is to say, how do I tell the table headers to show the arrow for ascending/descending sort ...
<p>In answer to 1 and 2, check out <a href="https://swingx.dev.java.net/" rel="nofollow">SwingX</a>, which already includes a table class with built-in sorting (and filtering). You may be able to adapt this.</p> <blockquote> <p>Am I going to run into horrible, horrible problems when I design the system like this?</p...
SSIS package not running when called as step in SQL Job <p>I have a .dtsx file (an SSIS package) that downloads files from an FTP server and imports data. It runs fine whenever I run it manually. However, when I schedule calling the package as a step in a SQL server agent job, it fails. The step it fails at is the one ...
<p>For me it was a permissions issue. Go to Environment --> Directories, then change Local directory to something the SQLAgentUser can access. I used C:\temp. Click the dropdown for Save, and choose "Set defaults".</p>
Dynamic Finders and Method Missing in Python <p>I'm trying to implement something like Rails dynamic-finders in Python (for webapp/GAE). The dynamic finders work like this:</p> <ul> <li>Your Person has some fields: name, age and email.</li> <li>Suppose you want to find all the users whose name is "Robot". </li> </ul> ...
<p>There's really no need to use GQL here - it just complicates matters. Here's a simple implementation:</p> <pre><code>class FindableModel(db.Model): def __getattr__(self, name): if not name.startswith("find_by_"): raise AttributeError(name) field = name[len("find_by_"):] return lambda value: self...