« first day (621 days earlier)      last day (3402 days later) » 
00:00 - 18:0018:00 - 00:00

6:01 PM
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
 
I presume that's why OP wraps their UoW with a using block
 
the using won't help
the isolation level is set for the connection until it is set again by someone else
disposal doesn't reset it back to what it was
 
feel free to comment ;)
 
no comment
In my experience, people who mess with transactional isolation levels seldom know why it is important, and what the consequences are.
 
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
 
6:05 PM
I have no idea.. I just let EF do its magic.
here
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 Mug 8 secs ago
 
6:18 PM
@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?
 
@Mat'sMug Two ways to do it. In your SQL or using a Derived Column task.
(I recommend doing it in your sql)
 
the function is on SQL Server, the source is on MySQL...
derived column would be reimplementing the T-SQL scalar function, right?
 
Yeah. It would be.
What about an OpenQuery?
 
FML
 
Pull the data from MySQL into memory and run the scalar function on it there.
 
6:29 PM
That's.... what I'm trying to figure out how to do ;)
Perhaps a way to hack up a lookup transform?
 
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.
@Mat'sMug Maybe, but I wouldn't know how.
 
Looks like what I have in TSQL now... don't fix it if it ain't broken?
2
 
Ain't broken if you don't fix it :P
 
@Marc-Andre That!
cough cough My last 10 commits cough cough
 
lol
 
6:35 PM
Most "bug" are just undesirable feature, so most "fix" are breaking existing feature anyway ! :D
3
 
I didn't know you worked for Microsoft @Marc-Andre. =;)-
Nice avatar btw. I like it.
 
Thanks it's my steam avatar to go with my steam username
 
in SQL Helpline, 3 mins ago, by nhgrif
Well, they're both done by MS, and they dont really do consistency...
 
T-SQL dates make me want to find the nearest living thing and kill it.
 
Agreed! T-SQL datetime functions are nearly unusable.
 
6:54 PM
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 Fram 14 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 Mug 14 secs ago
There
 
And my vpn went down. Awesome.
 
7:20 PM
0
Q: Code exercise - Interactive JavaScript Quiz App

Pete834As 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...

 
An my motivation is down. Awesome!
2
 
I guess I'll have to review some code or something...
 
7:34 PM
Offsite (offtopic). Anybody want to comment on this. lokiastari.com/blog/2014/12/30/…
 
hi @crap! that's an... awkward rename...
3
> a complex indevour
typo, shouldn't it be endeavor?
if all of that didn't go 100ft above my head I'd comment to say thanks for the CR toolbox :)
 
@CrappyExperienceBye Sure. I'll comment. It simultaneously makes me want to learn and never learn . =P
 
To all who worked in Java, is there a way to create a static variable for a class that is automatcly generated from an xsd by JAXB ?
Does my question make sense ?
 
I cannot believe how long I can have my interfaces/classes named wrongly sometimes
I mean, every method in the class, every part of documentation refers it to one name, and the class is still named wrong
@Marc-Andre Don't know... what you are trying to do?
 
7:48 PM
@Mat'sMug Well, there ya go...
 
So You Think You Can C++
 
Do you really think that you can C#, can you recall that license plate over there?
 
@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";
 
I don't have experience with that, doesn't seem I can be of any help :p
 
Woah.... that Physics question I wrote went hot I guess. Almost 1k views already.
 
7:52 PM
How hard would I hit the Martian ground?
 
Can you link the Q @RubberDuck?
3 votes and almost 1K views... weird
 
3
Q: How hard would I hit the ground on Mars?

RubberDuckHow 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 $...

5 actually. Anonymous downvoter. Likely some Physics snob that didn't think my question was worth the time to read.
 
Correct me if wrong, but isn't this a really simple physics calculation?
 
F=ma
 
Turns out it is, but I've not taken a physics class in 10 years.
 
7:56 PM
Atmosphere density is a good point though
 
The only thing different between Earth and Mars would be a. Acceleration. Which in this case is acceleration due to gravity.
 
