instruction
stringlengths
0
30k
Oracle has "START WITH" and "CONNECT BY" select lpad(' ',2*(level-1)) || to_char(child) s from test_connect_by start with parent is null connect by prior child = parent; http://www.adp-gmbh.ch/ora/sql/connect_by.html
How to easily edit SQL XML column in SQL Management Studio
|sql|xml|
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema. I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can...
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema. I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can...
To add to the lovely answers above, let me add that you should always, always, always (yes, three "always"es) use "use warnings" at the top of your code. If you had done so, you would have gotten the warning "Reference found where even-sized list expected at -e line 1."
Evernote http://www.evernote.com and delicious http://www.delicious.com
@Cebjyre. The IDE whether Enterprise Manager or Management Studio is better than anything I have seen so far for MySQL. I say 'easier to use' because I can do many things in MSSQL where MySQL has no counterparts. In MySQL I have no idea how to tune the queries by simply looking at the query plan or looking at the stati...
TortoiseSVN can show image revisions side-by-side, which is really useful. I've used it with different teams with a great degree of success. The artists loved having the ability to roll back things (after they got used to the concepts). It does take a lot of space, though.
This site is not good for my pre-existing biases, turns out *this one* was an ill-configured route not lazy/eager loading
To me, adding a symlink pointing to your development folder seems like a tidy solution to the problem.
I would say yes, it could easily be structured towards smaller applications. There is a learning curve towards getting started, but honestly, it helped me understand WPF better than attempting to start from scratch. After starting a project with CompositeWPF and then starting another project without it, I found myself ...
Do you mean something like: //reflect out the method to fire as a delegate DelegateHandler eventDelegate = (DelegateHandler) Delegate.CreateDelegate( typeof( DelegateHandler ), //type of event delegate objectWithEventSubscriber, //instance of the object with the matching met...
Do you mean something like: //reflect out the method to fire as a delegate EventHandler eventDelegate = ( EventHandler ) Delegate.CreateDelegate( typeof( EventHandler ), //type of event delegate objectWithEventSubscriber, //instance of the object with the matching method ...
Web Design for Google Chrome
|chrome|
What, if any, considerations (HTML, CSS, JavaScript) should you take when designing for Google Chrome?
|google-chrome|
To solve this problem I implemented a simple filter that would look at the User-Agent header in the HTTP request and compare it to a list of known robots. I got the robot list from <a href="http://www.robotstxt.org/dbexport.html">www.robotstxt.org</a>. It's downloadable in a simple text-format that can easily be pa...
I need help with a MenuStrip Error
|winforms|vb.net|exception|.net-3.5|
My users are having an intermittent error when using a Windows Forms application built in VB.NET 3.5. Apparently when they click on the form and the form re-paints, a red 'X' will be painted over the MenuStrip control and the app will crash with the following error. Has anyone seen this before? Can someone point me in ...
To me, adding a symlink pointing to your development folder seems like a tidy solution to the problem. If the main project is on a different machine/webserver, you could use something like sshfs to mount your development directory into the right place on the webserver.
I use type based (Systems HN) for components (eg editFirstName, lblStatus etc) as it makes autocomplete work better. I sometimes use App HN for variables where the type infomation is isufficient. Ie fpX indicates a fixed pointed variable (int type, but can't be mixed and matched with an int), rawInput for user st...
Yes, you should be able to write to any place under HKEY_CURRENT_USER without having Administrator privileges. But this is effectively a private store that no other user on this machine will be able to access, so you can't put any shared configuration there.
Using Java, using [Apache Commons][1] String Utils: public boolean isPalindrome(String phrase) { phrase = phrase.toLowerCase(); phrase = phrase.replaceAll(" ", ""); return StringUtils.reverse(phrase).equals(phrase); } [1]: http://commons.apache.org/
Using Java, using [Apache Commons][1] String Utils: public boolean isPalindrome(String phrase) { phrase = phrase.toLowerCase().replaceAll("[^a-z]", ""); return StringUtils.reverse(phrase).equals(phrase); } [1]: http://commons.apache.org/
Find the highest order bit in C
|c|
what I'm after is something I can feed a number into and it will return the highest order bit. I'm sure there's a simple way. Below is an example output (left is the input) <pre>1 -> 1 2 -> 2 3 -> 2 4 -> 4 5 -> 4 6 -> 4 7 -> 4 8 -> 8 9 -> 8 ... 63 -> 32</pre>
Those are very detailed answers, but they mostly beg the question, how do I get these benefits without leaving Postgres given that the data easily fits into memory, requires concurrent reads but no writes and is queried with the same query over and over again. Is it possible to precompile the query and optimization ...
Those are very detailed answers, but they mostly beg the question, how do I get these benefits without leaving Postgres given that the data easily fits into memory, requires concurrent reads but no writes and is queried with the same query over and over again. Is it possible to precompile the query and optimization ...
I have reproduced what you are seeing: import urllib, os link = "http://python.org" print "opening url:", link site = urllib.urlopen(link) meta = site.info() print "Content-Length:", meta.getheaders("Content-Length")[0] f = open("out.txt", "r") print "File on disk:",len(f...
@gatekiller: It seems TortoiseSVN does support [Client Side Hooks][1]. [1]: http://tortoisesvn.tigris.org/tsvn_1.5_releasenotes.html#client-side-hooks
Comitting the file wouldn't do you any good. The file isn't committed with the full version inside, it is replaced with just the keyword. If you look at the file inside the repository you will see this. As such, you need to force the file to be updated in some way instead. If you're on the Windows platform, you c...
One of the best things you can do if developing with Visual Studio for Mono is to get MoMA [http://www.mono-project.com/MoMA][1]. This will inspect any number of assemblies that you build and generate a report showing potential Mono problems (e.g., methods not implemented in the mono library). It can be run from a GUI ...
I always do that, and if you ARE following an MVP design creating getter/setters for your view components would be a design requirement. I do not understand what you mean by "does not comply with good programming practice". Microsoft violates *a lot* of good programming practices to make it easier to create stuff on...
You probably meant to have some rounding in there, rather than truncating the result to an integer, otherwise the purpose of the operation is really limited. But since you asked the question with that specific formula, it brought to mind that your result set is really coarse. For the first 333 numbers, the result i...
You mentioned Web based apps. Any particular framework you have in mind? In many cases, [WALL](http://wurfl.sourceforge.net/index.php) seems to help to large extent. Here's one Article, [Adapting to User Devices Using Mobile Web Technology](http://www.packtpub.com/article/adapting-user-devices-mobile-web-technolo...
Exporting a C++ DLL
|c++|dll|windows|
Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a DLL with accessible functions I just export them using the standard __declspec(dllexport) directive. Then access them either dynamically via LoadLibrary() or at compile time with a heade...
Exporting a C++ class from a DLL
|c++|windows|dll|
I use some macros to mark the code for import or export <pre> #ifdef ISDLL #define DLL __declspec(dllexport) #endif #ifdef USEDLL #define DLL __declspec(dllimport) #endif </pre> Then declare the class in a header file: <pre> class DLL MyClassToExport { ... } </pre> Then <code>#define ISDLL</code> in the ...
dynamic_cast has runtime type checking and only works with references and pointers, whereas static_cast does not offer runtime type checking. For complete information, see the following MSDN link. [MSDN Link][1] [1]: http://msdn.microsoft.com/en-us/library/c36yw7x9(VS.80).aspx
Cookies are automatically handled by the browser when you make an AJAX call, so there's no need for your Javascript to mess around with cookies.
When you build the DLL and the module that will use the DLL, have some kind of #define that you can use to distinguish between one and the other, then you can do something like this in your class header file: #if defined( BUILD_DLL ) #define IMPORT_EXPORT __declspec(dllexport) #else #defin...
I don't have any way to test this right now, but I think you can use the -f flag on RewriteCond to check if a file exists, in either directory. RewriteCond %{REQUEST_FILENAME} -!f RewriteCond Content/%{REQUEST_FILENAME} -f RewriteRule (.*) Content/(.*) Something like that might do what you're after,...
1) there's probably a way to get it to work... you just have to make sure to add your controls to the tree at the right moment. Too soon and you don't get ViewState. Too late and you don't get ViewState. 2) If you can't figure it out, maybe you can turn off viewstate for the hole page and then rely only on qu...
A while back at a Microsoft ArcReady event, I saw a presentation on scaling patterns that might be useful to you. You can [view the slides][1] for it online. [1]: http://www.slideshare.net/clintedmonson/scalable-and-usable-web-applications/
Are you adding items to this strip dynamically?
Apparently, in Vista there are new interfaces that enable querying for internet connectivity and more. Take a look at the [NLM Interfaces][1] and specifically at [INetworkConnection][2] - you can specifically query if the network connection has internet connectivity using the GetConnectivity method. See also: [Netwo...
[TFS SideKicks][1] is another good tool for supplementing TFS default tools. [1]: http://www.attrice.info/cm/tfs/
What does the big table do. If you're going to split it, you've got a few options: - Split it using the database system (don't know much about that) - Split it by row. - split it by column. Splitting it by row would only be possible if your data can be separated easily into chunks. e.g. Somethin...
In C++: use RAII. Smart pointers like std::auto_ptr, boost::shared_ptr, boost::scoped_ptr and boost::weak_ptr are your friends.
C# Dynamic Event Subscription
|c#|reflection|events|
How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired? It would seem using Reflection this isn't possible and I would like to ...
How can I simply inherit methods an existing instance?
|python|oop|object|inheritance|
below I have a very simple example of what I'm trying to do. I want to be able to use HTMLDecorator with any other class. Ignore the fact it's called decorator, it's just a name. import cgi class ClassX(object): pass # ... with own __repr__ class ClassY(object): pass # ... with own ...
How can I simply inherit methods from an existing instance?
|python|oop|inheritance|object|
Use SQL*Loader. It takes a little setting up, but if this isn't a one off, its worth it. **Create Table** SQL> create table ldr_test (id number(10) primary key, description varchar2(20)); Table created. SQL> **Create CSV** oracle-2% cat ldr_test.csv 1,Apple 2,Orange 3,Pe...
We rolled our own at work using [RRDtool][1] (the data storage back end to tools like MRTG). We run a perl script every 5 minutes that takes a du per partition and stuffs it into an RRD database and then uses RRD's graph function to build graphs. It takes a while to igure out how to set up the .rrd files (for instanc...
What registry access can you get without Administrator privleges?
|registry|
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_LOCAL_USER (the application currently access HKEY_LOCAL_MACHINE) without ...
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_CURRENT_USER (the application currently access HKEY_LOCAL_MACHINE) withou...
Fixed vs. variable frame rates in games: what is best, and when?
|untagged|
After working for a while developing games, I've been exposed to both variable frame rates (where you work out how much time has passed since the last tick and update actor movement accordingly) and fixed frame rates (where you work out how much time has passed and choose either to tick a fixed amount of time or sleep ...
I prefer to use the [good old url][1] for delicious Apart from that i use the [Scrapbook extension][2] in firefox when i want to save something on the disk. It's possible to tag the page, edit it and remove those stupids ads before saving it. I also have a [Wiki on a stick][3] that i carry around on a usbkey for ...
Can you add more to your question? That error sounds like the sql statement parser is very confused about your statement. Can you do a select on that table for the row where id = 555 ? You could try running a RUNSTATS and REORG TABLE <name> on that table, those are supposed to sort out wonky tables.
[Zotero](http://www.zotero.org), is a nice plugin for Firefox.
Put a `\` at the end of your line or enclose the statement in parens `( .. )`. From [IBM][1]: b = ((i1 < 20) and (i2 < 30) and (i3 < 40)) or b = (i1 < 20) and \ (i2 < 30) and \ (i3 < 40) [1]: http://www.ibm.com/developerworks/opensource/library/os-python5/
Wouldn't all the suggestions moving the mouse back and forth drive the user crazy? I know I'd remove any app that would do that as soon as I can isolate it.
The reason for not implementing Getters and Setters for components on a form I believe is cause they wouldn't be "Thread Safe" .Net objects are suppose to be only modified by the form thread that created them, If you put on getter and setters you are potentially opening it up for any thread. Instead your suppose to imp...
Don't version that file. Version a template or something.
Currently I have the "template" config file with an added extension for example: web.config.rename However, I can see an issue with this method if critical changes have changed.
You can use svn pre-commit-hooks to do it. The general idea I have in mind is create one that before the commit will put the new revision number in the file (get it using svnlook) or maybe change a bogus property on the file (it has to change or SVN will ignore it). For more information about pre-commit-hooks I f...
@Grant is right. I'm on a team with close to 100 other developers, and our config files are not checked into source control. We have versions of the files in the repository that are pulled with each check out but they don't change. It's worked out pretty well for us.
What I've done in the past is to have a default config file which is checked in to source control. Then, each developer has their own override config file which is excluded from source control. The app first loads the default, and then if the override file is present, loads that and uses any settings from the override ...
I version control it, but never push it to the other servers. If the production server requires a change, I make that change directly to the config file. It may not be pretty, but it works just fine.
The checked-in, plain-vanilla version of app/web.config should be generic enough to work on all developer machines, and be kept up to date with any new setting changes, etc. If you require a specific set of settings for dev/test/production settings, check in separate files with those settings, as GateKiller stated, wi...
I am looking for many answers to learn about new tools and consolidate this knowledge in a one question/thread, so I doubt there will be 1 true answer to this question. My answer to my own question is that we use: - Findbugs to look for common errors bad/coding - run from maven, and also integrates easily into Ec...
How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired? It would seem using Reflection this isn't possible and I would like to ...
|c#|reflection|events|delegates|
|c#|events|reflection|delegates|
How would you dynamically subscribe to a C# event so that given a Object instance and a String name containing the name of the event, you subscribe to that event and do something (write to the console for example) when that event has been fired? It would seem using Reflection this isn't possible and I would like to ...
Yes, using [Ngen][1], the Native Image Generator. [1]: http://msdn.microsoft.com/en-us/library/6t9t5wcf.aspx
Yes, using [Ngen][1], the Native Image Generator. There are, however, a number of you need to be aware of: - **You still need the CLR to run your executable.** - The CLR will not dynamically optimize your assemblies based on the environment it's run in (e.g. 486 vs. 586 vs. 686, etc.) All in all, it's only w...
Yes, using [Ngen][1], the Native Image Generator. There are, however, a number of things you need to be aware of: - **You still need the CLR to run your executable.** - The CLR will not dynamically optimize your assemblies based on the environment it's run in (e.g. 486 vs. 586 vs. 686, etc.) All in all, it's...
You can't apply an index to a var unless it's an indexable type: //works because under the hood the C# compiler has converted var to string[] var arrayVar = {"one", "two", "three"}; arrayVar[1].Dump(); //now let's try var selectVar = arrayVar.Select( (a,i) => new { Line = a }); /...
I realize that FOSS is your primary desire and I definitely agree with this. If I were to limit myself to FOSS, I would go with RT 3.8, [http://blog.bestpractical.com/2008/07/today-were-rele.html#screenshots][1] However, if you are willing to entertain commercial solutions and are looking for a Helpdesk-"ish" appli...
Try, it has support for vista style Icons Axialis IconWorkshop Lite for VS 2008 http://www.axialis.com/download/iwlite.html Axialis Software, in association with Microsoft Corporation, presents Axialis IconWorkshop Lite for Visual Studio 2008: * 100% Free for Visual Studio 2008 users; * Make icon...
It depends on how you have your OPC client configured to pull data. When you subscribe to a group in OPC, you get to specify a refresh rate. This might default to 1s or even 5s, depending on the OPC client. There's also a limit the OPC server might put on the frequency of updated data. This only applies if you have...
- [Evernote][1] - [Notepad2][2]'s clipboard feature (*Notepad2.exe /c* as a link in [Launchy][3]) - [Windows Clippings][4] or [PrintKey][5] - Firefox extension [Page Saver][6] - [Delicious][7] [1]: http://evernote.com/ [2]: http://www.flos-freeware.ch/notepad2.html [3]: http://launchy.net/ ...
If you want a portable solution that will work on any ANSI-SQL RDBMS, you will need to add a new column to your table. Joe Celko is the original author of the **[Nested Sets](http://www.intelligententerprise.com/001020/celko.jhtml)** approach to storing hierarchies in SQL. You can Google ["nested sets" hierarchy](ht...