instruction stringlengths 0 30k ⌀ |
|---|
Tools menu -> Options ...
Then go to Text Editor -> C# -> Fromatting -> new lines and there check when you want new lines with brackets
for css:
almost the same, but less options
|
Best way to do multi-row insert in Oracle? |
|sql|database|oracle-database| |
I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle.
INSERT INTO TMP_DIM_EXCH_RT
(EXCH_WH_KEY,
EXCH_NAT_KEY,
EXCH_DATE, EXCH_RATE,
FROM_CURCY_CD,
TO_CURCY_CD,
EXCH_EFF_DAT... |
Here's a nice approach (from [the main Wikipedia entry on pi][1]); it converges much faster than the simple formula discussed above, and is quite amenable to a recursive solution if your intent is to pursue recursion as a learning exercise. (Assuming that you're after the learning experience, I'm not giving any actual... |
For CSS you'll need the 'Semi Expanded' option. |
VisualBasic .NET's compatibility library contains strong typed control arrays. This is what the upgrade wizard uses to replace the current VB6 control arrays.
However, A control array in VB6 is just a collection of objects with VB6 doing some syntax magic on the surface. In the .NET world, by removing this, they are... |
VisualBasic .NET's compatibility library contains strong typed control arrays. This is what the upgrade wizard uses to replace the current VB6 control arrays.
However, A control array in VB6 is just a collection of objects with VB6 doing some syntax magic on the surface. In the .NET world, by removing this, they are... |
Yeah, I've found manually layout out controls (incrementing their Top property by the height of the control plus a margin as I go) to be reasonably effective.
Another approach is to place your controls in Panels with Dock set to Top, so that each successive panel docks up against the one above. Then you can toggle t... |
Are you JPEG's compressed in Jpeg 2000 Format? If so, there is a known bug:
- [https://bugs.webkit.org/show_bug.cgi?id=8754][1]
[1]: https://bugs.webkit.org/show_bug.cgi?id=8754 |
C# Dynamic Form Controls |
|c#|winforms|dynamicdata| |
Using C# 2.0 what is the best way to implement dynamic form controls?
I need to provide a set of controls per data object, so should i just do it manually and lay them out while increment the top value or is there a better way? |
|.net|winforms| |
"The image “http://kilkin.massiveatom.com/kilkin/images/dukkah.jpg” cannot be displayed, because it contains errors." and the image itself has some XML-fragment in it. So as others proposed: try to open with an editor and resave it. |
Another simple thing to do would be to use a debugger or logging statement to check the value of
> StringUtils.objectToString(currClip.get("market_local"))
to make sure it is what you think it is. |
+1 for VisualSVN being better than AnkhSVN, having tried both, and +1 for the FogBugz Add-in. |
have you looked into using facelets? It lets you get rid of the whole JSF / JSP differences (it's an alternate and superior view controller).
It also supports great design-time semantics with the jsfc tag...
<input type="text" jsfc="#{SomeBean.property}" class="foo" />
gets translated internally to the cor... |
It's as stated elsewere a bug in the image.
[Irfanview][1] is a very good viewer that will display any image (and other formats as well), is small and free and will also let you adjust, crop or rescale images very easily without heavy programs like photoshop.
I suggest [download irfanview][2] and the image, open... |
Well that's the way we are doing it right now on a project. but that's only useful for simple cases. I suggest you use some sort of template for more complex cases.
For instance I used Reflection to map a certain type of control to a certain property on my domain objects on an older project.
You could try generat... |
|database|logging|olap|hackery|text-files| |
To analyze lots of text logs I did some hackery that looks like this
1. Locally import logs into Access
2. Reprocess Cube link to previous mdb in Analisis Service 2000 (yes it is 2k)
3. Use Excel to visualize Cube (it is not big - up to milions raw entries)
My hackery is a succes and more people are demandi... |
|database|logging|olap|text-files|hacks| |
This is the effect of a new feature in Vista called "Boxing":
Windows has several mechanisms that allow the user/admin to set up applications to automatically run when windows starts. This feature is mostly used for one of these purposes:
1. Programs that are part of the basic work environment of the user, such that ... |
You can set the Build Action/Copy to Output Directory property on individual files (select the file and hit F4 to open the properties window) to control what happens to them during build, but not for folders. This could probably be automated with a (pre) build task if you don't want to do it manually.
Alternatively,... |
I am one of the authors of Drools, I will avoid pimping my wares.
But some other options are Jess (not open source) but uses the clips syntax (which we also support a subset of) - which is kinda a lisp dialect.
It really depends what you want it for, Haley have strong Natural language tech (and they recently aq... |
I've had no problems connecting to network shares transparently as if they were local drives. The only issue you may have is what you mentioned: having the `aspnet` account gain access to the share. Impersonation is probably the best way to do this.
You should be able to use any filestream objects to access the netw... |
How Do I Read in the Contents of a Directory in perl? |
|perl|filesystems|fileio| |
How do I get perl to read the contents of a given directory into an array?
Backticks can do it, but I know there is some method using 'scandir' or a similar term? |
|perl|filesystems|file-io| |
|perl|file-io|filesystems| |
I did quite a bit of googling trying to find this answer. There are plenty of people asking for it:
- <http://developers.slashdot.org/comments.pl?sid=414610&cid=21996944>
- <http://www.arguingwithmyself.com/archives/75-the-biggest-feature-your-editor-is-missing>
- <http://intype.info/blog/screencast-parser-in-e... |
Also don't forget that both Map and Hashtable are generic in Java 5 and up (as in any other class in the [Collections framework][1]).
Map<String, Integer> numbers = new HashMap<String, Integer>();
numbers.put("one", 1);
numbers.put("two", 2);
numbers.put("three", 3);
Integer one = numbers.g... |
Integrated GPUs are going to be really poor performers with games FSAA or no. If you want even moderate performance, buy a separate video card.
For something that's not crazy expensive go with either a nVidia Geforce 8000 series card or an ATI 3000 series card. Even as a nVidia 8800 GTS owner, I will tell you the A... |
It really depends on what kind of security you are looking to integrate. Do you want security to ensure that the user isn't running any debuggers or such to flip bits in your application to change the votes? Do you want to ensure that the user doesn't install logging software to keep track of who voted for who? Do y... |
Yes, of course integrated cards are awful. :) But this wasn't a question about gaming, but rather about an application that we are writing that will use OpenGL/D3D for 3D rendering. The 3D scene is relatively small, but antialiasing makes a dramatic difference in terms of the quality of the rendering. We are curiou... |
How do I execute a file in Cygwin? |
|c|gcc|cygwin| |
I created a C file in Eclipse on Windows and then used Cygwin to navigate to the directory. I called gcc on the C source file and a.exe was produced. How do I execute a.exe in the Cygwin shell? |
You need to index an associative container two ways:
- Insertion order
- String comparison
Try [Boost.MultiIndex][1]. I haven't used it this way but I think it's possible.
[1]: http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/index.html |
SQL Server 2005 Auto Updated DateTime Column - LastUpdated |
|sql-server| |
I have a table defined (see code snippet below). How can I add a constraint or whatever so that the LastUpdate column is automatically updated anytime the row is changed?
CREATE TABLE dbo.Profiles
(
UserName varchar(100) NOT NULL,
LastUpdat... |
You're going to have to use triggers for that. |
./a.exe at the prompt |
you should just be able to call it by typing in the file name. You may have to call ./a.exe as the current directory is usually not on the path for security reasons. |
just type ./a in the shell |
Just call it
> a
Make sure it will be found (path). |
One way to separate the MXML and ActionScript for a component into separate files is by doing something similar to the ASP.Net 1.x code behind model. In this model the declarative part (the MXML in this case) is a subclass of the imperative part (the ActionScript). So I might declare the code behind for a class like th... |
The main difference I noticed in moving from SQL Server to Oracle was that in Oracle you need to use cursors in the SELECT statements.
Also, temporary tables are used differently. In SQL Server you can create one in a procedure and then DROP it at the end, but in Oracle you're supposed to already have a temporary tabl... |
What is the best way to convert an array to a hash in Ruby |
|ruby| |
In Ruby, given an array in one of the following forms...
[apple, 1, banana, 2]
[[apple, 1], [banana, 2]]
...what is the best way to convert this into a hash in the form of...
{apple => 1, banana => 2} |
|ruby|arrays| |
Actually, @ajmastrean, you are wrong, they are not.
The official MS guidelines tells you to have the curly brace on the same line as the method/property/class and many other things which are not enforced in Visual Studio.
You can change all these auto-text settings under:<br />
**Tools -> Options -> Text Editor ... |
They way I have designed the database before is to have an News-table containing basic info like NewsID (int), NewsPubDate (datetime), NewsAuthor (varchar/int) and then have a linked table NewsText that has these columns: NewsID(int), NewsText(text), NewsLanguageID(int). And at last you have a Language-table that has L... |
If you're not on SQL Server 2008 and you have some solid reasons for putting specific image files in the database, then you could take the "both" approach and use the file system as a temporary cache and use the database as the master repository.
For example, your business logic can check if an image file exists on... |
Do you have any add-ins installed (or uninstalled)? I find that effects my intellisense. Besides that just making sure your Tools->Options->All Languages "Auto LIst Members" and "Parameter Information" are checked off.
|
I like the Request/Response object pattern, where you encapsulate your arguments into a single [Operation]Request class, which has simple public properties on it.
Something like AddCustomerRequest, which would return AddCustomerResponse.
The response can include information on the success/failure of the operation... |
Most database engines should support dumping your database into a file. I know MySQL does, anyway. This will just be a text file, so you could submit that to Subversion, or whatever you use. It'd be easy to run a diff on the files too. |
Multiple submit buttons on a form |
|html|forms| |
Let's say you create a Wizard in an HTML form. One button goes back and one goes forward. Since the "back" button appears first in the markup, when you press Enter it will use that button to submit the form.
Ex:
<form>
<input type="text" name="field1" /> <!-- put your cursor in this field and press... |
|html| |
Flat File Databases in PHP |
|php| |
What are your best practices around creating flat file database structures in PHP? A lot of the more mature PHP flat file frameworks I see out there attempt to implement SQL-like query syntax, which is over the top for my purposes in most cases (I would just use a database at that point).
Are there any elegant tric... |
|php|database| |
PHP Session Security |
|php|security| |
What are some guidelines for maintaining responsible session security with PHP? There's information all over the web, so it's about time it all landed in one place! |
One guideline is to call [session_regenerate_id][1] every time a session's security level changes. This helps prevent session hijacking.
[1]:http://www.php.net/session_regenerate_id |
I think one of the major problems (which is being addressed in PHP 6) is register_globals. Right now one of the standard methods used to avoid register_globals is to use the $_REQUEST, $_GET or $_POST arrays.
The "correct" way to do it (as of 5.2, although it's a little buggy there, but stable as of 6, which is comi... |
I would be a bit reluctant to use nested classes here. What if you created an abstract base class for a "multimedia driver" to handle the back-end stuff (workhorse), and a separate class for the front-end work? The front-end class could take a pointer/reference to an implemented driver class (for the appropriate medi... |
SSRS - Post Publishing Tasks |
|reporting-services|automation| |
As part of the publishing "best practices" i came up with my own, i tend to archive report groups and republish the "updated" reports. However, with this stratedgy, I lose users associated with each report, or have to rehide reports.
Is there an automated process I can use to hide reports, or add users, after deplo... |
Changing the resolution of a VNC session in linux |
|linux|vnc| |
I use VNC to connect to a Linux workstation at work. At work I have a 20" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900.
If I set the vncserver to run at 1440x900 I miss out on a lot of space on my monitor, whereas if I set it to run at 1600x1200 it doesn't fit on the l... |
I always preferred to write my Ajax calls in javascript using JQuery or Prototype. ASP.NET Ajax Toolkit does make things easier, but it never seems to do so elegantly.
I personally would make a new Calendar Controller. This way you can control the AJAX (using JQuery/Prototype) calls that are being made. |
A lot of people don't know or use the debugger to it's fullest - I.E. just use it to stop code, but right click on the red circle and there are a lot more options such as break on condition, run code on break.
Also you can change variable values at runtime using the debugger which is a great feature - saves rerunnin... |
As far as I know there's no way to change the client's resolution just using VNC, as it is just a "monitor mirroring" application.
[TightVNC][1] however (which is a VNC client and server application) can resize the screen on the client side, i.e. making everything a little smaller (similar to image resizing techniqu... |
Depending on what your requirements are, Windows Workflow Foundation (.NET 3.5) might be worth having a look at.
The .NET rule engine [InRule][1] supports WF and BizTalk; I've not tried it though so don't know if it's any good.
[1]: http://www.inrule.com/default.aspx |
Depending on what your requirements are, [Windows Workflow Foundation][1] (.NET 3.5) might be worth having a look at.
The .NET rule engine [InRule][2] supports WF and BizTalk; I've not tried it though so don't know if it's any good.
[1]: http://msdn.microsoft.com/en-us/netframework/aa663328.aspx
[2]: http... |
[Fredrik](http://stackoverflow.com/questions/15716/design-problems-with-net-usercontrol#15803) is right, basically, when you need to enable the designer to persist the property to page so it can be instantiated at run time. There is only one way to do this, and that is to write its values to the ASPX page, which is the... |
An other (better ?) way is probablby using the new keyword to prevent a particular method from being overiden:
class A
{
public virtual void Render()
{
}
}
class B : A
{
public override void Render()
{
// Prepare the object for rendering
SpecialRender();
// Do some cleanup ... |
An other (better ?) way is probablby using the new keyword to prevent a particular virtual method from being overiden:
class A
{
public virtual void Render()
{
}
}
class B : A
{
public override void Render()
{
// Prepare the object for rendering
SpecialRender();
// Do some ... |
Check out some of the [mono libs][2]. They have a great one to parse command line arguments but can't remember the namespace.
Miguel just posted some [terminal code][1] as well.
[1]: http://tirania.org/blog/
[2]: http://www.go-mono.com/docs/index.aspx?link=N:Mono.Terminal |
Take a look at the [Enumerable.SequenceEqual][1] method
[1]: http://msdn.microsoft.com/en-us/library/bb348567.aspx |
Take a look at the [Enumerable.SequenceEqual][1] method
var dictionary = new Dictionary<int, string>() {{1, "a"}, {2, "b"}};
var intList = new List<int> {1, 2};
var stringList = new List<string> {"a", "b"};
var test1 = dictionary.Keys.SequenceEqual(intList);
var test2 = dictionary.Values.Seq... |
Dispose does call DestroyHandle, but not always. If I close the parent window, then Windows will destroy all child windows. In this situation Dispose won't call DestroyHandle (since it is already destroyed). In other words, DestroyHandle is called to destroy the window, it is not called when the window is destroyed.
... |
This is not an answer to my quetion, but a solution to my issue example.
Instead of using multiple fixtures or changing the fixtures, I edit the Model::_schema arrays by removing the fields that I wanted to test without. This has the effect that the model acts as if the fields was not there, but I am unsure if this ... |
Consider using <a href="https://facelets.dev.java.net/">facelets</a>- it greatly simplifies the worst parts of JSF development. I'm doing a CMS-based JSF project now without facelets (after doing a project with it) and it feels like my left arm is missing....
|
Partial methods have been introduced for similar reasons to why partial classes were in .Net 2.
A partial class is one that can be split across multiple files - the compiler builds them all into one file as it runs.
The advantage for this is that Visual Studio can provide a graphical designer for part of the clas... |
Having seen a pile of machines recently that don't do it, I don't think that's quite true. The GMA 950 integrated ones don't do it to start with, and I don't think that the 3100/X3100 do either. Also, I don't believe that the GeForce MX5200 supported it either.
Or perhaps I'm just misunderstanding what you mean wh... |
Having seen a pile of machines recently that don't do it, I don't think that's quite true. The GMA 950 integrated ones don't do it to start with, and I don't think that the 3100/X3100 do either (at least not in hardware... the 3100 was enormously slow in a demo). Also, I don't believe that the GeForce MX5200 supporte... |
HTML Select Tag with black background - dropdown triangle is invisible in Firefox 3 |
|html|css|firefox|html-select| |