input
stringlengths
51
42.3k
output
stringlengths
18
55k
gcc inline assembly for context-switching <p>I am trying to implement context switch using gcc for m68k processors. I need to use inline assembly for saving all the registers d0, d1...d7 and a0,...a7. I was wondering if I can use a loop in my inline gcc that would allow me to save these registers instead of write a sep...
<p>Here you go:</p> <pre><code>MOVEM.L D0-D7/A0-A7,-(A7) ;Save registers onto stack. </code></pre> <p>You don't have to use the stack, you can use some other address.<br /> I have a feeling that the pre-decrement mode is compulsory,<br /> but I can't test that right now as I don't have a 68k machine.</p> <p>p.s. tha...
Can you get the exact date a user started following another using the twitter API? <p>Let's say user A follows user B, and B follows A. I want to know the exact date A started following B and viceversa. Is this information stored on twitter? Can I retrieve it using the API?</p> <p>To clear out: The point of this quest...
<p>No Ignacio, you can't. You just can know who follows who but not the date the follow started.</p> <p>Looking at the API, there's is no way, there are two calls to get the followers:</p> <p>User Methods/statuses/followers</p> <p>and</p> <p>Social Graph Methods/followers/ids </p> <p>Neither of them returns dates ...
netbeans : add library permanently <p>Hi<br /> I work in a group project and after every checkout<br /> I have to remove and add the javamail api..(because the path is relative) how can i make it IN the Project folder?</p> <p>This is how i add the library :</p> <ol> <li>right click on librarys folder</li> <li>Add/jar...
<p>This worked for me: Project Properties -> Libraries -> Add JAR/Folder, and in that dialog there is a "Reference as" option. Choose "Relative Path" and then locate your library.</p>
Collection lookups; alternative to Dictionary <p>A TimeSheetActivity class has a collection of Allocations. An Allocation is a value object that is used by other objects in the domain as well, looking something like this:</p> <pre><code>public class Allocation : ValueObject { public virtual StaffMember StaffMember...
<p>I don't think the fact that the key is part of the value is necessarily a problem. In my experience that's quite frequently the case for dictionaries. A <code>HashSet</code> with an appropriate equality comparer would certainly work, so long as you never needed to get at the current object with a particular <code>Ev...
PHP APC: What happens when APC cache is full? <p>What happens when you try to add a variable into APC and the APC cache is full? Does it automatically remove least used variable from the cache?</p>
<p>According to <a href="http://us3.php.net/manual/en/apc.configuration.php#ini.apc.ttl">APC: Runtime Configuration</a>, "In the event of a cache running out of available memory, the cache will be completely expunged if ttl is equal to 0. Otherwise, if the ttl is greater than 0, APC will attempt to remove expired entri...
Why do I see so many comments in this format? <p>I see so many PHP comments in the format of:</p> <pre><code>/** * (c) Copyright Someone 2009 * legal crap * blorp */ </code></pre> <p>Is this just by convention, or is there a reason? I thought it was just a way that some people did it, but I am now wondering afte...
<p>Those are <a href="http://www.phpdoc.org/">phpDocumentor</a> comments. Comments starting with <code>/**</code> are used by documentation generators (by convention) to create documentation for the project. Here is a <a href="http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial%5FphpDocumentor.qui...
Is there a way to set ASP.NET TextBox password char when in Password TextMode? <pre><code>&lt;asp:TextBox TextMode="Password" runat="server" /&gt; </code></pre> <p>I want that when the user types in text, it should show • rather than a simple asterisk, is there a way (in win-forms' TextBox there is a property Passwo...
<p>No this is browser specific. Maybe you could fake this with javascript, but I wouldn't recommend it.</p>
css background image positioning (negative position?) <p>I'm trying to add an icon which sits on top of the border, splitting it in half.</p> <p>Here is what I have so far:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;title&gt;Unti...
<p>An other way is using the pseudo class :after to inject an element after your box.. Of course this certainly not works for IE6...</p> <p>CSS </p> <pre><code> .box{ position:relative; } .box:after{ content:url(icon_neutral.png); display:block; position:relative; top: -30px; }...
How comes .array() doesn't work on ByteBuffers returned from map'ed FileChannels? <p>I'm doing memory-mapped IO in Java. The FileChannel class allows you to map a ByteBuffer to a particular part of a file. I'm doing that with a file opened read only.</p> <p>The problem I am having is that I'm getting an exception whe...
<p>I'm going to assume this is about the <a href="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html#map%28java.nio.channels.FileChannel.MapMode,%20long,%20long%29" rel="nofollow"><code>FileChannel.map</code></a> method which can map a file to memory which can be accessed by a <a href="http://java...
CSS Image Gallery Float BUG <p>This is new one, I'm having problem with an Archive page i've made. It seems like a fairly straight forward floated div image gallery... but for some reason the there's a bunch of line breaks randomly throughout the divs. I thought it may have been a problem with Cufon or IE.JS etc but ...
<p>Since some titles are longer than others, some line-break and thereby make the div taller. The floats will then "hang onto" these taller divs. It's not a bug per se, it's just how floating works.</p> <pre><code> --- --- --- |1| |2| |3| --- | | --- --- --- |4| --- --- |5| --- </code></pre...
HTML DOM: How to call a SELECT box's update method? <p>I'm writing a VB application that interacts with the HTML DOM.</p> <p>If I go to this page:</p> <p><a href="https://edit.yahoo.com/registration" rel="nofollow">https://edit.yahoo.com/registration</a></p> <p>And then try to change the "I prefer content from" SELE...
<p>Your looking for the <code>onChange</code> event. Of course there is a possibility that the form is getting submitted by some other event, perhaps <code>onBlur</code>.</p> <p><strong>Updated following additional questions from comments</strong></p> <p>Apparently bound by the following line:</p> <pre><code>YAHOO.u...
Clojure Variables and Looping <p>From googling around, I found that using <code>while</code> loops or using variables is discouraged.</p> <p>Now I implemented a very simple algorithm that will read characters from an inputstream and parse accordingly: if input is <code>10:abcdefghej</code> it will parse out <code>10</...
<p>What you are writing is C code with lisp-like syntax (no offense intended). Defining a style by what you <em>don't do</em> is very defining, but it is not very helpful if you don't know "well, then how else?"</p> <p>By the way, I don't know what <code>indicator</code> is supposed to do.</p> <p>This is how I would...
formencode invalid return type <p>if an exception occurs in form encode then what will be the return type??</p> <p>suppose</p> <pre><code>if(request.POST): formvalidate = ValidationRule() try: new = formvalidate.to_python(request.POST) data = Users1( n_date = new['n_date'], hea...
<p>I assume you are using formencode(<a href="http://formencode.org" rel="nofollow">http://formencode.org</a>)</p> <p>you can use unpack_errors to get per field error e.g.</p> <pre><code>import formencode from formencode import validators class UserForm(formencode.Schema): first_name = validators.String(not_empt...
how to control charset of directory listing via .htaccess? <p>I've enabled directory listing of a folder under public_html, by adding:</p> <p>Options +Indexes</p> <p>in the .htaccess file.</p> <p>However, some files are not listed correctly by default, as some filenames are in Chinese (UTF-8 encoded). I can see the ...
<p>IndexOptions Charset=UTF-8 </p>
jquery show slide bug <p>The desired effect is for the panel to change depending on which #button you click on. This works fine. The only problem I have noticed is that no matter what #button you click, the settings panel is the one that slides by. I tried to have a global var and store the prev panel, but that was ...
<p>I think you're correct. The line:</p> <pre><code>$("div#text div").not("#"+target).hide("slide", { direction: "right" }, 500); </code></pre> <p>is selecting the two divs in #text that aren't the target, which may be causing the problem. You may want to store the current div in a variable to avoid that:</p> <pre...
How can you read keystrokes when the python program isn't in the foreground? <p>I'm trying to analyze my keystrokes over the next month and would like to throw together a simple program to do so. I don't want to exactly log the commands but simply generate general statistics on my key presses. </p> <p>I am the most co...
<p>It looks like you need <a href="http://patorjk.com/keyboard-layout-analyzer/" rel="nofollow">http://patorjk.com/keyboard-layout-analyzer/</a></p> <p>This handy program will analyze a block of text and tell you how far your fingers had to travel to type it, then recommend your optimal layout.</p> <p>To answer your ...
How to validate form element generated by js in Zend Framework <p>I want to allow users to add textbox element using javascript by clicking the add button.</p> <p>I would like to know how I can use Zend validate to validate those elements that are created by javascript.</p>
<p>There is no built in way for that but it shouldn't be too tricky to do this.</p> <p>Firstly, I would suggest naming your JavaScript-generated elements with array notation, ie. <code>name='someName[]'</code>, so that PHP parses them into an array in POST/GET.</p> <p>Then, you can simply loop over the resulting arra...
Guidelines for GIS application development <p>i need some help! I'm supposed to create a GIS application for my MSc, and I was wondering what are the best free and (preferably) open source technologies for development. What programming language to use for development of such application.</p> <p>Known choices are: Data...
<p>afaik: the best choice for a web applications is to prepare your data with gvSIG (<a href="http://www.gvsig.org" rel="nofollow">http://www.gvsig.org</a>), host your data into postgresql/postgis (<a href="http://www.postgresql.org" rel="nofollow">http://www.postgresql.org</a>, <a href="http://postgis.refractions.net"...
Use file-only APIs in memory <p>Some APIs only support output to files. e.g. a library that converts a BMP to PNG and only has a Save(file) option - no in memory function. Disk IO is slow, though, and sometimes you just want in-memory operations.</p> <p>Is there a generic solution to such a problem? Maybe a fake in-me...
<p>Use <a href="http://en.wikipedia.org/wiki/Named%5Fpipe" rel="nofollow">named pipes</a>.</p> <p>Similar constructs exist for both <a href="http://msdn.microsoft.com/en-us/library/aa365590%28VS.85%29.aspx" rel="nofollow">Windows</a>and <a href="http://www.opengroup.org/onlinepubs/009695399/functions/mkfifo.html" rel=...
Critique on jQuery Use <p>I'm busy introducing myself to jQuery by implementing a little system where onmouseover on an element causes a text balloon to pop up close to the element. I feel like I'm using too much vanilla JS here, so please suggest where I can improve and what is wrong with this code:</p> <pre><code>&...
<pre><code>$(function() { $("span.balloon").hide(); $("span.ballooned[balloonid]").mouseover( function() { var balloonid = "#" + $(this).attr("balloonid"); $(balloonid).css("display", "inline"); }); }); </code></pre>
is it possible to edit/modify the firefox addons after installing? <p>Is it possible to modify/edit, already installed firefox addons? Where are the addons stored in the computer... I mean which folder etc...</p>
<p>It is possible to edit the files. Its simple to find the folder path. </p> <ul> <li>Open the Help menu from the browser top menu</li> <li>select Troubleshooting Information option. The Troubleshooting Information tab will open.</li> <li>Under the Application Basics section, click on Show Folder. A window with your ...
At what stage do you add logging & tracing in OO? <p>I'm interested at what stage in your development do add logging and/or tracing to your applications?</p> <p>I'm working with a .Net stack and log4net (via commons.logging). Generally taking a TDD approach to development although admittedly not 100%, sometimes Im kno...
<p>My software is in layers, with a well-defined API between each layer. I tend to implement logging for those APIs from the begining, so that for any given transaction I can see how that results in an API call at each of the underlying layers: if there's a mistake, that will help to narrow it down to a specific layer....
Is it possible to specify formatting options for to_yaml in ruby? <p>The code</p> <pre><code>require 'yaml' puts YAML.load(" is_something: values: ['yes', 'no'] ").to_yaml </code></pre> <p>produces</p> <pre><code>--- is_something: values: - "yes" - "no" </code></pre> <p>While this is a correct yaml, it j...
<p>About the hash options: see <a href="http://yaml4r.sourceforge.net/doc/page/examples.htm">http://yaml4r.sourceforge.net/doc/page/examples.htm</a></p> <p>Ex. 24: Using <code>to_yaml</code> with an options Hash</p> <pre><code>puts [[ 'Crispin', 'Glover' ]].to_yaml( :Indent =&gt; 4, :UseHeader =&gt; true, :UseVersion...
Executing win32 file ( using UpdateResource winapi ) in unix <p>I guess it is impossible, but I will ask it anyway. I have a Windows application that executes <code>BeginUpdateResource</code> / <code>UpdateResource</code> / <code>EndUpdateResource</code></p> <p>Can I somehow execute this on Linux/Unix? Its server-sid...
<p>I am not sure exactly what can be achieved with <a href="http://www.winehq.org/documentation" rel="nofollow">Wine</a>, but that might be a way to go if you have the source code for the application you want to run. See also <a href="http://wiki.winehq.org/WikiToDo" rel="nofollow">Will Wine run only under X, or can it...
C# Creating generic Vector4 class? <p>Is there any <em>good</em> way to create a generic Vector4 class in C#? I have a couple of units(force, distance, moment, rotation, acceleration, velocity etc) that all need a 3d-representation and they all behave very similar and should therefore support the basic functions for ad...
<p>Regarding overloading operators, there is a solution <a href="http://stackoverflow.com/questions/147646/solution-for-overloaded-operator-constraint-in-net-generics">here</a> which explains how to do it using .Net 3.5 (using Jon Skeet's <a href="http://www.yoda.arachsys.com/csharp/miscutil/" rel="nofollow">MiscUtil</...
Concept & Algorithm: How to record only single URL for widget? <p>I have created a widget for my web application. User's getting code and just pasting that code in their website and my widget works on their website something like twitter, digg and other social widgets.</p> <p>My widget is on the basis of post, for a s...
<p>I think doing something like this is a bit tricky. Here are some ideas that pop to mind</p> <p>You could for example ask the user to input their site's URL when they get the widget, or the widget could track the domain or subdomain, thus giving less URLs.</p> <p>Just tracking the domain would obviously be problema...
How can I hide the space to the left of menu items in XAML menus? <p>Is there a way that I can suppress the space to the left of a MenuItem's text?</p> <p><img src="http://tanguay.info/web/external/extraSpaceMenus.png" alt="alt text" /></p> <p>Something like <code>LeftAreaVisible="Collapsed"</code> (pseudo-code) belo...
<p>Struck through the somewhat same problem. Also did you noticed that there is no separator visible between Create Models and Create Pages. My issue was horizontal separator not completely visible i.e. for Highlighted area there is no horizontal separator.</p> <p><img src="http://i.stack.imgur.com/R1t8x.png" alt="ent...
Is there a dream language that merges the benefits of dynamic and strong typing? <p>I would be interested to learn a language that handles objects internally as hashtables (like JavaScript) but could wrap them with strong types to offer the benefits of code completion/intellisense in design time. Here is how I wish thi...
<p>Maybe the new dynamic type in C# 4.0. look at this: <a href="http://blogs.msdn.com/cburrows/archive/2008/10/27/c-dynamic.aspx" rel="nofollow">http://blogs.msdn.com/cburrows/archive/2008/10/27/c-dynamic.aspx</a></p>
How to use transactions with the Entity Framework? <p>When you have code like this:</p> <pre><code>Something something = new Something(); BlahEntities b = new BlahEntities() b.AddToSomethingSet(something); b.SaveChanges(); </code></pre> <p>how do run that addition inside a transaction?</p>
<p>The ObjectContext has a connection property that you can use to manage transactions.</p> <pre><code>using (var context = new BlahEntities()) using (var tx = context.BeginTransaction()) { // do db stuff here... tx.Commit(); } </code></pre> <p>In the case of an exception the transaction will be rolled back. ...
How to recompile a specific unit from the VCL? <p>I want to apply a fix from QC to a Delphi 2009 unit (DBClient as it happens). I know I need to copy the unit to another directory and make the change to the copy. How do I then get Delphi to compile that unit and use it in favour of the DCU that already exists?</p>
<p>If you don't want to modify the original .Pas file, I do this by copy the .Pas file into my application folder, then choose built project, it will create new dcu file in my application folder, which will be used instead of the original one.</p>
Are Flex charts available in the free Flex SDK? <p>Hmmmm... It appears that charts are only available through the Flex SDK that comes built-in with Flex Builder. This is a problem, since I want to use Flex 3.3, and Flex Builder came with 3.2.</p> <p>Eclipse is also ticking me off, and I prefer to use a different IDE (...
<p>The charts are <a href="http://www.adobe.com/products/flex/upgrade/" rel="nofollow">only available</a> with the professional Flex Builder plugin. If you have a FB license, however, there is no reason you can't use the libraries with FlashDevelop.</p>
NSNotification Strangeness when used in conjunction with AsyncSocket <p>I'm using AsyncSocket to connect to a server from my iPhone App. In the delegate that received data from the server, I post a notification that would tell the tableView's delegate to trigger a reloadData on the tableView:</p> <pre><code>- (void)o...
<p>One possibility is that your <code>initWithNibName:bundle:</code> method is not actually being called. If you instantiate the view controller in a NIB (rather than in code), then it calls <code>initWithCoder:</code> instead.</p> <p>A quick way to check is to put a breakpoint in <code>initWithNibName:bundle:</code>...
Windows 2008 unable to execute c# powershell app. Returning access exception <p>Does anybody know why I can't access the folder where my powershell scripts are in windows 2008 Ent. When I try to create a script with textpad it craps out. When I try and execute a c# powershell app, which is stored on another win 2003 dr...
<p>I managed to find an answer. I think it was something to do with inherited permissions. Creating the scripts on the referenced directory instead of copying them from the old ntfs directory worked. Thanks for the help. Bob.</p>
C# Set the visibility of a label using the result of String.IsNullOrEmpty <p>Hi I am trying to set the visibility of a label based on a textbox string being empty. I have the following code:</p> <pre><code>MyLabel.Visible = String.IsNullOrEmpty(MyTextBox.Text); </code></pre> <p>Why does MyLabel not appear when the te...
<p>Depends on where the code is being run. If you need interactivity, i.e. the label disappears when a character is typed into the textbox, you need to run it on the Keyup event of the textbox. You may also need to repaint the label.</p>
Unicode friendly alphabetic pattern for python regex? <p>I'm looking for a pattern equivalent to \w, and which doesn't match numeric pattern. I cannot use [a-zA-Z] because I would like it to match japanese kanjis as well.</p> <p>Is there a way to write something like [\w^[0-9]] ? Is there an equivalent of [:alpha:] in...
<pre><code>[^\W\d] </code></pre> <p>Throw out non-word characters and throw out digits. Keep the rest.</p>
unimportant question about erlang and functional programming <p>I stumbled upon <a href="http://stackoverflow.com/questions/1055166/please-walk-me-through-this-erlang-programming-recursive-sample">this question</a> and i realized i forgot a lot of stuff from my nonprocedural programming class.</p> <p>As I was trying t...
<p>Yes, it works properly. And it is more elegant in presentation. However, if I've learned correctly, not using the Zs variable as an accumulator makes it not tail recursive and thus less efficient. Also, using the reverse with the accumulator is more efficient than appending it together in correct order. This is,...
How can I get these span elements to expand to fill their full height? <h3>CSS:</h3> <pre><code>.events_holder { width:100%; background-color: #d9ceae; } .events_holder .event_holder { width:100%; float: left; min-height: 20px; } .events_holder .event_holder .event_data { bord...
<p>Use a table. There will be less markup and it will automatically expand the rows to the largest height and keep your columns aligned.</p> <pre><code>table { width:100%; background-color: #d9ceae; border-collapse:collapse; } td { border: thin gray dotted; font-size: 80%; } &lt;table&gt; &lt;...
C++ Meta Templates: A Good or Bad Design Choice? <p>I'm curious to find out if and when C++ meta templates are a good design choice for systems small to large. I understand that they increase your build time in order to speed up your execution time. However, I've heard that the meta template code is inherently hard to ...
<p>Metaprogramming is just another tool in a (C++) programmers' toolbox - it has many great applications, but like anything can be mis- or over- used. I think it's got a bad reputation in terms of 'hard to use', and I think this mainly comes from the fact that it's a significant addition to the language and so takes a...
macro problem <p>I'm trying to run the below mentioned code in VB(Excel Macro) but i m stuck with an error which pops up on running saying "Automation Error".</p> <pre><code>strComputer = "." </code></pre> <p>Set objNetwork = CreateObject("Wscript.Network") Set fs = CreateObject("Scripting.FileSystemObject")</p> <...
<p>You just need another slash after "winmgmts:\" :)</p> <p>It should be:<p><pre><code>Set objWMIService = GetObject("winmgmts:\<b><i>\</i></b>" &amp; strComputer &amp; "\root\cimv2")</code></pre></p></p>
how to tell a variable is iterable but not a string <p>I have a function that take an argument which can be either a single item or a double item:</p> <pre><code>def iterable(arg) if #arg is an iterable: print "yes" else: print "no" </code></pre> <p>so that:</p> <pre> >>> iterable( ("f","f") ...
<p>Use isinstance (I don't see why it's bad practice)</p> <pre><code>import types if not isinstance(arg, types.StringTypes): </code></pre> <p>Note the use of StringTypes. It ensures that we don't forget about some obscure type of string.</p> <p>On the upside, this also works for derived string classes.</p> <pre><c...
Python: linking/binding variables together in a dictionary <p>first post, so play nice!</p> <p>I have a fairly basic question about Python dictionaries. I would like to have some dict value that updates when another variable is changed (or at least recalculated when it is next called) - eg:</p> <pre><code>mass = 1.0 ...
<p>Seems like an abuse of a dictionary structure. Why not create a simple class?</p> <pre><code>class Entity(object): def __init__(self, mass, volume): self.mass = mass self.volume = volume def _density(self): return self.mass / self.volume density = property(_density) </code></pre...
Will this leak memory? <p>I made a small function to catenate strings and return the combined string. However since I assign memory to a third variable in the function, will the memory be freed when the function finishes or will it stay there, requiring me to free it later? and if I need to free it, what's the most sty...
<p>Yes you need to free it.</p> <p>Probably something like:</p> <pre><code>int main(){ char *s = StrCat("HELLO ", "WORLD"); printf("String: %s\n", s); free(s); return 0; } </code></pre>
How to sanitze user input in PHP before mailing? <p>I have a simple PHP mailer script that takes values from a form submitted via POST and mails them to me:</p> <pre><code>&lt;?php $to = "me@example.com"; $name = $_POST['name']; $message = $_POST['message']; $email = $_POST['email']; $body = "Person $name submitte...
<p>Sanitize the post variable with <a href="http://www.php.net//manual/en/function.filter-var.php"><code>filter_var()</code></a>.</p> <p><a href="http://net.tutsplus.com/tutorials/php/sanitize-and-validate-data-with-php-filters/">Example here</a>. Like:</p> <pre><code>echo filter_var($_POST['email'], FILTER_SANITIZE_...
Add PEAR packages to Subversion repository? <p>I'm working on a project that'll use PEAR packages. Because you never know what version of the PEAR package will be installed on your hosting provider (and especially because I require a patch to have been applied to one of the packages), I'd like to put the PEAR source f...
<p>I couldn't get my Hosting provider to install the PEAR libraries I wanted. Here's how I made PEAR part of my source tree.</p> <h2>1. Create a remote.conf file</h2> <p>Creating your remote.conf is a little different than in the manual. Lets say I want to install PEAR in <code>vendor/PEAR</code> of a project. You wo...
What are attributes? <p>Could anyone please clarify the defination of attribute?</p> <p>for example, in the following code, what is an attribute:</p> <pre><code>request.setAttribute("ja",new foo.Employee()); </code></pre> <p>Is the attribute in the above code an object of type foo.Employee(), or it is key/value pair...
<p>Request attributes are (or at least act like) a map of objects, in this case the key is "ja" and the value is a new foo.Employee.</p> <p>The session, page, and application have the same data structure.</p>
NSNotificationCenter selector won't work with its NSNotification <p>I'm working on a Cocoa project with some C in it (I know, objc contains C...) and am trying to understand <code>NSNotificationCenter</code>s. Here's the situation:</p> <p>I have a struct declared as <code>typedef struct {/*code here*/} structName;</c...
<p>You should be using <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/Reference/Reference.html#//apple_ref/occ/clm/NSNotification/notificationWithName%3aobject%3auserInfo%3a" rel="nofollow">+notificationWithName:object:userInfo:</a> not <a href="http://develope...
Instantiate a new instance of UIViewController within itself <p>I have an instance of UIViewController displaying a list of items. When the user selects an item I need to create a new instance of UIViewController (populated by a different list of items) and show it. At the moment I'm calling the constructor from withi...
<p>You are creating and presenting a new view controller, your problem is elsewhere.</p> <p>Where are you keeping the data for the table?</p> <p>Your code does make a new instance, but it's very telling that after creation you are not telling the new view controller what to display - this means that you are getting t...
Total amount of columns in mySQL ! <p>i have this sql : </p> <pre><code>SELECT * , ( xnum * xprice ) AS amount, SUM( xnum * xprice ) AS total FROM xxbasket LEFT JOIN xxsubproduct USING ( xsubproduct_id ) LEFT JOIN xxcolor USING ( xcolor_id ) WHERE xuserid = '3' </code></pre> <p>when i use SUM( xnum * xprice ) AS tota...
<p>Sum is a function where the sum of your value (xnum * xprice) over all selected rows is calculated. The result is one row.</p> <p>If you want to calculate the sum of multiple groups of rows, you may use the GROUP BY clause, which groups columns to groups (e.g. GROUP BY userid instead of your where clause would calc...
SQL Server login for SharePoint site login errors SSO <p>I'm having a very confusing error between SharePoint and SQL Server 2k5. </p> <p>My SQL Server acting as backend to my MOSS farm has several logins in it which correspond to the web front end servers in my farm, with the pattern: {my-domain}{my-machine}$</p> ...
<p>The {my-domain}{my-machine}$ account is an alias for the NETWORK SERVICE built-in local machine account. NETWORK SERVICE is a low privilege predefined account that was introduced in Windows 2003. It has network credentials and can therefore connect to remote databases (as long as they're within the same domain).</p>...
Deactivate FocusVisualStyle globally <p>I want to globally deactivate the focus rectangles in my WPF application. For single controls that can be done via</p> <pre><code>&lt;Style TargetType="Button"&gt; &lt;Setter Property="FocusVisualStyle" Value="{x:Null}" /&gt; &lt;/Style&gt; </code></pre> <p>but how to apply...
<p>According to <a href="http://msdn.microsoft.com/en-us/library/bb613567.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb613567.aspx</a>, you should be able to set global focus style like this:</p> <pre><code>&lt;Style x:Key="{x:Static SystemParameters.FocusVisualStyleKey}"&gt; &lt;Setter Property="C...
Data Access Layer design patterns <p>I have to design a Data Access Layer with .NET that probably will use more than one database management system (Mysql and Sql Server) with the same relational design.</p> <p>Basically, it has to be simple to switch from one database to another so I would like you to recommend me so...
<p>I recommend Patterns of Enterprise Application Architecture by Martin Fowler.</p> <p>A list of the patterns is also on his <a href="http://martinfowler.com/eaaCatalog/" rel="nofollow">website</a></p> <p>The <a href="http://martinfowler.com/eaaCatalog/dataMapper.html" rel="nofollow">DataMapper</a> pattern is also r...
Activate Trigger from Foreign Control <p>WPF newbie here so excuse the simple question. How do I cause a trigger to fire on a UserControl from a control outside of that UserControl? Here's what I want to do...</p> <p>I have a UserControl with a trigger set to display a background color change on itself when IsMouseO...
<p>Since your control is "external" to the button, you cannot use property triggers or data triggers to flip the background. What you need is an EventTrigger on Window level.</p> <p>Start a keyframe or discrete color animation with 0 duration on MouseEnter and remove the mentioned storyboard on MouseLeave:</p> <pre><...
file I/O in Spidermonkey <p>Thanks to <code>python-spidermonkey</code>, using JavaScript code from Python is really easy.</p> <p>However, instead of using Python to read JS code from a file and passing the string to Spidermonkey, is there a way to read the file from within Spidermonkey (or pass the filepath as an argu...
<p>The SpiderMonkey as a library allows that by calling the <a href="https://developer.mozilla.org/en/SpiderMonkey/JSAPI%5FReference/JS%5FEvaluateScript" rel="nofollow"><code>JS_EvaluateScript</code></a> with a non-NULL <code>filename</code> argument.</p> <p>However, the <a href="http://code.google.com/p/python-spider...
Changing field type in a Django ModelFormset <p>In a Django ModelForm, you can change the widget type of a field like so:</p> <pre><code>class EntryForm(ModelForm): entity = forms.CharField() class Meta: model = Entry </code></pre> <p>I can easily create a modelformset from the same model like so: </...
<p>EntryFormSet = modelformset_factory(Entry, form=EntryForm)</p>
Using Ajax, is it better to generate aditional markup in the server or the client side? <p>Which is better in AJAX request, Response with ready HTML or response with just data and write HTML using JavaScript, and this JavaScript will use a predefined HTML template to put the coming data inside and show on the page.</p>...
<p>I think the right solution is highly context dependent. There may be a <strong>right</strong> answer for a given situation, but there is no one size fits all answer. Generally, if I'm using a partial view that gets replaced via AJAX, I'll return html. If I'm performing an action on a small part of something, I'll...
How to write to a (Bitmap?) image buffer for faster GDI+ displays? <p>Using C++ and .net I have a stream of data I want to display as a scrolling image. Each time I get some new data I want to add it as a new row (128x1 pixels) and scroll the previous contents to one side.</p> <p>My first stab at the problem involved ...
<p>Take a look at the <a href="http://msdn.microsoft.com/en-us/library/bb787591%28VS.85%29.aspx">ScrollWindow</a> win32 method. You can scroll the existing data on the screen and then draw only the new data. This is <em>very</em> fast.</p>
Subsonic in Medium trust level <p>i host my web site in shared hosting server, this server use the default Medium trust level </p> <p>When i execute this</p> <p>ConfigurationDataCollection configurationDatumCollection = new ConfigurationDataCollection().Where(ConfigurationData.Columns.Name, configurationSectionName)....
<p>SUbSonic 2.x works in medium trust just fine - provided you're not using the BuildProvider. The Enterprise Library, however, has problems: <a href="http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=8832" rel="nofollow">http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=8832</a></p> <p>I think your conf...
Saving user input directly into variable in JQuery <p>I don't want to have a formal form field but save every user input directly into a variable and append new letters to a field every time the user enters a new letter. What command do I need?</p>
<pre><code>window.onkeypress = function(e) { var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code); document.body.innerHTML += character; }; </code></pre>
How to create "Upcoming birthdays" module in Rails? <p>I have a table "users" with a column "date_of_birth" (DATE format with day, month, year). In frontend I need to list 5 upcoming birthdays.</p> <p>Spent ages trying to work out the logic.. also browsed every possible article in Google with no luck..</p> <p>Any sug...
<p>Several answers have suggested calculating/storing <em>day of year</em> and sorting on that, but this alone won't do much good when you're close to the end of the year and need to consider people with birthdays in the beginning of the next year.</p> <p>I'd go for a solution where you calculate the full date (year, ...
Linux sockets communicating with QTcpSockets in Qt 4 <p>I am trying to communicate with TCP between a Qt program and a regular linux program. I have an existing linux client server program and I am trying to replace the server program with a Qt application. Here is the linux client code </p> <pre><code>#include &lt;st...
<p><a href="http://doc.trolltech.com/4.5/qstring.html#data" rel="nofollow">QString::data()</a> returns QChar*, you can't just cast it to char* and hope that it would always work. For debugging QString, use <a href="http://doc.trolltech.com/4.5/qtglobal.html#qPrintable" rel="nofollow">qPrintable</a> instead.</p> <p>Als...
How can I avoid properties being reset at design-time in tightly bound user controls? <p>I have UserControl 'A' with a label, and this property:</p> <pre><code> /// &lt;summary&gt; /// Gets or Sets the text of the control /// &lt;/summary&gt; [ Browsable(true), EditorBrowsable(EditorBrow...
<p>I had the same problem.</p> <p>Try this:</p> <pre><code>[Category("Appearance")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public override string Text { get { return uxLabel.Text; } set { uxLabel.Text = value; } } </code></pre>
Determining which code line threw the exception <p>In dotNet a line throws an exception and is caught, how can I figure out which line in which file threw the exception? Seems relatively straightforward, but I can't figure it out...</p>
<p>You can only do it if you have debug symbols available.</p> <pre><code>catch(Exception ex) { // check the ex.StackTrace property } </code></pre> <p>If you want to debug such a situation in VS, you'd better just check <code>Thrown</code> checkbox for <code>Common Language Runtime Exceptions</code> in <code>Exce...
What's the easiest way to write to a file using Perl? <p>Currently I am using</p> <pre><code>system("echo $panel_login $panel_password $root_name $root_pass $port $panel_type &gt;&gt; /home/shared/ftp"); </code></pre> <p>What is the easiest way to do the same thing using Perl? IE: a one-liner.</p>
<p>Why does it need to be one line? You're not paying by the line, are you? This is probably too verbose, but it took a total of two minutes to type it out.</p> <pre><code>#!/usr/bin/env perl use strict; use warnings; my @values = qw/user secret-password ftp-address/; open my $fh, '&gt;&gt;', 'ftp-stuff' # ...
PostgreSQL: Why can I connect to a user with a set password without having to give the password? <p>After creating a new user <code>john</code> with: <pre>CREATE USER john PASSWORD 'test'; CREATE DATABASE johndb OWNER john;</pre> I can connect to the PostgreSQL server with: <pre>psql -U john johndb</pre> The problem is...
<p>Your <code>pg_hba.conf</code> file probably has local connections set to "trust". The default contains a section like this:</p> <pre> # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/3...
How to display a label next to a Marker for Google Maps? <p>I would like to display a text label next to the markers on google maps. I've used Virtual Earth before and I'm just starting to use Google Maps. I tried setting the Title property but that only changes the roll over text. </p> <p>Is there a way to display...
<p>For Google Maps JavaScript API v3, check out <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/" rel="nofollow">the examples here</a>.</p> <p><a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/" rel="nofollow">Source code available in normal a...
Java Swing GUIs on Mac OS X <p>Have you ever attempted using Swing only to end up changing courses because it just couldn't do what you wanted?</p> <p>I'm pretty new to Swing, having only used it for school projects over 5 years ago, but it seems Swing has come a long way in providing a more native look and feel, so m...
<p>Swing isn't going to give you perfect fidelity with the hosting OS. Sun simply can't devote the considerable resources necessary to do so. My impression is that Swing has gotten much better, but is still going to look out of place by default.</p> <p>The minimum required to even hope to pass as a Mac app: </p> <...
Emacs Wishlist <p>Emacs is great. To me at least, Emacs is a metaphor of all software. Still, I know that it lacks some features sometimes that you have to actually migrate to other environments. Given emacs is so customizable, and great and everything, we only have to wish for it right? What do you think is a feature...
<p>There is a <a href="http://www.emacswiki.org/emacs-en?CategoryWishList" rel="nofollow">wishlist</a> on <a href="http://www.emacswiki.org/" rel="nofollow">EmacsWiki</a>.</p>
How to use SQL user defined functions in .NET? <p>I created a scalar function in the DB</p> <pre><code>SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[fn_GetUserId_Username] ( @Username varchar(32) ) RETURNS int AS BEGIN DECLARE @UserId int SELECT @UserId = UserId FROM [U...
<p>It sounds like the <em>right</em> way in this case is to use the functionality of the entity framework to define a .NET function and map that to your UDF, but I think I see why you don't get the result you expect when you use ADO.NET to do it -- you're telling it you're calling a stored procedure, but you're really ...
undelete the deleted command in bash <p>If you have written a really long command, say <code>cd /very/long/path</code>, and then you do ctrl+c or ctrl+u (if the cursor is at the end), and then you realise that you want the command back, is there any way to get the full line back without re-typing. Is there any trick to...
<p>To undo, use either</p> <ul> <li><kbd>Ctrl</kbd>+<kbd>X</kbd>, <kbd>Ctrl</kbd>+<kbd>U</kbd>; or</li> <li><kbd>Ctrl</kbd>+<kbd>_</kbd> (underscore).</li> </ul> <p>See <code>bind -P</code> for a full list of keybindings in <code>bash</code>.</p>
How to Autostart an Android Application? <p>I'm not sure how to autostart an android application after the android emulator completes its booting. Does anyone have any code snippets that will help me?</p>
<p>You have to add a manifest permission entry:</p> <pre><code>&lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt; </code></pre> <p>(of course you should list all other permissions that your app uses).</p> <p>Then, implement BroadcastReceiver class, it should be simple and fast executa...
Best Technology for a medical 3D Planning Software <p>I am looking to build a new Interactive 3D planning software similar to this one <a href="http://www.materialise.com/materialise/view/en/131410-SimPlant.html" rel="nofollow">http://www.materialise.com/materialise/view/en/131410-SimPlant.html</a></p> <p>I was lookin...
<p>The Python Imaging Library, <a href="http://en.wikipedia.org/wiki/Python%5FImaging%5FLibrary" rel="nofollow">PIL</a>, is a good compromise between speed-to-market and good performance (and you can always use <a href="http://www.scipy.org/" rel="nofollow">scipy</a> and its core part, <a href="http://numpy.scipy.org/"...
"How to get the Google video's thumbnail image ? " in PHP or Javascript? <p>I want to use the thumbnail of the Google video's. In PHP or JavaScript function </p> <p>function getScreen( url, size ) { if(url === null){ return ""; }</p> <p>size = (size === null) ? "big" : size; var vid; var results;</p> <p>result...
<p>Here is a small script that maybe gets the job done the way you want it: </p> <pre><code>&lt;?php $content = file_get_contents("http://video.google.de/?hl=de&amp;tab=wv"); $regex = '|&lt;img class=thumbnail-img.*?src=(.*?) |'; preg_match_all($regex, $content, $result, PREG_PATTERN_ORDER); $images = $result[...
Web Deployment <p>We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening</p> <ol> <li>In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine.</li>...
<p>For 2.0 sites, you have several options of how ASP.Net handles your web site. You can use default compilation, or pre-compiled sites. If you use default compilation, you need to have the source files on the server because inn this mode, ASP.Net will re-compile the website dynamically if it detects any changes to a...
Auto rotation when iPhone rotate <p>I am new in iPhone development... now i developed one Test application.in it 4 view is there.. </p> <p>my problem is that..when i rotate my simulator first 2 view will rotate automatically( landsacpe and Portrate mode).. but 3 and 4 not rotating . that time i got one exception.. th...
<p>Did you override the shouldAutorotateToInterfaceOrientation in ALL your view controllers?</p> <p>The part you posted from the exception means nothing, we'd need to see the sack trace. I'm not sure it's really related to the rotation issue though.</p>
What does <E> mean in Collection<E>? <p>What meaning has <strong><code>&lt;E&gt;</code></strong> on the code <code>Collection&lt;E&gt;</code>?</p>
<p>It means that you're dealing with a collection of items with type <code>E</code>. Imagine you've got a cup of tea. Instead of tea, it could also hold coffee so it makes sense to describe the cup as a generic entity:</p> <pre><code>class Cup&lt;T&gt; { … } </code></pre> <p>now you could fill it, either with coff...
django: select_related with entry_set <p>Should entry_set be cached with select_related? My DB is still getting calls even after I use select_related. The pertinent sections </p> <pre><code>class Alias(models.Model): achievements = models.ManyToManyField('Achievement', through='Achiever') def points(self) : ...
<p>Select_related() doesn't work with manytomanyfields. At the moment, this is something that is not planned, but might be a future feature. See <a href="http://code.djangoproject.com/ticket/6432" rel="nofollow">http://code.djangoproject.com/ticket/6432</a></p> <p>In this case, if you want to make a single query you g...
Input value to a child window text box <p>I am developing a website in which I need to send a value from parent window to child window. </p> <p>Is it possible via the URL ? </p> <p>For example: I have this line in parent window</p> <pre><code>&lt;tr ondblclick="fopenclaim(69856984);" id =trackrow&gt;'; function fop...
<p>You could pass the claim number in the Querystring and load it from the Querystring collection and then set the value of the textbox in the target page.</p> <pre><code>function fopenclaim(number) { window.open('https://www.sample.com/ClaimsOnline/myPage.asp?claimNum=' + number.toString(), 'claimform', 'width=800,...
jQuery closure & object property access <p>Can anyone tell me how to get access to variable "a" here:</p> <pre> var test = { a: 3, init: function() { $("body").click(function() { alert(a); }); } }; test.init(); </pre> <p>This doesn't work either: alert(this.a);</p> <p>Thanks in adva...
<p>Actually, I prefer this: It's <b>self</b> setting and initializing:</p> <pre> function createX() { var self = { init: function() { $("body").click(this.doit); }, doit: function(data, b) { alert(self.testing()); }, testing: function() { ...
How to get Path previous to Exceuting Assembly <p>i have some files located in </p> <p>c:\MyApp\file.txt</p> <p>and current executing assenbly in in debud filder</p> <p>c:\MyApp\bin\Debug\</p> <p>i want to get address of above "file.txt" at run time..</p> <p>i tried this</p> <p>Assembly.GetExecutingAssembly().Lo...
<p>You can't, since the file and the compiled application have no relation. What if you moved the MyApp.exe somewhere else?</p> <p>You have 2 options: </p> <ol> <li>Include file.txt in your project as a content file (it will be included in the output and in the same folder as MyApp.exe) </li> <li>Use configuration...
How to determine Controller class given URL string <p>Within the scope of a Rails controller or a view: How can I query the Rails routing mechanism to turn a relative url string (eg "/controllername/action/whatever" into the controller class that would be responsible for handling that request?</p> <p>I want to do some...
<p>Building off Carlos there: </p> <pre><code>path = "/controllername/action/whatever" c_name = ActionController::Routing::Routes.recognize_path(path)[:controller] controllerClass = "#{c_name}_controller".camelize.constantize.new </code></pre> <p>will give you a new instance of the controller class.</p>
VMware: "Unexpected response from vmware-authd: 501 Global command GLOBAL server to non-host agent targets not supported" <p>I have VMware Server 2.0.1 and VMware mui 1.0.9 installed on a remote host. When I try to connect to the server (port 902) or to the mui (port 8333) I get the following error message:</p> <block...
<p>" If you try to connect with the old management server you will get the following. "Unable to connect to the remote host: 501 Global command GLOBAL server-vmdb to non-host agent targets not supported."</p> <p>Open a web browser and point it to your server and with the port 8222. localhost:8222 i ran on your local m...
Fixing CSS on login page of my site <p>I have a problem on my site's login page in IE7 browser. One of the buttons on that page <a href="http://j-in.org.ua:9000" rel="nofollow">http://j-in.org.ua:9000</a> is cut off, in IE browser</p> <p>Here's the screenshot: <a href="http://img.skitch.com/20090629-nxnr2pwcs529peqxst...
<p>You need to set it to <code>display: block</code>.</p> <pre><code>#login #reg a { display: block; } </code></pre>
serialport exception java <p>i'm reading data from serialport using javax.comm API but when i run the code 2-3 times it is showing port currently own by this,but i have closed the port what's the problem i'm not getting plz help me</p> <p>this is expetion: javax.comm.PortInUseException: Port currently owned by flashha...
<p>Try disabling the port, then try enabling it again. Also try to check if the process using it terminated successfully. Hope this helps.</p>
How to get the Primary/Secondary color in jQuery UI Theme <p>Is there a way to reference the colours used in the jQuery themes without creating a simple style for each theme that I may choose to use?</p> <p><strong>Example</strong>: I have some text as follows</p> <p><code>&lt;div&gt;Hello&lt;/div&gt;</code></p> <p>...
<pre><code>var color = $(".ui-state-default").css("color"); </code></pre> <p>gave me color: "rgb(255, 255, 255)"</p>
Everything showed good, except the tabs. (HTML,CSS,JS) <p>Iam working on a website and I dont have any clue why the tabs doesnt work when I upload the website. Because when I view the website normal it does work perfectly. By the way: The tabs are working with a jquery script.</p> <p>This is the website URL: <a href="...
<p>Your About me tab does not show up because your server is case sensitive. </p> <p>Aboutme.jpg != Aboutme.JPG</p> <p>You should check out <a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/" rel="nofollow">CSS Sprites</a>. There is a flicker when you hover...
Bluetooth in C#, Which stack, Which SDK? <p>We've got an application which needs to be able to use bluetooth for the following requirements:</p> <ol> <li>Receive files from bluetooth devices (up to 2 devices at the same time)</li> <li>Display all bluetooth devices in range</li> <li>Send files to bluetooth devices</li>...
<p>Firstly the disclaimer, I'm the maintainer of the 32feet.NET library. :-)</p> <p>I've just checked, and on XP with the Microsoft stack (using one dongle) I can concurrently be receiving two OBEX PUTs and also discovering devices. That's using 32feet.NET's ObexListener class and the BluetoothClient.DiscoverDevices ...
delete duplicate rows <p>anyone know how can i delete duplicate rows by writing new way from script below to improve performance.</p> <pre><code>DELETE lt1 FROM #listingsTemp lt1, #listingsTemp lt2 WHERE lt1.code = lt2.code and lt1.classification_id &gt; lt2.classification_id and (lt1.fap &lt; lt2.fap or lt1.fap =...
<p><a href="http://www.devx.com/tips/Tip/13943" rel="nofollow">Delete Duplicate Rows in a SQL Table</a> :</p> <pre><code>delete table_a where rowid not in (select min(rowid) from table_a group by column1, column2); </code></pre>
Precautions when developing ASP.NET application on x86 computers but target computer is 64 bit (Windows Server 2008) <p>We have to deploy our application on a Windows 2008 64 bit server. As the application is already running for over one year on a Windows 2003 server installation, we know everything is working fine. We...
<p>There's probably no real things to worry about, <strong>except when using Third party dll's that have been compiled specfically for x86</strong>. </p> <p>I do all my builds in ASP.NET 'Platform independent', so they run on x86 as well as x64 without problems.</p>
Make string that starts with http:// clickable <p>Looking to make a string that starts with either http:// or www clickable.</p> <pre><code>str_replace("http://", "$string", "&lt;a href='$string'&gt;"); str_replace("www", "$string", "&lt;a href='$string'&gt;"); </code></pre> <p>shouldnt it be something like that?</p>...
<p>Are you looking for something like this?</p> <pre><code>&lt;?php $content = 'this is a test http://www.test.net www.nice.com hi!'; $regex[0] = '|(http://[^\s]+)|i'; $replace[0] = '&lt;a href="${1}"&gt;${1}&lt;/a&gt;'; $regex[1] = '| (www[^\s]+)|i'; $replace[1] = ' &lt;a href="http://${1}"&gt;${1}&lt;/a&gt;'...
How to deal with silent mysql sum() integer overflow? <p>I've got this table with an <code>int(11)</code> column and hundreds of millions of rows. When I run a query like </p> <pre><code>SELECT SUM(myIntColumn) as foo FROM myTable; </code></pre> <p>the return value does not make sense--it is smaller than the the sin...
<p>You can double the range by casting the value to an unsigned value:</p> <pre><code>SELECT SUM(CAST(myIntColumn AS UNSIGNED)) ... </code></pre> <p>There is a bigger data type: the BIGINT, but unfortunately you cannot <a href="http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html" rel="nofollow"><code>CAST()</c...
Apple Java source code available <p>Is the source code for the Java shipped with Mac OS X available anywhere (official)? I know that the Sun implementation is GPL nowadays.</p>
<p>No, it is not. While Sun has released the JVM under the GPL, they own the copyrights so they can (and do) license to other parties under other terms. Apple has been shipping the JVM (based on Sun's code) for over a decade, since well before it was GPLed, so they clearly originally licensed it under some other terms....
current directory doesn't appear in title bar when running under screen <p>My xterm <code>$prompt</code> variable in my <code>.tcshrc</code> is:</p> <pre><code>set prompt="<b><i>%{\033]0;%m:%~\007%}</b></i>%{^[[;37;1m%}%B%{^[[;34;1m%}%m%{^[[;34;1m%}:%b%c%# "</code></pre> <p>The <strong><em>highlighted</em></strong> p...
<p>I think there is no direct way, because of the way screen works. However screen can display its own status bar, that you can define in .screenrc. Here's mine for instance :</p> <pre><code>hardstatus alwayslastline hardstatus string '%{= kG}[ %{G}%H %{g}][%=%{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%...
DB2 web OLAP Viewer <p>Does anybody know of a web based something that would allow end users to interact (change selection) for an OLAP cube on DB2</p>
<p>I've tried DB2 AlphaBlox once. Check that out.</p>
Known constructs that crash the Delphi IDE <p>I'm using Turbo Explorer 2006 (update 2), and sometimes the IDE crash in a certain unit, specially when I try to use class-completion. The unit (and whole project) are in production and have run fine for years, with daily modifications, it's just the IDE tools that fail.</p...
<p>Googling for [ delphi turbo "class completion" crash ] located <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=43498" rel="nofollow">a bug report with what sounds like the same problem you are seeing</a>. The bug report lists a workaround (&raquo;Change "TTest" to "TButton" and remove the "TButton = class(TTest...
Master Table Information required for the Replication Process <p>In SQL Server 2005 while doing Replication (Snap Shot/ Transactional/ Marge Replication), what are the master tables are used ?</p>
<p>The Master table is used in snapshot replication and contains metadata about the replication, the current state of the snapshot, and rollback information in the event a transaction fails. Normally you can just forget about it, but in certain cases you can (very carefully) modify it directly, and save a lot of time i...
Microsoft Sharepoint Error <p>I am getting the Following Error Could not load file or assembly 'Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format,</p> <p>Though I have added the req...
<p>YOu are trying to use an x86 version of the dll instead of the x64 version or vice versa probably.</p>
Looking for a summary of which version of XSLT is supported in each major browser <p>Does anyone know of a resource which summarises which version of XSLT is supported in different versions of the major browsers?</p>
<blockquote> <p>-- <a href="http://www.w3schools.com/XSL/xsl%5Fbrowsers.asp" rel="nofollow">http://www.w3schools.com/XSL/xsl_browsers.asp</a></p> </blockquote> <p><strong>Mozilla Firefox</strong></p> <p>Firefox 3 supports XML, XSLT, and XPath.</p> <p><strong>Internet Explorer</strong></p> <p>Internet Explorer 6 s...
VBA - Create a new object using the text name of the class <p>Is there a way to set an object to the new instance of a class by using the text name of the class?</p> <p>I will have a library of classes, and depending on some other variable, I want to get one of these classes at runtime.</p> <p>E.g. I have "CTest1", "...
<p>There's no reflection in VBA, so I don't think this is possible. You'd have to do something like the following I'm afraid:</p> <pre><code>Function GetTestClass(lngClassNo as long) as Object Select Case lngClassNo Case 1 Set GetTestClass = New CTest1 Case 2 Set GetTestClass = New CTest2...
How to set the colour of my 1st row in my JTable to yellow(or any colour)? <p>I am able to set one column to yellow but I am unable to set a row to yellow.</p> <p>The following code does it for the column:</p> <pre><code>TableColumn col = mytable.getColumnModel().getColumn(0); col.setCellRenderer(new MyTableCellRend...
<p>what you need to do is generate a custom TableCellRenderer. see <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#renderer" rel="nofollow">this tutorial</a> for detail. your renderer will need to test the row index that is passed in and determine whether it is row 0 or not.</p> <pre><...
Avoiding control paint spam (during the heavy update of treeview, listview controls) <p>I've got an application which adds 10+ items to a treelist every second. This causing the control and UI to unresponsive and sometimes can't even paint it enough, also consumes a lot of CPU.</p> <p>These new items coming from diffe...
<p>Since the new Items come from different threads you already need Control.Invoke , you might as well batch that. So push your items in a Queue, and on the main thread poll that queue (using a Timer probably) and add a batch of Items in a BeginUpdate/EndUpdate block. The Timer interval will let you configure responsiv...