instruction
stringlengths
0
30k
For those looking for an answer in Oracle: Select column_name from user_tab_columns where table_name='TABLENAME'
Plug in your network cable into a switch which has no other connection/cables. That should work imho.
It depends on whether the thread is running or not. If you just created Thread object and didn't start it, it is an ordinary managed object, i.e. eligible for GC. As soon as you start thread, or when you obtain Thread object for already running thread (GetCurrentThread) it is a bit different. The "exposed object", mana...
How do you cast an IEnumerable<t> or IQueryable<t> to an EntitySet<t> ?
|c#|.net|linq|
In this situation I am trying to perform a data import from an XML file to a database using LINQ to XML and LINQ to SQL. Here's my LINQ data model: public struct Page { public string Name; public char Status; public EntitySet<PageContent> PageContents; } public stru...
i'm sure Tim meant "splitter = re.compile(r'([\D])')". if you copy exactly what he has down you only get the digits not the operators.
Using a standard W3 DOM such as the stdlib's minidom, or pxdom: def getValues(category): for parent in document.getElementsByTagName('parent'): if parent.getAttribute('name')==category: return [ el.getAttribute('value') for el in pa...
Using a standard W3 DOM such as the stdlib's minidom, or pxdom: def getValues(category): for parent in document.getElementsByTagName('parent'): if parent.getAttribute('name')==category: return [ el.getAttribute('value') for el in pa...
Copyright and Fair Use in Distributable Software
|distributed|legal|copyright|
At what length of text and/or length of audio snippet does a piece of commercially distributable software pass the threshold of fair use and violate the included work's copyright? Does attribution absolve the developer from infringement? An example would be a quote from a novel used on a start-up screen.
What happens now when the site is down and someone tries to hit it? Does ADO.NET throw a specific exception you could catch and then redirect to the "website down" page? You could add a "Global.asax" file to the project, and in its code-behind add an "Application_Error" event handler. It would fire whenever an excep...
What happens now when the site is down and someone tries to hit it? Does ADO.NET throw a specific exception you could catch and then redirect to the "website down" page? You could add a "Global.asax" file to the project, and in its code-behind add an "Application_Error" event handler. It would fire whenever an excep...
Any suggestions for effectively testing AJAX enabled web pages using MSVS Tester Edition Tools?
|visual-studio|testing|ajax|
It seems like MS really left a massive gaping hole in their automated testing tools in Visual Studio for web pages with AJAX components and I have been hard pressed to find any commentary or third party add-ons that remedy the problem. Anyone have any advice on automating web tests in MSVS for AJAX pages?
'|' does not do short-circuit evaluation in boolean expressions. '||' will stop evaluating if the first operand is true, but '|' won't. In addition, '|' can be used to perform the bitwise-OR operation on byte/short/int/long values. '||' cannot.
Vista has a new api for everything related to mixers and audio, per process legacy api's should still work, but to change global volume, you would have to look at the new COM interfaces added to Vista <a href="http://www.codeproject.com/KB/vista/CoreAudio.aspx">This</a> should get you started
How do you get the response from the Request object in MooTools?
|javascript|ajax|mootools|
Just in general, how do you access the response from the Request object in MooTools? I've been looking at the documentation and the MooTorial, but I can't seem to make any headway. Other Ajax stuff I've done with MooTools I haven't had to manipulate the response at all, so I've just been able to inject it straight ...
Just in general, how do you access the response from the Request object in MooTools? I've been looking at the documentation and the MooTorial, but I can't seem to make any headway. Other Ajax stuff I've done with MooTools I haven't had to manipulate the response at all, so I've just been able to inject it straight ...
How do you access the response from the Request object in MooTools? I've been looking at the documentation and the MooTorial, but I can't seem to make any headway. Other Ajax stuff I've done with MooTools I haven't had to manipulate the response at all, so I've just been able to inject it straight into the document...
Check out the permalink_fu plugin (extracted from Mephisto)... the Git repository is [located here][1]. [1]: http://github.com/technoweenie/permalink_fu/tree/master
You could use the condition task to branch to different copy tasks... from the ant manual: <condition property="isMacOsButNotMacOsX"> <and> <os family="mac"/> <not> <os family="unix"/> </not> </and> </condition>
HttpUtility.HtmlEncode / Decode HttpUtility.UrlEncode / Decode
HttpUtility.HtmlEncode / Decode HttpUtility.UrlEncode / Decode You can add a reference to the System.Web assembly if it's not available in your project
I think in 2008 the express editions do not have the built in Testing features for one.
Extending the previous answer: &lt;ESC&gt;* will list all matching files on the command line. Then you can use the standard vi editing commands to remove the ones you don't care about. So to add to the above table: <ESC><shift-8> x.txt x171 x171go Then use backspace to go get rid of the last two,...
After reading the replies so far (Thanks!) I passed the outermost JPanel to the following method: (Note the printf statements are for debugging and will be disabled once things are working.) void addTextFocusSelect(JComponent component){ if(component instanceof JTextComponent){ System.out.p...
After reading the replies so far (Thanks!) I passed the outermost JPanel to the following method: void addTextFocusSelect(JComponent component){ if(component instanceof JTextComponent){ component.addFocusListener(new FocusAdapter() { @Override publ...
That article just recommends against overriding the equality operator, not against overriding Equals. You should override Equals within your object (reference or value) if equality checks will mean something more than reference checks. If you want a "more complex" interface, you can also implement [IEquatable][1], th...
That article just recommends against overriding the equality operator (for reference types), not against overriding Equals. You should override Equals within your object (reference or value) if equality checks will mean something more than reference checks. If you want an interface, you can also implement [IEquatable...
You can also view the auto-generated code that flex makes when it compiles your mxml file, by adding a -keep argument to your compiler settings. You can find your settings by selecting your projects properties and looking at the "Flex Compiler" option, then under "Additional compiler arguments:" add "-keep" to what is ...
Looking at the link supplied by [ThatBloke in his answer][1], I found the RowNumber command. Which means that this worked: =IIf(RowNumber(Nothing)=1,"myString", "") [1]: http://stackoverflow.com/questions/103240/finding-first-row-in-a-rdlc-table#103388
Sounds like a CASE expression. I don't know the proper data manipulations for SQL Server, but basically it would look like this: CASE WHEN [Date] is a Friday THEN DATEADD( day, 3, [Date] ) ELSE DATEADD( day, 1, [Date] ) END If you wanted to check for weekend days you could add additional W...
Assuming this is under Windows, there is a program usually in "C:\Program Files\VMWare\VMware Workstation\" called vmware-vdiskmanager.exe that you can use to do this. Open a DOS prompt and CD to that directory. The command to expand the drive is: vmware-vdiskmanager.exe -x 50Gb NameOfDisk.vmdk Also, this isn...
Straying from the "inline" part of this, actually, the two sets of code won't compile out to the same thing. The issue comes in with: Dim dtLookupCode As New LookupCodeDataTable() Dim taLookupCode AS New LookupCodeTableAdapter() In VB, this will create new objects with the appropriately-named references...
This: dtLookupCode = taLookupCode.GetDataByCodeAndValue("EmpStatus", "FULL") strDescription = dtLookupCode.Item(0).Meaning and this: strDescription = taLookupCode.GetDataByCodeAndValue("EmpStatus", "FULL").Item(0).Meaning are completely equivalent. In the first example, you've got an explici...
Some more index information! Clustered indexes are the actual physical layout of the records in the table. Hence, you can only have one per table. Nonclustered indexes are the aforementioned card catalog. Sure, the books are arranged in a particular order, but you can arrange the cards in the catalog by book siz...
It's called a full outer join and it's not supported natively in MySQL, judging from its [docs](http://dev.mysql.com/doc/refman/4.1/en/join.html). You can work around this limitation using UNION as described in the comments to the page I linked to.
It's called a full outer join and it's not supported natively in MySQL, judging from its [docs](http://dev.mysql.com/doc/refman/4.1/en/join.html). You can work around this limitation using UNION as described in the comments to the page I linked to. [edit] Since others posted snippets, here you go. You can see explan...
You're correct, you can't actually get access to the enumerations. Just a wee nitpick, this constant doesn't need to be an object, you can make it an int32 - Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2
The 'default' keyword in generic types: T t = default(T); results in a 'null' if T is a reference type, and 0 if it is an int, false if it is a boolean, etcetera.
This works for me on SQL Server: select isnull(a.id, b.id), a.mark, b.mark from a full outer join b on b.id = a.id
This works for me on SQL Server: select isnull(a.id, b.id), a.mark, b.mark from a full outer join b on b.id = a.id EDIT: @Nickolay interesting that it's not supported on MySQL. I guess it's something of an edge case.
Thanks for the resource. It certainly helped me test out the webservice, but it didn't much help with using the WCF service in my .net 2.0 application. What I eventually ended up doing was going back to the architects and explaining that the 3.0 dll's that I needed to reference got compiled back to run on the 2.0 CL...
I would also suggest checking out the SharePoint Content Deployment Wizard by Chris O'Brien. [http://www.codeplex.com/SPDeploymentWizard][1] Should help smooth the process you describe, and it's a nice tool for your kitbag regardless [1]: http://www.codeplex.com/SPDeploymentWizard
Visual Studio 2008 Window layout annoyance
|visual-studio|annoyance|
I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's position is saved, but it's sized will be screwed when I load. ...
I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's position is saved, but it's size will be reset to very-narrow (a...
As far as simplicity, it doesn't get any better than: # Set a var $_SESSION['foo'] = 'whatever'; # Access the var print $_SESSION['foo'];
As far as simplicity, it doesn't get any better than: # Start the session manager session_start(); # Set a var $_SESSION['foo'] = 'whatever'; # Access the var print $_SESSION['foo'];
In pure .Net I don't know of anything. There are [CSS Solutions](http://www.imaputz.com/cssStuff/bigFourVersion.html) for a fixed header. But a fixed right column, in my experience, requires some javascript finangling.
In pure .Net I don't know of anything. There are [CSS Solutions](http://www.imaputz.com/cssStuff/bigFourVersion.html) for a fixed header. But a fixed left column, in my experience, requires some javascript finangling. Took me a minute to find the old example. Host has since gone down. http://web.archive.org/web/...
Well, here are the first few problems you've got. 1. You appear to be assuming that a mail client is going to handle uuencoded attachment without any headers. That won't happen. 2. You're misusing I/O redirection: uuencode's output and the here-document are both being fed to mailx, which can't happen. 3. ...
Well, here are the first few problems you've got. 1. You appear to be assuming that a mail client is going to handle uuencoded attachment without any headers. That won't happen. 2. You're misusing I/O redirection: uuencode's output and the here-document are both being fed to mailx, which can't happen. 3. ...
Why won't my package upgrade with yum?
|linux|fedora|yum|
I'm trying to upgrade a package using yum on Fedora 8. The package is "elfutils". Here's what I have installed locally: $ yum info elfutils Installed Packages Name : elfutils Arch : x86_64 Version: 0.130 Release: 3.fc8 Size : 436 k Repo : installed Summary: A colle...
if you don't have access to the php.ini, a ini_set('register_globals', false) in the phpscript won't work (variables are already declared) An .htaccess with: php_flag register_globals Off can sometimes help
did you try out any of these books ? 1) http://www.ervacon.com/products/swfbook/index.html -- from the original author of WebFlow ? 2) http://www.amazon.com/Expert-Spring-MVC-Web-Flow/dp/159059584X BR,<br> ~A
If you are planning to continue developing your software, you might consider the ransom model: http://en.wikipedia.org/wiki/Street_Performer_Protocol Essentially, you develop improvements to the software, and then ask for a certain amount of donations before you release them (without any DRM).
In lisp: CL-USER> (defun common-chars (&rest strings) (apply #'map 'list #'char= strings)) COMMON-CHARS Just pass in the strings: CL-USER> (common-chars "Toby" "Tiny" "Tory" "Tily") (T NIL NIL T) If you want the characters themselves: CL-USER> (defun common-chars2 (&...
I recall doing some VB programming in an access form where True was -1.
`erase` will return an `iterator` in C++0x. If you can cope with the standardeze, this is [defect report 130](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2728.html#130). So the standards comittee seems to think that this was a mistake.
If you'd like to see some real-world examples, the Terracotta Maven plugin (tc-maven-plugin) has some tests with it that you can peruse in the open source forge. The plugin is at: http://forge.terracotta.org/releases/projects/tc-maven-plugin/ And the source is in svn at: http://svn.terracotta.org/svn/forge/projec...
It all depends on what you are comfortable administering. Any of these setups can be stable, robust, and secure if its properly set up.
The union command will help you. Something along these lines: SELECT *, 1 as order from books where title like '%text%' union SELECT *, 2 as order from books where description like '%text%' ORDER BY order, date
If your prefer a GUI interface [CurrPorts][1] is free and works with all versions of windows. Shows ports and what process has them open. [1]: http://www.nirsoft.net/utils/cports.html
LAMP seems to be the most common of those options, so on a strictly find solutions to your problems I would recommend LAMP. It really comes down to whats going to be the best option for you though. If you don't know Linux than maybe running a WAMP setup will make the process easier to maintain. Try and factor in y...
First, install haml as a plugin ruby script/plugin install git://github.com/nex3/haml.git Then, Make sure your views are named with a `*.html.haml` extension. For example: . |-- layouts | `-- application.html.haml `-- users |-- edit.html.haml |-- index.html.haml ...
First, **install haml** as a plugin ruby script/plugin install git://github.com/nex3/haml.git Then, Make sure your views are named with a ***.html.haml** extension. For example: `-- app `-- views |-- layouts | `-- application.html.haml `-- users ...
XAMPP is good for development and portability, that's for sure. LAMP is best for performance and security (and ubiquity). WAMP...well, that's for if you don't want to learn Linux, I guess.
Dundas do great RS add-ins if you have the budget: [http://www.dundas.com/index.aspx][1] [1]: http://www.dundas.com/index.aspx
In sql server I would do the following: select * from books where title like '%text%' or description like '%text%' order by case when title like '%text%' then 1 else 2 end, date I'm not sure if you can include columns in ORDER BY in mysql that aren't in the SELECT, but that's the principle I'd use....
Embedding a dll to be used by another
|c#|.net-3.5|dll|
I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible. This with is C# and .NET 3.5. The way I would like to do this is by storing the third party DLL a...
I eventually gave up trying, and just stuck with WATIR
That's the best way to do it if your class is pretty lightweight - I mean that it isn't very expensive to make a copy of it. One side effect of that method though is that it does tend to make it more likely to have temporary objects created, although that can depend on how well the compiler can optimize things. F...
|| returns a boolean value by OR'ing two values (Thats why its known as a LOGICAL or) IE: if (A || B) Would return true if either A or B is true, or false if they are both false. | is an operator that performs a bitwise operation on two values. To better understand bitwise operations, you can read here...
I don't think having an AJAX request every second is a good idea, it's way to chatty. I think most people implement this feature by just recording when someone makes a request to the site and from that time to `threshold` the user is 'visiting' the site. If the user doesn't make another server request before the `th...
I don't think having an AJAX request every second is a good idea, it's way too chatty. I think most people implement this feature by just recording when someone makes a request to the site and from that time to `threshold` the user is 'visiting' the site. If the user doesn't make another server request before the `t...
I haven't seen that happen, although my experience is mostly with SAPI 5.3 with SSML, which gets translated (under the covers) to SAPI TTS. Have you tried surrounding your text with the `<pitch absmiddle="0">` Your Text Here </pitch> instead of just at the front of the text?
[FileStream.SetLength](http://msdn.microsoft.com/en-us/library/system.io.filestream.setlength.aspx) is the one you want.
In your installer class, are you overriding the Uninstall method: Public Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary) MyBase.Uninstall(savedState) 'Shell to batch file here End Sub And secondly, have you qualified the full path ...
Have you checked that the batch file is in the current directory as seen by the script? I would add another message showing the directory it is using to ensure it is actually trying to execute the batch file where you think it is located.
This is the <a href="http://moffdub.wordpress.com/2008/09/10/the-spreadsheet-conundrum/">Spreadsheet Conundrum</a>: do you write repository.store(entity) or entity.storeIn(repository)? Each has its merits. I generally tend to favor repository.store(entity) for the main reason that I keep the methods of my entities d...
The only benefit I can see to a maximum password length would be to eliminate the risk of a buffer overflow attack caused by an overly long password, but there are much better ways to handle that situation.
We are not aiming for MEF to be an all-purpose IoC. The best way to think about the IoC aspects of MEF is an implementation detail. We use IoC as a pattern because it is a great way to address the problems we are looking t solve. MEF is focused one extensibility. When you think of MEF look at it as an investment in...
I have not found anything on Try/Catch performance on Google but a simple test with a loop throwing error instead of a IF statement produce 329ms vs 6ms in a loop of 5000.
i found this [blog][1] (not mine!) very interesting on the subject. personally i would adopt a solution based on needs, if i was building say a internal app for a company on a windows network, then silverlight seems great. Otherwise, it seems you leave out the entire rest of the world by going with silverlight on a p...
What is "Best Practice" For Comparing to Instances of a Reference Type?
|.net|comparison|equality|operator-overloading|
I came across this recently, up until now I have been happily overriding the equality operator (**==**) and/or **Equals** method in order to see if two references types actually contained the same **data** (i.e. two different instances that look the same). I have been using this even more since I have been getting m...
|.net|comparison|equality|operator-overloading|
What is "Best Practice" For Comparing Two Instances of a Reference Type?