There is a bit of a subtlety to it though. "How hard is the ground?" basically.
 
The grounds hardness doesn't effect force. Perhaps pain, but not force.
 
So, it's not quite as simple as F=ma, you also have to take into account how long it takes you to stop to figure out how hard you hit.
 
Isn't 100kg also biased there? I thought the unit "kg" was related to other factors
 
7:57 PM
It does, read the answers.
@skiwi kg is a mass, not a weight.
Right?
 
@RubberDuck I think that depends on how you use the definition
 
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..
 
You don't lose work on a Mac.
 
you don't lose work on a laptop either ;)
 
@Mat'sMug delegates. That's how you clean up the event tossing UI.
2
Q: Enhance MVC implementation

hofmeisterI 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...

 
8:02 PM
 
Hmhmhm, when I'm building a log parser, am I then parsing entries from a log file or reading entries from a log file?
I'm still confused by the whole issue
 
How does this work? Minimum bounty is 50.
 
I didn't award it manually, but it was eligible for auto-award, which awards half the bounty amount
I'd have awarded it manually (+50) if it addressed the event-tossing...
 
Ahhh gotchya.
 
Something I haven't done in a while
0
Q: Create a static variable from an xsd

Marc-AndreIn 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...

 
8:09 PM
You have to read to parse...
In most cases, you are parsing too.
 
@Marc-Andre and now you remember why it's been that much of a while ;)
-1
Q: Create a static variable from an xsd

Marc-AndreIn 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...

 
Is there no word that both captures reading and parsing as an atomic action?
2
 
@RubberDuck Protected even!
 
@Mat'sMug Yeah but I dont care much about vote since if it really bad someone will comment
 
Parsing captures both. You can't parse without reading...
What would you parse?
 
8:13 PM
@skiwi meh.. in my world there's a Lexer involved too.. would that be lexing?
 
@Mat'sMug What would lexing be?
 
reading, really ;)
 
Ugh :p
 
or tokenizing
@RubberDuck that MVC is borked.
 
How so?
 
8:15 PM
public interface IView
{
    Controller Controller { set; }
}
^^ WRONG!
 
It's really just this...
try (CloseableLogReader logReader = new FileLogReader(file, new HearthStoneEntryParsers()) {
	while (logReader.hasNextEntry()) {
		process(logReader.readNextEntry());
	}
}
 
@Mat'sMug Good catch!
 
versus
 
The view shouldn't know about the controller. You're right.
 
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...
 
8:17 PM
Does it make sense for a parser to take in a HearthStoneEntryParsers?
 
@RubberDuck Probably neither, as now there's a parser using a set of parsers
 
That's what I was thinking.
 
and confusion ensues
 
Perhaps I must call it reader
 
Wait... speaking of confusion. All of the diagrams I'm seeing say the view knows about the controller....
Ohhhhh no. I get it. The controller listens for the views events.
 
8:21 PM
the way I read this, the view knows about the model, and the controller knows about model and view , and ^^^ that
 
So, yeah. View shouldn't have a handle on the controller.
 
and I'm stealing that picture and ditching my yUML
 
You writing a review? =;)-
 
I guess I will not wait for an answer to my question, I really feeling like it's a dumb idea to start with ....
 
Here's an even better one.
 
8:25 PM
great! thanks!
 
ermph.. In the Java room there's a discussion on MVP (or something like it)
the 2nd monitor discusses MVC
 
What are you trying to read/parse?
 
I bet any other chatroom I join now talks about MVVM
 
lol
@RubberDuck there
and now I need to work a little ;)
 
and reading your answer I think I never did MVC correctly..
 
8:32 PM
perhaps the wording is a little off, it's right for the controller to know about both view and model
 
@Mat'sMug And this is why I will always use a laptop.
 
@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.
 
The only thing you can lose is internet.
 
@Mat'sMug: Found it.
 
@CrappyExperienceBye hold on.... ah ok
there's also s/cost/const
 
9:04 PM
2
Q: Forgotten zombie killers

janosZombies 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...

