input
stringlengths
51
42.3k
output
stringlengths
18
55k
Django payment proccessing <p>Can anyone suggest any good payment processing libraries for python/django?</p>
<p>The most developed Django solution is <a href="http://www.satchmoproject.com/docs/svn/">Satchmo</a> with support for Authorize.Net, TrustCommerce, CyberSource, PayPal, Google Checkout, and Protx.</p> <p>The new kid on the Django block is <a href="http://code.google.com/p/django-lfs/">django-lfs</a> which looks like...
How do I save a reference to a specific photo on iPhone for loading without picker? <p>A user can select a photo from their library using the image picker - I want to remember this selection and display this picture in future without the user having to pick it. How can I reference the specific photo or is there a way I...
<p>you can save the selected image by converting it into NSData object and then writing it on the iphone file system under your app's document directory like this:</p> <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingIn...
Need help with Sql Server Full Text Search problem <p>I have a <code>Full Text Catalog</code> on single table, with three fields defined :-</p> <pre><code>TABLE: Animals Fields: Name, Breed, LatinName. </code></pre> <p>Now, the Catalog <em>seems</em> to be working perfectly.</p> <p>eg.</p> <pre><code>CREATE FUNCTIO...
<p>Not sure it's a good idea. Table valued functions do not store statistics, so performance may suffer.</p>
Wordpress filter to modify final html output <p>Wordpress has great filter support for getting at all sorts of specific bits of content and modifying it before output. Like "the_content" filter, which lets you access the markup for a post before it's output to the screen. </p> <p>I'm trying to find a catch-all filter ...
<p>WordPress doesn't have a "final output" filter, but you can hack together one. The below example resides within a <a href="https://codex.wordpress.org/Must_Use_Plugins">"Must Use"</a> plugin I've created for a project. </p> <p>Note: I haven't tested with any plugins that might make use of the "shutdown" action.</p>...
Using LINQ to SQL to read stored procedures <p>Does anyone know a way to access the text of stored procedures using LINQ to SQL? I'd like to audit a set of stored procedures to check that they contain all contain some common code.</p> <p>It feels like there should be a nice way of opening them through a LINQ to SQL da...
<p>You could try something along these lines:</p> <pre><code>string results = db.ExecuteQuery&lt;string&gt; (@"EXEC sp_helptext '{0}'", procedure_name); </code></pre> <p>or use this query in you LINQ:</p> <pre><code>SELECT text FROM syscomments WHERE id = (SELECT id FROM sysobjects WHERE name = 'procedure_name') ORD...
sql profiler 2008 does not accept template name in command line launch <p>I am trying to launch sql profiler 2008 from the command line launch. the syntax I used :</p> <p>C:\Program Files\Microsoft SQL Server\100\Tools\Binn>profiler90 /S <em>server</em> /D <em>dbname</em> /U sa /P <em>password</em> /T "C:\Documents an...
<p>yes, it worked the correct one is /t "template name" and not the physical file name of the template. thanks!</p>
What does the @package directive do in Objective-C? <p>Does anyone know exactly what the @package directive is used for in Objective-C?</p> <p>The only mention I could find of it in Programming in Objective-C 2.0 by Stephen Kochan was:</p> <blockquote> <p>@package - For 64 bit images, the instance variable can be a...
<p><code>@package</code> is similar to <code>internal</code> for .NET. It means the member is accessible only from the framework in which it is defined.</p> <p>Note: In 32-bit it acts like <code>@public</code>.</p>
Will Perl upgrade break older version on Linux? <p>I upgrade perl from perl58 to perl588 on Suse Linux.It looks that even though the Config.pm exists for the older version the newer version installation breaks the older version.While the upgrade of Perl on other OSes like HP and AIX does not disturb the older version. ...
<p>I've never seen this problem on Linux. I leave the original perl in its location (/usr/bin/perl), and simply compile my own perl to install to /usr/local/bin (or whatever), and have never seen any breakage of the old version.</p> <p>You don't say</p> <ul> <li>how you came to have a /usr/standard_perl/perl588 (com...
What is dictionary compaction support? <p>"Here is the implementation of the dictionary without any compaction support."</p> <p>This quote is taken from here: <a href="http://blogs.msdn.com/jaredpar/archive/2009/03/03/building-a-weakreference-hashtable.aspx" rel="nofollow">http://blogs.msdn.com/jaredpar/archive/2009/0...
<p>For that particular post I was refering to shrinking the dictionary in order to be a more appropriate size for the number of non-collected elements. </p> <p>Under the hood most hashtables are backed by a large array which usually points to another structure such as a linked list. The array starts out at an initia...
SqlServer, Transaction deadlock, when are table actually locked? <p>This SQL (called from c#) occasionally results in a deadlock. The server is not under much load so the approach used is to lock as much as possible.</p> <pre><code> -- Lock to prevent race-conditions when multiple instances of an application calls t...
<p>Using Table Locks can increase the likelihood of getting deadlocks... Not all deadlocks are caused by out of sequence operations... Some can be caused, (as you have found) by other activity that only tries to lock a single record in the same table you are locking completely, so locking the entire table increases th...
Finding previous page Url <p>i am trying to find the url of previous page.Such as if a user navigates from Page A to Page B using <code>Server.Redirect("B.aspx")</code>, page B can display the url referring to it.</p> <p>I have tried using </p> <pre><code>Response.Write(Page.PreviousPage.ToString()); Response.Write(...
<p>If it's only for this scenario (where you programatically redirect to B.aspx) then why not put something on the querystring to say where the redirect came from. This would be more likely to work across muliple browser types and devices.</p> <p>One advantage to this approach is that you'll be able to tell the differ...
Dependency Injection and ModelStateWrapper <p>in tutorial <a href="http://www.asp.net/learn/mvc/tutorial-38-cs.aspx" rel="nofollow">Validating with a service layer</a> constructor for Product Service looks like this:</p> <pre><code>ProductService(IValidationDictionary validationDictionary, IProductRepository repositor...
<p>Think.</p> <p>Here's what you're trying to do:</p> <ul> <li>In order to create product controller you need product service</li> <li>in order to create product service you need product controller</li> </ul> <p>you have a vicious circle, that's why you can't do it.</p> <p>I dunno about implementation Unity, but co...
Creating Drupal CCK content programatically/ via API <p>I am working with a Drupal 6.x system to create exercise / personal training programmes, and am using the CCK with content types of Exercise and Programme, where Programme contains a few header fields and a list of node references to the exercises it consists of. ...
<p>The best way to tackle this problem would be to write your own module to do this.</p> <p>Step 1 you can do node_load($nid) on all the excercies Step 2 you can use user_load($uid) Step 3 you'll need to iterate through the user object and match up to the appropriate excercies. Step 4/5 I'd create a new $node = stdCla...
Flex 3 - Equals sign (=) in TextInput control Is displaying as a plus sign (+) in Firefox <p>When I deploy my Flex application and browse to it in Firefox (3.0.8), typing an equals sign into a TextInput control results in a plus sign. </p> <p>In Chrome and IE, an equals sign works as expected. Also, when I run the F...
<p>This is a known issue in <a href="https://bugzilla.mozilla.org/show%5Fbug.cgi?id=347185" rel="nofollow">Firefox</a>/Flash. If you disable wmode=transparent, it should work as expected.</p>
e-democracy: web based voting software <p>For an organization counting a few thousands of members, can you recommend web based voting software?</p>
<p>You have <a href="http://moderator.appspot.com/" rel="nofollow">Google Moderator</a> (which will require each one to have an Google acount) or <a href="http://uservoice.com/" rel="nofollow">UserVoice</a> (which SO uses to rank feature requests).</p>
How do XBox game updates work? <p>You have a static medium, a cd, so you can't change any files on it. So how do the updates work? I understand there is come code that runs and checks if the version isn't correct, and then downloads a patch if needed, but how does that path get integrated into the game?</p> <p>Is ther...
<p>The patch contains a delta-compressed executable and any new data that that executable might need. The Xbox 360's executable loader checks for the patch (via the game's title id), and, if found, loads the old executable into memory, then modifies it in-memory with the delta-compressed version. (The process of maki...
Use REGEX to find Contents of HTML ListItem (.NET) <p>Using the following text as a sample, I need to be able to extract text between LI tags. Notice that the first LI is intentionally mal-formed as this may be the case. Said another way, I want everything from an LI tag to either it's closing LI tag or the next LI ope...
<p>If this is a recurring scenario, I would rather use an HTML parser. Parsing HTML with Regex will take a tremendous amount of time, and might still turn out buggy, because of malformed input (that you mentioned).</p> <p>Here's one I found with a basic Google search:<br /> <a href="http://www.netomatix.com/products/D...
Why are 0d arrays in Numpy not considered scalar? <p>Surely a 0d array is scalar, but Numpy does not seem to think so... am I missing something or am I just misunderstanding the concept? </p> <pre><code>&gt;&gt;&gt; foo = numpy.array(1.11111111111, numpy.float64) &gt;&gt;&gt; numpy.ndim(foo) 0 &gt;&gt;&gt; numpy.issca...
<p>One should not think too hard about it. It's ultimately better for the mental health and longevity of the individual.</p> <p>The curious situation with Numpy scalar-types was bore out of the fact that there is no graceful and consistent way to degrade the 1x1 matrix to scalar types. Even though mathematically they ...
Are there any standalone HTML markup validation tools <p>Other than submit individual web pages for verification on the W3C site, are there any standalone tools that will do this job. </p> <p>Ideally this would be a visual studio plugin that could catch errors at design time but one that would just take a wep applicat...
<p>The W3C Markup Validator is an open source tool, which you can <a href="http://dev.w3.org/cvsweb/validator/">download</a> and use it offline.</p> <p>On Fedora, do:</p> <pre><code>yum install w3c-markup-validator </code></pre>
How to prevent git merge to merge a specific file from trunk into a branch and vice versa <p>I am using git while developing VHDL code. I am doing development on a component in a git branch: comp_dev. The component interface does not change, just the code inside the component. Now, this component already exists in the ...
<p>I posted a solution that works for me <a href="http://stackoverflow.com/questions/332528/is-it-possible-to-exclude-specific-commits-when-doing-a-git-merge/3970442#3970442">here</a></p>
Can you provide examples of parsing HTML? <p>How do you parse HTML with a variety of languages and parsing libraries? </p> <hr> <p>When answering:</p> <p>Individual comments will be linked to in answers to questions about how to parse HTML with regexes as a way of showing the right way to do things.</p> <p>For the ...
<p>Language: <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a><br> Library: <a href="http://jquery.com/">jQuery</a></p> <pre><code>$.each($('a[href]'), function(){ console.debug(this.href); }); </code></pre> <p>(using firebug console.debug for output...)</p> <p>And loading any html page:</p> <pre...
Add a new line to a text file in MS-DOS <p>I am making a <code>.bat</code> file, and I would like it to write <a href="http://en.wikipedia.org/wiki/ASCII_art">ASCII art</a> into a text file.</p> <p>I was able to find the command to append a new line to the file when echoing text, but when I read that text file, all I ...
<pre><code>echo Hello, &gt; file.txt echo. &gt;&gt;file.txt echo world &gt;&gt;file.txt </code></pre> <p>and you can always run:</p> <pre><code>wordpad file.txt </code></pre> <p>on any version of Windows.</p> <p><hr /></p> <p>On Windows 2000 and above you can do:</p> <pre><code>( echo Hello, &amp; echo. &a...
Android : Customizing tabs on state : How do I make a selector a drawable <p>I know how to put the icon on each tab, that is no problem. I also ran across this : [Stack Overflow thread on pretty much same thing][1]</p> <p>I followed one of the links from that question, and found [this][2]</p> <p>Pretty much, it said ...
<p>The XML you've included here is a way of defining a drawable that lets you embed a case statement. It presents a different drawable depending on the state of the View it's being assigned to. As a drawable, you should save it as an xml file within the <code>res/drawable</code> folder of your project (for example <cod...
Displaytag library - detecting a paging request <p>I'm currently developing a portlet for Liferay (using the Spring MVC framework). Now I just used the displaytag library for implementing paging on a list I'm displaying on the portlet. </p> <p>My problem now is that I would need to detect whether the current request h...
<p>Displaytag provides a class "ParamEncoder" that (I think its in its constructor) produces the checksums for you based off the table name of your table (the id or uid element - this must be set to produce valid checksums (the numbers between d and -(parameter)). Check it out. TableTagParameters includes the constan...
Where can I get the 10.6 SDK for XCode <p>Where can I get the 10.6 SDK for XCode? I have the beta of Snow Leopard, and I installed XCode off of the DVD, but it only installed the 10.5 and 10.4 SDKs. I need to build against 10.6 to verify a bug for Apple.</p>
<p><a href="https://connect.apple.com">ADC Member Site</a>. Login and select downloads. If you're a Premier or Select member, that should be where you'll find it.</p> <p>If you're not a Premier or Select member, you won't see it.</p>
Java: Can't get incremented value to print. <p>I'm learning to do some Java 101 syntax stuff. In an exercise I'm trying to do, I can't get the incremented value to print. Any ideas? </p> <p>Here is my code: </p> <pre><code>class StaticTest { static int i = 47; } class incrementable { static void increment(...
<p><code>increment()</code> doesn't have a return value. You'd need to have it return an <code>int</code> for your code to work:</p> <pre><code>class incrementable { static int increment() { StaticTest.i++; return StaticTest.i; } } </code></pre> <p>"<code>void</code>" is a keyword reserved...
WCF Method not found after signing an assembly <p>I have a 3 projects in a solution like such:</p> <ul> <li>WCF Service: Hosts a couple of methods</li> <li>Class Library: Acts as a gateway to the WCF service by returning an instance of its Soap client</li> <li>WPF Application: Consumes the service methods via the refe...
<p>When you update the service references in your class library, make sure you are creating a new version of the assembly and registering this new version in the GAC, then make sure your WPF app is referencing this new version.</p>
Why this code is not working while it worked fine for almost a year <p>Does automatic software update causes some of the module property not to work? I am really scratching my head over this function that I have posted here. They are basically the same function that reads image logo from the currently executing assembl...
<p>Since .Name returns just the assembly and .ScopeName returns the full path, it seems likely that something caused your program to need an absolute path to the logo file to operate. </p> <p>From there, it could be a lot of things, ideas off the top of my head: 1) You had an environment variable storing the path to t...
Implementing MS Access style 'relationships' GUI <p>I have no idea what the correct name for this UI style is. In MS Access the 'relationships' tool shows the db tables as little movable boxes that can be linked with lines. It's the same with Visio and a few audio apps - boxes that are movable, containing lines of text...
<p>You'll need two main custom controls: the <strong>main view</strong> and the <strong>table control</strong>.</p> <p>The <strong>table control</strong> is responsible for drawing itself with all of its columns and ensuring that the item can scroll if need be. It is also responsible for providing an x/y co-ordinate f...
Flash (as3) printing .. data ? html? <p>I need to add a print button to my page that should print a certain page</p> <p>the best way should be that i add an html and that it would print from out flash or is it possible to open a html page and automatically open the print dialog box?</p> <p>it's in AS3</p>
<p>You can open simple html in a TextField (not every html tag is suported), plus it might be a bit tricky with css.</p> <p>If you get it sortet out, AS3 supports printing straight from flash. You'll find more of that here:<a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/printing/PrintJob.html"...
DNS resolving based on client IP <p>I want to configure bind/write driver that resolves DNS requests based on the ip address of the client.</p> <p>We want to unify the domain names of all test environments for our web application. Instead of having many domains like <code>test.mysite.com</code>, <code>qa.mysite.com</c...
<p>You can use <a href="http://www.powerdns.com" rel="nofollow">PowerDNS</a> with the <a href="http://downloads.powerdns.com/documentation/html/backends-detail.html#PIPEBACKEND-PROTOCOL" rel="nofollow">pipe backend</a> to return different IP addresses dependent on the client's IP address.</p>
How do I know which files in a directory arn't in my SVN repository? <p>The tile is exactly my question.</p> <p>[edited out mistaken code]</p>
<p>You could use <a href="http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html" rel="nofollow">svn status</a> command.</p> <p>If you didn't set ignore property the files will be shown with '?' prefix.</p>
Oracle Character Types <p>Is using a VARCHAR2 (1 BYTE) any less efficient than using CHAR(1 BYTE)?</p> <p>Is using a VARCHAR2 (2000 BYTE) any less efficient than using CHAR(1 BYTE), if I never put any value longer than one character in the field?</p> <p>** By efficient, I meant efficient in both time (searching) and ...
<p>Depending on your character set, CHAR(1 BYTE) may not be able to store any particular character, so there may be differences between VARCHAR2(2000 BYTE) and CHAR(1 BYTE) if we're talking about multi-byte characters.</p> <p>More generally, in SQL (the PL/SQL rules are a bit different) a VARCHAR2(2000 BYTE) isn't goi...
In vim, how do I get a file to open at the same line number I closed it at last time? <p>I want to configure vim to open a file at the same place I left off at.</p>
<p>From Ubuntu's <code>/etc/vim/vimrc</code> file, this example is commented out:</p> <pre><code>" Uncomment the following to have Vim jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") &gt; 0 &amp;&amp; line("'\"...
can not redraw rect from callback <p>I am new on iphone</p> <p>what I wanna do is to render image to iphone</p> <p>so I have one module to generate image data, after done invoke callback function to notify UIView, in UIView I have I have callback function to give the image to UIImage, and then I setNeedsDisplay and r...
<p>you need to create a UIImageView frm your image data then add your new UIImageView to your main view by sending it an <code>addSubView:</code> message. After that your image will automatically be rendered. You do not need to implement drawRect.</p> <p>It sounds as though you have tried to subclass UIImageView - you...
Good tutorials for learning intermediate to advanced Regex? <p>So I'm familiar with the basics of regex but am looking for good tutorials for learning anything beyond the basics. I'd also appreciate any links to interactive problems where I can type in regular expressions and see if they solve it. Even ideas for inter...
<p>This is ground-zero for learning regular expressions:</p> <p><a href="http://www.regular-expressions.info/tutorial.html" rel="nofollow">Regular Expression Tutorials</a></p>
Why did hasExited throw 'System.ComponentModel.Win32Exception'? <p>I can successfully run a new process using ShellExecuteEx, but if I access the HasExited property, a Win32Exception is thrown. What is this exception and how do I check if the process is alive?</p> <pre><code>ShellExecuteEx(ref info); clientProcessId ...
<p>For info, did you set fMask to <code>SEE_MASK_NOCLOSEPROCESS</code>, so that hProcess is valid?</p> <p>Also, why are you P/Invoke'ing to ShellExecuteEx, why not use Process.Start w/ ProcessStartInfo, which will handle ShellExecuteEx for you?</p> <p>EDIT: Since you are doing runas, you only get SYNCHRONIZE access o...
Ensuring fresh content for photo album <p>I'm working on a site where users submit photos which can be viewed one by one on a page.</p> <p>There is another page where you see smaller versions of multiple photos.</p> <p>When user clicks any of these smaller photos they get the large version page, pressing "next" will ...
<p>If you're using sessions, you could keep track of the oldest 'new' photo ID that a user has viewed. So when they click next, you show the newest photo and store its ID in the user's session. Each time they click next, give them the newest photo you have that is lower than the ID of the photo they have in their ses...
How do I retrieve data with Linq to XML? <p>I need to find <code>ShippingMethod</code> and the attribute <code>Code</code> and <code>Destination</code> from the following piece of XML:</p> <pre><code>&lt;ScoreRule&gt; &lt;ShippingMethod Code="UPS1DA"&gt; &lt;Destination Country="US" Area="IL" Value="0" /&g...
<p>Is this what you want?</p> <pre><code>XElement scoreRuleElement = XElement.Parse("&lt;ScoreRule&gt;&lt;ShippingMethod Code=\"UPS1DA\"&gt;&lt;Destination Country=\"US\" Area=\"IL\" Value=\"0\" /&gt;&lt;/ShippingMethod&gt;&lt;/ScoreRule&gt;"); XElement shippingMethodElement = scoreRuleElement.Element("ShippingMethod...
How to prevent Duplicate Object creation in ADAM? <p>I am testing out using ADAM and the DSML services. I have two ADAM servers, one is a replica of the other and they are Load Balanced. How can you protect duplicate object creation in the ADAM directory?</p>
<p>Before you create anything, query for the name you intend to use as the naming attribute first to see if it is in use already.</p> <p>I am not sure for ADAM, but for Active Directory, while the full DN of course must be unique, the sAMAccountName must also be unique within the domain. </p> <p>Or else try, catch t...
What are good or interesting Assembler-like languages, but at a higher level? <p>I've been looking at <a href="http://www.anywherebb.com/linoleum.html">L.in.oleum</a> and am intrigued by it's mix of higher-level constructs (loops, dynamic variables) with low-level assembler power (registers). </p> <p>Are there other l...
<p><a href="http://www.cminusminus.org/">C--</a> is an intermediate language designed to be generated mainly by compilers, is somewhere between C and assembler</p>
how to hide the content of the div in css <p>I have this html code</p> <pre><code>&lt;div id="mybox"&gt; aaaaaaa &lt;/div&gt; </code></pre> <p>and this is my css</p> <pre><code>#mybox{ background-color:green; } #mybox:hover{ background-color:red; } </code></pre> <p>the question is how to hide the content of ...
<p>Without changing the markup or using JavaScript, you'd pretty much have to alter the text color as knut mentions, or set text-indent: -1000em;</p> <p>IE6 will not read the :hover selector on anything other than an anchor element, so you will have to use something like <a href="http://dean.edwards.name/IE7/">Dean Ed...
Containing drawing to a panel area <p>I want to draw an array of X and Y integers to a panel in a Java frame.</p> <p>What is the best way to draw the line (currently I'm using Graphic's drawPolyline)?</p> <p>How can I <em>efficiently</em> scale the integer values so they all fit in the panel area without knowing the ...
<p>Without knowing both the x and y maximum values, I don't think this can be done, since you can't then calculate the scale needed. But if you have an array of points, then you can certainly search it to find the minimum and maximum x and y values.</p> <p>If you have a means of getting the maximum values, read on (a...
What is this Excel formula suppose to do? <p>I have a spreadsheet in which I'm suppose to fix up broken formulas. Does anyone know what this is 'meant' to do?</p> <pre><code>=#REF!A33 </code></pre>
<p>that means there was a reference to a worksheet or a named range that has been deleted</p> <p>in other words it may have been</p> <pre><code>=Worksheet2!A33 </code></pre> <p>but Worksheet2 has been deleted</p> <p>possibly nearby cells have similar formulas that still point to a valid location and you can recreat...
When should you NOT use a Rules Engine? <p>I have a pretty decent list of the advantages of using a Rules Engine, as well as some reasons to use them, what I need is a list of the reasons why you should NOT use a Rules Engine</p> <p>The best I have so far is this:</p> <blockquote> <p>Rules engines are not really in...
<p>I will give 2 examples from personal experience where using a Rules Engine was a bad idea, maybe that will help:-</p> <ol> <li>On a past project, I noticed that the rules files (the project used Drools) contained a lot of java code, including loops, functions etc. They were essentially java files masquerading as ru...
ResultSet method "last" is this an optimal way? <p>I have this java code which does this</p> <pre><code>ResulSet rs = stmt.executeQuery(); while (rs.next()) { .... //do regular processing if (rs.last()) { //do last record processing } } </code></pre>
<p>You should use: <a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html#isLast%28%29" rel="nofollow">isLast()</a> instead.</p> <p>Be warned, not all the JDCB drivers support this feature. Obviously you have to check it with your installation.</p> <p>Most major DB work fine.</p> <p>The fixed code sh...
Cross-platform partition management library? <p>I'm looking for some sort of partition management library (preferably a Python one, but anything works) that will function on both Windows and Linux. (For working with USB devices, specifically, but any harddisk tool should do)</p> <p>We'd much rather not implement two d...
<p>You can either use libparted from GNU parted (<a href="http://www.gnu.org/software/parted/index.shtml" rel="nofollow">http://www.gnu.org/software/parted/index.shtml</a>) or open a pipe to sfdisk which is the most scriptable of the partitioning tools on most linux distros.</p>
What kind of Application would be best for running non interactively? <p>I need to create an application that can be activated with a batch file.</p> <p>The application would accept a single string parameter of a file name. It will then run some processing with this file and drop another file in a predetermined locat...
<p>Option one: Console App. Use Windows Scheduler to run it at schedule times. (recommended)</p> <p>Option two: Windows Service that has some inbuilt scheduler or poller.</p>
How to add selected item into database using ASP.NET MVC <pre><code> &lt;% foreach (FoodMenu f in (IEnumerable)ViewData.Model) { %&gt; &lt;ul &gt; &lt;li&gt;&lt;%= Html.Encode(f.ProductId) %&gt; &lt;/li&gt; &lt;li&gt;&lt;%= Html.Encode(f.Name) %&gt;&lt;/li&gt...
<p>Encode the id of the product that is selected into the name of the check box.</p> <pre><code>&lt;%= Html.CheckBox("Selected_" + f.ProductId) %&gt; </code></pre> <p>The on the server side, iterate through the ValueProviderKeys and find selections and extract the product id from the ones that are selected.</p> <pre...
Isapi rewrite filter ends up in a loop <p>I am using ionics isapi rewrite filter to redirect all .asp files to validate.asp file to do session validation. But I end up in a loop. Any help would be much appreciated.</p> <p><strong>my .ini file</strong></p> <pre><code>ReDirectRule ^/XXXX/(.*).asp?(.*) /YYYY/validate.a...
<p><strong>ini.file</strong></p> <pre><code>ReWriteRule ^/XXXX/(.+).asp(?:\?(.*))?$ /YYYY/validate.asp?$2&amp;url1=$1&amp;url2=$2 [L] </code></pre> <p><strong>validate.asp</strong></p> <pre><code>'validation step goes here.. Server.Transfer("../XXXX"&amp;Request.QueryString("url1") &amp; ".asp") </code></pre> <p>T...
Updating RSS <link> URL with Javascript? <p>Is it possible to update the URL of an rss <code>&lt;link&gt;</code> tag dynamically, so that when the RSS icon in the location bar is clicked, the browser will direct the user to the updated URL?</p> <p>For example, using Jquery:</p> <pre><code>&lt;link id="feed_url" rel="...
<p>Many browsers will parse the link tag on DocumentComplete and not reparse it later if it changes. So technically it may be updated, but the browser may not notice. You'll have to test in different browsers.</p>
Sorted collections: How do i get (extended) slices right? <p>How can I resolve this?</p> <pre><code>&gt;&gt;&gt; class unslice: ... def __getitem__(self, item): print type(item), ":", item ... &gt;&gt;&gt; u = unslice() &gt;&gt;&gt; u[1,2] # using an extended slice &lt;type 'tuple'&gt; : (1, 2) &gt;&gt;&gt; t =...
<p>Since there is no way to differentiate between the calls u[x,y] and u[(x,y)], you should shift one of the two operations you are trying to define off to an actual method. You know, something named u.slice() or u.range() or u.getslice() or u.getrange() or something like that.</p> <p>Actually, when writing my <em>ow...
Null value cannot be assigned - LINQ query question <p>I have the following LINQ query:</p> <pre><code>DataClassesDataContext dc = new DataClassesDataContext(); var query = from contact in dc.Contacts select new { ContactId = contact.ContactId, LastName = contac...
<p>Think I figured it out. </p> <p>If I cast the maximum note value to a nullable DateTime it seems to eliminate the exception. The following change worked for me:</p> <pre><code>LastNote = (Nullable&lt;DateTime&gt;)contact.Notes.Max(n =&gt; n.Created) </code></pre> <p>As others have pointed out, it can also be wr...
Suggestions for dealing with time offsets in mysql <p>Distilling this project down to the simplest of terms;</p> <ol> <li>Users click a button, a record is made with a timestamp of NOW(). </li> <li>NOW() of course equals the time on the server of record creation. </li> <li>I need to show them stats based on their time...
<p>You can use javascript to get timezone from client as follows:</p> var timeZone=(new Date().gettimezoneOffset()/60)*(-1); <p>print the variable out and test before using it. I think this will be your simplest bet.</p>
Is there such a thing as a virtual COM port receipt printer? <p>I'm debugging some code that writes directly to a COM port in order to print receipts on a receipt printer. The printer model is something like an Epson TM-88.</p> <p>Instead of printing reams of thermal paper while debugging this code, it would be nice i...
<p>The Wikipedia page for <a href="http://en.wikipedia.org/wiki/COM%5Fport%5Fredirector" rel="nofollow">COM Port Redirector</a> has a list of open source and freeware tools at the bottom that can redirect serial ports, and you can probably write your own simple emulator for the printer.</p> <p>If the receipt printer i...
Python bindings for libparted? <p>I'm looking for a way to interact with the GNU <code>libparted</code> library from Python, but so far what I've found, a <a href="http://code.google.com/soc" rel="nofollow">GSOC</a> <a href="http://pylibparted.tigris.org" rel="nofollow">project from 2005</a> and an <a href="https://edg...
<p>You mean like the <a href="https://github.com/rhinstaller/pyparted" rel="nofollow">pyparted</a> library?</p>
How to configure Zend_Auth to support multiple subdomains? <p>I have two applications that both run separate instance of Zend Framework MVC application. They are hosted on different subdomains:</p> <pre><code>news.mydomain.com member.mydomain.com </code></pre> <p>I use Zend_Auth on <code>member.mydomain.com</code> to...
<p>You should be able to do this if you set the Zend_Session namespace to the same namespace in both applications. I believe you set it when you instantiate it the first time, for example:</p> <pre><code>$sess = new Zend_Session("Mynamespace"); </code></pre> <p>As long as both applications run on the same machine, o...
How to increment the address in MIPS assembly? <p>I am just starting to lean MIPS assembly, and I am trying to write a simple <code>while</code> loop. It will be equivilent to the C code:</p> <p><code>int A[5];</code></p> <p><code>for(i=0;i&lt;5;i++) A[i]=i;</code></p> <p>So I know I can use <code>beq</code> to make...
<p>assuming $3 points to A[]</p> <pre><code>lis $4 .word 4 lis $5 .word 1 add $7, $4, $5 ;$7 = 5 add $6, $0, $0 ;$6 = 0 loop: sw $6, 0($3) add $3, $4, $3 ;point to next "int" add $6, $5, $6 ;add 1 to our counter bne $7, $6, loop ;we will stop at 5 </code></pre>
Safe to jump on ASP.NET MVC bandwagon when building enterprise solutions? <p>Before I get pointed to one of those 'VS.' questions like below...</p> <ul> <li><a href="http://stackoverflow.com/questions/99056/asp-net-webforms-asp-net-ajax-versus-asp-net-mvc-and-ajax-framework-freedom">ASP.NET webforms + ASP.NET Ajax ver...
<p>I can answer half of your question. I've just dove into MVC from a WebForms background. There is (obviously) a learning curve, but it's really not very steep. I've been able to make the transition with little effort, and I find the whole thing to be a breath of fresh air.</p> <p>However, I am quite capable with fro...
Why aren't Shell_NotifyIcon balloon tips working? <p>According to everything I've seen, the following C++ program should be displaying a balloon tool tip from the tray icon when I left-click in the application window, yet it's not working. Can anyone tell me what I'm missing?</p> <p>This is on XP with version 6.0 of ...
<p>Bah, I figured it out. For some reason with the headers I have...</p> <p>sizeof(NOTIFYICONDATA) == 508</p> <p>whereas...</p> <p>NOTIFYICONDATA<code>_</code>V3<code>_</code>SIZE == 504<br /> NOTIFYICONDATA<code>_</code>V2<code>_</code>SIZE == 488<br /> NOTIFYICONDATA<code>_</code>V1<code>_</code>SIZE == 88</p> <...
Please confirm or correct my "English interpretation" of this Haskell code snippet <p>I'm a C# developer who is working through <a href="http://book.realworldhaskell.org/">"Real World Haskell"</a> in order to truly understand functional programming, so that when I learn F#, I'll really grok it and not just "write C# co...
<blockquote> <ul> <li>The "Cons" value constructor has a single type parameter.</li> </ul> </blockquote> <p>Nope: you've already parametrized it when you declared <code>data List a</code>. One effective property of this is that if I have a Nil :: List Int, I can't interchange it with a Nil :: List Char.</p> <bl...
From Visual Studio C++ 6.0 to VS 2008? <p>I work in a company doing C++ development on VC6, and we're considering a move to VS 2008.</p> <p>What are the benefits of upgrading? </p> <p>What are the cons?</p> <p>Any guides/steps on migrating project files, or gotchas I should be aware of? Are people ok with moving to ...
<p>For me, the biggest reason to upgrade to 2008 is the level of standards compliance in the C++ compiler. It is <strong>vastly</strong> improved from VC6 and is capable of using most libraries that you are familiar with or want to use. Including STL, BOOST and TR1.</p> <p>The downsides are the normal issues with up...
Need help by modifying this code <p>I want to delete all .rar extension file from all directory with particular drive. Say i have "D:\Test" under this i have created many .rar files or .zip files. Once the program run only all .rar file should be deleted and other extension files should remain same and it should displa...
<p>Works fine for me; maybe check that <code>d:\Test</code> exists? As an aside - note that the recursive overload of <code>GetFiles</code> is a bit flaky when it gets to complex permission sets. You would do better by doing the recursion manually, using <code>try</code>/<code>catch</code> around sub-folders: </p> <pr...
serialize and deserialize SQL query <p>I'm having an embedded device which keeps a list of inner tables. I would like it to synchronize this table's state with some outside database for debugging purposes. That is whenever I add an element to a certain struct array I wish the device to issue an "INSERT INTO ..." comman...
<p>Most DBMS do this with prepared statements. You prepare a statement, such as an insert, and then execute it with just the relevant parameters. The server (or client) gives the prepared statement some sort of ID (typically, an integer, sometimes a string), and the client-side library can re-execute it on demand.</p...
access eggs in python? <p>Is there any way to call an installed python egg from python code? I need to cal a sphinx documentation generator from within a python code, and currently i'm doing it like this:</p> <p><code>os.system( "sphinx-build.exe -b html c:\\src c:\\dst" )</code></p> <p>This works, but requires some ...
<p>So basically, you want to use Sphinx as a library?</p> <p>Here is what <code>sphinx-build</code> does:</p> <pre><code>from pkg_resources import load_entry_point load_entry_point('Sphinx==0.5.1', 'console_scripts', 'sphinx-build')() </code></pre> <p>Looking at <code>entry-points.txt</code> in the EGG-INFO directo...
How to embed a excel sheet inside the property sheet of a flex component? <p>I am trying to create a custom component in flex using mxml. I have created the property sheet for the custom component but it needs a button which onclick has to point to a cell in excel sheet from which data can be retrieved. How to go about...
<p>Have a look at <a href="http://code.google.com/p/as3xls/" rel="nofollow">as3xls</a>. </p>
Does programming terminology have an inbuilt tendency away from clarity? <p>A little while back I decided to learn C# which has been a fairly rewarding experience as the language seems very easy to pick up. </p> <p>That is, with the exception of the terminology. It's not that there's loads of jargon (that comes with l...
<p>Every domain of knowledge tends to develop jargon so that domain-specific concepts can be discussed without labouring over the language used to express those concepts.</p> <p>When I was taught data modeling it was emphasised that a key to developing a good model was to understand--document if helpful--the domain vo...
Currency Library <p>I am looking for a .Net class/library to use with currency acronyms in the same way the TimeZoneInfo class works with timezones. </p> <p>I need to populate a drop down list with these acronyms and store the result in a databse. This value will be used to retrieve up to date exchange rates from the ...
<pre><code>CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures); IEnumerable&lt;string&gt; currencySymbols = cultures.Select&lt;CultureInfo, string&gt;(culture =&gt; new RegionInfo(culture.LCID).ISOCurrencySymbol); </code></pre> <p>Is it what you are looking for?</p>
JQuery reusable functions <p>Completely new to JQuery so I am learning everyday.</p> <p>One thing I noticed is how easy it is, you can just write </p> <pre><code>$('div#test).remove(); </code></pre> <p>But I am looking for an example on how to reuse some code, eg.:</p> <pre><code>function RemoveTableRow(row, id) {...
<p>is user-row-1 the ID of the table row? If yes, than you are missing # in your selector</p> <pre><code>function RemoveTableRow(row, id) { $('#'+row).remove(); // id should be used for ajax call } </code></pre> <p>or without changing the function, call it with the complete selector</p> <pre><code>onclick="Rem...
Semantic Web :Tutorial on RDF dev <p>I am new to Semantic Web. I want to start working on creating some basic RDF document and publish them to get a feel how it works.I found a lot of information about the concepts,vocabulary etc but I couldn't find any thing related to development as what is the development environmen...
<p>Its real easy to be confused at first, but its ultimately simple enough. I liked this UMBC equity <a href="http://www.youtube.com/watch?v=ldl0m-5zLz4" rel="nofollow">video tutorial</a> on RDFa, its starts by explaining RDF, gives you a nice human readable notation for reference (N3) and then shows you how to put RDF...
What is "generator object" in django? <p>Am using Django voting package and when i use the method get_top() in the shell, it returns something like <strong>"generator object at 0x022f7AD0</strong>, i've never seen anything like this before, how do you access it and what is it?</p> <p>my code:</p> <pre><code>v=Vote.ob...
<p>If you want a list, just call list() on your generator object.</p> <p>A generator object in python is something like a lazy list. The elements are only evaluated as soon as you iterate over them. (Thus calling list on it evaluates all of them.)</p> <p>For example you can do:</p> <pre><code>&gt;&gt;&gt; def f(x): ...
How to trap the OutOfMemoryException in .NET (Excel add-in) <p>I am getting OutOfMemory Exception in my .net addin. The addin is using large number of managed and unmanaged objects. Is there a way to trap this exception?</p> <p>Updated: I think any application can get an OutofMemory exception if it processess a large ...
<p>In .Net the OutOfMemoryException is throw by the runtime when it cannot allocate the requested memory for your application. As such there is very little actual work that can be done to handle such an exception.</p> <p>Instead of catching it you should prevent it from happening in the first place. Ignoring the excep...
How to get the public channel URL from YouTubeVideoFeed object using the YouTube API? <p>I'm using the Python version of the YouTube API to get a YouTubeVideoFeed object using the following URL:</p> <blockquote> <p><a href="http://gdata.youtube.com/feeds/api/users/USERNAME/uploads" rel="nofollow">http://gdata.youtub...
<p>Well, the youtube.com/user/USERNAME is a pretty safe bet if you want to construct the URL yourself, but I think what you want is the link rel='alternate'</p> <p>You have to get the link array from the feed and iterate to find alternate, then grab the href</p> <p>something like:</p> <pre><code>client = gdata.youtu...
Multiple simultaneous network connections - Telnet server, Python <p>I'm currently writing a telnet server in Python. It's a content server. People would connect to the server via telnet, and be presented with text-only content.</p> <p>My problem is that the server would obviously need to support more than one simulta...
<p>Implemented in <a href="http://twistedmatrix.com/">twisted</a>:</p> <pre><code>from twisted.internet.protocol import Factory, Protocol from twisted.internet import reactor class SendContent(Protocol): def connectionMade(self): self.transport.write(self.factory.text) self.transport.loseConnectio...
How to make canvas with Swing? <p>I'm trying to make a paint editor with Java in which I have a toolbar with the objects that I would like to paste in the canvas. I'm using Swing components to make the GUI, but when I looked for the way of making the canvas, I only found the class canvas from AWT. </p> <p>Is there any...
<p>In order to make a custom 'Canvas' in swing you usually write a subclass of a <a href="http://docs.oracle.com/javase/6/docs/api/javax/swing/JPanel.html"><code>JPanel</code></a>. Then, you must overwrite the <code>protected paintComponent(Graphics g)</code> method of <code>JPanel</code>.</p> <p>In the paint method,...
'Encapsulate Field' tool for a PHP IDE <p>Does anybody know an PHP IDE that features a tool to encapsulate private variables, as Visual Studio does for C#/VB/etc? In fact any IDEs that support PHP and include code-generation tools would be of interest.</p>
<p>yes and no ;)</p> <p>There are IDEs that support code generation of getter and setter methods. For example the commercial <a href="http://www.zend.com" rel="nofollow">Zend Studio for Eclipse</a> and the free <a href="http://www.aptana.com" rel="nofollow">Aptana Studio</a> with PHP Plugin. In fact this is a bit diff...
creating txt file <p>In my MFC application project during runtime i want create a txt file and i want store some data in that i dont want to create the notepad file in any Hard drive. It must be in application only. when i click a IDC_BUTTON1 then it must open.then the user must decide wheather the txt file has to save...
<p>You do not need a file, you just need a variable in memory to hold the text. You can display this text in you GUI in a preview window. </p> <p>If the user wants to save it, write the content of your variable to the disc. If you want to present this file to the user in his default text editor, you can perform a <a ...
MsgWaitForMultipleObjectsEx and alertable wait state <p>Is it possible to enter an alertable wait state using <code>MsgWaitForMultipleObjects()</code> / <code>MsgWaitForMultipleObjectsEx()</code>?</p>
<p>it is possible to enter into an alertable wait if you specify MWMO_ALERTABLE flag as the last parameter (dwFlags - the wait type)</p>
Parsing CSV file with un-escaped quotation marks and commas in .NET <p>I was wondering if someone could help me. </p> <p>I have to parse data from a csv file and put this into a db table. An example of the data is as follows:</p> <p>"first field", "second <strong>,</strong> field", "third <strong>"</strong> Field <st...
<p>Don't really understand the answers so far. </p> <p>As far as I can tell, your example input string can't be parsed without adding extra restrictions.</p> <p>It is your third field which presents a problem. How can the parser tell that after the " between third and Field we haven't finished the third element? By d...
Why is The Iteration Variable in a C# foreach statement read-only? <p>As I understand it, C#'s foreach iteration variable is immutable.</p> <p>Which means I can't modify the iterator like this:</p> <pre><code>foreach (Position Location in Map) { //We want to fudge the position to hide the exact coordinates ...
<p>Lets start out with a silly but illustrative example:</p> <pre><code>Object o = 15; o = "apples"; </code></pre> <p>At no point do we get the impression that we just turned the number 15 into a string of apples. We know that <code>o</code> is simply a pointer. Now lets do this in iterator form.</p> <pre><code>int[...
Soundex Algorithm implementation using C++ <p>Put simply a Soundex Algorithm changes a series of characters into a code. Characters that produce the same Soundex code are said to sound the same.</p> <ul> <li>The code is 4 characters wide</li> <li>The first character of the code is always the first character of the wor...
<p>Instead of </p> <pre><code>scode[codeCount] = 1; </code></pre> <p>you should write</p> <pre><code>scode[codeCount] = '1'; </code></pre> <p>as you are forming a char array, the former is actually the first ascii character while the latter is the character '1'.</p>
single quotes(') Insert problem in sql server 2005 stored procedure <pre><code>txtname.Text.Trim().Replace("'", "' + char(39) + '") </code></pre> <p>the above statement is not working for stored procedure</p>
<p>Don't build the sql manually. Use Parameters instead.</p>
IE7 & 8 not fireing jQuery click events for elements appended inside a table <p>I have an IE bug that I'm not sure how to fix.</p> <p>Using jQuery I'm dynamically moving a menu to appear on an element on mouseover.</p> <p>My code (simplified) looks something like this:</p> <pre><code>$j = jQuery.noConflict(); $j(do...
<p>Strangely, although your click event isn't firing in IE, if you change it to either mousedown or mouse up it works as you'd expect although you still have your image hover issue.</p> <pre><code>$j('div.ico').mouseup(function() { alert($j(this).parent().html()); }); </code></pre>
Error when I run my C# program that work's with Oracle <p>I Made Setup from my C# program (that work's with Oracle 10g)</p> <p>when I try to run this program - in different Computer, i got this error message:</p> <p>unable to load dll 'OraOps10.dll'</p> <p>what it can be ?</p> <p>thank's in advance</p>
<p>If you're using the Oracle ODP (<code>Oracle.DataAccess.Client</code>) and not the default Microsoft ODP (<code>System.Data.OracleClient</code>) then you have to download install the <a href="http://www.oracle.com/technology/software/tech/windows/odpnet/index.html" rel="nofollow">Oracle Data Access Compontents</a> b...
Web.Config issue <p>i have a two webservers, REMOTE and LOCAL. I have multiple projects of which some are hosted on REMOTE, some on LOCAL and some on both. I have a problem configuring the following situation:</p> <pre><code>http://REMOTE/ &lt;&lt; contains 'main project' http://REMOTE/doubleproject/...
<p>Is your subdirectory set up as a seperate application in IIS? Adding it as a seperate application may remove the dependency on the parent configSection.</p>
Adding a new view to the a Zend Framework site <p>We have taken on a site written in Zend framework. We didn't write the site and haven't use the Zend framework before so I'm interested in finding three things.</p> <ol> <li>How do I add new views to the site, adding in a new folder to the application/views/scripts dir...
<p>to answer your questions in order:</p> <ol> <li><p>You have to find the controller, that will emerge the view you want to add. There are two ways to get a view script rendered. The first one is a naming convention on the view script. The view has to be the same name as the action name of the controller. Like "index...
Dynamic View name in Table valued function <p>I'm passing View name as parameter in a Table Valued Function, and I want to fetch some data from that view by building a dynamic SQL and executing it by sp_executesql(). when try to execute the function, I get the error: Only functions and extended stored procedures can be...
<p>Well, you could wrap the dynamic SQL in an extended stored procedure. That would work, but I'd (strongly) advise against doing it.</p> <p>SQL Server requires user-defined functions to be deterministic (with the exception of the aforementioned extended stored procedures) -- i.e. the results of the function should b...
Adding javascript to a link's OnClientClick property while binding a repeater <p>I'm trying to get this working but no success:</p> <pre><code>&lt;asp:Repeater ID="Repeater1" runat="server" OnItemCommand="btnDeleteFamily_Click"&gt; &lt;HeaderTemplate&gt; &lt;table&gt; &lt;tr&gt; &lt;th width="90"...
<p>I think writing the message to page as a javascript variable is a better solution : </p> <pre><code>&lt;script&gt; var deleteMemberDialogMessage = '&lt;%= getTag("deletefamilymemberdialog") %&gt;'; &lt;/script&gt; </code></pre> <p>And your repeater : </p> <pre><code>&lt;asp:LinkButton ID="btnDeleteFamily" CssC...
JavaScript: undefined !== undefined? <p><em>NOTE: As per <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.1.3">ECMAScript5.1, section 15.1.1.3</a>, window.undefined is read-only.</em></p> <ul> <li><em>Modern browsers implement this correctly. for example: Safari 5.1, Firefox 7, Chrome 20, etc.</em></l...
<p>The problem is that undefined compared to null using == gives true. The common check for undefined is therefore done like this:</p> <pre><code>typeof x == "undefined" </code></pre> <p>this ensures the type of the variable is really undefined.</p>
What's the best way to implement a operator overload? <p>Among all things I've learned in C++ (which isn't so much), operator overloading seems the most difficult. In general terms, when is it best to write an operator overload as a friend function? When do I have to explicilty use <code>*this</code>? Is always bad ...
<p>There is nothing magical abourt operator overloading - such overloads are simply functions with strange-looking names. So you write operator overloads in the same way you would write a named function. In fact, it's often a good idea to write a named function first - you can always change it to an operator later.</p>...
Whether should I use try{} or using() in C#? <p>I'm new to C#,been a pascal lover until I found C# in Depth.In Delphi there is a try{} statement that is also implemented in C#.</p> <p>However,I've seen some of you mentioning "Using(){} is better than try{}".</p> <p>Here's an example:</p> <pre><code> //This might t...
<p>Using and try are 2 very different things, and are completely orthogonal.</p> <p>If an exception occurs and is not in a try block the stack unwinds until an appropriate exception handler is found. This is regardless of the using statement.</p> <p>Use <code>using {}</code> when you want to ensure that the object is...
How can I have a dynamic URL in generic class <p>I need to have a dynamic URL preferably from a Test Class. Can any one help me in formatting this design pattern to handle dynamic links from tests. instead of a constant HomePageURL. </p> <pre><code>Namespace TestDesign Public Class HomePage Inherits IE Public ...
<p>How I would approach this is to put the base url into the applicaiton config and then build a URLs class to construct them here is an example:</p> <p>In app config</p> <p><code>&lt;appSettings&gt; &lt;add key="TestServerUri" value="http://www.apple.com"/&gt; &lt;/appSettings&gt;</code></p> <p>in class file </p...
Add form values to Ajax.ActionLink <p>How is it possible to get values from a Html form to an Ajax.ActionLink method like the example below. Instead of "id=Model.DinnerID" I need to get the values of two textboxes that is in a Html form block?</p> <p>&lt;%= Ajax.ActionLink( "RSVP for this event", ...
<p>set id with id of the textbox(something like this: {id="textboxId"})</p>
fastest way to store comment data python <p>Hi I have a small comment shoutbox type cgi process running on a server and currently when someone leaves a comment I simply format that comment into html i.e</p> <p><code>&lt;p class="title"&gt;$title&lt;/p&gt; &lt;p class="comment"&gt;$comment&lt;/p&gt;</code></p> <p>and ...
<p>If a flat file is fast enough, then go with that, since it's very simple and accessible. Storing as XML and JSON but still using a flat file probably is very comparable in performance.</p> <p>You might want to consider (ignore this if you just left it out of your question) sanitizing/filtering the text, so that use...
How to ensure that table was not tampered with in the SQL Server 2008? <p>I need simple but reliable mechanism to ensure that table was not tampered with in the SQL Server 2008. The assumption is that hacker can access and control only one of the servers (application or database) but cannot access both. Any links or su...
<p>Your time would be better spent ensuring that a hacker can't get in at all, because as soon as you start making pessimistic assumptions like above, then you can be sure that a hacker <em>Will</em> get into both servers.</p> <p>You could create an audit system via triggers that makes log entires anytime someone does...
Use ResourceReader to create a HybridDictionary of resources <p>I'm using a ResourceReader to read an embedded resx resource and I want to store it at a class level in a member variable. I'm want to store it as a HybridDictionary but don't see an easy way of doing it.</p> <p>Class member</p> <pre><code>private IEnume...
<p>IEnumerable does not support access by key (the dictionary["something"] part in your code), to access data that way you'd need your dictionary property to be an IDictionary class. Something like:</p> <pre><code>private IDictionary&lt;string, object&gt; dictionary; </code></pre> <p>Then you would need to parse the ...
PHP IDE with vi key bindings <p>At the moment I'm using eclipse with viplugin. I also know about netbeans and its vi plugin. I find both of these IDEs don't really fit my tastes though. Too slow, bad remote editing support. I don't really have time at the moment to set up and try a vim based ide either.</p> <p>So, wha...
<p>I personnaly use <a href="http://www.netbeans.org/downloads/index.html" rel="nofollow">netbeans</a> with <a href="http://jvi.sourceforge.net/" rel="nofollow">jvi plugin</a>. The vi emulation of this vi plugin is near perfect, plus you get the very good (and fast growing) Netbeans Ide.</p>
How to add namespace to an xml file using java program <p>I want to add namespace to an xml file using java program. So how can I add namespace to an xml file using java</p> <p>Thanks Bapi</p>
<p>Whit JDom</p> <p>add an URI to xmlns in root element</p> <pre><code>Namespace ns = Namespace.getNamespace("yourURI"); Element root = new Element("someName", ns); </code></pre> <p>add any namespace</p> <pre><code>Namespace ns = Namespace.getNamespace("someName", "someValue"); Element yourElement = new Element("so...
What is the best non-SAS IDE for the SAS Language? <p>I am working on SAS code that will run under UNIX. Ideally the IDE will have:</p> <ul> <li>intelligent code formatting (autocomplete is not necessary).</li> <li>ability to transfer code to server via SFTP/SSH/SCP.</li> <li>Ability to execute code on the server via...
<p>I haven't tried it yet, but it looks like using myEclipse along with the <strong><a href="http://sourceforge.net/project/showfiles.php?group%5Fid=254574&amp;package%5Fid=312831">plugin SLink</a></strong> from anixma, will provide support for everything listed, including SSH execution of code on remote UNIX servers a...
How can I access the actual text that is displayed in a DIV when using CSS style overflow: hidden? <p>I have the following content DIV on my page, which displays dynamic text:</p> <pre><code>&lt;div id="someContent"&gt; &lt;/div&gt; </code></pre> <p>It uses the following CSS to cut off additional text:</p> <pre><cod...
<p>I don't think what you're asking to do is possible with javascript.</p> <p>Alternatively, why not truncate the text at a specific character count server-side? You probably won't have the kind of control you want over the size of the div displayed on the page depending on the font you've selected but it should solv...