I don't know that it's a very good idea to be changing back and forth between isolation levels
the isolation level of a connection doesn't reset when you return it to the pool, so if you forget to set it to the appropriate level in every single place you touch the database, you risk unexpected behavior
on that note, TransactionScope's default isolation level is Serializable, but the SQL Server default is ReadCommitted, so it's common for people to create factory methods for TransactionScope which explicitly set its isolation level
There's a balance between ease of use (i.e. using-friendliness) and how "pure" you want things to be - I'm just pointing out that not all implementations may need to be disposable. As for the isolation level, by changing it on a whim you may be running into unexpected issues unless you're using SQL Server 2014. — Mat's Mug8 secs ago
@anyone, I have a scalar-valued function (T-SQL) that I want to use to compute a new column in a SSIS workflow, based on the value of another column.... anyone has a clue?
Something like this is how I would go about it. (But that requires you having your remote set up as a linked server)
SELECT *, SOMEFUNCTION(SOMEFIELD_FROM_REMOTE) AS SOMEFIELD
FROM OPENQUERY(LINKED_SERVER,
'SELECT *
FROM MYSQL_TABLE
WHERE -- FILTERING REMOTE SIDE IS MORE EFFICIENT
')
Sucks passing the query as text, but it works without much hassle.
Ouch. Not what I was expecting from you. Kind of goes against everything you have been saying so far. "...then it knows more than it should about the implementation behind the interface it's presented." — Issa Fram14 mins ago
Eh.. I'm only human!
Actually, the simpler way is to let the IoC container deal with the lifetime of your UoW - that's what IoC containers do! — Mat's Mug14 secs ago
As an exercise to practice JavaScript, I built a quiz app, for which I would appreciate a short review for improvements. The quiz stores the questions in an array of objects, loads the questions individually in the view, checks if an answer option has been selected and if the selection is correct...
@skiwi I'm creating the xsd that generate classes that we use a the domain model for our application. I need a public static final String EXTENSION_CODE = "FinancialActivityExtension";
How do you calculate with how much force a mass would hit the ground when falling from a certain height?
In particular, I'm curious to know how the force of impact on Earth compares with Mars, so surface gravity needs to be accounted for.
According to wikipedia, Mars has a surface gravity of $...
working on a laptop with a 2nd monitor gets funny when there's a power failure and everybody around you goes "WTF!!!!" and all you can see is your 2nd monitor turned off... and you just continue working while everybody is bitching about having lost their work..
I know that there are several ways to develop the MVC pattern. To improve consistently my knowledge, I would like to get some advice and feedback. How could I enhance my code? I knew that there are several lines of code, but it would be great if you help me improve my skills.
The Model store the...
In a project I'm working on, we generate classes from multiple xsd. Some of my classes need a public static final String EXTENSION_CODE = "NAMEOFTHEEXTENTION";. The xsd of my class looks something like :
<xsd:complexType name="SomeExtension">
<xsd:sequence>
<xsd:element name="ID" ty...
In a project I'm working on, we generate classes from multiple xsd. Some of my classes need a public static final String EXTENSION_CODE = "NAMEOFTHEEXTENTION";. The xsd of my class looks something like :
<xsd:complexType name="SomeExtension">
<xsd:sequence>
<xsd:element name="ID" ty...
try (CloseableLogReader logReader = new FileLogReader(file, new HearthStoneEntryParsers()) {
while (logReader.hasNextEntry()) {
process(logReader.readNextEntry());
}
}
try (CloseableLogParser logParser = new FileLogParser(file, new HearthStoneEntryParsers()) {
while (logParser.hasNextEntry()) {
process(logParser.parseNextEntry());
}
}
Though now a closeable log parser doesn't make much sense anymore...
@Mat'sMug I did a couple of searches for variations of "endeavor" to try and find the word but I can't (Being dyslexic does not help). Can you put that is ed replace command s/XXXX/endeavor/ (that's how I have trained my team to tell me where my spelling mistakes are in code reviews). that would make it a lot easier for me to find.
Zombies are questions with no upvoted answers.
I came up with this SEDE query to find answers with zero votes on questions that have no accepted answer and no answers with greater than zero score.
In other words, answers on questions that show up on the Unanswered tab,
until the answer receives a...
This is a follow up to Rolling my own Configuration with UI. I got a lot of great advice about the Configuration system I created, but no one touched on how all of my logic for the UI was in the code behind of the control. I decided that it was a bad idea, and took a stab at the Model-View-Contro...
I have two matrices (a, b) each including 3 genes and 6 observations. I have estimated spearman correlation for gene pairs (rcorr.observed). Then I want to do an empirical permutation (1000 times) and estimate correlation for each time. Then achieve Pval_estim file. Since I have a very huge datas...
@RubberDuck I'm just kidding ! The user interface is all grey with big buttons but small text. Looks liek the kind of UI I do because I can't seems to do something that look nice. (I really don;t want to be mean )
I have a method to upload a file using the Net::SFTP gem. My method looks like this:
class Uploader
def initialize(host,user,password)
@host = host
@user = user
@password = password
end
def upload(local_file_path,remote_file_path)
Net::SFTP.start(@host,@user,:password => @passwo...
A = [9, 1, 4, 2, 5] k unique integers
B = [3, 1, 8, 7, 6, 5] n unique integers
Intersection => [1, 5]
Find an algorithm that uses O(1) space and run as fast as possible.
private static List<Integer> getIntersectionO1Space(List<Integer> a, List<Integer> b)
{
List<Integer> intersection = ne...
I've created a Timecode class. The "timecode" that I'm trying to represent is a timecode that is used in video editing quite often, and is seen displayed in the format "hh:mm:ss:ff", or 10:00:05:24, for example ("ff" = frames"). Without further ado:
/// <summary>
/// Immutable timecode.
...
WPF facilitates MVVM because of its formidable data binding capabilities - nothing (except common sense) forbids throwing it all out the window and going MVP in WPF
When looking beyond the RAD (drag-drop and configure) way of building User Interfaces that many tools encourage you are likely to come across 3 design patterns called Model-View-Controller, Model-View-Presenter and Model-View-ViewModel. My question has three parts to it:
What issues do these pa...
> This differs from MVP where actions route through the View to the Presenter. In MVC, every action in the View correlates with a call to a Controller along with an action.
Holy cow, this is the most lucid description i've ever come across. This could seriously replace about 3 books from my shelf! — PierretenMar 5 '10 at 3:55
Meme: HOLY CARP
Originator: Malachi
Cultural height: Mostly The 2nd Monitor
Background: Dec 2013
It may or may not have been a typo, but as recorded in The 2nd Monitor originally:
Malachi Dec 11 '13 11:10 PM
105.1k close votes needed on Stackoverflow. holy carp
It has since been used ...
> The Presenter handles user gestures. The View binds to the Model directly through data binding. In this case it's the Presenter's job to pass off the Model to the View so that it can bind to it. The Presenter will also contain logic for gestures like pressing a button, navigation, etc.
This sounds an awful lot like what I actually did.
I have the following code that checks the value of a variable, and then will apply the correct id attribute accordingly.
Is there a way to simplify this so it can search the href path of .mainmenu a instead of explicitly stating each one.
if (menuLink == "whatsnew") {
$('.mainmenu a:eq(1)')...
I have just written a function copy_lowbits_off to copy any number of bits (not bytes) from a source buffer to a destination buffer. The function also supports arbitrary offset (expressed in bits) in the source and the destination buffer.
Could you have a look at it and let me know if anything c...
So, it looks like so far, most like the code formatted to have numbers on all lines. In case anyone is interested but has not had a chance, here's the question
What you need is an array!
And to remember that you can dynamically construct jQuery selectors.
Then you need to loop through the array and search for the matching menuLink:
var links = ["whatsnew", "products", "contact"];
for (var i = 0; i < links.length; i++) {
if (menuLink == links[i])...
@Mat'sMug might know about this. seems he got home already. Is there a place which you're allowed to leave the last loner comma with nothing afterwards Mat?
@Mat'sMug BTW do you live in the top floor of your company? cuz it literally took you less than 5 mins to go home :O
A while back, I posted a question involving code of the same function. This post contains improved code.
From the last post, I have improved size, my work with conventions, and my comments. I was also able to minimalism memory interaction to speed things up/make things more efficient.
The code:...
The program is asking you to guess a number 1-100 and if you guessed too low it says that in Swedish and the same goes for if it's too high and if it's the correct answer it says congratz you guessed right in Swedish.
I'd like comments about any aspects of my code.
public class Kidsprogram {
...
The program is asking you to guess a number 1-100 and if you guessed too low it says that in Swedish and the same goes for if it's too high and if it's the correct answer it says congratz you guessed right in Swedish.
I'd like comments about any aspects of my code.
public class Kidsprogram {
...