1
Q: Refactoring my Todo List was on my Todo List. How's my MVC?

RubberDuckThis 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...

0
Q: Quick estimation for empirical permutation and correlation test in R

user3789396I 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...

 
@CaptainObvious Interface of the year :P
 
@Marc-Andre ?? what makes you say that?
 
@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 )
 
@Marc-Andre LOL. The UI? Yeah.... I''m not good at that.
It's a VBA add-in though, so it fits right in with the rest of the editor.
 
@RubberDuck Yeah in french "Interface" is UI, and I know I always make everything looks horrible.
 
9:16 PM
It takes a lot of time to make it look good. Being a former art student, you would think I'd be good at it.
I mean, I can be. But the hard part was getting that thing working. Making it pretty is an after thought.
 
0
Q: Refactor Net::SFTP Upload

Graham JacksonI 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...

0
Q: Find intersection of two arrays without depulication

LoveRightA = [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...

 
If I can re-assure you, I've seen a lot of designer or art student doing a lot of bad design. It's magic after all !
 
@RubberDuck I'll make it pretty if I have a minute or two alone with it ;)
 
@Mat'sMug That phrase sounds creepy
 
LOL. You'll get it soon. I have another user control and a form to refactor first.
 
9:27 PM
@Marc-Andre oh.. and I toned it down...
somehow doesn't add up in my mind
what's wrong with ?
 
Idk. What's mvp? model-view-presenter?
What's the difference?
 
TBH... no frakkin' clue
but MVC is heard in web dev, and MVP in WinForms dev, and MVVM in WPF dev
 
What is the difference between all of them?
I sort of know WPF (at least I think I do now), but what are the others?
 
1
Q: Timecode class design

dark_perfectI'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. ...

 
To me "C" from MVC == "P" from MVP.
C/P drives the show and coordinates everything. in MVVM it's the VM
@Vogel612 there's MVVM
 
9:41 PM
So, why the different names?
Is it basically to specify what you are working with when you refer to it?
So you say MVVM, and you always mean WPF?
 
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
 
OK, so how would I do that, assuming I wanted to?
What specifically would change?
 
VM becomes a P
the view no longer binds to a viewmodel
and you have dozens of event handlers in the code-behind
 
I see.
And what about the C?
 
9:45 PM
5 mins ago, by Mat's Mug
To me "C" from MVC == "P" from MVP.
 
So nothing is different in the code in MVC and MVP?
Just two identical names?
 
@Mat'sMug I've always wondered why it is two different things...
 
927
Q: What are MVP and MVC and what is the difference?

WolfbyteWhen 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...

2
> 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! — Pierreten Mar 5 '10 at 3:55
 
I approve this message
4
A: What's a Zombie? And what are the many other memes of Code Review?

PhrancisMeme: 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 ...

 
@Malachi I really wonder how many times that question has been posted.
 
9:50 PM
@Hosch250 I don't think that you meant to ding me on that one????
 
73 times.
Yes, I did.
Posts from the QA have been linked to at least 73 times.
 
oh I see said the blind man to his deaf wife as he pee'd into the wind, it's all coming back to me now.
 
@Hosch250 25 from me
 
lol
 
> 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.
 
9:54 PM
yep. MVP
Ctrl+R,R -> "Controller" -> "Presenter"
 
> One other big difference about MVC is that the View does not directly bind to the Model.
 
and MVVM
 
So what is it when you have go V -> M -> VM -> V?
 
Yup. I need to replace Controller with Presenter. No doubt now that I read that.
 
@Hosch250 a headache
 
9:56 PM
Where the V calls the VM through the M, the VM changes something, which directly changes the V?
:)
 
So, I missed the mark, but it's still better than having everything crammed in the code behind.
 
That is what my back and forward buttons do.
Back in the V calls OnBackClicked in the M, which calls GoBack in the VM, which changes the V.
 
Jun 3 '14 at 12:38, by Vogel612
could it be that nobody really knows how MVC works??
3
 
Ohhhhh if I only had a star for that.
 
8 questions away from Inquisitive.
 
