input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
usecase diagram <p>I am designing a use case diagram for a system that includes a special type of hardware/device that generates multiple events for it self. How do i draw a Use case diagram for those system generated events or how will i proceed with the diagram.</p>
<p>Abdul Khaliq</p>
| <p>I don't think I would use a use case diagram at all in this case. The special device is a part of the system, and use cases are best at showing interactions with the system from outside, typically from human users.</p>
<p>To expand a little, consider a desktop application that uses a timer (analagous to your " spec... |
Indexing databases <p>if we make an index on the primary key of a table how would it increase performance ,,,,as if the desired record afer creating the index might turn up in the end of the index list!!</p>
| <p>I think you're mistaken in your understanding of how indexes work. They're not lists.</p>
<p>For introductory reading on indexes, see the <a href="http://en.wikipedia.org/wiki/Index%5F%28database%29" rel="nofollow">Wikipedia article</a>.</p>
|
Can Qt Creator in Linux create executables for Windows? <p>Can I create executables for Windows using Qt Creator in Linux? Or would I have to use a cross-compiler?</p>
<p>I'm guessing Qt Creator in Linux has an option to build code for Windows. If I'm wrong, please correct me.</p>
| <p>Qt Creator is just an IDE it does not necessarily come with a compiler, though it can be set up to use various compilers like the GCC or a cross compiler. </p>
<p>You can compile applications for windows on linux using a cross compiler. One such cross compiler is the <a href="http://www.mingw.org/" rel="nofollow"... |
XML to Relational with DB2 and Java (and Hibernate?) <p>What I have here is a bunch of XML-Files containing data and a nice ER-Model to which the data belongs. What my problem is: I need to get this data into a db2. The tables with all necessary attributes and keys are already created.
I was thinking of three different... | <p>Number 3 all the way. You talk about using reflection to create the objects from the XML. have you looked at using jibx to map the xml to your object model.</p>
<p>What you just described is used a lot in STP systems to map xml from other sources into downstream systems.</p>
<p><a href="http://jibx.sourceforge.net... |
How do I bind a StackPanel to my ViewModel? <p>In my view I have this:</p>
<pre><code><TextBlock Text="{Binding Title}"/>
</code></pre>
<p>which binds to my ViewModel's Title property and <strong>this is straightforward and works well</strong>:</p>
<pre><code>private string _title;
public string Title
{
ge... | <p>Firstly, don't. Instead of dictating the UI from your VM, you should be dictating data (the model). In other words, the property type should be <code>ObservableCollection<FormField></code>. Then your view would bind as follows:</p>
<pre><code><ItemsControl ItemsSource="{Binding FormFields}">
<Ite... |
Applying square bullets in css affects numbers <p>When I use this in my css to achieve square bullets:</p>
<pre><code>li { list-style-type: square; }
</code></pre>
<p>it affects all numbered lists as well, as they both use <code><li></code></p>
<p>The context is within a sharepoint richhtmlfield control.</p>
... | <p>You can specify the parent of the <code><li></code>s to apply the styles to, thus only affecting unordered lists (<code><ul></code>):</p>
<pre><code>ul li { list-style-type: square; }
</code></pre>
|
Problem writing this query in mysql (marking read messages in a forum) <p>Hey. i am writing a forum, and i have this table that marks messages a specific user read:</p>
<pre><code>`read_messages`(`message_id`,`user_id`)
</code></pre>
<p>a simplified version of the messages table:</p>
<pre><code>`messages`(`id`,`foru... | <pre><code>SELECT messages.*, read_messages.id as read_id
FROM messages
LEFT OUTER JOIN read_messages
ON ( messages.id = read_messages.message_id AND read_messages.user_id = [ USER ID ] )
</code></pre>
<p>If <code>read_id</code> is returned as a number > 0 rather than <code>NULL</code>, then the message has bee... |
Using another Controller/view inside the One controller/view by ajax and CakePHP <p>I m having a three controllers in my app:</p>
<ol>
<li>Forms</li>
<li>attributes</li>
<li>Users</li>
</ol>
<p>In my /forms/designpage I'm posting the data as:</p>
<pre><code>$.ajax({
type: "POST",
url: "./attributes/untitledf... | <p>Use something like</p>
<pre><code>// ...
url: "<?php echo $html->url('/controller/action'); ?>",
// ...
</code></pre>
<p>Also, consider using $.post rather than $.ajax</p>
|
how to make file listing using the .bat script <p>I have directory structure:</p>
<pre><code>pakages
|-files.bat
|-component
|-source
|-lib
</code></pre>
<p>I need to make text file using the files.bat script with file listing like this:</p>
<pre><code> File0001=source\WindowT.pas
File0002=source\AWindowT.pas
... | <p>I have cobbled together the following script:</p>
<pre><code>@echo off
setlocal
rem The number of the current file, gets incremented
set FileNumber=1
rem Move into "component" directory, the following "for" command will
pushd %~dp0\component
rem loop over directories there
for /d %%f in (*) do call :process "%%f"
... |
Remoting , Messaging and Data Management in Flex? <p>Can anyone explain me the difference of all and also an another question does Zend AMF support all these.</p>
| <p>Though my answer may not be complete, it'll give you some hints.</p>
<p><strong>Flash Remoting</strong> is a way of doing RPC using AMF protocol. Basicly you implement some server-side services with some methods, call them from your flex application and receive the result (using <a href="http://livedocs.adobe.com/f... |
IE 7, Javascript transparent div onclick <p>Well i have a transparent div or the background is set to transparent :)
css:</p>
<pre><code>#lowerLayer
{
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
background-color: Transparent;
cursor: hel... | <p>I had same problem with IE7 and found easier solution.
Instead making your div transparent using css use javascript to set it's opacity.</p>
<p>Following your example:</p>
<p>css style </p>
<p><code>#lowerLayer {<br>
position: fixed;<br>
top: 0px;<br>
left: 0px;<br>
width: 100%;<br>
... |
Creating a shared HSQLDB database <p>In-process HSQLDB database are not expected to be opened by others, even for file-based storage.</p>
<p>The documentation hints that this is possible: <a href="http://hsqldb.org/doc/guide/ch01.html#N1013D">Server Modes</a>, <a href="http://hsqldb.org/doc/guide/ch04.html">Advanced T... | <p>The following works for me:</p>
<ol>
<li><p>Start a server from your code, which is shown in the org.hsqldb.test.TestBase code in the HSQLDB source code. Something like:</p>
<pre><code>Server server = new Server();
server.setDatabaseName(0, "test");
server.setDatabasePath(0, "file:/path/to/db");
server.start();
</... |
Speed up the enabling/disabling of controls (C# WinForms) <p>I have a recursive method on the base form that takes in a control and an enabled flag. It goes through every control on the form and based on what the control type is, it sets the background colour of the control accordingly and sets the enabled property to ... | <p>Enclose the modification in:</p>
<pre><code>form.SuspendLayout();
</code></pre>
<p>and</p>
<pre><code>form.ResumeLayout(false); // read the doc about "false", might be a little unsafe
</code></pre>
<p>Also, traversing the control hierarchy might be time consuming. You could do that once and cache them in a list ... |
Useful and unuseful real life development techniques <p>I work on a medium/large company that follows what I think are some good practices for development, maybe not the best ones but good enough.</p>
<p>We've some development resource that get implemented on the basis of "do, test, if it useful the use, else throw aw... | <p>One of the most useful things we introduced was a project Wiki, an extremely useful dumping ground for all the little titbits of information floating around in peoples head but too trivial to record in a full document.</p>
|
SilverLight file upload? <p>I would like to upload file from the client to the server with a Front End in SilverLight.</p>
<p>My problem is that the file is NOT in the isolation storage (that would be easy!).</p>
<p>The application in few word require to upload images from the user computer similar to the file upload... | <p>If you don't want to use the open file dialog, then I would say that there are no way, if there were, it would be a bug - a security hole in the sandbox.</p>
|
Configure Eclipse to run my FlexUnit tests automatically <p>I'd like to set up my projects in Eclipse to run FlexUnit tests everytime I save my work.</p>
<p>I found an example with JUnit here : <a href="http://misko.hevery.com/2009/05/07/configure-your-ide-to-run-your-tests-automatically/" rel="nofollow">http://misko.... | <p>Try using Flex Builder 4 beta, it has unit testing integration built in.</p>
|
Best setup for Linux development from Windows? <p>What's the best setup for developing Linux apps from a Windows workstation? Right now I'm connected via SSH to our Linux development server and am using Eclipse, forwarded over SSH via PuTTY, to the public domain version of Xming running on my Windows workstation. It ... | <p>Options for Linux on Windows:</p>
<p><strong>Tools Only</strong></p>
<p>Given you're using Eclipse I'm going to assume you want a full IDE, but if you can get by with just the GNU/Linux tools, there are a few choices.</p>
<ul>
<li><a href="http://www.cygwin.com/">cygwin</a> gives you a bash shell with lots of too... |
wcf return an XmlDocument? <blockquote>
<p>Duplicate: <a href="http://stackoverflow.com/questions/935080/serializing-generic-xml-data-across-wcf-web-service-requests">serializing-generic-xml-data-across-wcf-web-service-requests</a></p>
</blockquote>
<p>I have a WCF service where Im building up a block of XML using a... | <p>If you are using .Net 3.5 then you can try returning <a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xelement.aspx">XElement</a> instead - this implements <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializable.aspx">IXmlSerializable</a>, which is the missing ingre... |
ASP.NET video and audio handler <p>I am using ASP.NET's "handler" to show images in an application. I need to play files of audio and video like I do with the image: I recover it from database and show it on an aspx page. Can I create a "handler" for the video and the audio? I don't want that a dialog box is opened ask... | <p>It consists of two parts. </p>
<ol>
<li>A handler or something that streams the video under the hood.</li>
<li>A client (can be implemented in Silverlight or Flash) that's on an standard HTML page that fetches the video from the handler and displays it.</li>
</ol>
|
Add file using SharpSVN <p>I would like to add all unversioned files under a directory to SVN using SharpSVN.</p>
<p>I tried regular svn commands on the command line first:</p>
<pre><code>C:\temp\CheckoutDir> svn status -v
</code></pre>
<p>I see all subdirs, all the files that are already checked in, a few new fi... | <p>Use this my tool <a href="http://svncompletesync.codeplex.com/">http://svncompletesync.codeplex.com/</a> or take it as a sample.
It does exactly what you need.</p>
|
Is JavaScript an untyped language? <p>I've found that some people call JavaScript a "dynamically, weakly typed" language, but some even say "untyped"? Which is it really?</p>
| <p>JavaScript <strong>is</strong> untyped:</p>
<p><img src="http://no.gd/p/untyped-20120205-235300.jpg" alt=""></p>
<p>Even Brendan Eich says so. On Twitter, he replied to a thread that linked to this question:</p>
<blockquote>
<p><a href="https://twitter.com/brendaneich/status/166310376340848643">... academic typ... |
Is it possible to reasonably workaround an antivirus scanning the working directory? <p>My Win32 application performs numerous disk operations in a designated temporary folder while functioning, and seriously redesigning it is out of the question.</p>
<p>Some clients have antivirus software that scans the same tempora... | <p>A virusscanner that locks files while it's scanning them is quite bad. Clients who have virusscanners this bad need to have their brains replaced... ;-)</p>
<p>Okay, enough ranting. If a file is locked by some other process then you can use a "try again" strategy like you suggest. OTOH, do you really need to close ... |
SQL Server Client App <p>I'm designing a database for internal use at my company that will store data that is produced by my team members. While SQL Server will be installed only on a single server machine, my team members will need to be able to access the data and run filter/select queries on it from their own termin... | <p>You answered yourself: SQL Management Studio Express Edition is the right tool for the job. Then if you need to restrict some access use the same tool as DBO and create the logins you need with the specific access restrictions to databases or objects involved in the project.</p>
<p>Just one detail, with SQL Managem... |
NotSupportedException when creating button with .NET CF on CE5 device? <p>I have an application that runs well on WinCE and WM devices (all that I have tested so far).
I have just received a new device to test on and the Form throws a NotSupportedException when the designer creates a button on the device.</p>
<p>The d... | <p>You are probably using Smartphone (Standard) SDK, which doesn't support Buttons.</p>
<p>See also this <a href="http://stackoverflow.com/questions/286286/windows-mobile-5-sdk-button-control">question</a>.</p>
|
Jquery: ajax post and encoding <p>I am unable to understand why I can't get a correct ISO-8859-1 charstet from the server answer. Being this a work on legacy code, i hardly could change charset encoding on the pages.</p>
<p>I make use of the JQuery call</p>
<pre><code>$.post("server-side-code", {t:ctext, i:ioff, sid:... | <p>I have a better solution now. Both post and get works PERFECTLY.
I'm working over tomcat who by default handle ISO 8859 stuff.</p>
<p>Web page properties:</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
</code></pre>
<p>charset of the web... |
Python - simple reading lines from a pipe <p>I'm trying to read lines from a pipe and process them, but I'm doing something silly and I can't figure out what. The producer is going to keep producing lines indefinitely, like this:</p>
<p>producer.py</p>
<pre><code>import time
while True:
print 'Data'
time.sle... | <p>Some old versions of Windows simulated pipes through files (so they were prone to such problems), but that hasn't been a problem in 10+ years. Try adding a</p>
<pre><code> sys.stdout.flush()
</code></pre>
<p>to the producer after the <code>print</code>, and also try to make the producer's stdout unbuffered (by u... |
In Java switch statements on enums, why am I getting a compilation error when I qualify my values in each case? <p>I have a switch statement in Java, on an Enum which let us call IMyInterface.MyEnum</p>
<p>Each of my case statements has the form:
IMyInterface.MyEnum.MyValue, (though I could drop the IMyInterface if I ... | <p>From the JLS:</p>
<blockquote>
<p>(One reason for requiring inlining of constants is that switch statements require constants on each case, and no two such constant values may be the same. The compiler checks for duplicate constant values in a switch statement at compile time; the class file format does not do sy... |
Developer tool for configuring IIS6 <p>edit: <strong>IIS6</strong>; I'm not sure IIS7 is an option in the immediate future...</p>
<p>From a developer angle, I am constantly changing my IIS settings, or need to merge settings from other teams into different VMs. The "Save Configuration to Disk" has never really worked ... | <p>I can think of three options off the top of my head...</p>
<ol>
<li>Powershell snap-in.</li>
<li>the AdsUtil.vbs (located in C:\Inetpub\AdminScripts by default) will enable you to script those tasks into a batch file, or you could even call it from powershell if you don't have the time to invest learning the WMI in... |
ASP .NET AJAX: UpdatePanel uploads entire page on postback? <p>Can someone explain how UpdatePanel works ?
What is uploaded when UpdatePanel make a postback ?</p>
<p>I know how to update partial content, but how about uploading only a part of the page ?</p>
<p><strong>It's not about UploadFile control, it's about pos... | <p>When an update panel is refreshed on the client, the POST request sends back the same data that would occur for a normal postback. On the server the request will run through it's normal lifecycle with the difference that render will only be called on controls that are children of update panels that are being update... |
What would cause NHibernate to return an invalid identity selection when using JET? <p>Our application (sadly) uses an MDB back-end database (I.e. JET engine).</p>
<p>One of the items being persisted to the database is an "event" object. The object is persisted to a table with an ID (EventLogID) that is an Autonumber ... | <p>It could be that the default 'connection-release-mode' configuration setting is the cause of the problems.</p>
<p>A while ago, I ran into a similar issue, and I found that changing the connection.release-mode to 'on_close' (instead of the default after_transaction) solved the issue.</p>
<p>More information can be ... |
Access Hotmail Unread Mail Count via Java <p>I want to write an application using Java6 that can check a users Hotmail inbox for the 'unread message count'!</p>
<p>There is a <a href="http://msdn.microsoft.com/en-us/library/microsoft.live.messenger.mailbox.inboxunreadcount.aspx" rel="nofollow">Javascript API</a> but I... | <p>Unfortunately, <a href="http://social.msdn.microsoft.com/Forums/en-US/liveframework/thread/c30c126f-14a7-4a94-b0b0-f9517ec97f53" rel="nofollow">this similar question on msdn</a> suggests this is impossible</p>
<p>EDIT:</p>
<p>All I can offer is a half-solution. You could create the html page containing the script ... |
Can I have a Switch Statement with more than one Case Criteria? <p>Can I have a switch statement like this:</p>
<p>...</p>
<pre><code>switch (temp)
{
case "NW" or "New":
temp = "new stuff"
break;
}
</code></pre>
<p>...</p>
| <p>No, but you can use (at least in Java)</p>
<pre><code>switch (temp) {
case "NW":
case "New":
temp="new stuff";
break;
}
</code></pre>
|
How should I create my DES key? Why is an 7-character string not enough? <p>I'm having a bit of difficulty getting an understand of key length requirements in cryptography. I'm currently using DES which I believe is 56 bits... now, by converting an 8 character password to a <code>byte[]</code> my cryptography works. If... | <p>DES uses a 56-bit key: 8 bytes where one bit in each byte is a parity bit.</p>
<p>In general, however, it is recommended to use an accepted, well-known key derivation algorithm to convert a text password to a symmetric cipher key, regardless of the algorithm.</p>
<p>The PBKDF2 algorithm described in PKCS #5 (<a hr... |
Complex Object in JAX-WS is created empty <p>I'm testing JAX-WS to access the Oracle IRM web serviecs. I can get it to work just fine with AXIS so this isn't an Oracle problem.</p>
<p>What's happening is that I'm getting the following error when making the call:</p>
<pre><code>Expected xsd:anyType - unknown type pro... | <p>Despite the Oracle IRM documentation stating that BrowseAccounts accepts either a LicenseServer object or a Context object for the owner parameter it actually accepts an LicenseServer_ref.</p>
<p><B>EDIT</B>
Further, I was running JAX-WS under JDK 1.6.0 which is a lower version than JDK 1.6.0_14. The new version ... |
Simple Edit/Update actions using LINQ. Isn't my code a bit wrong? <p>Consider a simple Edit/Update code:</p>
<pre><code>public ActionResult Edit(int id)
{
return View(db.Foos.Single(x => x.Id == id));
}
public ActionResult Update(Foo changed)
{
Foo foo = db.Foos.Single(x => x.Id == changed.Id);
foo.... | <p>This is Linq checking for database concurrency. You can suppress this behavior by setting this attribute on your columns:</p>
<pre><code>[Column(... UpdateCheck=UpdateCheck.Never)]
</code></pre>
<p>More details here: <a href="http://msdn.microsoft.com/en-us/library/bb399373.aspx" rel="nofollow">http://msdn.microso... |
C# generics syntax for multiple type parameter constraints <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/588643/generic-methods-and-multiple-constraints">Generic methods and multiple constraints</a> </p>
</blockquote>
<p>I need a generic function that has t... | <pre><code>void foo<TOne, TTwo>()
where TOne : BaseOne
where TTwo : BaseTwo
</code></pre>
<p>More info here:<br />
<a href="http://msdn.microsoft.com/en-us/library/d5x73970.aspx">http://msdn.microsoft.com/en-us/library/d5x73970.aspx</a></p>
|
http post headers <p>When I post some headers in a request and view them on on the receiving page, most of them are prefixed with "HTTP_" except for a few like [CONTENT_TYPE] => text/xml [CONTENT_LENGTH] => 8647. </p>
<p>When I post my own headers (which are required for an external server) they then get prefixed e.g.... | <p>If you're using a CGI script to test, then it's the web server that's adding the HTTP_ prefix. Don't worry - that prefix is almost certainly not present on the network. You could use <a href="http://www.xhaus.com/headers" rel="nofollow">http://www.xhaus.com/headers</a> to check.</p>
|
In GWT, what does the "[...].java' is removed due to invalid reference(s)" mean? <p>I have converted a GWT Eclipse based project to GWT-Maven but when I run the command</p>
<pre><code>mvn clean gwt:compile
</code></pre>
<p>I get an awful lot of errors that specify:</p>
<pre><code>[class name].java' is removed due to... | <p>That's because the removed class refers to a method that is implemented as part of the GWT
JRE emulation library :</p>
<p><a href="http://library.igcar.gov.in/readit2007/tutori/tools/gwt-windows-1.4.10/doc/html/jre.html" rel="nofollow">http://library.igcar.gov.in/readit2007/tutori/tools/gwt-windows-1.4.10/doc/html... |
WPF: Are 'automatic' animations possible? <p>I have an ItemsControl that shows items using DataTemplates. When certain properties of the items change, I would like the changes to appear animated in the ItemsControl. For instance, an item has a Thickness and a Color and when these properties change, I would like to show... | <p>I think you could do this through using a Trigger's <a href="http://msdn.microsoft.com/en-us/library/system.windows.triggerbase.enteractions.aspx" rel="nofollow">EnterActions</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.triggerbase.exitactions.aspx" rel="nofollow">ExitActions</a>.<br />
Yo... |
Java optional parameters <p>How do I use optional parameters in Java? What specification supports optional parameters?</p>
| <p>There are several ways to simulate optional parameters in Java:</p>
<ol>
<li><p><strong>Method overloading.</strong></p>
<pre><code>void foo(String a, Integer b) {
//...
}
void foo(String a) {
foo(a, 0); // here, 0 is a default value for b
}
foo("a", 2);
foo("a");
</code></pre>
<p>One of the limitations... |
C Preprocessor testing definedness of multiple macros <p>I searched the site but did not find the answer I was looking for so here is a really quick question.</p>
<p>I am trying to do something like that :</p>
<pre><code>#ifdef _WIN32 || _WIN64
#include <conio.h>
#endif
</code></pre>
<p>How can I do such ... | <p>Try:</p>
<pre><code>#if defined(_WIN32) || defined(_WIN64)
// do stuff
#endif
</code></pre>
<p>The <a href="http://tigcc.ticalc.org/doc/cpp.html#SEC38a%5F">defined</a> macro tests whether or not a name is defined and lets you apply logical operators to the result.</p>
|
Selecting GUI on windows (wxPy vs pyQt) <p>We are planning to develop an application for monitoring and configuring our service (which is running on remote server). After long time of discussion, we decided for python as platform for our app, because we love and know python. But we don't know, what GUI toolkit preferre... | <p>I choose wxPython after much research. The reasons were:</p>
<ul>
<li>"wxPython in Action" book by Rappin & Dunn</li>
<li>The voluminous examples that come as part of the wxPython download</li>
<li>The number of projects that have used wxWidgets</li>
<li>The fact that wxPython code runs equally well on Linux, ... |
column order problem in dataGridViews in C# <p>I fill the dataGrid by binding a dataSet to the grid, with aDataGridView.dataSource = aDataSet.aTableName, when I trace the code after using this function, all of the column indexes are reset to 0,
what can I do? how can I find new real indexes? can I use a different funct... | <p>Set dataGridView1.AutoGenerateColumns = false; before assigning the DataSource.</p>
|
How can I write a real time chat using XAJAX and PHP? <p>How can I write a real time chat using XAJAX and PHP?</p>
<p>In other words, is there a way to send xajax responses from the server to multiple clients?
Or is the only possibility to check for new messages every few seconds on client side?</p>
| <p>No. Clients must "poll" the server repeatadly.</p>
<p>I think the key here is to think interaction design. The trick is to fool the user into thinking that the chat is instant, but when in reality it updates once every 1 or 2 or 3 or 10 seconds.</p>
<p>Ideas:</p>
<p>1) When the user sends a message, show it direc... |
Will a standard book on ruby on rails work if I am using jRuby? <p>I will have to use JDBC with an old database, which I why I selected jRuby. If I get a book on ruby on rails that does not include jRuby information, will that be benficial to me?</p>
| <p>Yes it will. Jruby is just another Ruby implementation, so pretty much everything that works in regular Ruby will work in Jruby as well. They have worked very hard at getting rails to run really well with Jruby While there are some gems that currently will not run in jruby, a Ruby On Rails book will definitely be... |
JSF <c:if> with different object type <p>I'm trying to compare two different object in JSF.
A String and an Integer, of cours it don't work...</p>
<p>//myVar ==> Integer <b>object</b><br />
//myVar2 ==> String</p>
<pre><code><c:if test="${myVar == myVar2}">
YES!!!!!!!!
</c:if>
</code></pre>
<p>I try wit... | <blockquote>
<p>I'm trying to compare two different object in JSF. A String and an Integer, of cours it don't work...</p>
</blockquote>
<p>That does not sound right - I would check the values. For the bean:</p>
<pre><code>public class CoercedBean {
public int getValueAsInt() {
return 123;
}
public Strin... |
How to produce range with step n in bash? (generate a sequence of numbers with increments) <p>The way to iterate over a range in bash is</p>
<pre><code>for i in {0..10}; do echo $i; done
</code></pre>
<p>What would be the syntax for iterating over the sequence with a step? Say, I would like to get only even number in... | <p>I'd do</p>
<pre><code>for i in `seq 0 2 10`; do echo $i; done
</code></pre>
<p>(though of course <code>seq 0 2 10</code> will produce the same output on its own).</p>
<p>Note that <code>seq</code> allows floating-point numbers (e.g., <code>seq .5 .25 3.5</code>) but bash's brace expansion only allows integers.</p... |
Are Common Table Expression's (CTE) available in SQL Server 2000 <p>I recently found the following article: </p>
<p><a href="http://www.tsqltutorials.com/with-common-table-expressions.php">http://www.tsqltutorials.com/with-common-table-expressions.php</a></p>
<p>The article doesn't list which version of SQL server th... | <p>Common table expressions were introduced in SQL Server 2005.</p>
<p><a href="http://www.simple-talk.com/sql/sql-server-2005/sql-server-2005-common-table-expressions/">http://www.simple-talk.com/sql/sql-server-2005/sql-server-2005-common-table-expressions/</a></p>
|
ActionScript 3 multiple instance, same name, question <p>I'm trying to create a grid where the users can 'draw' across it and change the colors of the grid squares to a chosen color.</p>
<p>In this code, I'm creating the grid with squares. I've got the functionality 'working', but it's only working on the last square ... | <p>Can't say I've ever used AS but.. shouldn't you add the listener inside the for? You're overwriting <code>colorBox</code> with every iteration so at the end only the last one will be referenced by it (this is where i would rant that it even compiles, since colorBox seems accesible out of scope; the C programmer in m... |
ActionScript Project to AIR Application? <p>I'm not using the Flex libraries or anything from Flash. I'm developing a pure AS3 project in Flexbuilder which I would like to deploy as an AIR application.</p>
<p>What are my options? What's easiest? I'm having trouble finding a straight answer here.</p>
| <blockquote>
<p>That runs, but shows nothing... for
some reason this doesn't automatically
instantiate a native window.</p>
</blockquote>
<p>rather than creating a new window that doesn't represent your main application, simply call <code>stage.nativeWindow.activate();</code> in your main application class.</p>
|
What exactly is the last part of the address in WCF? <p>When specifying an address as part of an endpoint, the format is:</p>
<p><a href="http://localhost:8080/MyWCFService" rel="nofollow">http://localhost:8080/MyWCFService</a> or net.tcp://localhost:8080/MyWCFService</p>
<p>The guidance (in books, MSDN etc) states t... | <p><code>/MyWCFService</code> is the virtual directory in ASP.NET. You'd probably have something like
<code>/MyWCFService/SomeService.svc</code> in your solution or project.</p>
|
Lotus Notes - scripting the creation of design element <p>I have a Lotus Notes application which actually consists of a template with all the required forms, views and agents needed. It also requires some design elements (a custom form and a view for our own type of documents) from this template to be copied over to th... | <p>That sounds doable with DXL, and I think you can use both LotusScript and Java to accomplish it. </p>
<p>Something along the lines of this should do it in Java:</p>
<pre><code>public class RenderDesign extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentCont... |
How should I implement User Stories in Bugzilla? <p>A few individuals at my work have come together to form a group whose goal is to analyze the benefits of implementing some Agile software development / project management principles.</p>
<p>As a developer, I see great benefit in User Stories. We're looking to put to... | <p>I've done similar things before in Bugzilla, and the solution I found was not to implement hierarchical "story bugs" or the like; we decided as well that that would cause confusion and was simply too complicated for what we wanted. The solution I've used before was simply to put the User Story number in the descrip... |
Access URL of IFrame site <blockquote>
<p><strong>Possible Duplicate:</strong><br />
<a href="http://stackoverflow.com/questions/44359/how-do-i-get-the-current-location-of-an-iframe">How do I get the current location of an iframe?</a> </p>
</blockquote>
<p>Hi,</p>
<p>How can I get the URL of the page inside my i... | <p>Duplicate of: <a href="http://stackoverflow.com/questions/44359/how-do-i-get-the-current-location-of-an-iframe">http://stackoverflow.com/questions/44359/how-do-i-get-the-current-location-of-an-ifram</a>e
And here you have several tutorial how to work with <a href="http://www.dyn-web.com/tutorials/iframes/" rel="nofo... |
Multidimensional Data Structure in C# <p>I want to build a data structure which is basically a matrix of strings with the following.</p>
<ol>
<li>A growable no of rows</li>
<li>A FIXED no of columns</li>
</ol>
<p>I want to be able to get at whatever is in a particular row or column via a method call that takes the an... | <p>The <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx" rel="nofollow">DataTable</a> and the DataSet (basically a collection of data tables) would work fine for what you are looking for.</p>
<p>You could then access your data (once you set up the columns and added your rows of data) via the... |
WPF databinding binding error notification <p>OK, working on WPF(using MVVM) and came across a question, want some input. I have a simple class</p>
<p>like below(assume I have IDataErrorInfo implemented):</p>
<pre><code>public class SimpleClassViewModel
{
DataModel Model {get;set;}
public int Fee {get { return Mo... | <p>This can be done using a ValueConverter:</p>
<pre><code>using System.Windows.Data;
namespace MyNameSpace
{
class IntToStringConverter:IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((int) value).ToString();
... |
NHibernate Aggregate Traversal (C#) <p>My application has a very simple model right now and I'm trying to find the best way to traverse through an aggregate. As you can see in my model diagram at the bottom, I have an account, a trip and a list of people attending a trip. I would like to be able to view all of the trip... | <p>Im not supprised this doesn't feel right to you, it not. Infact it's so wrong it hurts!But instead of just just giving you grief ill explain all the reason why this is wrong@</p>
<p>Firstly, your load in ALL the trips into memory from the database, this essentially means you are querying a data store to get a whole... |
Flex 3 TileList Drag/Drop/Re-order Exception. How do I rearrange tiles? <p>Iâm in need of some dire help here. I'm writing an application in Flex 3 that utilizes a TileList with a custom itemRenderer to display info from a service. Unfortunately, I'm running into an exception with the drag/drop/rearrange portion of... | <pre><code>ArgumentError: Error #2004: One of the parameters is invalid.
</code></pre>
<p>Is one of those "can be whatever" messages ;(</p>
<p>I remember I had it not to long ago, misspelled some function and Eclipse compiled just fine even though it shouldn't have..(a restart of eclipse helped here, but it took me ... |
Is there a way to extract a custom request header with cgicc <p>I am using <a href="http://www.gnu.org/software/cgicc/doc/lib%5Foverview.html" rel="nofollow">Cgicc</a> , which has some methods to extract specific request headers, e.g. getUserAgent would return "User-Agent" header.</p>
<p>Is there a generic method that... | <p>No, cgicc does not support this direcly. However, it is just a wrapper around CGI. <a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface" rel="nofollow">http://en.wikipedia.org/wiki/Common_Gateway_Interface</a> and it uses "getenv" in CgiInput
class to extract all information provided by the web server.</p>... |
Is there a way to get IE to render CYMK images <p>I put images on our website that were very nice in Firefox and little red x's in IE. I understand that IE wants only RGB and I could convert my images. In fact I tried it out. The issue is that the images get dulled down, look dead in RGB. I'm hoping that there is s... | <p>I do not believe you can get IE to render CMYK encoded images. To avoid manually changing them, you could put a filter on the site to automatically convert them but I would assume that the quality would suffer. </p>
<p>CMYK encoding is typcally used for print, which as quality requirements that are overkill for t... |
Mythical man month 10 lines per developer day - how close on large projects? <p>Everybody always says that they can beat the "10 lines per developer per day" from the "Mythical Man Month", and starting a project, I can usually get a couple hundred lines in in a day.</p>
<p>But at my previous employer, all the develope... | <p>On one of my current projects, in some modules, I am proud to have contributed a negative line count to the code base. Identifying which areas of code have grown <em>unnecessary</em> complexity and can be simplified with a cleaner and clearer design is a useful skill.</p>
<p>Of course some problems are inherently c... |
Ruby scripting - Telnet Hangs During Login <p>I am trying to do some basic scripting using ruby to log in to a windows machine via telnet and pull some files over using the dos command line ftp. When I do this manually everything goes swimmingly but when I try it via ruby I'm getting an error in the login call.</p>
<... | <p>I think the prompt field needs to <em>be</em> a regexp, not a string
Try </p>
<pre><code>tn = Net::Telnet::new("Host"=>"xxx.xxx.xxx.xxx", "Timeout"=>25,
"Output_log"=>"output_log.log", "Dump_log"=> "dump_log.log",
"Prompt"=> /C:.*>/)
</code></pre>
|
wpf toolkit data grid <p>hello i'm building a wpf app with data grids,
the pattern is model view view model.</p>
<p>all og my screens contains a contentcontrol, and i just assign him the view model, that have a suitable data template,</p>
<p>anyway, my problem is with combo box column, the data context is the present... | <p>I'm using another datagrid, but it might be similar. The way i did it was like that:</p>
<p>in the XAML, i defined an ObjectDataProvider in the resources:</p>
<pre><code><ObjectDataProvider x:Key="VM" ObjectInstance="{x:Null}" x:Name="vm"/>
</code></pre>
<p>then after assigning the DataContext (either the c... |
What does -fPIC mean when building a shared library? <p>I know the '<code>-fPIC</code>' option has something to do with resolving addresses and independence between individual modules, but I'm not sure what it really means. Can you explain?</p>
| <p>PIC stands for Position Independent Code</p>
<p>and to quote <code>man gcc</code>:</p>
<blockquote>
<p>If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table. This option makes a difference on the m68k, Power... |
Can I use a wordpress theme in new php pages? <p>I'm putting together a web site that needed to include some signup and blogging capability. Wordpress seems to be a perfect fit for that portion of the app, so I've started experimenting with it. I see plenty of tutorials on creating custom themes so I don't expect tha... | <p><em>Generally</em>, "yes". </p>
<p>A well-designed WordPress theme uses mostly CSS/Stylesheets for display, and you are correct in your assumptions: Look through the "Codex" about Theme Design / Template Design (<a href="http://codex.wordpress.org/Stepping_Into_Templates" rel="nofollow">http://codex.wordpress.org/S... |
What is best approach of joining 2 tables from different Database? <p>What is best approach of joining 2 tables from different Database? In my situation, I have a development database that has postfix such as _DEV while on the production has _PROD.</p>
<p>The issue is that if I join these 2 tables I have to reference ... | <p>You can use <strong><a href="http://msdn.microsoft.com/en-us/library/ms187760%28SQL.90%29.aspx" rel="nofollow">Synonyms</a></strong> to simplify your queries. For example:</p>
<pre><code>-- Create a synonym for the Product table in AdventureWorks.
USE tempdb;
GO
CREATE SYNONYM MyProduct
FOR AdventureWorks.Productio... |
Is there a way to avoid the additional cast List<T> into MyOwnCollection : List<T> in C#? <p>Is there any way for me to avoid the additional cast when I cast a <code>List<T></code> to my own collection, which is nothing but a derivate of <code>List<T></code>?</p>
<p><hr /></p>
<h3>Example:</h3>
<p><code>... | <p>This isn't possible and in fact, your cast is wrong too. Just because <code>ScreenCollection</code> derives from <code>List<Screen></code> doesn't mean every <code>List<Screen></code> instance also implements <code>ScreenCollection</code>.</p>
<p>.NET 4.0 and C#4 will provide contravariance and covarian... |
Disable Google Toolbar Autocomplete in IE and FF <p>Although an <a href="http://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field">Autocomplete question</a> was asked last year, I wanted to see if there was a solution that worked in both IE and FF that disabled the Google Toolba... | <p>Force the user to uninstall Google Toolbar.</p>
<p>How you can do that, I'm not sure.</p>
|
Get a value of a variable dynamically in SQL Server SP <p>Is there a way to get a value of a local variable specified by its name dynamically in SQL Server SP?</p>
<pre><code>declare @foo int
declare @bar int
declare @variable_name varchar(10)
set @variable_name = '@foo'
print -- magic happens here - how to print th... | <p>Technically this is possible by passing all local variables to sp_executesql:</p>
<pre><code>declare @foo int
declare @bar int
declare @variable_name varchar(10)
set @variable_name = '@foo'
set @foo = 1;
set @bar = 2;
declare @sql nvarchar(max);
set @sql = N'SELECT ' + @variable_name;
exec sp_executesql @sql, N'@... |
Are sequential numbers necessary? <p>I am working on a winform (.NET) application which includes Orders, Invoices, Service Orders, Ticketing etc.</p>
<p>It it necessary for these enities to be sequential when numbering their IDs? IMO no. Take an order for instance, it can only be valid once it passes thorugh the busin... | <p>You only need to have sequential ids if it is a valid business requirement.</p>
|
How to partially migrate a database to a new system over time? <p>We are in the process of a multi-year project where we're building a new system and a new database to eventually replace the old system and database. The users are using the new and old systems as we're changing them. </p>
<p>The problem we keep running... | <p>You can use linked server queries to leave the data where it is, but connect to it from the other db.</p>
<p>Depending on how up-to-date the data in each db needs to be & if one data source can remain read-only you can:</p>
<ol>
<li>Use the Database Copy Wizard to create an SSIS package
that you can run period... |
Can I redefine an XSD Schema to change the maxOccurs attribute of a child of a type? <p>I am trying to extend an XML schema to change the number of times a child can occur under an element.</p>
<p>In the original schema, the parent type is defined as such:</p>
<pre><code><xsd:complexType name="CrimeLineBusiness_Ty... | <p>When you make an extension the content model of the new type is a sequence of the content model of the base and whatever you add in your new type. For example in your case the content model for the redefined CrimeLineBusiness_Type type is</p>
<pre><code><xsd:sequence>
<xsd:sequence>
<xsd:elemen... |
Jquery user control <p>I have a problem with jquery not loaded in an asp user control.</p>
<p>I want simply to add the click event when a checkbox is clicked.</p>
<p>Here is my javascript file </p>
<pre><code>$(document).ready(function() {
var arr = jQuery(":checkbox[id*='drpAccountType']");
for (i = 0; i &l... | <p>your script may be getting inserted into the page before the jquery library. (You can verify this by checking the HTML output of your page.)</p>
<p>When script files execute JS inline, and especially when that JS depends on other libraries, it's safest to use <code>RegisterStartupScript</code> rather than <code>Re... |
When to CDATA vs. Escape & Vice Versa? <p>I'm creating XML documents with values fetched from a DB. Occasionally due to a legacy implementation, I'll pullback a value that contains a char that's invalid when not properly escaped (& for example).</p>
<p>So the question becomes, should I CDATA or Escape? Are certain... | <p>CDATA is primarily useful, IMO, for human readability. As far as a machine is concerned, there's no difference between CDATA and escaped text other than the length, at most. Perhaps the escaped version will take a little bit longer to process, but I say <em>perhaps</em>, because this shouldn't be a significant fac... |
Free Text Editor with built-in SVN Support for Windows? <p>I'm looking for a free text editor which has built-in SVN support for Windows, to avoid having to switch to Explorer to do Commits and such. Googling just produces the usual phony sites with lists of products that have nothing to really do with a free text edit... | <p><a href="http://notepad-plus.sourceforge.net/uk/site.htm" rel="nofollow">Notepad++</a> has plugins for <a href="http://www.switchonthecode.com/tech-news/notepadplusplus-subversion-plugin" rel="nofollow">TortiseSVN</a> aswell as an <a href="http://sourceforge.net/project/showfiles.php?group%5Fid=189927&package%5F... |
Are implicity/explicit conversion methods inherited in C#? <p>I'm not sure what I'm doing wrong here. I have a generic class, which is basically a glorified integer, with a few methods for certain string formatting, as well as into/from string and int conversions:</p>
<pre><code>public class Base
{
protected int ... | <p>The reason</p>
<pre><code>Derived d = (int)3;
</code></pre>
<p>does not work is because the type <code>Derived</code> does not exactly match the return value of the operator <code>Base</code> as is required to invoke this operator. Notice that you haven't provided any conversion operators that contain the code <co... |
Crystal Reports 9 Database Connection Issue <p>Crystal Reports 9 seems to save the database connection information inside the report file itself. I am having an issue changing that connection. I work with a team of developers who all have their own copy of a database on the same server. We are using Trusted Connecti... | <p>You could use a .dsn datasource file in a user-specific location (i.e. the same path for every user, but a different physical location) and point Crystal Reports at that. For example, on everyone's C drive: C:\DSNs\db.dsn, or on a network drive that is mapped to a different location for each user.</p>
<p>You can ge... |
Bash date/time arithmetic <p>I have a little Bash script which suspends the computer after a given number of minutes. However, I'd like to extend it to tell me what the time will be when it will be suspended, so I can get a rough idea of how long time I have left so to speak.</p>
<pre><code>#!/bin/sh
let SECS=$1*60
e... | <p>Found out how.</p>
<pre><code>echo "The computer will be suspended at" $(date --date "now $1 minutes")
</code></pre>
|
Creating program libraries in Windows and LINUX [C++] <p>I am planning to use libraries in my C++ program. Development is happening on Linux but application is designed to compile on both Linux and Windows. I understand direct equivalent for shared libraries(.so) in windows is DLL, right? </p>
<p>In Linux using g++, I... | <p>We specify <code>__declspec(dllexport)</code> for class:</p>
<pre><code>#define EXPORT_XX __declspec(dllexport)
class EXPORT_XX A
{
};
</code></pre>
<p>You can then check for platform and only define the macro on windows. E.g.:</p>
<pre><code>#ifdef WIN32
#define EXPORT_XX __declspec(dllexport)
#else
#define EXP... |
What information should I be logging in my web app? <p>I finishing up a web application and I'm trying to implement some logging. I've never seen any good examples of what to log. Is it just exceptions? Are there other things I should be logging? What type of information do you find useful for finding and fixing bugs.<... | <p>Here is my logical breakdown of what can be logged within and application, why you might want to and how you might go about doing it. No matter what I would recommend using a logging framework such as log4net when implementing.</p>
<h2>Exception Logging</h2>
<p>When everything else has failed, this should not. It ... |
java xslt tutorial <p>Can any one suggest good XSLT with java tutorials?</p>
| <p>There are <strong><em>three steps</em></strong> to learning XSLT on Java:</p>
<p><strong><em>1- Pick a XSLT engine.</em></strong> </p>
<p>Each engine is slightly different, but for basic processing any will do. </p>
<p>Xalan has always worked well for me. To get started, all you need to do is download the Xalan... |
Cross Reference TSQL Join <p>Say i have Four tables</p>
<p>1) Studnets:</p>
<ul>
<li>Student_ID</li>
<li>First Name</li>
<li>Last Name</li>
</ul>
<p>2) Contact (Will take the latest item)</p>
<ul>
<li>Contact_ID</li>
<li>Address</li>
<li>ZipCode</li>
<li>DateAdded</li>
</ul>
<p>3) Phone (Will take the last three i... | <pre><code>select
s.Student_ID,
s.FirstName,
s.LastName,
c.Contact_ID,
c.Address,
c.ZipCode,
p.PhoneNumber1,
p.PhoneNumber2,
p.PhoneNumber3
from
Students s
inner join StudentContactRef r on
s.Student_ID = r.StudentID
inner join Contact c on
r.Contact_ID = ... |
Synchronizing two state machines <p>Say, I am building a business process management application. It has the following entities: issues and tasks, related to each other as 1 issue to many tasks. Both, task and issue, have their own states and the state of one may influence the state of another.</p>
<p>For example, bot... | <p>I prefer the observer pattern for this sort of thing: <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="nofollow">http://en.wikipedia.org/wiki/Observer_pattern</a> In the example you gave, I'd have tasks observe their issue and issues observe their tasks. When an issue is marked canceled, the tasks see an... |
Including Browser specific CSS file when JavaScript disabled? <p>I have 2 CSS files for my site, one for all normal browsers and other for the retarded Internet Explorer. I am including either of the CSS file depending on a JavaScript which checks the browser capabilities. What would be the best option in case the user... | <p>you mean </p>
<pre><code><!--[if IE 6]>
</code></pre>
<p>and</p>
<pre><code><![endif]-->
</code></pre>
<p>don't work without javascript?</p>
<p>BTW, here are the first two google search results for "browser specific css":</p>
<ol>
<li><a href="http://www.webmonkey.com/tutorial/Browser-Specific_CSS_... |
changing admin site url <p>Is there a way to change the url to open the admin site in django? I don't want to use the default /admin url. I am new to django so please try giving a bit more detailed information.</p>
| <p>In urls.py, change the line that reads:</p>
<pre><code>(r'^admin/(.*)', admin.site.root),
</code></pre>
<p>to something like:</p>
<pre><code>(r'^new_admin/(.*)', admin.site.root),
</code></pre>
<p>so now instead of <a href="http://example.com/admin" rel="nofollow">http://example.com/admin</a> you'd use <a ... |
Create multiple Java Threads at once <p>Is there any possibility to create the threads as follows,</p>
<pre><code>Thread odjhygThread= new Thread(objJob1, objJob2);
</code></pre>
<p>I think we couldn't, if we want to create what needs to be done?
anyone knows the answer? Thanks in advance.</p>
| <p>A Thread runs one job. That's the way they are designed.</p>
<p>If you are trying to run two jobs, use two Threads.</p>
<p>If you want to hand over two jobs to be run in the background, read the JavaDocs for the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executors.html" rel="nofollow">Ex... |
IIS not serving .net control (.dll) <p>I'm serving a .net user control in .dll form.</p>
<p>It displays in IE7 fine when served from my external IIS 6 server.</p>
<p>However when served from a IIS 5 the <strong>control is rendered as a Text Area control with a Scrollbar control on the side</strong>.</p>
<p>I had a l... | <p>Aw man!</p>
<p>The .dll wasn't registered on the server!!!</p>
<p><code>regasm mydll.dll /tlb</code></p>
|
I want to analyze WCF messages <p>as in title I want to see the code of the messages exchanged in local testing.</p>
<p>I want to do it to ensure that they are really encrypted as I set to do.</p>
<p>Can someone help me?</p>
<p>Thanks,</p>
<p>Alberto</p>
| <p>You can use <a href="http://msdn.microsoft.com/en-us/library/ms732009.aspx" rel="nofollow">SvcConfigEditor</a> to enable tracing, which may be enough - see also (on MSDN) <a href="http://msdn.microsoft.com/en-us/library/ms730064.aspx" rel="nofollow">Configuring Message Logging</a>. Alternatively - for non-local test... |
JQuery Flexigrid question <p>Anyone know how to format the columns on a flexigrid?</p>
<p><a href="http://turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/FlexiGrid.html" rel="nofollow">http://turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/FlexiGrid.html</a></p>
<p>the colModel doesn't seen to have any formatti... | <p>Set the <strong>process</strong> property of the column you want to format, like this:</p>
<pre><code>colModel: [
{display: "ID", name: "id", width: 40, sortable: true, align: "center", process: procMe},
{display: "Title", name: "title", width: 180, sortable: true, align: "left"}
],
</code></pre>
<p>n... |
How to set a configuration property when using fluent nhibernate? <p>In particular, I'd like to set <code>current_session_context_class</code>. I know how to do it in hibernate.cfg.xml, but is it possible at all with pure fluent configuration?</p>
| <p>You can use the method <code>ExposeConfiguration</code> on a <code>FluentConfiguration</code> instance, to access the original NHibernate <code>Configuration</code> object.</p>
<p>Then, you'll have access to the <code>Properties</code> property, and you will be able to add the <code>current_session_context_class</c... |
Getting current connection properties in SQL Server <p>In MS SQL Server, the Database Properties dialog has the "View Connection Properties" link over on the left. Clicking that brings the "Connection Properties" dialog with properties of the current connection, such as Authentication Method, Network Protocol, Computer... | <p>SQL 2005 and after you interrogate <a href="http://msdn.microsoft.com/en-us/library/ms181509.aspx"><code>sys.dm_exec_connections</code></a>. To retrieve your current connection properties you'd run:</p>
<pre><code>select * from sys.dm_exec_connections
where session_id = @@SPID
</code></pre>
<p>The field values dep... |
Problem with JERSEY and JAX-RS <p>I am new to RESTful Services.</p>
<p>I am trying to deploy a simplest REST service using jersey, and JAX-RS, but i am getting this error,</p>
<p><strong>HTTP ERROR: 404
NOT_FOUND
RequestURI=/hosting/demo/example
Powered by Jetty://</strong></p>
<p>Where i think i have done everythin... | <p>Change your url-pattern in your web.xml to:</p>
<pre><code><url-pattern>/demo/*</url-pattern>
</code></pre>
|
How do you check the browser's user agent in a JSP page using JSTL, EL? <p>I need to check the browser's user-agent to see if it is IE6. However I shouldn't use scriptlets (we have a strict no scriptlets policy) to do this. </p>
<p>Currently I use</p>
<pre><code><%
String ua = request.getHeader( "User-Agent" );
bo... | <pre><code><c:set var="browser" value="${header['User-Agent']}" scope="session"/>
</code></pre>
|
Internet Explorer 8 - Session Shared among Explorer Window <p><strong>IE 8</strong> sharing session among different Explorer Window for same domain.
<br/>Like if you are a logined at hotmail.com in IE 8, and you have open another explorer window for hotmail.com, you will automatically logined.
<br/>This was not in <str... | <p>Use</p>
<p><strong>File -> New Session</strong></p>
<p>Well, it is not a bug. Browsers usually share data via cookies. IE8 have this 'new session' feature to let you use multiple email accounts (and similar services) with multiple browsers.</p>
|
How can I redirect every URL that's not requesting an JPEG or PNG image to index.php/x? <p>For example, I have an URL that looks for an image like this:</p>
<blockquote>
<p><a href="http://example.com/img/foo.png" rel="nofollow">http://example.com/img/foo.png</a><br />
<a href="http://example.com/img/interface/men... | <p>You can either exclude specific URLs:</p>
<pre><code>RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule !.*\.(jpeg|png)$ index.php%{REQUEST_URI}
</code></pre>
<p>Or you exclude any existing file:</p>
<pre><code>RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php%{REQUE... |
Linq2SQL and Duplicate records <p>What would be the best way to check if a record exists in a table. What happens is the user types the same name and I need to see if it is in the database. The thing is that I would like to do it on the Repository base class that uses generics. So I can not go Entity.Name.</p>
<pre><c... | <p>This will give you a collection of the Identity members you could do a check on the primary key of your item is contained in the collection</p>
<pre><code>_db.Mapping.GetTable(T).RowType.IdentityMembers
</code></pre>
|
Image upload in rails <p>How do I upload images and zip files in RoR? I am a newbie. So please help.
Give me both the view and the controller code example.</p>
<p>Thanks in advance.</p>
| <p>Nav,</p>
<p>Try the paperclip plugin, you can read about it here <a href="http://www.thoughtbot.com/projects/paperclip">http://www.thoughtbot.com/projects/paperclip</a></p>
|
Hibernate NullPointerException when using criteria in a EntityMode.DOM4J session <p>I'm running into a null pointer exception if I try to use the following code:</p>
<pre><code>//Spring JPA entityManager allow us to retriver the underlying session.
org.hibernate.Session session = (org.hibernate.Session)entityManager.g... | <p>Can you post your mapping file ? Also verify, if the mapping file has node and type information. This link may help you.</p>
<p><a href="http://docs.jboss.org/hibernate/core/3.3/reference/en/html/xml.html" rel="nofollow">http://docs.jboss.org/hibernate/core/3.3/reference/en/html/xml.html</a></p>
|
How to print out the method name and line number and conditionally disable NSLog? <p>I'm doing a presentation on debugging in Xcode and would like to get more information on using NSLog efficiently.</p>
<p>In particular, I have two questions:</p>
<ul>
<li>is there a way to easily NSLog the current method's name / lin... | <p>Here are some useful macros around NSLog I use a lot:</p>
<pre><code>#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
# define DLog(...)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) NSLog((@"%s... |
How do I get the "Copy view area" for CCRC as a variable in Eclipse? <p>When attempting to set up an 'External Tool' in Eclipse, there are a great deal of variables that deal with project location, workspace location etc - but not any for reference to the Copy View Area - i.e. Where your CCRC view starts.</p>
<p>This ... | <p>In general, referencing an external path in done through a Linked Resource Variable, which you can then refer in your project through a <strong><a href="http://stackoverflow.com/questions/300328/eclipse-attach-source-javadoc-to-a-library-via-a-local-property/300346#300346">linked folder</a></strong>.<br />
Your exte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.