input
stringlengths
51
42.3k
output
stringlengths
18
55k
Why are banking passwords so weak? <p><em>Out of interest and because it infuriates me, I was wondering if SOmebody here might happen to work for a bank or otherwise know the answer to this.</em></p> <p>I've used a few online banking sites (UK and N.America) and they universally enforce a password pattern of <code>/[\...
<p>If the stories I've heard about certain banks are true...</p> <p>It's because whenever you enter your password:</p> <ul> <li>The web server sends it over a half-kilometre-long serial cable to an old 386 in an abandoned office, running the UI (Compiled using a custom-hacked version of Borland C 1.0) that was used b...
List all files changed by a particular user in subversion <p>Is it possible to get a list of all files modified/added/deleted by a particular user?</p> <p>The goal is to get an idea of what a user did for the day (or date range).</p>
<p>Here's an example, using the <a href="http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.log.html">svn log command</a> and <a href="http://www.google.com/search?hl=en&amp;q=linux+sed+command">linux sed command</a>, with your username, 'blankman':</p> <pre><code>svn log | sed -n '/blankman/,/-----$/ p' </code></pre> ...
Adjust Sharepoint URL field length <p>Is there anyway to change the length of the field that Sharepoint uses to store URLs. Its default is 255, which is just not long enough to hold links to content within the sharepoint site.</p>
<p>No, this is a hard limit in SharePoint. Studying the schema of the content database reveals the limit originates from the primary key columns DirName and LeafName in the AllDocs table.</p> <p>I recently worked on a project where this problem also surfaced because users tended to create deep folder structures with l...
Using only std::exception in exception specification <p>It seems it is general accepted that exception specifications are not helping as much as one thinks. But I wonder if a specification which only uses std::exception might be a good compromise:</p> <pre><code>void someFunction() throw ( std::exception ); </code...
<p>Yes but what do you expect to happen when something that is not derived from std::exception is thrown?</p> <p>Would you like the application to terminate.<br> No stack unwinding not destructors being called to tidy up the code, just the application exiting.</p> <p>The difference between Java and C++ exception spec...
UITextField in UITableViewCell's and proper usage <p>I have a complex settings style table where individual cells represent different aspects of a data model class. Users can click into a cell and edit individual attributes, such as say if I have a user class, a name, date of birth, etc. My question is, do I need to ha...
<p>I would recommend creating a subclass of a UITableViewCell. You could do this either purely programaticaly, or if you have an aversion to CGRect's (or want to be able to drag and drop your layout around) with a combination of a XIB and a custom class file.</p> <p>The Subclass would then contain the UITextFiled's y...
Variable/Ram viewer for .NET? <p>I'm using Office Automation in .NET. It is leaving behind the excel.exe program. I know the fix - it is all about explicitely defining the variables. Once defined, I can properly de-allocate the ram and the GC will clean them up.</p> <p>The problem is, I have literally thousands of lin...
<p><a href="http://www.automatedqa.com/techpapers/net_allocation_profiler.asp" rel="nofollow">http://www.automatedqa.com/techpapers/net_allocation_profiler.asp</a></p>
How to use libapt (or libept) in debian-like system to list packages and get their infos? <p>Somebody used libapt or libept to list packages and get informations about package in a debian-like system?</p> <p>Libapt is not well-documented at all, and i've found few examples and tutorials about libept. Can someone expla...
<p>In debian there is a package called <code>libapt-pkg-doc</code> which contains some documentation (like an API reference). Once installed, you can access it at file:///usr/share/doc/libapt-pkg-doc/html/index.xhtml.</p> <p>I only just had a look at libapt and here is what I have learned so far:</p> <p>How to list a...
Statistics engine for Java EE Web Application <p>We are working on a Java EE Web Application, and the people from marketing need some really detailed stats for our site. Something similar to Google Analytics, gathering the user's information, and their navigation through the site (where they come from, what they click,...
<p>1) You could use a log analyser to analyse the web server logs - with Tomcat you need to install a module that does this, I've forgotten the name.</p> <p>2) Create a table in your database called user_journey or similar. Inside you can log all the relevant details of each hit. Then in your root servlet, or the equi...
On Windows, when should you use the "\\\\?\\" filename prefix? <p>I came across a c library for opening files given a Unicode filename. Before opening the file, it first converts the filename to a path by prepending "\\?\". Is there any reason to do this other than to increase the maximum number of characters allowed i...
<p>Yes, it's just for that purpose. However, you will likely see compatibility problems if you decide to creating paths over MAX_PATH length. For example, the explorer shell and the command prompt (at least on XP, I don't know about Vista) can't handle paths over that length and will return errors.</p>
.NET 2.0 - Tokenizing space separated text <p>Suppose you have output like this:</p> <pre><code>Word1 Word2 Word3 Word4 </code></pre> <p>Where the number of spaces between words is arbitrary. I want to break it into an array of words.</p> <p>I used the following code:</p> <pre><code>string[] tokens...
<p>He already mentions string.Split(). What he's missing is StringSplitOptions.RemoveEmptyEntries:</p> <pre><code>string[] tokens = input.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); </code></pre>
How can I determine the element type of a matched element in jQuery? <p>I'm matching ASP.Net generated elements by ID name, but I have some elements which may render as text boxes or labels depending on the page context. I need to figure out whether the match is to a textbox or label in order to know whether to get the...
<p>Just one jQuery too much:</p> <pre><code>$("[id$=" + endOfIdToMatch + "]").each(function () { alert(this.tagName); }); </code></pre>
Implementing and Enforcing Coding Standards <p>My team (of which I am the newest and most junior member) has increased in size from 3 to 9 developers in just about 1 year. Our primary product has increased in complexity and we are about to undertake a year long port/re-write to Silverlight. In the past there has been...
<p>A combination of ReSharper, FxCop/StyleCop (there is a way to define custom rules at least for FxCop), clear code guidelines and monthly reviews should do the job for a team of nine people I think. If someone breaks the rules, you'll have no way but to use a whip :)</p>
Buttons in gridview control <p>I have a gridview control which displays data returned from DB. The datakey property of the gridview is bound to the ID column of the DB</p> <p>Each record in the GV had 2 buttons and one Checkbox. When either of these controls is clicked I want to obtain the row that this was clicked on...
<p>Did you assign the buttons' <code>CommandName</code> and <code>CommandArgument</code>?</p>
Read & Update filestream <p>I have a little utility that does a search of a number of files. I had to create it because both Google &amp; Windows desktop searches were not finding the appropriate lines in files. The searching works fine (I am willing to improve on it) but one of the things I would like to add to my uti...
<p>I would do the following for each file:</p> <ul> <li>Do the search as normal. Also check for the token to replace. As soon as you've seen it, start that file again. If you don't see the token to replace, you're done.</li> <li>When you start again, create a new file and copy each line that you read from the input fi...
Why would Guid.NewGuid() be generating an empty guid? <p>I have a Guid.NewGuid() call that is creating an Empty Guid. </p> <p>What would cause such a problem and how can I fix it?</p> <p><b>Edit:</b> The code:<br /></p> <pre><code>&lt;WebMethod()&gt; _ Public Function CreateRow(rowValue As String) as String Dim...
<p>This is an old problem in VB.NET. It is only the debug visualizer that is broken.</p> <p><a href="http://www.thesoftwaredevotional.com/2008/12/guid-visualizer-broken-in-vbnet.html" rel="nofollow">http://www.thesoftwaredevotional.com/2008/12/guid-visualizer-broken-in-vbnet.html</a></p>
How can I feed standard input to a batch file when an app run from the batch mucks with stdin? <p>Here's a minimal batch file, <code>demo.bat</code>, to illustrate my problem:</p> <pre><code>@ECHO off set /p foo=Enter foo: echo. echo you typed "%foo%" sqlcmd -? set /p bar=Enter bar: echo. echo you typed "%bar%" </c...
<p>I don't know if it helps, but you can try to pipe something else to sqlcmd, for example:</p> <pre><code>echo. | sqlcmd -? </code></pre>
How to use System::Threading::Interlocked::Increment on a static variable from C++/CLI? <p>I would like to keep a static counter in a garbage collected class and increment it using Interlocked::Increment. What's the C++/CLI syntax to do this?</p> <p>I've been trying variations on the following, but no luck so far:</p...
<p>You need to use a <a href="http://msdn.microsoft.com/en-us/library/8903062a(VS.80).aspx">tracking reference</a> to your <code>_int64</code> value, using the % tracking reference notation:</p> <pre><code>ref class Bar { static __int64 _counter; __int64 Next() { __int64 %trackRefCounter = _counter; ...
read property value in Ant <p>I need to read the value of a property from a file in an Ant script and strip off the first few characters. The property in question is</p> <pre><code>path=file:C:/tmp/templates </code></pre> <p>This property is store in a file that I can access within the ant script via</p> <pre><code>...
<p>In Ant 1.6 or later you can use <code>LoadProperties</code> with a nested <code>FilterChain</code></p> <pre><code>&lt;loadproperties srcFile="${property.file.name}"&gt; &lt;filterchain&gt; &lt;tokenfilter&gt; &lt;containsstring contains="path=file:"/&gt; &lt;replaceregex pattern="path=file:" repla...
Generating a Protocol Buffers definition <p>I have a large set of XML files of a propriatary schema -the XML files define binary communication protocol (message structure).</p> <p>I'd like to leverage Google's protocol buffers technology. </p> <p>I am using existing code to load the XML files into an object model (in...
<p>My code can only serialize and deserialize to binary and text. However, I believe <a href="http://code.google.com/p/protobuf-net/" rel="nofollow">Marc Gravell's project</a> has XML capabilities. In fact, I believe he generates C# code based on loading the binary version of a .proto file (which is itself encoded as a...
tool for detecting non-parametrized sql in java jdbc code <p>I'm looking to inspect SQL statements in Java/jdbc code to ensure that the SQL to be executed is of acceptable quality. Neither PMD not Findbugs appears to have JDBC or sql rules. I could use p6spy to log the SQL and look at that way, but this is manual. </p...
<p>This is a tricky problem. Comparison operators like <code>=</code> and <code>IN()</code> are some cases, but there's also: <code>!= &lt;&gt; &lt; &lt;= &gt; &gt;= LIKE</code>.</p> <p>How do you spot cases of interpolating application variables as literals in expressions?</p> <pre><code>String sql = "SELECT *, " ...
Enable/Disable buttons depending on the app selected control <p>I have a very complicated .NET application that contains cut/copy/paste functionality. I want to enable/disable cut/copy/paste buttons depending on the selected control/content. The app has many user controls. What is the best way to achieve this?</p> <p>...
<p>Are you talking about catching the focus of the control or about a design pattern in which to do this?</p> <p>I would probably register each control that is to be enabled/disabled with the control that it's dependent on. Then when the dependent control gets selected/focused, spin through the controls and enable/dis...
ASP.NET: How to change the itemTemplate used per row in an <asp:repeater>? <p><em>Existing</em> code is using an <code>asp:repeater</code> to build an HTML table. (emphasis on the existing design). This is some partial pseudo-code to generate the table:</p> <pre><code>&lt;asp:repeater OnItemDataBound="ItemDataBound" ....
<p>Place two ASP:Placeholder controls in your item template. In the codebehind, on the ItemDataBound event, determine which style you want to show, and hide one placeholder.</p>
Shorten URL value as Javascript variable <p>I'm using the <a href="http://jquery.com/" rel="nofollow">jQuery</a> <a href="http://bassistance.de/jquery-plugins/jquery-plugin-treeview/" rel="nofollow">Treeview</a> plugin for navigation on a site with nested levels of categories. In each category there are then products, ...
<p>After help from a friend (thanks Sawks) I am presenting the answer to my own question in case anyone else finds themselves in the same boat.</p> <p>I changed the lines starting 206 within jquery.treeview.js from:</p> <pre><code>case "location": var current = this.find("a").filter(function() { return this.href....
In .NET CF 2.0, will a global keyboard hook interfere with P/Invokes that require a keypress? <p>My details: custom mobile device running Windows CE 4.2, Compact Framework 2.0 SP1. C# app making decent use of P/Invokes with no problems until now.</p> <p>I've written a low-level keyboard hook (similar to, but not ident...
<p>a) No, they are fully compatible. The keyboard hook happens down at the kenel level, so anything that uses a keyboard message will go through it, whether it's coming from native or managed code.</p> <p>b) Hard to say since we can't see your implementation</p> <p>c) This is possible (anything is since just about e...
Silverlight Verticle Slide Panel <p>Can anyone recommend a good Silverlight 2.0 slide panel that takes an unknown number of user controls as childen and allows the user to scroll up and down through the child list.</p> <p>Similar to <a href="http://www.thejamesbondmovies.com/" rel="nofollow">http://www.thejamesbondmov...
<p>Looking around <a href="http://www.robertjantuit.nl/index.php/2008/09/13/storyboard-animation-for-the-scrollviewer-animationhelpercontrol/" rel="nofollow" title="Rob">Rob</a> has a good starting point. His example uses adapts the ScrollViewer control, hides the default scroll bars and adds buttons to scroll left and...
Replace MS Cardspace UI <p>Is it possible to replace Microsoft Cardspace UI with your own? Or use Cardspace without any UI?</p>
<p>Google for Chuck Mortimer who wrote a Cardspace UI for Firefox.</p>
Sorting domain names <p>Has anyone implemented sorting a list of domain names?</p> <p>I have seen some applications sort them as flat strings, but the problem is that you end up scattering all the related hosts in a domain:</p> <p>a.me.com a.you.com b.me.com b.you.com</p> <p>So, the basic logic I came up with revers...
<p>I don't know about Java and Javascript in particular, but many languages provide some sort of array data structure that can be lexicographically sorted. So, like you said, convert "a.example.com" into {"com", "example", "a"}, and just let the default sorting rules run. A lexicographical sort will then do exactly w...
How do I get the instance of a templated item from a databound ItemsControl? (WPF) <p>I have an <code>&lt;ItemsControl&gt;</code> with a custom <code>&lt;DataTemplate&gt;</code> (and also a custom <code>&lt;ItemsPanelTemplate&gt;</code> that is just a <code>WrapPanel</code>), bound via <code>ItemsSource</code> to a sim...
<p>The answer I've posted <a href="http://stackoverflow.com/questions/329556/focus-on-textbox-in-datatemplate#329571">over here</a> deals with focusing an element inside a DataTemplate, but it should provide the code you need. It involves using the FindName method on your DataTemplate to find a control within it. If yo...
Application crashes on iPhone OS 2.2, works fine on 2.1 <p>This is the trace of my app,when I updated my device to 2.2.</p> <p>any idea to get rid of this leak? because I think that's the culprit who keep crashing my application.<br /> This is trace when I run my application in os2.2,see the image which show the part ...
<p>That trace is rather meaningless without access to the code. My suggestion would be to download and install the Clang Static Analyzer and run your code against it to determine where the leak exists. It can be found at <a href="http://clang.llvm.org/StaticAnalysis.html" rel="nofollow">http://clang.llvm.org/StaticAn...
Create Java console inside a GUI panel <p>How can I create an instance of the Java console inside of a GUI panel?</p>
<p>Here's a functioning class. You can install an instance of this into the system out and err using:</p> <pre><code>PrintStream con=new PrintStream(new TextAreaOutputStream(...)); System.setOut(con); System.setErr(con); </code></pre> <p><strong>Updated 2014-02-19</strong>: To use EventQueue.invokeLater() to avoid G...
How to get .NET version (1.1, 2.0, 3.0 etc.) under which an Assembly was built? <p>I have an assembly. Is there a way to detect which version of .NET was used to build that assembly?</p>
<p>You could possibly use Assembly.ImageRuntimeVersion. According to the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.imageruntimeversion.aspx" rel="nofollow">MSDN docs</a>, by default this is set to the version of the CLR used to build the assembly. Though apparently it can be changed....
Can MVC (or MVP) co-exist with SOA? <p>I think that business logic should exist in a model when using an MVC or MVP design pattern, but should be hidden behind a service in a service-oriented architecture.</p> <p>Can a software system use the MVC or MVP design pattern within a service-oriented architecture? If so, whe...
<p>Well they are totally different animals. MVC is all about presentation of data, controlling the navigation of hte user dialog and some business logic in building the data model.</p> <p>SOA is about retrieving data from a service provider.</p> <p>On the client side you can use SOA within the Model part of the MVC p...
Extract Icon from Windows .lnk (shortcut) file <p>I need to extract the icon from a windows shortcut (.lnk) file (or find the icon file, if it's just pointed to by the shortcut).</p> <p>I'm not asking about extracting icons from exe's, dll's, etc. The shortcut in question is created when I run a installation program....
<p>This thread provides interesting informations about the <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1407242&amp;SiteID=1">data contained in a .lnk file</a></p> <p>The <a href="http://www.codeproject.com/KB/shell/systemiconsimagelist.aspx?display=PrintAll">sSHGetFileInfoss</a> function should be a...
What happened to the python bindings for CGAL? <p>I found the <a href="http://www.cgal.org/">Computational Geometry Algorithms Library</a> in my search for an algorithm to decompose a concave polygon into the minimum number of convex components. Links off the site and numerous google results indicate there are python ...
<p>A rewrite of the CGAL-Python bindings has been done as part of the cgal-bindings project. Check it out : <a href="http://code.google.com/p/cgal-bindings/">http://code.google.com/p/cgal-bindings/</a></p>
How to remove html tags from database text field <p>How do I remove html elements in a text field from SQL Server?</p>
<p>I assume you mean removing html tags from a field stored in a database. If so, and if you can code the solution in .NET, I would have used the <a href="http://www.codeplex.com/htmlagilitypack" rel="nofollow">HTML agility pack</a> to traverse the html contents, and save the InnerText (i think that's the property name...
Where to look for database samples/schema? <p>I found <a href="http://www.databaseanswers.org/data_models/" rel="nofollow">http://www.databaseanswers.org/data_models/</a> very useful. Any other suggestions?</p>
<p>If you're just looking for data models, I recommend the following books:</p> <ul> <li><a href="http://rads.stackoverflow.com/amzn/click/0471380237" rel="nofollow">The Data Model Resource Book, Vol. 1: A Library of Universal Data Models for All Enterprises</a></li> <li><a href="http://rads.stackoverflow.com/amzn/cli...
How do I convert an audio stream to MP3 using Java? <p>Is it possible using Java to convert a real time audio stream from the mixer to MP3? </p> <ul> <li>It has to be converted chunk by chunk otherwise the memory will be exhausted. </li> <li>I already know how to record but only to lossless formats such as wav and aif...
<p>May be you could use <a href="http://openinnowhere.sourceforge.net/lameonj/" rel="nofollow">LAMEOnJ</a>, which is a 100% Java API wrapping the standard LAME API (LAME being a MP3 encoder).</p> <p>I am not sure however it would encode "chunk by chunk"...</p>
How to fix the "421 RP-001 The mail server IP connecting to Windows Live Hotmail server has exceeded the rate limit" problem? <p>We run a large online community in the Netherlands. Because of that we send a lot of mail to the hotmail email addresses of our members. Recently we have noticed that not all mail is reaching...
<p>421 means that the service is not <em>currently</em> available, and that the client <strong>should try again</strong>. This could be for any number of reasons, including trying to discourage you from too frequent mailing if Hotmail thinks you might be a spambot. </p> <p>Why not simply let your outbound smtpd queue ...
Access rdlc elements from code behind file <p>can you please give any sample code for accessing the rdlc elements from code behind file.</p> <p>I have a text box in the rdlc file, i have to set the value for that from code behind file. Please help me</p> <p>Thanks </p> <p>P S Marimuthu</p>
<p>You can just load the RDLC code as XML using XDocument or XmlDocument or whatever you want, and then query and update the file accordingly as you wish, and then save the RDLC. If you have a value you want to set programatically this way, you can define a hidden report parameter and use the DOM to update that parame...
How about using FLEX 3 component inside Flash file? <p>Is it possible to use Flex 3 component/code inside Flash (cs4) SWF file ?</p> <p>I know its possible in the opposite direction.</p>
<p>I haven't used Flex code in a "pure AS3" project myself, but I don't see why you couldn't do that.</p> <p>You can download the <a href="http://www.adobe.com/products/flex/flexdownloads/" rel="nofollow">Flex SDK</a> and get the Flex components from there, both as an <code>swc</code> file (under <code>/frameworks/lib...
SystemSounds Play not working <p>I am trying to play the Asterisk system sound from a C# program with</p> <pre><code>System.Media.SystemSounds.Asterisk.Play(); </code></pre> <p>but no sound plays. My system does have a sound set up for Asterisk and other programs (not written by me) cause various system sounds to pl...
<p>I had ignored this problem until today. Some googling revealed that this is quite a common problem and totally unrelated to the .NET Play calls.</p> <p>What happens is that while you can play/preview the sounds from the Control Panel Sounds and Audio Devices applet they do not play when programs trigger the sounds....
IS CAML the only way to Query MOSS? <p>CAML is hard to learn, and dificult to use, is there a better way to get results from MOSS, besides using CAML queries? And not referring to the Web Services, which are slower, or the object model, which again is slower. </p>
<p>Essentially, yes, you need to at least be able to read and understand CAML. However you can probably get out of writing it. I've used these tools:</p> <p>U2U CAML Query Builder by U2U - <a href="http://www.u2u.be/res/Tools/CamlQueryBuilder.aspx" rel="nofollow">download</a> and <a href="http://www.u2u.be/res/Tools/S...
Selecting rows where first n-chars are equal (MySQL) <p>I have a table with playerhandles, like this:</p> <pre><code>1 - [N] Laka 2 - [N] James 3 - nor | Brian 4 - nor | John 5 - Player 2 6 - Spectator 7 - [N] Joe </code></pre> <p>From there I wanna select all players where the first n-chars match, but I don't know ...
<p>If you know the value of n, you could do something like this (for n=3):</p> <pre><code>Select * FROM players WHERE Left(name, 3) in ( SELECT Left(name, 3) FROM players GROUP BY Left(name, 3) HAVING (Count(*) &gt; 1) ); </code></pre>
Yet another About ajax.net update panels performance thread <p>Good day,</p> <p>we just moved from asp.net 1.1 to asp.net 2.0. We are using ajax update panels.</p> <p>In an Apress book (Pro asp.net 2008) , I've read that when you use the updatepanel, you don't reduce the acount of bandwidth sent, because the entire p...
<p>It depends on how many parts of your page you want to be able to load separately, you'll need a panel for each part.</p> <p>The complete viewstate is always sent with the postback to the server.</p> <p>Regards K</p>
How to determine total size of ASP.Net cache? <p>I'm using the ASP.net cache in a web project, and I'm writing a "status" page for it which shows the items in the cache, and as many statistics about the cache as I can find. Is there any way that I can get the total size (in bytes) of the cached data? The size of each i...
<p>I am looking at my performance monitor and under the <strong>ASP.NET Apps v2.0.50727</strong> category I have the following cache related counters:</p> <p><strong>Cache % Machine Memory Limit Used</strong></p> <p><strong>Cache % Process Memory Limit Used</strong></p> <p>There are also a lot of other cache related...
Disable Windows Mobile security features <p>I'm currently writing an app for a Windows Mobile 5.0 app and it seems to possess some firewall-esqe feature where I need to permit the running of any deployed executable. Is there some kind of registry key I can use to turn this off during development as it's frustrating hav...
<p>Have you seen the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7e92628c-d587-47e0-908b-09fee6ea517a&amp;displaylang=en" rel="nofollow">Device Security Powertoy</a>?</p>
Different output from midl.exe 6 and midl.exe 7 <p>I'm tyring to convert a MSVC project from VS 2005 to VS 2008. It contains a IDL file that outputs a header and stubs used for RPC. The VS 2005 project uses MIDL.exe version 6.00.0366. The VS 2008 project uses MIDL.exe version 7.00.0500.</p> <p>Here's the problem: MI...
<p>Looks like I can answer my own question...</p> <p>MIDL v6 appears to automatically default the handle type to auto_handle for the server prototypes. MIDL v7 does not, so the solution is to use a Server.acl file with the auto_handle setting in it. This outputs a Server.h file with function prototypes that is the sa...
Stored procedure to modify bit flag, can't use Enums since many apps will be modifying it, what should I do? <p>There is a column in a database that is of type INT (Sql server).</p> <p>This int value is used at a bit flag, so I will be AND'ing and OR'ing on it.</p> <p>I have to pass a parameter into my sproc, and tha...
<p>You could use a string, and a CASE construct:</p> <pre><code>CREATE PROCEDURE BitBang(@Flag AS VARCHAR(50), @Id AS INT) AS BEGIN DECLARE @Bit INT SET @BIT = CASE @Flag WHEN 'approved' THEN 16 WHEN 'noapproved' THEN 16 WHEN 'fooflag' THEN 8 WHEN 'nofooflag' THEN 8 END IF @Bit IS NOT N...
Why is January month 0 in Java Calendar? <p>In <code>java.util.Calendar</code>, January is defined as month 0, not month 1. Is there any specific reason to that ?</p> <p>I have seen many people getting confused about that...</p>
<p>It's just part of the horrendous mess which is the Java date/time API. Listing what's wrong with it would take a very long time (and I'm sure I don't know half of the problems). Admittedly working with dates and times is tricky, but aaargh anyway.</p> <p>Do yourself a favour and use <a href="http://joda-time.source...
Unit testing CLI/MFC Application <p>I have CLI/MFC application and I would like to begin to learn how to unit test with it. I have VS2008 Pro. If possible, I would like to use the built in unit testing. Thanks for your input!</p>
<p>I've had success with both <a href="http://sourceforge.net/projects/cppunit" rel="nofollow">CPPUnit</a> and <a href="http://code.google.com/p/googletest/" rel="nofollow">Google Test</a>. For either you have to do a bit of work to get the test results to integrate back into Studio. The granularity of the results yo...
Response.Flush not working ASP.NET <p>I have an aspx page where i am Processing a large number of records from a table and doing some manipulation.after each manipuation,(each record),I have a Response.Write("Record : "+rec); Response.Flush()</p> <p>I have set Response.Buffer property to false. It is working fine But...
<p>For anyone else having this problem...</p> <p>Be aware that if your IIS server is compressing the output with GZIP, then it will seem to ignore all <code>Response.Flush</code> calls. This is turned on by default in IIS7 and on Windows 7.</p> <p>And, if you are testing with Fiddler, be sure to turn on "Streaming" m...
How to get which page threw an exception to Application_error in aspx <p>I have a general exception handler, Application_error in my global.asax where I'm trying to isolate all the uncaught exceptions on all my many pages. I don't want to use Page_error to catch exception because it's inefficient to call that on so man...
<pre><code>HttpContext con = HttpContext.Current; con.Request.Url.ToString() </code></pre>
Why is $1 empty in my substitution? <p>I am trying to put the stuff within parentheses into the value of a src attribute in an img tag:</p> <pre><code>while(&lt;TOCFILE&gt;) { $toc_line = $_; $toc_line =~ s/&lt;inlineFig.*?(\.\.\/pics\/ch09_inline99_*?\.jpg)*?&lt;\/inlineFig&gt;/&lt;img src="${1}" alt="" \/\&g...
<p>There's an error in your regex so that phrase will never match anything:</p> <pre><code>inline99_*?\.jpg ^^^ </code></pre> <p>I think you forgot <code>\d</code> in front of the star, judging by the example data you are trying to match.</p> <p>You're not even asking that it'll match, as you put a <code>*?<...
Full-Time WPF Development <p>I am fortunate to be working for a company in which all of our new development efforts are all in WPF. Are there a lot of other developers out there in this situation? Are companies quickly adopting this as their primary UI platform? As developers we all see the value in it, but are compani...
<p>I am doing WPF development at a major semi-conductor company. So far it has been a hit and miss experience. I was given pretty free reign to decide what development platform I used as long as we could support Windows Vista and later. Given that I had a pretty short development timeline for a rather large application...
$1 outputting no characters in regex <p>A couple people just recommended removing the curly brackets from ${1}, but that didn't seem to change anything; still getting nothing for $1.</p> <p>I am trying to put the stuff within parentheses into the value of a src attribute in an img tag:</p> <pre><code>$toc_line =~ s!&...
<p>I think you want to add dots before the second and third stars.</p>
gwt-ext file upload <p>I am trying to do a file upload from gwt-ext without bringing up the dialog box. To do this, I created a FormPanel and added the appropriate fields to it. Then did a form.submit(). This doesn't seem to work. Any idea why? The code is shown below.</p> <pre><code>final FormPanel uploadForm = new F...
<p>I found out why the above piece of code is not working. The primary issue here is that file uploads are blocked by the browser due to security reasons if the upload form has not been rendered and/or if the form has been modified after the user clicks the submit button. If the browser did allow such things, then any ...
Issue with Self Signed Cert in WCF - Must have Private Key <p>I am creating a WCF service hosted within IIS7 on Windows Vista SP1. I am getting the following error:</p> <p>The certificate 'CN=SignedByLocalHost' must have a private key that is capable of key exchange. The process must have access rights for the private...
<p>Figured it out. </p> <p>Assuming you have a self signed cert at c:\OutCert the following command will work. I had left off the -sky exchange.</p> <p>makecert -sk SignedByCA -iv c:\OutCert.pvk -n "CN=MyLocalHost" -ic c:\OutCert.cer -sr LocalMachine -ss My -sky exchange pe</p> <p>Now you can go into the MMC tool an...
Ignore ObsoleteAttribute Compiler Error <p>I have an enumeration value marked with the following attribute. The second parameter instructs the compiler to error whenever the value is used. I want this behavior for anyone that implements my library, but I need to use this enumeration value within my library. How do I...
<p>Private a separate constant somewhere like this:</p> <pre><code>private const Choices BackwardsCompatibleThree = (Choices) 3; </code></pre> <p>Note that anyone else will be able to do the same thing.</p>
Good algorithm for combining items from N lists into one with balanced distribution? <p>Let's say I have the three following lists</p> <p>A1<br /> A2<br /> A3 </p> <p>B1<br /> B2</p> <p>C1<br /> C2<br /> C3<br /> C4<br /> C5 </p> <p>I'd like to combine them into a single list, with the items from each list as eve...
<ol> <li><p>Take a copy of the list with the most members. This will be the destination list.</p></li> <li><p>Then take the list with the next largest number.</p></li> <li><p>divide the destination list length by the smaller length to give a fractional value of greater than one.</p></li> <li><p>For each item in the sec...
Can I extract a file from a jar that is 3 directories deep? <p>I have a jar file that has a file named "client.ts" in (when viewing in ZipGenius) "/com/something/messaging". When I do </p> <pre><code>JarFile jarFile = new JarFile("Client.jar"); JarEntry zipFile = jarFile.getJarEntry("client.ts"); </code></pre> <p>It ...
<p>The full path of the entry within the JAR should work:</p> <pre><code>JarEntry zipFile = jarFile.getJarEntry("com/something/messaging/client.ts"); </code></pre>
Enterprise Messaging API with Web Services for High Performance? <p>Does combining an Enterprise Messaging solution with Web Services result in a real performance gain over simple HTTP requests over sockets?</p> <p>(if implementation details will help, interested in JMS with a SOAP webservice)</p>
<p>Typically one uses a messaging solution for message reliability, rather than performance. If you need guaranteed message delivery, use something like JMS.</p> <p>HTTP is so lightweight, I can't imagine that any other messaging solution would have higher performance.</p>
Do I need to unsubscribe from (manually subscribed to) events in asp.net? <p>Do the same best practis rules regarding subscribing/unsubscribing to events apply in asp.net?</p> <p>I know it might seem like a silly question, but when I think about it, I have never really seen any code where people first subscribe to an ...
<p>The page instance and all of its components will "go out of scope" when request completes, e.g. they become eligible for GC. So your ListView will go out of scope along with the Page/user controls on it. You don't need to unsubscribe (unless you subscribe to an event that belongs to some kind of singleton that survi...
How to manage NHibernate sessions in a long lived Windows forms application? <p>We are using NHibernate to manage our persistence in a complex modular windows forms application - but one thought keeps bothering me. We currently open a session on launch and open all objects through that session. I am worried that all lo...
<p>Ayende and company usually recommend using a session per "conversation". This usually makes the session lifetime last for very short operations, so it behaves more like a web app.</p> <p>For your tree case, you can use Bruno's solution #2 just fine. The objects can be lazily mapped. Then, every time you need to acc...
Access a custom .NET DLL in VBScript <p>I wrote a DLL in .NET and I want to access it in VBScript. I don't want to add it to the assembly directory. </p> <p>Is there a way to point too the DLL and create an instance of it?</p>
<p>Just had to do this myself, my findings were:</p> <p>Making types visible to COM:</p> <ol> <li>Ensure your class is public, non static and has a public default constructor i.e. not arguments.</li> <li>Ensur your method is public, non static.</li> <li><p>Ensure you have the following set on your assembly - typicall...
Bayesian networks tutorial <p>for a beginner, which is the best book to start with for studying Bayesian Networks? </p> <p>Thanks, Lucian</p>
<p>A good book on general machine learning is [1]. But it is quite light on BN. I haven't read [2] but I have read [3] by him which is good (so, [2] is likely to be good as recommended by dwf). I would not recommend Pearl's book at all unless you are doing your Ph.D.!</p> <p>However, I actually would recommend the on...
SQL Server 2005 deadlock on key <p>I have a table with a clustered primary key index on a uniqueidentifier column. I have a procedure that runs the following psuedo functions:</p> <pre><code>begin transaction read from table 1 insert into table 2 update table 1 with pointer to table 2 record commit transaction </code>...
<ol> <li><p>increase the transaction isolation level as eulerfx.myopenid.com is hinting.</p></li> <li><p>use sql "mutexes" to simply wait for a procedure to finish before alowing another to run. <a href="http://weblogs.sqlteam.com/mladenp/archive/2008/01/08/Application-Locks-or-Mutexes-in-SQL-Server-2005.aspx" rel="nof...
System.EngineExecutionException on a return from a WCF service <p>This one has us all baffled at work. We have two services running on .net 3.5 SP1 that hits up sharepoint, and return Lists of model objects that are pretty similar. One of them works fine, the other throws an EngineExecutionException on the return.</p> ...
<p>Ok, it turns out that if you have ILists in your data contract, the framework blows up. Change IList to List as your return type, and it works</p>
SQL Server 2005 - Enabling both Named Pipes & TCP/IP protocols? <p>We have a SQL Server 2005 database, and currently all our users are connecting to the database via the TCP/IP protocol. </p> <p>The SQL Server Configuration Manager allows you to "enable" both Named Pipes, and TCP/IP connections at the same time. Is th...
<p>This is not correct. Your thought on network traffic is correct - capacity is not 'reserved'.</p> <p>You should not enable named pipes if it is not needed.</p>
How to disable a select box not inside a form? <p>I can't seem to be able to disable a select box when the select tag is not nested inside a form tag. Some things I tried are (using Firefox 3): (via Jquery)</p> <pre><code>$("#mySelect").attr("disabled", true); $("#mySelect").attr("disabled", "disabled"); </code></pre...
<p>Short answer: No, you don't need to have the select box within a form. </p> <p>Where is your JavaScript currently included with respect to the <code>body</code> tag in your HTML? Remember that if you have inline JavaScript included in the head if your page, then it will fire as the page is loaded. At this point, th...
How do I connect to a IBM 3770 Remote Job Entry system for Customs Border Patrol 10+2 Security Filing from Java? <p>I'm working on a project to submit the new 10+2 Security Filing data to Customs &amp; Border Patrol (as required by DHS). Anyone else doing this? I need to be able to submit our data files via a IBM 3770 ...
<p>I thought that CBP had done away with 3770 dial-up altogether. It is my understanding that everything switched to IBM MQ. We use MQ to connect to CBP in our business. Its far simpler and reliable. You can talk to it via JMS also.</p>
Remove all but the last 500,000 bytes from a file with the STL <p>Our logging class, when initialised, truncates the log file to 500,000 bytes. From then on, log statements are appended to the file.</p> <p>We do this to keep disk usage low, we're a commodity end-user product.</p> <p>Obviously keeping the first 500,00...
<blockquote> <p>"I would probably create a new file, seek in the old file, do a buffered read/write from old file to new file, rename the new file over the old one."</p> </blockquote> <p>I think you'd be better off simply:</p> <pre><code>#include &lt;fstream&gt; std::ifstream ifs("logfile"); //One call to start it...
Interacting with jQuery plugin objects after their creation <p>I have a ticker which items are updated using polling. I have written a simple jQuery plugin for the ticker which is invoked like so:</p> <pre><code>$("#cont ul").ticker(); </code></pre> <p>Which turns a ul into a ticker, scrolling through the li. To add ...
<p>what you should do is extend the settings for your plugin:</p> <pre><code>jQuery.ticker = function(settings) { var settings = jQuery.extend( { action : 'create', item : $(this) } ,settings); return $(this).each(function(){ if(settings.action =='create') { //initialize ticker.. } else if(settings.action == 'add'...
Should enums have uninitialized values . <p>We were having a debate if enums should have uninitialized values. For example. We have </p> <pre><code>public enum TimeOfDayType { Morning Afternoon Evening } </code></pre> <p>or </p> <pre><code>public enum TimeOfDayType { None Morning Afternoon ...
<p>Speaking of nullable types - I think they can be used to solve the problem of forcing/not forcing the initialization of an enum. Say we have</p> <pre><code>enum Color { Red, Blue } </code></pre> <p>And let's say you have a function:</p> <pre><code>void Draw(Color c); </code></pre> <p>That function says that it <...
How to limit transfer rate using HttpHandler <p>I'm programming a file transfer handler with speed limit feature, the rate based on user level. How do I control/calculate transfer rate in HttpHandler?.</p> <p>Some asp.net resource tell me that use Thread.Sleep will block asp.net thread pool.</p>
<p>It is generally a bad idea to Sleep any thread from ASP .NET, because those threads could be used otherwise to service requests from the pool. If there were say, 10 threads in the pool, sleeping 10 threads that were processing downloads would cause all other requests to pile up in the queue until a download had fini...
Need skeleton code to call Excel VBA from PythonWin <p>I need to invoke a VBA macro within an Excel workbook from a python script. Someone else has provided the Excel workbook with the macro. The macro grabs updated values from an external database, and performs some fairly complex massaging of the data. I need the ...
<p>OK, I got it! Thanks for the help on the Application.Run method. This info, plus the "Microsoft Excel Visual Basic Reference": <a href="http://msdn.microsoft.com/en-us/library/aa209782(office.10).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa209782(office.10).aspx</a>--as recommended by Hammond &a...
Efficient Methods for a Life Simulation <p>Having read up on quite a few articles on Artificial Life (A subject I find very interesting) along with several questions right here on SO, I've begun to toy with the idea of designing a (Very, very, very) simple simulator. No graphics required, even. If I've overlooked a que...
<p>If you were doing this as a hard-core development project, I'd suggest using the equivalent of Java reflection (substitute the language of your choice there). If you want to do a toy project as a starter effort, I'd suggest at least rolling your own simple version of reflection, per the following rationale.</p> <p>...
How to capture events from a dynamically created button control in asp.net? <p>How can a program capture <del>generates</del> events from a dynamically created button control in asp.net?</p>
<p>You can attach the event programmatically:</p> <pre><code>Button myButton = new Button(); myButton.Click += new ClickEventHandler...etc </code></pre>
Read file object as string in python <p>I'm using <code>urllib2</code> to read in a page. I need to do a quick regex on the source and pull out a few variables but <code>urllib2</code> presents as a file object rather than a string.</p> <p>I'm new to python so I'm struggling to see how I use a file object to do this. ...
<p>You can use Python in interactive mode to search for solutions.</p> <p>if <code>f</code> is your object, you can enter <code>dir(f)</code> to see all methods and attributes. There's one called <code>read</code>. Enter <code>help(f.read)</code> and it tells you that <code>f.read()</code> is the way to retrieve a str...
In Ruby, can you perform string interpolation on data read from a file? <p>In Ruby you can reference variables inside strings and they are interpolated at runtime. </p> <p>For example if you declare a variable <code>foo</code> equals <code>"Ted"</code> and you declare a string <code>"Hello, #{foo}"</code> it interpol...
<p>Well, I second stesch's answer of using erb in this situation. But you can use eval like this. If data.txt has contents:</p> <pre><code>he #{foo} he </code></pre> <p>Then you can load and interpolate like this:</p> <pre><code>str = File.read("data.txt") foo = 3 result = eval("\"" + str + "\"") </code></pre> <p>A...
Default action gets 404 for only one page (asp.net mvc) <p>I test my app only on local cassini web server, and I get strange thing.</p> <p>One Index page works right in default manner, second shows 404, but when use full version Controller/Index - works normal. Only difference I found is that in first sample there is ...
<p>Thanks for RouteDebug, the Problem was because I called Controller by name of one of the directory in the root, like Models, Views and etc!</p>
What are unit tests and why should I care? <p>Okay, I develop web applications in PHP and JavaScript and a lot of times here on Stack Overflow I have seen the word <em>unit test</em> passing by, but nowhere on the website have I been able to found a satisfactory answer to what exactly a unit test is. </p> <p>So what a...
<p>Unit tests are for any code you wish to maintain.</p> <p>In a nutshell, the idea is to write many small tests, each of which can be run in isolation, and test the smallest possible part of your codebase (often individual classes or individual functions). If I give this function the input it expects, does it return ...
Is there a "nice" way to deal with reassembling multicasts from multiple sources? <p>I'm currently reworking our existing proprietary socket wrapper code to use boost asio so that it can do some of the heavy lifting for us. Perhaps the most complex area of our existing code is the multicast handling code. The code a...
<p>It doesn't sound like you've given enough information for detailed answers, but there are a few general pointers to consider for realtime handling of multicast data.</p> <ul> <li>If you're using raw UDP multicast, you're probably doing some sort of protocol sequencing in userspace in order to deal with lost or dupl...
What is the best way to generate a Rails app using edge? <p>Currently when I want to create a Rails application using edge I first just run...</p> <pre><code>rails appname </code></pre> <p>Then I...</p> <pre><code>rake rails:freeze:edge </code></pre> <p>Then I delete all of the folders but the vendor folder which c...
<p>Get edge rails by using git (clone to repository to your local hdd). Then, simply add the bin dir of the cloned rails git repository to your PATH in front of the gem path, so the rails command from the repo takes precedence and is executed when creating a new rails app.</p> <p>e.g. if you cloned the rails.git repo ...
How to work with pointer to pointer to structure in C? <p>I want to change member of structure under double pointer. Do you know how?</p> <p>Example code</p> <pre><code>typedef struct { int member; } Ttype; void changeMember(Ttype **foo) { //I don`t know how to do it //maybe *foo-&gt;member = 1; } </cod...
<p>Try</p> <pre><code>(*foo)-&gt;member = 1; </code></pre> <p>You need to explicitly use the * first. Otherwise it's an attempt to dereference member.</p>
How to create a non OwnerDraw Button in .NET? <p>I'm creating a plugin to a software that skins the form I created. However, the button are not skin based on them and a standard gray button is shown. Asking on the software forum pointed me that .NET forms control are owner-draw and therefor my button won't redraw with ...
<p>The controls in Windows.Forms are not owner-drawn, but rather system-drawn. This is how Windows paints them by default, be it a Button, TextBox or what else. You can override the drawing either by specifying that the control should be owner-drawn (that is: you are responsible for drawing it) - some controls support ...
How to find "equivalent" texts? <p>I want to find (not generate) 2 text strings such that, after removing all non letters and ucasing, one string can be translated to the other by simple substitution.</p> <p>The motivation for this comes from a project I known of that is testing methods for attacking cyphers via proba...
<p>There are 26! different substitution ciphers. That works out to a bit over 88 bits of choice:</p> <pre><code>&gt;&gt;&gt; math.log(factorial(26), 2) 88.381953327016262 </code></pre> <p>The entropy of English text is something like 2 bits per character at least. So it seems to me you can't reasonably expect to find...
Dealing with timezones in PHP <p>Some issues with timezones in PHP have been in the back of my mind for a while now, and I was wondering if there are better ways to handle it than what I'm currently doing.</p> <p>All of the issues revolve around reformating database stored dates:</p> <p>When dealing with a site that ...
<p>Few months ago we spent some time thinking about this. The technique we ended up with is pretty simple:</p> <ol> <li>Store dates in GMT/UTC (e.g. 0 timezone offset).</li> <li>Apply current user timezone offset after retrieval from the database (e.g. before showing to the user or whenever you want).</li> </ol> <p>W...
Django.contrib.flatpages without models <p>I have some flatpages with empty <code>content</code> field and their content inside the template (given with <code>template_name</code> field).</p> <h3>Why I am using <code>django.contrib.flatpages</code></h3> <ul> <li>It allows me to serve (mostly) static pages with minima...
<p>Using the <a href="https://docs.djangoproject.com/en/1.4/ref/generic-views/#django-views-generic-simple-direct-to-template" rel="nofollow"><code>direct_to_template</code></a> generic view would be a lot simpler. You could use the passed in parameters on one view to specify the actual template in urls.py, if you don...
Two HTML tables side by side, centered on the page <p>I have two tables on a page that I want to display side by side, and then center them within the page (actually within another div, but this is the simplest I could come up with):</p> <pre><code>&lt;style&gt; #outer { text-align: center; } #inner { text-align: ...
<p>If it was me - I would do something like this:</p> <pre><code>&lt;style type="text/css" media="screen"&gt; table { border: 1px solid black;float:left;width:148px;} #table_container{width:300px;margin:0 auto;} &lt;/style&gt; </code></pre> <p>With the table like:</p> <pre><code>&lt;div id="table_container"&gt; ...
ASP conditional error <p>i am trying to use an ASP conditional here:</p> <pre><code>if (Request.Cookies("username")) and (Request.Cookies("password")) &lt;&gt; "" Then </code></pre> <p>And i keep getting this error:</p> <blockquote> <p>Type mismatch: '[string: ""]'</p> </blockquote> <p>Any ideas what I am getting...
<p>try</p> <pre><code>if (Request.Cookies("username") &lt;&gt; "") and (Request.Cookies("password") &lt;&gt; "") Then </code></pre>
How should I choose an authentication library for CodeIgniter? <p>I see there are <a href="http://codeigniter.com/wiki/Category%3aLibraries%3a%3aAuthentication/">a few</a>. Which ones are maintained and easy to use? What are their pros and cons? </p>
<h2>Update (May 14, 2010):</h2> <p><strong>It turns out, the russian developer Ilya Konyukhov picked up the gauntlet after reading this and created a new auth library for CI based on DX Auth, following the recommendations and requirements below.</strong></p> <p><strong>And the resulting <a href="http://konyukhov.com/...
Questions for python->scheme conversion <p>I currently am trying to write a Python program using scheme semantics so I can later translate it into Scheme without relying on a lot of Pythonic stuff.</p> <p>I'm trying solve the sliding puzzle problem (where you have 9 slots and 8 tiles arranged in a square) using a*, de...
<p>You identified that your initial problem was trying to write C semantics in Lisp. Is it not repeating the mistake to try to write scheme semantics in python? I always try to learn language X as a paradigm as much as a language and write in the most x-ish way.</p> <p>It might be justifiable if this was a business ap...
Should I delete or disable a row in a relational database? <p>In a brand new program where space isn't really that big a deal, is it better to delete a row or to disable a row by let's say a boolean "Disabled" and have the program just ignore it?</p> <p>For example, if I wanted to remove a user from a program.</p>
<p>It depends. (But you guessed that already, I'm sure.) </p> <p>In practice, the violation of proper usage here is almost always in the direction of deleting. </p> <p>The main bad consequence of deleting is how often there are dependent records in other tables whose referential integrity is lost when the parent re...
How do you execute a Javascript function without 'onclick' like "Grippie" in a new post on SOF <p>How do you execute a Javascript function without <code>onclick</code> like "Grippie" in a new post on SOF, like the <code>&lt;div class="grippie" style="margin-right: 59px;"/</code>> on Stack Overflow when you post a quest...
<p>If you look at the generated source with Firefox Web Developer plugin you'll see that it adds a DIV of class "grippie", using the TextAreaResizer mentioned by @grepsedawk. This DIV has the resize sprite for a background and has a click handler attached to it that performs the resize.</p>
Tone Generation in Cocoa Touch <p>I need to generate a tone that I can manipulate frequency and wave. The overall goal is to create a basic piano. Does anyone know how I can achieve this?</p> <p>My development platform is the iPhone 2.x</p>
<p>Piano is strange. Robert Moog wrote about it in Keyboard Magazine in March 1980. The fundamental (lowest frequency partial) is in tune, but each higher harmonic is brighter (or "sharper" or higher-pitched) than it should be, and by an increasing amount.</p> <p>The second through ninth harmonics are louder than the ...
Visual Studio 2008 C++ Problems <p>I'm trying to write a program to calculate the quadratic formula. When I run it, I get 2 error messages:</p> <pre>error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup fatal error LNK1120: 1 unresolved externals</pre> <p>this is after I cha...
<p>Is your project a Win32 Console Application or a Win32 Application? If you are using regular main(int argc, char** argv), then make sure your app is a console app.</p>
"Node cannot be inserted at the specified point in the hierarchy" <p>I am doing JavaScript Scaffold-like thing. And, code below is showing table. It works normal for all of them, and not for only one table I am getting - in the centring of processing on the third row - I get exception "Node cannot be inserted at the sp...
<p>I fixed this, when used </p> <pre><code>out.rows[y][x].toString() </code></pre>
Smarty Plugin for Eclipse Europa <p>Are there any good Eclipse plugins for creating smarty templates? I am using Europa with PDT on Ubuntu (though I doubt the OS will make a difference for this).</p> <p>I found <a href="http://code.google.com/p/smartypdt/" rel="nofollow">SmartyPDT</a>, but it did not seem to install p...
<p>You can find newer version of this plugin here : <a href="http://code.google.com/p/smartypdt/issues/detail?id=31" rel="nofollow">http://code.google.com/p/smartypdt/issues/detail?id=31</a></p> <p>But I haven't installed it yet with my machine.</p>
Where are all my inodes being used? <p>How do I find out which directories are responsible for chewing up all my inodes?</p> <p>Ultimately the root directory will be responsible for the largest number of inodes, so I'm not sure exactly what sort of answer I want..</p> <p>Basically, I'm running out of available inodes...
<p>If you don't want to make a new file (or can't because you ran out of inodes) you can run this query: </p> <pre><code>for i in `find . -type d `; do echo `ls -a $i | wc -l` $i; done | sort -n </code></pre> <p>as insider mentioned in another answer, using a solution with find will be much quicker since recursive ls...
iPhone TrustStore CA certificates <p>Does any of you have a clue how to alter the contents of <code>Security.framework/TrustStore.sqlite3</code>. It seems as if the iPhone uses it to store trusted CA certificates. I really want my iPod touch to trust my custom certificate. Beside that, does anyone of you know an app (...
<p>If you have a webserver configured to serve up digital certificates with the correct mime-type then Safari on the iPhone will add them to the trust store.</p> <p>mime-type for a CA certificate is "application/x-x509-ca-cert" (example <a href="http://o-regan.org/oregan.org.cacert">here</a>)</p> <p>When safari down...