10:02 PM
Looks like Pops is lurking around.
Nice analysis. Throwing together a short tag wiki might be helpful here. — Pops ♦ 53 secs ago
 
@RubberDuck talk about MVC tomorrow as well and I can link it again.
I have linked it before:
Jun 3 '14 at 12:42, by Simon André Forsberg
4 mins ago, by Vogel612
could it be that nobody really knows how MVC works??
 
0
Q: Simplify this if then statement

user2867494I 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)')...

 
+140 today ...I wonder....
 
@CaptainObvious Simplify this title
 
@Mat'sMug ...if santa is around?
 
10:17 PM
> Is there a way to simplify this so it can search the href path of .mainmenu a instead of explicitly stating each one?
Does that sound off-topic, or not quite?
 
I don't know. He has working code, there are other similar questions.
Should it be on SO instead?
 
0
Q: Copy arbitrary number of bits at arbitrary offset from buffer to another buffer

Xion345I 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...

 
@Jamal I think it would warrant a comment to ask the OP if they are just looking for a review, or if they need help making the code do something new?
 
@Jamal I think it is on-topic.
 
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
 
10:20 PM
@Phrancis they don't need help doing something new, they are asking for help in doing the same thing in a better way.
 
Cool
 
@Jamal and answered, CR-style:
0
A: Applying an id attribute based on a variable's value

Simon André ForsbergWhat 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])...

 
Thanks Santa!!!
 
8 rep from 22K, and I still have one one-away.
 
@Mat'sMug but.... but.... I only voted on one of your answers?
@Jamal you have nothing.
 
10:30 PM
:-)
 
@SimonAndréForsberg you're not the only one with a red had and a white pom-pom eh?!
 
apparently not! thankfully.
 
TTQW/TTGH
what a day!
 
Gotta love SQL Server... This mistake did not even throw a syntax error:
CREATE TABLE foo
(
  id INT,
  string VARCHAR(10),
);
 
10:46 PM
Morning alls
and what is even the mistake @Phrancis? Is it the second comma ?
 
Yep. All other RDBMS I tested threw an error, even MySQL...
 
because if it is I remember I came across something similar once in C# and I thought maybe it's not a bug but it's actually allowed to do so
Which company even makes Sql Server... They must be high or something :P
 
Microsoft
 
YAYYYYYYYYY... :D all wanted to hear
 
(and there's your answer for C#!)
 
10:52 PM
@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
 
0
Q: Improved countdown program in x86 NASM

SirPythonA 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:...

 
TTGH
 
Bye!
 
way to crush my dreams the night before an exam, BBC
> In reality, this particular kind of sleep learning is almost certainly impossible
 
Hah! I too was a bit excited.
That would make studying a lot easier.
 
11:09 PM
New 2K user!
 
A friend of mine just posted his first question:
1
Q: High-Low Guessing Game

Henrik BohlinThe 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 { ...

 
@SimonAndréForsberg pimping a friend and his question at the same time :P
 
11:24 PM
3
Q: High-Low Guessing Game

Henrik BohlinThe 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 { ...

 
even YOU captain ? He must have lots of fans @SimonAndréForsberg ;)
 
11:50 PM
@SimonAndréForsberg Think we may have a new user soon? :)
 
@Phrancis I don't think he will be addicted like us, but I hope he will come back with good questions.
 
Is Swedish from germanic roots?
 
Is it pronounced similarly, or not quite?
 
ummm, depends on the word perhaps.
 
11:52 PM
translate se: That's not a number. Please enter a value
 
@rolfl Det är inget tal. Ange ett värde
 
translate swedish: That's not a number. Please enter a value
Thanks system.
 
@rolfl You're welcome.
 
Hey there @HenrikBohlin!
2
 
hi there man :)
 
11:56 PM
We were just talking about your question, glad you found your way to Code Review
 
@SimonAndréForsberg wouldn't shut up about it! :3
but I must say it seems pretty good :)
 
00:00 - 18:0018:00 - 00:00

« first day (621 days earlier)      last day (3402 days later) »