instruction
stringlengths
0
30k
|sql-server|powershell|
I have a large csv file and I want to execute a stored procedure for each line. What's the best way to execute a stored procedure from Powershell?
If it is just ONE workstation returning the row then it sounds like that workstation has an open transaction that has not been committed. Otherwise is it possible that the isolation levels are different for different workstations, ie. some will see uncommitted data and other wont?
No arguments in DIVs favour from me. I'd say : If the shoe fits, wear it. It's worth noting that it's difficult if not impossible to find a good DIV+CSS method of rendering contents in two or three columns, that is consistent on all browsers, and still looks just the way I intended. This tips the balance a bi...
Can you explain more why SPSS itself isn't a fine solution to the problem? Is it that it generates pivot tables as output that are hard to manipulate? Is it the cost of the program? F-statistics can arise from any number of particular tests. The F is just a distribution (loosely: a description of the "frequenc...
Indeed, JNA looks impressive, it requires less effort than directly using JNI. But in any case you'd loose the platform independence, and since you're probably only using a small part of it, you might consider translating what you actually need.
**Pastebin** is a common solution to this. Just install somewhere on your network, then paste snippets. [http://pastebin.com/][1] Works well when trying to debug a piece of code, or stack trace also. [1]: http://pastebin.com/
I would recommend http://msdn.microsoft.com/en-us/vsx/cc677256.aspx for DSL Tools as a starter. Also, check out the concept of MDSD (Model Driven Development). An expert on that topic (and DSL's) is Markus Voelter: http://www.voelter.de/ I believe there are so many similarities between MDSD, Software Production...
I write a lot of test code to do range/validity checking on my code. This tends to catch most of these types of situations - and definitely helps me write more bulletproof code.
I have never encountered a C#->Java conversion tool. The syntax would be easy enough, but the frameworks are dramatically different. Even if there were a tool, I would strongly advise against it. I have worked on several "migration" projects, and can't say emphatically enough that while conversion seems like a good ...
Cognos is a robust suite of tools (we use it as a front-end for an Oracle back-end), but there's a pronounced lack of documentation on how to accomplish complex reporting tasks -- mostly, you end up banging on it until you get something to work. I wouldn't discount the usefulness of using Microsoft Access as a repo...
function SelectElement(valueToSelect) { var element = document.getElementById('leaveCode'); element.value = valueToSelect; }
You could use this tool apparently - [Microsoft Script Debugger][1] Personally I try to go through the code and figure out what's going on - it gives you the line number where it goes wrong right? [1]: http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=e...
Not answering the question, but you can also select by index, where i is the index of the item you wish to select: var formObj = document.getElementById('myForm'); formObj.leaveCode[i].selected = true; You can also loop through the items to select by display value with a loop: for (var i = 0, len ...
It comes down to what you need it for. Its main strength is the easy maintainability of the transform, and writing your own parser generally obliterates that. With that said, sometimes a system is small and simple and really doesn't need a "fancy" solution. As long as your code-based builder is replaceable without h...
I agree that Wireshark might be all you need. If you want to write your own filter application and can use Vista, then check out the [Windows Filtering Platform](http://www.microsoft.com/whdc/device/network/WFP.mspx).
Try AscW()
A Future encapsulates a deferred calculation, and is commonly used to shoehorn lazy evaluation into a non-lazy language. The first time a future is evaluated, the code required to evaluate it is run, and the future is replaced with the result. Since the future is replaced, subsequent evaluations do not execute the ...
Using WPF you can build desktop and then almost 1:1 port it to silverlight and target the web
You don't tell us which version of rails you are using, but I would recommand you use the following form instead of overloading find yourself : account.contacts.find(...) this will automatically wrap the find in a scope where the user clause is included (since you have the account_id I assume you have t...
You don't tell us which version of rails you are using [edit - it is on rails 2.1 thus following advice is fully operational], but I would recommand you use the following form instead of overloading find yourself : account.contacts.find(...) this will automatically wrap the find in a scope where the use...
The anwer is this; it searches through the entire application domain -- that is, every assembly currently loaded by your application. /// <summary> /// Returns all types in the current AppDomain implementing the interface or inheriting the type. /// </summary> public static IEnu...
When you create a future, a new background thread is started that begins calculating the real value. If you request the value of the future, it will block until the thread has finished calculating. This is very useful for when you need to generate some values in parallel and don't want to manually keep track of it all....
It's simple -- just add the name of the method to the end of http://msdn.microsoft.com//library/<method>. For example, to find the URL for the System.Byte.ToString method go to [http://msdn.microsoft.com//library/System.Byte.ToString][1] [1]: http://msdn.microsoft.com//library/System.Byte.ToString
Aside from limiting the columns selected to reduce bandwidth and memory: > DataTable t; > t.Columns.Remove("columnName"); > t.Columns.RemoveAt(columnIndex);
How to display a dynamically allocated array in the Visual Studio debugger?
|c++|visual-studio|debugging|
If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it. Is there an easy way to tell the de...
I set up dekiwiki on a server at work that my coworkers and I use for company specifics stuff but also for general programming tips that arise as well.
A simple wiki, may be useful. See[Tiki Wiki][1] [1]: http://info.tikiwiki.org/tiki-index.php
You could write a small redirect script to take care of this simply and quickly. <?php header( 'Location: http://guardthe.net/punbb/' ); ?> Enter that as the only content in your index.php in your root directory, and any requests sent to that folder will then redirect the user to the forum.
Bash is the standard, so it is easier to find help when needed.
I use [neomem][1] all the time. I write notes to myself. Then I can later search for it. [1]: http://www.neomem.org/
Personally you might just script the objects to file using SQL Server Management tools, it will get a few extras in there for the checks to do the drop first incase the object exists.
unsigned char
|c++|c|
In C/C++, what is an unsigned char used for? How is this different from a regular char?
> 1) Define Maintainer class as a Spring bean. Standard Spring syntax applies: <bean id="maintainer" class="com.example.Maintainer"/> > 2) Make it so that all sorts of listeners would be able to register themselves to Maintainer via XML by using addListener method. Spring doc nor Google are very generous...
If you're looking for something that extends C# then no, but there is F# which is a .NET based functional language. From the "About F#" [page][1]: > F# is a typed functional programming language for the .NET Framework. It combines the succinctness, expressivity, and compositionality of typed functional programming w...
I would just invite them into my SVN tree on their own branch so they can provide changes and I can see them and integrate their changes into my development tree. Don't fight it, embrace it.
Applying UML and Design Patterns. It helped design patterns to click with me, and provided a justification for UML that made sense to me in the phrasing 'UML as Sketch'. Namely that UML should be used as a brief sketch of the system that has the additional benefit of you not having to explain the notation to others ...
Better use grid view control, but if you want **only** one column with checkboxes and that column is the **first** one you can just write: this.listView1.CheckBoxes = true;
You would probably need to access the class as the type that your Global.asax.cs is rather than the type it is inheriting from. I believe it is more common to just use the Application State object for application wide variables.
You want a PolicyComparator class. If you want to override < and >, that's fine, but do that overriding in the Policy base class, and have those implementations utilize PolicyComparator to do it.
I use [Rafel Lima's Browser Selector][1] when I need to tweak differences between IE/Standards browsers. It greatly reduces using "hacks" in your HTML to solve common problems. You can target CSS statements for different browsers, or even different versions of browsers (Hello IE 6). It's very simple to implement, bu...
As I understand the question is that you have a subversion repository checked out on a laptop (or some other computer) that you checked out at work using the ip address 192.168.0.10, and now you're at home and want to use it. Personally I wouldn't try any fancy network reordering (or modifying the hosts file) but ju...
You can also add class variables to classes on the fly >>> class X: ... pass ... >>> X.bar = 0 >>> x = X() >>> x.bar 0 >>> x.foo Traceback (most recent call last): File "<interactive input>", line 1, in <module> AttributeError: X instance has no attribute 'fo...
You can also add class variables to classes on the fly >>> class X: ... pass ... >>> X.bar = 0 >>> x = X() >>> x.bar 0 >>> x.foo Traceback (most recent call last): File "<interactive input>", line 1, in <module> AttributeError: X instance has no attribute 'fo...
You could use a [MaskedTextBox][1] [1]: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx
Also look at [data URIs][1] (though IE versions below 8 don't support them, unfortunately!) [1]: http://en.wikipedia.org/wiki/Data:_URI_scheme
Why don't you just access svn via 127.0.0.1? Surely this would be a better solution? You're faced with several issues here, if I understand correctly. There's only one way you can make this work, that is to have your home machine have an address of 192.168.0.10. Then, you specify the ssh local address with 192.16...
Starting with WinForms 2.0, you have a MaskedTextBox. You can set the mask to whatever you want, i.e. for numbers use the mask all 0s.
Which version of SQL Server do you run? You can write a stored procedure to do this, looking at the data from sp_who and then making some guess about the last activity. There's a "LastBatch" column that does the last time something was submitted by this user. I'd say if that is over an hour old (or whatever interval), ...
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
|language-agnostic|algorithm|microsoft|puzzle|
taken from [here][1] >>> reversewords = lambda s: " ".join(reversed(s.split())) #NOTE: it does not meet the requirements! >>> reversewords("this is a string") string a is this It should be O(N) in time and O(1) in space (no *split* allowed). [1]: http://halcyon.usc.edu/~kiran/msqs.html#pr...
taken from [here][1] >>> reversewords = lambda s: " ".join(reversed(s.split())) #NOTE: it does not meet the requirements! >>> reversewords("this is a string") 'string a is this' It should be O(N) in time and O(1) in space (no *split* allowed). [1]: http://halcyon.usc.edu/~kiran/msqs.html#...
|language-agnostic|algorithm|puzzle|
Example input and output: >>> reverse_words("this is a string") 'string a is this' It should be O(N) in time and O(1) in space. The puzzle is taken from [here][1] [1]: http://halcyon.usc.edu/~kiran/msqs.html#programming "Microsoft Interview Questions"
Example input and output: >>> reverse_words("this is a string") 'string a is this' It should be O(N) in time and O(1) in space (`split()` and pushing on/poping of stack are not allowed). The puzzle is taken from [here][1] [1]: http://halcyon.usc.edu/~kiran/msqs.html#programming "Microsoft Int...
*I don't have enough reputation to comment, so a new answer...* In that case I think there are only two options: run a service that converts the existing video feed to a more useable feed (for example to wmv, is accepted by most clients), or create some kind of 'applet' (like in Flash) that updates the image every s...
@Stephen Bailey To complete your answer, you can also delegate the user rights to the project manager, through a plain text file in your repository. To do that, you setup your svn database with a default authz file containing the following #################################################################...
Use high precision floating point numbers like a [long double](http://en.wikipedia.org/wiki/Long_double).
When I import a new CA certificate in firefox (etc) I have the option of choosing which certificate uses I trust: * sign servers * sign code (like your applet) * sign email certs So to me the answer is Yes, they're the same. Furthermore, why not generate your own with openssl. (man openssl, man x509, man req,...
When I import a new CA certificate in firefox (etc) I have the option of choosing which certificate uses I trust: * sign servers * sign code (like your applet) * sign email certs So to me the answer is Yes, they're the same. Furthermore, why not generate your own with openssl. (man openssl, man x509, man req,...
I'm afraid I'm unable to test this at the moment, but in the past, I believe I had to give each option tag an ID, and then I did something like: document.getElementById("optionID").select(); If that doesn't work, maybe it'll get you closer to a solution :P
Oracle ASP.net Provider-model objects performance
|asp.net|oracle-database|provider|11g|
Oracle 11g version of ODP.Net introduces the provider model objects (session state provider, identity provider etc) which lets the application to store these information in an oracle DB without writing custom provider implementation. Has anyone has done any performance benchmarking on these objects? how do they comp...
Consider using [ImageScience](http://seattlerb.rubyforge.org/ImageScience.html), RMagick is known to leak massive amounts of memory and lock.
<pre> <code> function foo(value) { var e = document.getElementById('leaveCode'); if(e) e.value = value; } </code> </pre>
Argh - the bane of my existence over the last week. Sqlite3 locks the db file when any process *writes* to the database. IE any UPDATE/INSERT type query (also select count(*) for some reason). However, it handles multiple reads just fine. So, I finally got frustrated enough to write my own thread locking code around...
You have to start slow and small. Take a portion of code and look at all of the external interfaces. You have to absolutely sure that these don't change. Now that you have defined that start to look at the internal structure of it and slowly change it around. You'll have to work in small steps and check in frequent...
You have to start slow and small. Take a portion of code and look at all of the external interfaces. You have to absolutely make sure that these don't change. Now that you have defined that start to look at the internal structure of it and slowly change it around. You'll have to work in small steps and check in fre...
I prefer to use getters rather than constants. Those getters might return constant values, e.g. `public int getMaxConnections() {return 10;}`, but anything that needs the constant will go through a getter. One benefit is that if your program outgrows the constant--you find that it needs to be configurable--you can ...
Performance of an large directory structure, networked application
|performance|link-performance|nfs|academic|
I'm trying to find out what the performance of a large directory structure would be if deep directories were to be accessed on a shared, nfs filesystem. The structure would be excessively large, with 4 levels of nested directories, each level containing 1024 directories. (1024 at root, 1024 in a given subdirectory, and...
That's because the suggested answer is for DB2, not Informix. The sysmaster database (a virtual relational database of Informix shared memory) will probably contain the information you seek. These pages might help you get started: - <http://docs.rinet.ru/InforSmes/ch22/ch22.htm> - <http://www.informix.com.ua...
VBA strings are based from 1 so you should probably use "For iter = 1 To Len(cell_val)" (step 1 is the default).
I assume from the body of your question is you're a business user? I purchased a 6TB RAID 5 unit from Silicon Mechanics and have it NAS attached and my engineer installed NFS on our servers. Backups performed via rsync to another large capacity NAS.
What about Silverlight? Also XAML based solutions with MVP pattern applied could be very good, when UI layer could be rendered based on front-end type and has no strong relationships with business model. Cheers!
I wrote a recursive version of the solution in lisp. If the length of the list is greater that 2 it splits the list in half as best as it can and then tries merging the sublists (defun concatenate-string(list) (cond ((= (length list) 1) (car list)) ((= (length list) 2) (concatenate...
Quick advice on best practices before I babble on about the magic *this* variable. If you want OOP in Javascript that closely mirrors more traditional/classical inheritance patterns, pick a framework, learn its quirks, and don't try to get clever. If you want to get clever, learn javascript as a functional language, ...
Great question! if you are using c++ and you are developing real-time CPU-and-memory boud application (like games) you need to write your own Memory Manager. I think the better you can do is merge some interesting works of various authors, I can give you some hint: - Fixed size allocator is heavily discussed, ...
You are right about the inner pattern being troublesome. ((.){1,}?) That is doing a captured match at least once and then the whole thing is captured. Every character inside your tag will be captured as a group. You are also capturing your closing element name when you don't need it and are using {1} when that...
Read Firefox 3 bookmarks
|firefox-3|bookmarks|parsing|sqlite|
Firefox 3 stores the bookmarks in a sqlite database. There are several hacked sqlite java libraries available. Is there a way to hack the sqlite database in java(not using libraries) to read bookmarks reliably? Does someone know how the sqlite DB is stored and access programmatically (from java)?
|java|parsing|sqlite|firefox-3|bookmarks|
I am not aware of any specific RSS library. But the format is fairly simple so any library that can write xml will do at that level. You could have e.g. a look at the nuclblog (http://cyrusharmon.org/projects?project=nuclblog) project as that has the capability to generate an RSS feed for the blog entries it mainta...
A frequent source of these bugs is when you have a method that accepts a reference or pointer to an object but leaves ownership unclear. Style and commenting conventions can make this less likely. Let the case where the function takes ownership of the object be the special case. In all situations where this happen...
VS2008 Setup Project always requires .NET 3.5 at install time but I don't need it!
|.net-3.5|.net-2.0|installation|
1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. 2, Create a Setup project that installs just the single executable from the Windows Forms project. 3, Run that installer and it always says that it needs to install ...
When I implement the render states for "A" (that is paint the source pixel color/alpha and ignore the destination pixel color/alpha), Direct3D doesn't seem to perform the operation correctly if the source has an alpha value of zero. Instead of filling the target area with transparency, I'm seeing the target area remai...
If you use the /k argument, you can add a single line to execute a change drive and change directory. For instance: `C:\Windows\System32\cmd.exe /k "d: & cd d:\storage"` Using `&` you can string together many commands on one line.
If you use the /k argument, you can add a single line to execute a change drive and change directory. For instance: `C:\Windows\System32\cmd.exe /k "d: & cd d:\storage"` Using `&` you can string together many commands on one line. Edit: You can also change drive with the cd command alone `"cd /d d:\storage"`. ...
What XML parser do you use for PHP?
|php|xml|