input
stringlengths
51
42.3k
output
stringlengths
18
55k
Should Locks and Mutexes in C# be used together <p>Wouldn't this be overkill and only one of these necessary? I've searched and found different posts about Mutual Exclusion and locks in C# <a href="http://stackoverflow.com/questions/301160/what-are-the-differences-between-various-threading-synchronization-options-in-c"...
<p>That Mutex (because it has a name) will stop any process on the same machine accessing it as well, whereas lock will only stop other threads in the same process. I can't see from that code sample why you'd need both kinds of lock. It seems good practice to hold the simple lock for a short period of time - but then t...
Invalid scale size. Cannot be less than zero <p>I am using spring-2.5.6 to connect from a standalone application to an Oracle 10g database (ojdbc14.jar) using the org.apache.commons.dbcp.BasicDataSource. When I try to retrieve a SqlRowSet using the <code>public SqlRowSet queryForRowSet(String sql, Object[] args) throws...
<p>This error is caused by an incompatibility in the Oracle JDBC drivers. You can fix it by setting the system property oracle.jdbc.J2EE13Compliant to true. For example, on the commandline:</p> <p><code>java -Doracle.jdbc.J2EE13Compliant=true</code></p>
Erroneous Data Retrieved From ListView <p>I am having some trouble with my program logic that loops through a collection of data that exists in two separate ListViews. After looping though and extracting the data from the ListView, I then add everything into a comma delimited text file (<strong>CLOSEULDCONFIG.TXT</stro...
<p>If I'm not mistaken, you are opening the file to append, instead of overwrite. Have you checked the file itself to see if the data is being duplicated there?</p>
Freeze TH header and scrolling data <p>I have a html table and I want to freeze the header row th tag for scrolling the data. How I can do that? Does I need to use the Dom? Thanks !!</p>
<p>My solution is to use two tables and fix the column widths. The lower table is in a scrollable div and has no header.</p>
Is there a bug in "tf add /recursive"? <p>I'm trying to add the following folder tree to TFS:</p> <pre><code>C:\TFS\folder1 C:\TFS\folder1\folder2 C:\TFS\folder1\folder2\folder3 C:\TFS\folder1\folder2\folder3\test.txt </code></pre> <p>In the above example the folder "C:\TFS" is a mapped TFS working folder. I issue th...
<p>worked for me.</p> <pre><code>c:\Temp&gt;md Test\1\2\3\4\5 c:\Temp&gt;dir test /s/b c:\Temp\test\1 c:\Temp\test\1\2 c:\Temp\test\1\2\3 c:\Temp\test\1\2\3\4 c:\Temp\test\1\2\3\4\5 c:\Temp&gt;cd test c:\Temp\Test&gt;tf add 1 /recursive 1 1: 2 1\2: 3 1\2\3: 4 1\2\3\4: 5 c:\Temp\Test&gt; </code></pre> <p>In Tf...
Getting Number of Displayed Lines in Multi-Line Textbox in the Compact Framework <p>I have a multi-line textbox that typically displays very long strings (license agreements, for example), and a requirement around the display is that if the user "pages" through the text via the vertical scrollbar (not clicking the arro...
<p>You could get the maximum number of lines displayed at one time by calculating the font height and devide the textbox height by that.</p> <p>Just an idea... Not sure if it will come out correct, but you could do some tests and see if it matches.</p> <p>To get the font Height:</p> <p><a href="http://msdn.microsoft...
How to avoid duplicate logic with Mocks <p>I have the following challenge, and I haven't found a good answer. I am using a Mocking framework (JMock in this case) to allow unit tests to be isolated from database code. I'm mocking the access to the classes that involve the database logic, and seperately testing the datab...
<p>You are fundamentally asking for the impossible. You are asking for your unit tests to predict and notify you when you change the external resource's behaviour. Without writing a test to produce the new behaviour, how can they know?</p> <p>What you are describing is adding a brand new state that must be tested fo...
Override default styling in WPF TextBox, based on PresentationFramework.Aero <p>I want to use the Aero textbox styling, but still override some properties. I try to accomplish this by:</p> <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schema...
<p>It seems to work if you put the <code>Style</code> as a lower-level resource, instead of in the same ResourceDictionary:</p> <pre><code>&lt;Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;Grid.Resources&gt; &lt;Resourc...
How can I clear memcache using capistrano? <p>I use capistrano to deploy my app to a machine that uses memcache. I want capistrano to clear memcache when it deploys a new version of the site. </p>
<p><a href="http://github.com/engineyard/eycap/blob/35c69f12aa78b5ee6f99bd9c1b22980698076b1f/lib/eycap/recipes/memcached.rb">Something like that?</a></p>
Suggestions for Data Access Interface Name <p>I am looking for suggestions for an interface name.</p> <p>The interface is for the primitive CRUD methods that will be defined later in the DAL, however I need to use it in a lower-level API. The interface itself will just have the four members, Create(), Read(), Update()...
<p>How about ICantBelieveItsNotButter ?</p> <p>Or, ICanReadUpsideDown?</p> <p>Or, (more seriously), <strong>IPersistData</strong></p>
HTML/IE: stretch image to fit, preserve aspect ratio <p>In an HTML window, I am setting a custom body </p> <pre><code>&lt;img src="file://[filename]"&gt; </code></pre> <p>to display an image.</p> <p>Now I want to strectch the image to fit the available window, but preserve aspect ratio. </p> <pre><code>&lt;img src=...
<p>If you want to preserve aspect ratio, you only need to specify one dimension ie:</p> <pre><code>&lt;img src="file://[filename]" width="100%" alt="" /&gt; </code></pre> <p>You can use javascript to determine max dimension and resize accordingly</p> <pre><code>&lt;script type="text/javascript"&gt; function getImgSi...
How do I access the .NET TimeZoneInfo class from SQL Server 2005? <p>The TimeZoneInfo class has a Host Protection Attribute of MayLeakOnAbort.</p> <p>This seems to prevent me accessing it from the SQL Server CLR. But is there a workaround?</p>
<p>Yeah sure. You encapsulate it in another .NET class and then reference from your .NET assembly in SQL Server. Then you complete disable the security in your SQL Server database so you can run the second class.</p> <p>If that does not work, you can create a COM wrapper and then an Interop wrapper and still destroy s...
Maximum MIMEType Length when storing type in DB <p>What are people using as the length of a MIMEType field in their databases? The longest one we've seen so far is 72 bytes:</p> <pre><code>application/vnd.openxmlformats-officedocument.wordprocessingml.document </code></pre> <p>but I'm just waiting for a longer one. W...
<p>According to RFC 4288 "Media Type Specifications and Registration Procedures", type (eg. "application") and subtype (eg "vnd...") both <a href="http://tools.ietf.org/html/rfc4288#section-4.2">can be max 127 characters</a>. you do the math :)</p> <p><strong>Edit:</strong> meanwhile, that document has been obsoleted ...
"Cached Item Was Locked" causing Select Statement in Hibernate <p>I am having trouble with getting some caching to work with hibernate exactly the way I would like. I created some example code to replicate this problem I am having. </p> <p>I have one object that contains instances of itself. For instance, a Part tha...
<p>You've probably seen this already, but there is an open Hibernate bug that seems to relate to your problem - <a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-1813" rel="nofollow">"2nd level cached collections are locked causing a cache miss".</a>.</p> <p>From that bug, the fix may be to use a ...
Is there some kind of memory limit for an executable (written in C) to run without problems? <p>i´m doing a project using C, and CodeBlocks is my IDE. Windows Vista is the OS. I added some new stuff to the already working code and now the executable crashes everytime. i have no errors after compiling though. Computers...
<p>There are limitations with platforms, etc, but your 3 3D matrices only use a few MB of RAM (just over 6), so I doubt that you're hitting the limits given those.</p> <p>If it just started crashing when you added other matrices, I'd be more suspicious that you're having memory allocation/access errors on the pointers...
Extension of question many to many relationships in same table <p>I got a single table and it contain 4 fields</p> <pre> Id|Hospital| Doctor|patient 1 A D1 P11 2 B D6 P61 3 A D2 P21 4 A D1 P12 5 B D7 P71 6 B D6 P62 ...
<p>Try something like:</p> <pre><code>select Id,Hospital,Doctor,Patient from table where Id in (select max(t.Id) from table t group by t.Hospital,t.Doctor) order by Hospital,Doctor; </code></pre>
Help me optimize this selector? $('#data div.item:has(div.video_guid:empty)') <p>It's currently not so slow as to make the site unusable, but in mobile safari on the iphone there is a noticeable lag. Is there a simpler way to do this?</p> <p>"Find div.items that have an empty div.video_guid"</p>
<p>Are there div's with a class video_guid anywhere else on the page? If not, you could simplify it to:</p> <pre><code>$('div.video_guid:empty'); </code></pre> <p>The only difference between your selector and mine is that yours would match the parent <code>div.item</code> while mine would match the actual <code>div.v...
CommandType.Text vs CommandType.StoredProcedure <p>Is there any benefit to explicitly using the StoredProcedure CommandType as opposed to just using a Text Command? In other words, is</p> <pre><code>cmd = new SqlCommand("EXEC StoredProc(@p1, @p2)"); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@p1", 1); cm...
<p>One difference is how message pumping happens. </p> <p>Where I used to work we had a number of batch processes that ran over night. Many of them simply involved running a stored procedure. We used to schedule these using sql server jobs, but moved away from it to instead call the procedures from a .Net program. Th...
Using "like" in a cursor/query with a parameter in python (django) <p>I know this may be something stupid but I decided to ask any way.</p> <p>I've been trying to query something like:</p> <pre><code> cursor.execute("select col1, col2 \ from my_tablem \ where afield like '%%s...
<p>First, why aren't you using the Django ORM for this?</p> <pre><code>MyClass.objects.filter( aField__contains=var1, secondField__exact=var2 ) </code></pre> <p>Second, be sure you're getting the SQL you expect.</p> <pre><code>stmt= "select... afield like '%%%s%%' and secondfield = '%s'..." % ( var1, var2 ) print st...
How do I rewrite $x = $hash{blah} || 'default' in Python? <p>How do I pull an item out of a Python dictionary without triggering a KeyError? In Perl, I would do:</p> <pre><code>$x = $hash{blah} || 'default' </code></pre> <p>What's the equivalent Python?</p>
<p>Use the <a href="http://docs.python.org/library/stdtypes.html#dict.get" rel="nofollow"><code>get(key, default)</code></a> method:</p> <pre><code>&gt;&gt;&gt; dict().get("blah", "default") 'default' </code></pre>
RDLC Medium Trust <p>Does anyone know of a free (for a non-profit group) RDLC reporting tool that will work under medium trust in IIS 7?</p>
<p>Our <a href="http://www.datadynamics.com/Products/DDRPT/" rel="nofollow">Data Dynamics Reports</a> product is not free, but we did implement special support for working in the restrictive medium trust environments. I don't know if it is tested on IIS7 yet, but I presume the security policy is the same so it should w...
SVN Branching and "IIS Url Already Mapped to Different Location" <p>I maintain several subversion development branches on my development pc and build box.</p> <p>How do you guys deal with opening a solution on one branch and having IIS get configured to that location. Then opening the same solution / project in a dif...
<ol> <li>I added localhost.branch to my host file</li> <li>In IIS I created a new website mapped to host header localhost.branch. </li> <li>I searched and replaced <code>&lt;IISUrl&gt;<a href="http://localhost/myapp&lt;/IISUrl&amp;gt" rel="nofollow">http://localhost/myapp&lt;/IISUrl&amp;gt</a>;</code> with <code>&lt;I...
Design considerations for internationalization <p>I've read Joel's article on <a href="http://www.joelonsoftware.com/articles/Unicode.html">Unicode</a> and I feel that I have at least a basic grasp of internationalization from a character set perspective. In addition to reading <a href="http://stackoverflow.com/questio...
<p>Our game <a href="http://www.lobstersoft.com/gemsweeper/index.php" rel="nofollow">Gemsweeper</a> has been translated to 8 different languages. Some things I have learned during that process:</p> <ul> <li><p><strong>If the translator is given single sentences to translate, make sure that he knows about the context t...
Is it possible to have Castor marshal/unmarshal an EnumMap? <p>I'm using Castor to marshal/unmarshal my Java objects, one of which contains an EnumMap. Can Castor marshal/unmarshal EnumMaps? I have a mapping file with some nested HashMaps, but I've never pushed an EnumMap through Castor. If it is possible, how is it d...
<p>One of the big problems is that Enums can't really be serialized and restored, at least not in Java 1.5. And I think also not in Java 1.6. </p> <p>As enums can not - by default - be serialized or XMLEncoded I very much doubt an EnumMap can be serialized. From the <a href="http://www.castor.org/xml-mapping.html#7.5-...
How does Python sort a list of tuples? <p>Empirically, it seems that Python's default list sorter, when passed a list of tuples, will sort by the first element in each tuple. Is that correct? If not, what's the right way to sort a list of tuples by their first elements?</p>
<p>It automatically sorts a list of tuples by the first elements in the tuples, then by the second elements and so on tuple([1,2,3]) will go before tuple([1,2,4]). If you want to override this behaviour pass a callable as the second argument to the sort method. This callable should return 1, -1, 0.</p>
Converting a pthreaded program to MPI? <p>I understand the differences between a multithreaded program and a program relying on inter-machine communication. My problem is that I have a nice multithreaded program written in 'C' that works and runs really well on an 8-core machine. There is now opportunity to port this...
<p>Depending on how your software is written, there may or may not be advantages to going to MPI over keeping your pthread implementation.</p> <p>Unfortunately (or fortunately), message passing is a very different beast than pthreading - the basic assumption is quite different. I love <a href="http://blogs.msdn.com/m...
What settings affect the layout of compiled java .class files? How can you tell if two compiled classes are equal? <p>I have an app that was compiled with the built-in Eclipse "Compile" task. Then I decided to move the build procedure into Ant's <code>javac</code>, and the result ended being smaller files.</p> <p>Late...
<p>THere is no required order for things such as the order of the constant pool entries (essentially all of the symbol info) as well as the attributes for each field/method/class. Different compilers are free to write out in whatever order they want.</p> <p>You can compared compiled classes, but you would need to dig...
Query on Select System Call <p>select() is defined as :</p> <pre><code>int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); </code></pre> <p><em>nfds</em> represents the highest file descriptor in all given sets plus one. I would like to know why is this data required fo...
<p>The catch is that fd_set is not really a "set" in the way you're thinking. The behind-the-scenes detail is that the implementation of an fd_set is just an integer that is used as a bitfield. In other words, executing</p> <pre><code>fd_set foo; FD_CLEAR(&amp;foo); FD_SET(&amp;foo, 3); </code></pre> <p>Sets foo to d...
CPU clock frequency and thus QueryPerformanceCounter wrong? <p>I am using QueryPerformanceCounter to time some code. I was shocked when the code starting reporting times that were clearly wrong. To convert the results of QPC into "real" time you need to divide by the frequency returned from QueryPerformanceFrequency,...
<p>Apparently there is a known <A href="http://support.microsoft.com/kb/274323" rel="nofollow">issue</A> with QPC on some chipsets, so you may want to make sure you do not have those chipset. Additionally some dual core AMDs may also cause a <A href="http://forum.beyond3d.com/showthread.php?t=47951" rel="nofollow">prob...
Can you force symfony resolve to a specific route? <p>Say that I have to following 2 routes in this order:</p> <pre><code>Zip: url: home/:zip param: { module: home, action: results } State: url: home/:state param: { module: home, action: results } </code></pre> <p>and I use a route such as:</p> <pre><code>'...
<p>You need to add requirements so that it will recognize the different formats</p> <pre><code>Zip: url: home/:zip param: { module: home, action: results } requirements: { zip: \d{5} } # assuming only 5 digit zips State: url: home/:state param: { module: home, action: results } requirements: { state: [a-z...
Is this causing EXC_BAD_ACCESS? <p>I'm getting a EXC_BAD _ACCESS after leaving the method below. At that point htmlDocument becomes invalid, which it should since it falls out of scope. But is that why I'm getting the error? By the time the contentView (UIWebView) loads, htmlDocument is gone. But doesn't contentVie...
<p>From your second post, the line you have commented out ([button release]) releases an object already marked to be released automatically. </p> <p>Either remove the "autorelease" where you are doing an alloc for the button or remove the [button release] statement for the code to compile without errors and exceptions...
How do I send Asian charset plaintext emails in ASP.NET? <p>I have an ASP.NET application that needs to send emails in Korean. These emails are sent in plaintext. </p> <p>But when the emails are received, they look like this:</p> <blockquote> <p>? First name? ??: ?????.</p> <p>?? ???? ???? ?? ??? ??? ?? ???? ?...
<p>You basically have 2 ways to encode email parts:</p> <ol> <li><p>Using the Korean Code page for your email so people not using Unicode can still view it (charsets like <code>ISO-2022-KR</code> and <code>x-windows-949 </code>, I don't know which of the 3 is the most common):</p> <pre><code>Content-Type: text/plain;...
Allow php sessions to carry over to subdomains <p>I use php sessions (not cookies, except for session id cookie) for all user data, and when a user goes to their profile user.mydomain.com they are immediately "logged out" untill then remove the subdomain.</p> <p>Is there a way to accept sessions from all domains as lo...
<p>Here are 4 options.</p> <p>Place this in your php.ini:</p> <pre><code>session.cookie_domain = ".example.com" </code></pre> <p>Or in your .htaccess:</p> <pre><code>php_value session.cookie_domain .example.com </code></pre> <p>Or as the first thing in your script:</p> <pre><code>ini_set('session.cookie_domain', ...
Force UIView/UIVIewController orientation <p>We're writing an application that's in landscape mode exclusively. We use a transform on a root view to rotate it to LandscapeRight, then every view that gets loaded by that view shares the coordinate system. That's all fine and dandy, except one of our views has a UIWebView...
<p>Hopefully you've already found an answer for this, but you might try telling your app to just start out in landscape mode, rather than forcing it to always rotate to that orientation. Then if your root view's shouldAutorotateToInterfaceOrientation returns yes only for landscape modes, I'd bet you'd have the behavio...
[i.][m.] HTTP Addresses <p>I noticed that on the web some sites have subdomains dedicated to images or information on sub-domains such as i.domain.com. I was wondering what is the advantage of this? Is there a name for this type of "Method"? Where can I get more information on this? Thanks.</p>
<p>Parallel-izing image/script downloads.</p> <p>Some browsers will only have 2 concurrent connections open to a given <strong>domain</strong> at a time. If you have 20 images/scripts to download you can only get 2 at a time x10. If you use different domains (subdomains) you can increase the amount of concurrent dow...
Calling typeface.js on HTML fetched by jQuery? <p>I have a page where I'm fetching a Wordpress main index to handle my 'news feed', imported via jQuery.ajax. I'm also using typeface.js on the same page to have better typeface control. I want to call typeface.js on the elements in the Ajax'd HTML. The problem is that...
<p>Once you append the returned contents to your document you can call: _typeface_js.renderDocument() which will render the new content</p>
Runtime query analysis and optimization <p>I'm wondering if there's some sort of runtime mechanism that would observe the queries that are running against my database server; record how many queries of each "type" are running; look at the performance of these queries; then, based on this runtime data, suggest what inde...
<p>I'd suggest giving <a href="http://www.jetprofiler.com/" rel="nofollow">Jet Profiler</a> a try. The free version is a bit limited but i still found it useful. It will do most of what you have asked, but you may struggle to find a tool that will suggest indexes for you though.</p>
How to hook up LED lights in C++ without microcontroller? <p>I want to light up/off LEDs without a microcontroller. I'm looking to control the LEDs by writing a C++ program. but the problem im having is hooking them up is there a free way to do !!!!</p> <p>I'm using Windows XP if that is relevant.</p> <p>I have LEDs ...
<p>That completely depends on which hardware you have, which determines which driver you need. Back then, i got a simple led and put it into the printer LPT port. Then i could write a byte to address 0x0378h and the bits in it determined whether a pin had power or not (using linux). For windows, you need a driver that ...
How to blend a quad, already with a texture on it <p>I made a quad with a nice texture on it. The texture has an alpha channel (RGBA). I replaced the quad with the texture <code>(GL_REPLACE)</code>, so now I have a billboard with (semi)transparant pixels on it.</p> <p>So far, no problem. </p> <p>But now I want to <em...
<p>GL_MODULATE, instead of GL_REPLACE, after setting the color to solid white, with an appropriate amount of alpha. (glColor(1,1,1,0.5) for instance)</p> <p>(Should work fine on OpenGL. Seems likely it'll be good on ES, too.)</p>
Have buildbot poll a git repository for new commits? <p>Is there a <a href="http://buildbot.net/trac" rel="nofollow">buildbot</a> plugin that will poll a git repository for new commits, like the currently included <a href="http://github.com/djmitche/buildbot/blob/d4ec886c3740a4f97ab172b81c9a9b94eb6f00d3/buildbot/change...
<p><strong>Update:</strong> The kind folks at the Buildbot project have made the GitPoller an official Change Source as of version 0.8.2, and made several improvements to the original.</p> <hr> <p>Our company is in a similar situation where our build machines cannot be reached by GitHub's post-commit hook. I've writt...
side effects of garbage collection? <p>This may be an eminently closeable question, but I'm the type that sees what sticks to the wall. For all of the benefits of memory and lifetime management afforded by a garbage collected runtime, have there been any notable cases of program indeterminacy caused by race conditions...
<p>The problem with garbage collection is that it only manages memory resources. Unfortunately, programmers must manage many, many other resource types:</p> <ul> <li>file and socket handles</li> <li>database connections</li> <li>synchronisation objects</li> <li>gui resources</li> </ul> <p>to name but a few. To manage...
Insert a commit before the root commit in Git? <p>I've asked before about how to <a href="http://stackoverflow.com/questions/598672/git-how-to-squash-the-first-two-commits">squash the first two commits</a> in a git repository.</p> <p>While the solutions are rather interesting and not really as mind-warping as some oth...
<p>Here’s a cleaner implementation of the same solution, in that it works without the need to create an extra repository, futz around with remotes, and correct a detached head:</p> <pre><code># first you need a new empty branch; let's call it `newroot` git checkout --orphan newroot git rm -rf . # then you apply the...
Keeping my web app running after Browser close <p>I have a aspx web application that updates or adds files in a database. The clients access through the browser and one of the requirements is that they can start the update and be able to close the browser while the update continues. It appears to run for a little bit ...
<p>That's something you could very well solve with <a href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx" rel="nofollow">WF (Workflow Foundation)</a>. Create a workflow for the task that should survive closing the browser. Workflows have their own threads and livecycles separate from ASP.NET. </p>
Servlets and JSP video tutorials <p>Are there video tutorials for Servlets and JSPs with the same caliber as asp.net and windowsclient.net Learn section?</p>
<p>Perhaps this is helpful: <a href="http://blogs.oracle.com/arungupta/entry/screencast_28_simple_web_application" rel="nofollow">http://blogs.oracle.com/arungupta/entry/screencast_28_simple_web_application</a></p>
Mimic Window. onerror in Opera using javascript <p>I am currently working on a web application, I have a JS logging mechanism that Handles Javascript error that are not caught by the js code inside the page. I am using window.onerror to catch all such errors and log them else where.</p> <p>However, Problem is with Ope...
<p>Opera 11.60+ supports <code>window.onerror</code>.</p> <p>Opera's <a href="http://dev.opera.com/articles/view/introduction-to-opera-dragonfly/" rel="nofollow">Dragonfly</a> supports <a href="http://dev.opera.com/articles/view/remote-debugging-with-opera-dragonfly/" rel="nofollow">remote debugging</a>. You might be ...
Process rdl/rdlc report files without SSRS? <p>Is there any way to render and export an rdl file within a batch process without using SSRS?</p> <p>I don't want the overhead of SSRS (IIS + database) and instead want to handle this within my own batch/scheduling service.</p> <p>Thanks</p>
<p>You can conceivably use the <a href="http://msdn.microsoft.com/en-us/library/ms251671%28VS.80%29.aspx" rel="nofollow">Report Viewer control</a> in a server process written in managed code. You pass the control a data source (which can be a DataTable memory object), and it will return a byte stream that you can direc...
.NET port of OGNL Library <p>Does anyone know of a good .NET port of the <a href="http://www.opensymphony.com/ognl/" rel="nofollow">OGNL library</a> here? It looks like I could use something like this and the only one I have found so far is on SourceForge <a href="http://sourceforge.net/projects/ognlnet/" rel="nofollo...
<p>I've been looking for something like this as well. Unfortunately, there isn't anything I'm aware of that's feasible for use in a real project. Sorry!</p> <p>One suggestion that might be of help is to e-mail the author directly. Oftentimes, they abandon the project because they've found that another existing project...
Distributing loadable builtin bash modules <p>I've written a built-in for bash which modifies the 'cd' command, a requirement for my software. Is there a way to actually distribute a loadable independently of bash itself? I'd ideally like to distribute just a drop in "additional feature" because I know people can be pu...
<p>It is unclear what you have modified but in any case, <code>bash</code> (like at least <code>ksh93</code> which IIRC introduced the concept and <code>zsh</code>) supports, using the <code>enable -f file name</code> syntax, loading built-in functions as external dynamically loaded modules.</p> <p>These modules being...
Jqmodal isn't working in the Updatepanel <p>I have a method named raise_alarm() which, show a message box based on jquery. But when I call this method from an event of a control(such as submit button) which is inside of Updatepanel, it isn't working. Related codes are below. How can I fix it?</p> <pre><code> Public Su...
<p>You have to use <code>ScriptManager</code> instead of <code>p_Page.ClientScript</code>.</p> <p>EDIT : Example. I replaced <code>p_Page.ClientScript</code> by <code>ScriptManager</code> in your code.</p> <pre><code>Public Sub Raise_Alarm(ByVal p_Page As Page, ByVal p_Message As String, Optional ByVal p_IsError As B...
Silverlight's WebClient isn't connecting to my server <p>I've got a problem here.</p> <p>I've got an ASP.net website hosting a silverlight 2 application. I'd like the site to communicate to and fro from the silverlight app, and I'm doing this via http requests. Incidentally, if anyone knows a better way, please do tel...
<p>Since this is only a test add an "else TextBox1.Text=e.Error.ToString();" in your TestDownloadStoriesCompleted handler to see what error you get.</p> <p>EDIT:</p> <p>You can't host both the asp.net app and your listener on the same port - you could fix this by using a different port and serving a clientaccesspolic...
ASP.NET MVC - Custom validation message for value types <p>When I use UpdateModel or TryUpdateModel, the MVC framework is smart enough to know if you are trying to pass in a null into a value type (e.g. the user forgets to fill out the required Birth Day field) .</p> <p>Unfortunately, I don't know how to override the ...
<p>Make your own ModelBinder by extending DefaultModelBinder:</p> <pre><code>public class LocalizationModelBinder : DefaultModelBinder </code></pre> <p>Override SetProperty:</p> <pre><code> base.SetProperty(controllerContext, bindingContext, propertyDescriptor, value); foreach (var error in bindingCo...
PSD to HTML (with text) conversion <p>I just downloaded a website template that is in a .PSD form. I have made the changes via photoshop, setup the splices then clicked "Save for web devices". </p> <p>I export the website and I get the images directory and the html file. All ok so far.</p> <p>I next open the html ...
<p>Did your template only come with a PSD file?</p> <p>Typically, the PSD file allows you to edit the graphical portion, then save off the images you need, to be placed back in HTML, rather than generating HTML directly from the PSD.</p> <p>Since you asked for the <em>best</em> way to do this, I will give you my answ...
Need a php script diagnosis for a small snippet of code <p>Can somebody tell me what I am doing wrong really? I am going nuts, the following code works perfect on localhost/WIN and when I try it on the webhost/linux it gives warnings:</p> <pre><code>$lines = file('english.php'); foreach($lines as $line) { $matches...
<p>I don't see anything obviously wrong with your code, but I'm curious why you're building separate arrays and then combining them rather than just building a combined array:</p> <pre><code>// Make sure this file is local to the system the script is running on. // If it's a "url://" path, you can run into url_fopen p...
Get resource file inside the application <p>i was wondering if i could access a folder inside the Resources folder of the application? i would make it to eliminate the use of the debug directory in storing files and to use the clickonce deployment.</p> <p>I need your advices and suggestions. Thank you.</p>
<p>You can change where the project outputs it's build to. Right click on the Project's name and click properties then go to Build and down near the bottom it tells you where it will output the build to. If you're building it in debug, it usually goes to bin\Debug, release goes to \bin\Release, etc.</p> <p>You can loo...
How to access your website through LAN in ASP.NET <p>I have an asp.net web-page application and i want it to be accessed using a local area network(LAN) or wireless area network(WLAN).</p> <p>I do not know where to start. Is there something that i will configure in order for others to access my web-page?? </p> <p>I w...
<p>I'm not sure how stuck you are:</p> <p><strong>You must have a web server</strong> (Windows comes with one called IIS, but it may not be installed)</p> <ol> <li>Make sure you actually have IIS installed! Try typing <code>http://localhost/</code> in your browser and see what happens. If nothing happens it means tha...
Vertical center a TextFlow in GEF <p>I'm trying to vertical center a multiline textbox within a RectangleFigure in GEF. It needs to be ajusted on resize.</p> <p>This would be best done with a layout, but I can't figure out how that works.</p> <p>I'm adding a BorderMargin to the parent FlowPage and changing the margin...
<p>I'm not seeing an answer (yet) but I do have some questions:</p> <ul> <li>Can you post an example of your code so far?</li> <li>Messing with the parent BorderMargin to center is probably the wrong way to go. What happens if you don't do that?</li> <li>Are you doing invalidateTree() to force recomputation / layout?...
How to subscribe for an javascript event form Flex 3 action script code? <p>We have that Flex app talking to the server. We need some kind of *FlexEvent.ON_BROWSER_WINDOW_CLOSE* event but, unfortunately Flex does not provide such.</p> <p>So I've got the advice to catch a javascript "onbeforeunload" event and call the ...
<p>You can use ExternalInterface to call Javascript functions defined in the container. See <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=19%5FExternal%5FInterface%5F06.html#126566" rel="nofollow">this</a>.</p> <p><a href="http://gregjessup.com/flex-3-catch-browser-exit-or-close-event-using-javascri...
Is using a Mutex to prevent multiple instances of the same program from running safe? <p>I'm using this code to prevent a second instance of my program from running at the same time, is it safe?</p> <pre><code>Mutex appSingleton = new System.Threading.Mutex(false, "MyAppSingleInstnceMutx"); if (appSingleton.WaitOne(0,...
<p>It is more usual and convenient to use Windows events for this purpose. E.g.</p> <pre><code>static EventWaitHandle s_event ; bool created ; s_event = new EventWaitHandle (false, EventResetMode.ManualReset, "my program#startup", out created) ; if (created) Launch () ; else Exit () ; </code></pre> <p...
Catch tasks from windows task scheduler in a .net app <p>I have a program that is running in the background, this program has to be notified when a specific windows event is occurring.</p> <p>I know the name and id for the event and i know how to schedule an action for it in the task scheduler, but here i can only sta...
<p>I would have the scheduler start a new process (it could be the same application exe) and have this process set an event that the first process is waiting on. Seems pretty clean to me, especially if you have the scheduler launch the same application (maybe with a special command line).</p>
Strange temporary array corruption <p>I am attempting to create a permutation, and I receive this strange error when I finish my problem:</p> <pre><code>Stack around the variable "temp" was corrupted </code></pre> <p>the segment of the variable is within a nested for loop:</p> <pre><code>for(int i = 0 ; i &lt; str_l...
<p>You just need to use <code>char temp;</code> and acces it as <code>temp = text[i];</code>, etc.</p> <p>You're accessing a point on the stack one byte PAST temp, which is invalid. In this case, since you only want a single char, there's no need for an array at all.</p>
How can I implement an algorithm for multicore in Java? <p>Modern computers have more and more cores. We want to change our current linear algorithm to use these cores.</p> <p>A splitting of any algorithm to use different threads only makes sense if there is a free processor.</p> <p>Are there any good libraries that ...
<p>This isn't necessarily true.</p> <p>Depending on the algorithm, it often makes sense to split it into multiple threads even if there is only a single core available. If there is any waiting on sockets, IO, etc, you can get benefits from this. If there are 2 processes, the "other" process may not be using 100% of ...
Can I save data from the Visual Studio 2008 debugger? <p>I have an rare data-dependent error in some code. It's difficult to reproduce the conditions that generated the problematic data, so I need to be able to serialize the (fairly large) data that causes the error to disk to make a test case. Is there any way to seri...
<p>Is all the data that you want already in some serializable form? If so, you could use the Immediate window to create an appropriate serializer and write it to disk that way.</p> <p>If you need to do this reasonably regularly, and if you're after the data contained in a single object, you could add a method to that ...
send request with gwt to a different domain <p>Is there a way I can make a request to a different server than the one that's being used for development using a RequestBuilder?</p> <p>I keep getting </p> <pre><code>com.google.gwt.http.client.RequestPermissionException: The URL http://127.0.0.1:4321/getSellers is inval...
<p>GWT currently doesnt support cross domain ajax calls - but it can be worked around if you are willing to do a bit of jsni. And I heard a rumour some time ago that there is a gwt patch with the solution, but its not perfect. see this <a href="http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_threa...
Window settings for Google Maps widget <p>I've got a plain-vanilla google maps widget sitting in a page and I'd like it if the driving directions opened up in a new window instead of taking over the current window. Is there a setting for this?</p>
<p>The driving directions go into whatever HTML element you specify as the second argument when you construct the GDirections object. So I guess that means you'd have to create the window before you create the GDirections object, which is likely not what you want.</p> <p>The other thing that jumps out, looking at the ...
Where is the class assigned to when stored in a struct? <p>I read a thread (which had the input of Marc Gravell and Jon Skeet) that mentioned if a struct is in a class, that struct is stored on the heap like the class.</p> <p>What if a class is a member of a struct? Where does the class get assigned to?</p> <p>Thanks...
<p>If a class is a member of a struct, then only the <strong>reference</strong> is stored in the struct (i.e. the 32/64-bit address to the instance). The instance of a class is <strong>always</strong> on the heap.</p>
A site where users could make suggestion for my code? <p>Hi do you guys know a site where other programmers could make suggestions about the code that I make? I always think that the code I make could be better and I also wish someone could like mentor me or point out some bad habits that I make. I code in Java.</p>
<p>What's wrong with right here? Also there is <a href="http://www.refactormycode.com" rel="nofollow">refactor my code</a>.</p>
Cannot connect to X server :0.0 with a Qt application <p>Compiling on Fedora 10.</p> <p>I have just started my first qt GUI application. I used all the default settings.</p> <p>Its just a simple form. It builds OK without any errors. But when I try and run the application. I get the following message:</p> <pre><code...
<p>The general causes for this are as follows: </p> <ol> <li><p>DISPLAY not set in the environment.<br /> <strong>Solution</strong>: </p> <pre><code>export DISPLAY=:0.0 ./myQtCmdHere </code></pre> <p>( This one doesn't appear to be the one at fault though, as its saying which X display its trying to connect to. Al...
why does java's inputstream.close() block? <p>My Java program uses ProcessBuilder (with redirectErrorStream set true) and has a loop that runs the processes's inputstream's read method, which is blocking. The external program I'm calling then comes to a stop waiting for input and stdin. I now want to kill the process. ...
<p>Regarding the blocking behavior, there is a known issue in Java that can cause deadlock when communicating with another process. I can't tell if this is what you're seeing but it's worth looking into. The document for <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Process.html" rel="nofollow">java.lang...
What do you think of my simple Java class that encrypts text into SHA-1? <p>Anyway I'm starting out to make Java programs (a programming newb) and I've decide to do a simple utility class that converts text into SHA-1 strings. I'm planning on using this to encrypt passwords for databases. Feel free to comment and I'd l...
<p>If you're using this to create hashed passwords why not just store the bytes directly in the database. The advantage is that you know the size of the field in advance. I also agree that if you're going to the effort of using salts then it makes sense to create and store a unique salt for each as this makes rainbow t...
Is it possible to wait for methods that aren't in Threads to finish in Java? <p>I have an object which does some computation, then for each iteraction I want to draw what happens. While the drawing is happening, I want it to wait.</p> <p>This is what I did, basically:</p> <pre><code>synchronized public void compute()...
<p>Your question suggests that you want to perform some operation that updates the GUI state either when it is finished or notifies the GUI of its progress. This is what <a href="http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html" rel="nofollow">SwingWorker</a> was designed for. There are some examples ...
List all permutations of the numbers 1,...,n in lexicographic order <p>I'm trying to program a Matlab to list all permutations of the numbers 1 through n in lexicographic order. What I have so far is below. I am using recursion to try and write a program that will work for n=3 first, and then see if I can gain insight ...
<p>See <a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/perms.html" rel="nofollow">the documentation</a> for a start. If by lexicographical order you mean alphabetical by english name, you may want to populate your input with the names, sort them, then permute that.</p> <p>If I've misunderstood what...
How do I get an Expression Blend Keyspline control? <p>I need a control in my C# program that behaves exactly the same as MS Expression Blend keyspline control - is there any way to get hold of that control and add it to my application? </p> <p>As a side note it'd be nice to use some of the other controls that appear...
<p>What do you mean by add it to your application? If you're developing a C# WPF application you can already add it using the Blend designer or programatically in Visual Studio.</p> <p>You can inherit from all the WPF controls to create new ones that enhance the behaviour if needed. If you simply want to customise the...
Opinion on Visual WebGui <p>I would like to hear your experiense with Gizmox Visual WebGui product. Thanks.</p>
<p>I've been looking at it for a few weeks on and off and I've been unable to find substantive information that doesn't originate from Gizmox itself. That combined with documentation that seems lacking at best makes me think it needs some more time before it should really be considered.</p>
Why does new Rails db migration file start with datestamp instead of sequence number? <p>Whenever I use script/generate to generate a new scaffold for a change to my Rails database, the new migration file is prepended by a datestamp (e.g. 200903140912_create_users.rb) instead of a sequence number (e.g. 004_create_users...
<p>This was introduced in Rails 2.1. According to the <a href="http://guides.rubyonrails.org/migrations.html#whatsinaname">migrations docs</a>, you can revert it by setting <code>config.active_record.timestamped_migrations</code> to <code>false</code> in <code>config/environment.rb</code>.</p>
Python: Abstract Base Class and ZopeInterface <p>What's the point of both? When do you think it's appropriate to use either?</p>
<p>There is an article <a href="http://griddlenoise.blogspot.com/2007/05/abc-may-be-easy-as-123-but-it-cant-beat.html">ABC may be easy as 123, but it can't beat zope.interface</a>, which goes into details comparing both and links to other documents.</p>
Clustered index insert performance on not-so-unique column? <p>In your experience, at about how many records does insert performance become intolerable when using a clustered index on not-typically-unique columns?</p> <p>A good example I can think of would be the comments table for stack overflow. Do you think that in...
<p>It Depends on:</p> <ul> <li>The size of the rows</li> <li>On Fill Factor (i.e. space left in the index)</li> <li>The number of non-clustered indexes on the table</li> <li>How often the index is reorganised (note: not so important when the clustered index is on a montonically increasing key)</li> </ul> <p>You shoul...
Just what is 'A big database'? <p>Ok, dumb question I know but I see the nebulous comment 'a large database' as well as small and medium and I wonder just what that means. Can someone define what a small, medium and large database is for us SQL neophytes?</p>
<p>There isn't a threshold where a small database becomes medium or a medium database becomes large. Generally, when I hear these terms, I think of particular orders of magnitude in terms of total records being stored.</p> <ul> <li>Small: 10<sup>5</sup> or fewer records.</li> <li>Medium: 10<sup>5</sup> to 10<sup>7</su...
Deleting a section of text from an RSS feed <p>Twitter's RSS feed displays names as: </p> <pre><code>&lt;name&gt;johnDoe (John Doe)&lt;/name&gt; </code></pre> <p>Is there a way to use php or javascript (preferably jquery) to delete everything starting with the first parentheses and after? I only want to show the use...
<p>I would suggest parsing the RSS feed as usual then getting the value of the <code>&lt;name&gt;</code> element from your parsed structure, finding the index of the opening parenthesis, and trimming off everything from the previous index (i.e. the space) onwards. Something like</p> <pre><code>var nameStr = ...; // ge...
Deep copying an NSArray <p>Is there any built-in function that allows me to deep copy an <code>NSMutableArray</code>?</p> <p>I looked around, some people say <code>[aMutableArray copyWithZone:nil]</code> works as deep copy. But I tried and it seems to be a shallow copy.</p> <p>Right now I am manually doing the copy w...
<p>As the <a href="https://developer.apple.com/library/mac/documentation/cocoa/conceptual/Collections/Articles/Copying.html#//apple_ref/doc/uid/TP40010162-SW3">Apple docs</a> state,</p> <blockquote> <p>If you only need a one-level-deep copy, you can explicitly call for one...</p> <pre><code>NSMutableArray *newArray...
How to refresh the windows desktop programmatically (i.e. F5) from C#? <p>Yeah, I know this seems like a dumb question, its just a one-off hack I need to wrap up a somewhat mundane task so I can move on to something more interesting.</p> <p>EDIT: Maybe more info would help: I'm trying to remove some shortcuts from the...
<p>You can use the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762118(v=vs.85).aspx" rel="nofollow">SHChangeNotify</a> API.</p> <pre><code>[System.Runtime.InteropServices.DllImport("Shell32.dll")] private static extern int SHChangeNotify(int eventId, int flags, IntPtr item1, IntPtr item2); </co...
C# to C++/CLI to C DLL System.IO.FileNotFoundException <p>I'm getting <em><code>System.IO.FileNotFoundException: The specified module could not be found</code></em> when running C# code that calls a C++/CLI assembly which in turn calls a pure C DLL. It happens as soon as an object is instantiated that calls the pure C ...
<p>Are the C and C++ DLLs in the same directory as the C# assembly that's executing?</p> <p>You may have to change your project output settings so that the C# assembly and the other DLLs all end up in the same folder.</p> <p>I've often used the <a href="http://www.dependencywalker.com/">Dependency Walker</a> in cases...
Is the original Java ideal dead? <p>I feel that while I love J2ME and Java it's hypocritical of them to have two APIs for Java. Java was designed with "One code, many platforms" in mind, and now it's more like "One API for every OS, and one API for everything smaller than a netbook." I see a lot of J2ME emulators and s...
<p>I think this should be a community Wiki</p> <p>But to the point, my view is that J2ME is going to die a horrible death and leave us with normal Java. The current Netbook trend combined with the more powerful smartphone trend means that your average cellphone today is much stronger than the machines that ran J2SE wh...
Resources for WinForms/WPF dev trying to learn ASP.NET <p>What are your best resources for a WinForms/WPF developer to come up to speed on ASP.NET? Will it take a complete paradigm shift for me to learn how to use ASP.NET or will it be a slight adjustment?</p> <p>I will award the answer flag to the post with a resour...
<p><a href="http://www.asp.net/" rel="nofollow">The Official ASP.NET Site</a> has <a href="http://www.asp.net/Learn/" rel="nofollow">tutorials and videos</a></p> <p><a href="http://www.4guysfromrolla.com/" rel="nofollow">4 Guys From Rolla</a> is a great resource, as is <a href="http://weblogs.asp.net/scottgu/" rel="no...
Cocoa or Objective-C? <p>In regards to iPhone development, how do you now when your using a Cocoa vs pure Objective-C objects. For example, the following are Objective-C:</p> <ul> <li>NSTimer</li> <li>NSString</li> <li>int, float</li> <li>NSMutableArray</li> </ul> <p>But these are Cocoa:</p> <ul> <li>UILabel</li> <...
<p>You've got it a little wrong.</p> <p>NSTimer, NSString, NSMutableArray are all Cocoa. <code>int</code> and <code>float</code> are actually C, but since Objective-C is a strict superset of C, you are able to use them in your Objective-C code.</p> <p>Pure Objective-C requires linking only to the Objective-C runtime ...
Converting an empty string into nil in Ruby <p>I have a string called <code>word</code> and a function called <code>infinitive</code> such that<br /> <code>word.infinitive</code> would return another string on some occasions and an empty string otherwise<br /> I am trying to find an elegant ruby one line expression for...
<p>The ActiveSupport <a href="http://guides.rubyonrails.org/active_support_core_extensions.html#presence"><code>presence</code></a> method converts an empty (or <code>blank?</code>) string to <code>nil</code>. It's designed for your exact use case:</p> <pre><code>word.infinitive.presence || word </code></pre> <p>Not...
Showing a Splash Screen during script execution <p>I want to know how to show a splash screen (like a gif or jpeg file) on the user screen during my script execution.</p> <p>Thank you for your help. </p>
<p>The trick is to let the rendering re-paint after the splash display is enabled before coninuing with long running JS. To do that you can use the setTimeout method.</p> <p>For example assuming you splash display is in a div with display style none you can use this function to run you code:-</p> <pre><code>function...
How do I forward a complete email without downloading attachments? <p>Hello (and thanks in advance!)</p> <p>I'm working in Python and I got IMAP and SMTP to work with my Gmail account. I now need to forward select messages to another account (after reading their body).</p> <p>How do I do this without downloading the ...
<p>Look at the IMAP and SMTP Lemonade extensions. There is support for forwarding messages without downloading. It's a very new extension, so not many IMAP servers support it yet; I'm not sure if Gmail is one of them.</p> <p>Section 2 of <a href="ftp://ftp.rfc-editor.org/in-notes/rfc4550.txt" rel="nofollow">RFC 4550...
Does qt 4.5 have any skins? <p>I am developing for the first time using qt 4.5. I am developing a desktop app that will run on windows xp/vista.</p> <p>The client would like to have a skin that assemblies a softphone, or something similar. </p> <p>Does qt come with any skinning engine? Is it possible to create skins...
<p>Yes, you can write <a href="https://doc.qt.io/qt-5/stylesheet.html" rel="nofollow">style sheets</a> to customize the look of your application. The syntax is like CSS and gives you many possibilities. If you just want all your buttons to be red, for example:</p> <pre><code>QPushButton { color: red; } </code></pre>...
Applications for using couchDB and a RDBMS together <p>Wondering if there was a scenario where one would use a document-based DB and a relational DB together in a best-of-both-worlds scenario? </p>
<p>One idea is to use a relational database as the main data store and a document-based db as a data distribution mechanism from the back end to the front end(s).</p>
.NET Equivalent for Hotkey Control <p>What is the .NET equivalent for the <a href="http://msdn.microsoft.com/en-us/library/bb775233%28VS.85%29.aspx" rel="nofollow">Hotkey Control</a>?</p>
<p>There is no implementation of HotKey Control in .Net but u can create a Custom control deriving from TextBox. One such implementation available to steal is <a href="http://www.codeproject.com/KB/buttons/hotkeycontrol.aspx" rel="nofollow">here</a></p>
Anyone recommends 'Pure Variants' for Software Product Lines generation? <p>Dear all, I am working on a software product line for online-tests automatic builds in coordination with my professor. He recommended for me "Pure Variants" as an open source tool which can be used as a plugin to Eclips. However, I am not reall...
<p>In fact pure::variants isn't open source but there is a Community edition for personal use. I think you should do a search though as learning to do this well could help your future academic career but you will only find one other tool specifically developed for <em><a href="http://www.software-acumen.com/about-produ...
Python - test that succeeds when exception is not raised <p>I know about <code>unittest</code> Python module.</p> <p>I know about <code>assertRaises()</code> method of <code>TestCase</code> class.</p> <p>I would like to write a test that succeeds when an exception is <strong>not</strong> raised.</p> <p>Any hints ple...
<pre><code>def runTest(self): try: doStuff() except: self.fail("Encountered an unexpected exception.") </code></pre> <p>UPDATE: As liw.fi mentions, the default result is a success, so the example above is something of an antipattern. You should probably only use it if you want to do something s...
Set the icon of a Flex button with a Sprite in runtime <p>I want to set the icon of a button in flex.</p> <p>The default syntax is as follows.</p> <pre><code>myButton.setStyle("icon", iconClass); </code></pre> <p>and iconClass is normally an embedded object.</p> <p>But what I want to do is, use a standard <strong>S...
<p>This is actually a fatal flaw in Flex's framework in regards to styling. When Flex grabs a style value for an icon it assumes it's of type <code>Class</code> and that the instantiated object will be of type <code>DisplayObject</code> (or derived). It's a trivial change to the code (which classes like <code>mx:Image<...
How to properly release and switch views in multiview controller? <p>I'm trying to create a multiview controller for a game, in which one root view controller releases views before switching to another view. The sub view controllers are, in turn, sub-root view controllers themselves since they contain other view contro...
<blockquote> <p>Note how my singlePlayerViewController is not inserting subviews, but is instead replacing its own view with a sub-view controller's view. (Don't know if this is a good practice or not :?: )</p> </blockquote> <p>Huge warning flag here. It sounds like you have one view with two view controllers. Thi...
Get User Input From Dynamic Controls <p>I am looking to create a dynamic survey. Where I generate all the question controls from the database. Below is an example of what I am trying to do (without the database part). I am able to display questions as seen below. I am unable to read the users input. </p> <p>Does ...
<p>You have to generate the controls with an unique id. You must be able to math each control-id with exactly one question in your database. After doing this, you are able to write back the answer to a specific question into a datbase.</p>
How do I create an instance from a string in C#? <p>I'm reading information from an XML which contains the type of an object that I need to instantiate along with it's constructor parameters.</p> <p>The object type is actually in another project, within a sibling namespace. (I need to create a Company.Project2.Type wi...
<ul> <li>You need to specify the full type name to <a href="http://msdn.microsoft.com/en-us/library/w3f99sx1.aspx"><code>Type.GetType()</code></a>, including namespace, e.g. "Company.Project2.Type"</li> <li>If the type isn't in the same assembly (or mscorlib), you need to give the assembly name too, including version i...
Regex: How to match a string that contains repeated pattern? <p>Is there a regex pattern that will match a string that contains repeated pattern, e.g.:</p> <pre>"a"|"b","c"|"d",...,"y"|"z"</pre> <p>Do you have any idea?</p>
<p>Maybe you are looking for something like this:</p> <pre><code>^"."\|"."(,"."\|".")*$ </code></pre> <p>This will match a comma-separated list of sequences of form <code>"</code><em>α</em><code>"|"</code><em>β</em><code>"</code> where <em>α</em> and <em>β</em> can be any character.</p>
Implementing an Application in PL/SQL <p>We're developing a web application which according to my spec must have the backend written entirely in PL/SQL (stored procs etc.). Anyone have any advice/links on how to write a well structured backend using stored procedures and custom types? Normally I would have a business l...
<p>You can <strong>still</strong> have a business layer - it's just that you are writing it in PL/SQL instead of some other language.</p> <p>A typical PL/SQL business layer would use packages for each major area of functionality, with appropriate procedures and functions in it e.g. </p> <pre><code>create package empl...
How to: Back button support "Ajax" <p>I have an asp.net ajax website, it full of things happen on the same page without page reload, such as sorting records, paging,... When the user go to another page in the same site and press the browser back button, how can i make the browser save the page state to return to it wit...
<p>You dont need 3.5 for the history control, <a href="http://weblogs.asp.net/scottgu/archive/2006/09/14/Tip%5F2F00%5FTrick%5F3A00%5F-Enabling-Back%5F2F00%5FForward%5F2D00%5FButton-Support-for-ASP.NET-AJAX-UpdatePanel.aspx" rel="nofollow">check ScottGu's blog here</a></p> <p>Also check if <a href="http://geekswithblog...
What's the point of using Amazon SimpleDB? <p>I thought that I could use SimpleDB to take care of the most challenging area of my application (as far as scaling goes) - twitter-like comments, but with location on top - till the point when I sat down to actually start implementing it with SDB.</p> <p>First thing, SDB h...
<p>I use SDB on a couple of large-ish applications. The 10 GB limit per domain does worry me, but we are gambling on Amazon allowing this to be extended if we need it. They have a request form on their site if you want more space.</p> <p>As far as cross domain joins, don't think of SDB as a traditional database. Du...