« first day (819 days earlier)      last day (3496 days later) » 

14:01
0
Q: Is this the best way to update entities with Entity Framework?

OrtundMost of the time I update (lets say a user account) in the following way: public ActionResult Edit(int id, User source) { User existing = db.Users.Single(x => x.Id == id); if (existing != null) { existing.Username = source.Username; existing.EmailAddress = source.Ema...

Well... that's only part of the question
Can somebody improve the title on this question?
14:20
@Quill What does the B stand for in his BFS?
Best or Breadth?
Badly written, maybe
Breadth-first-search probably?
That's what I expect, yea
Fixed the title.
@Mast, I know the border is thin between SO and CR - I could specifically address the issue that I am aware of... then return for the code review, because I am certain that it needs improvisation (all over). I will return with better code and update this question. Thank you lesson learned. — John Spiteri 14 mins ago
OP is enlightened.
I may have opened a can of worms with my Windows 10 question on skeptics. Perhaps I should stick to CR.
link?
10
Q: Is the Windows 10 upgrade event the largest upgrade event?

MastI got an e-mail from Microsoft about my Windows 10 reservation. It's lacking free-hand circles, but the message is clear. Microsoft states it's the largest software upgrade event ever. Are there any numbers to back-up this claim or to prove it's false?

14:31
0
Q: Create a text index of files in python

Prabhat SainiThis program creates a text index of 3 different files in python. While, this works correctly I am still a beginner on python. I used a list of class objects. Can this code be further optimised? class ListNode : def __init__(self,w,docslist) : self.word = w self.docslist = ...

On a more related note, this question seems to be on-topic now
-1
Q: Improvising Code Into A More DRY Approach?

John SpiteriThis code feels like it can be drastically improved. Should the for loop be replaced with an array.filter()? $scope.categories = inputCategories($scope.item.categories, $scope.settings.categories, "category"); function inputCategories (input, settings, category) { var updatedSettings = []; ...

Still a lousy title, but hey.
Greetings
@Mast, I know the border is thin between SO and CR - I could specifically address the issue that I am aware of... then return for the code review, because I am certain that it needs improvisation (all over). I will return with better code and update this question. Thank you lesson learned. — John Spiteri 33 mins ago
Yeah, I've found a site to generate the algorithms for my library. Next step is to find a site to generate the testsuite.
The border isn't thin. Actually, it is well defined: StackOverflow to fix code, Code Review to improve the written code (and not to fix the end result)
What algorithms?
Actually original parts in the library: the interface of 2~3 functions.
@IsmaelMiguel Sorting algorithms for fixed numbers of values.
14:42
How many values?
Currently, I have the algorithms for 0 to 6 values.
The site gives me algorithms for up to 32 values.
Yes.
Er, no.
It gives me the results as a series of calls to SWAP where SWAP is something that you can reimplement in your favourite programming language.
14:46
Never heard of it
But it's always good to learn something new
@IsmaelMiguel SO does more than fix broken code.
@nhgrif Stargreed.
@Morwenn Shiny.
@nhgrif Besides being as a$$ to newusers, what else does it do?
Well, I fundamentally disagree with the unnecessary first part of that question.
The only people who are poorly treated are people who write poor questions and don't read any of the help center, etc.
14:48
@IsmaelMiguel Answer some abstract question, explain pieces of code, gives rationale for anguage design decisions...
And that applies to new AND old users.
That too
Or, if the moderators don't like you
You may expect a bad experience
You still have nothing more than a story.
And only your own perspective of that story.
14:49
I know
@IsmaelMiguel SO has very decent moderators.
I've never had a problem with any of the SO moderators.
@Mast I tend to disagree. The few I know, I didn't liked. I'm not saying they are all bad. I'm saying I hate some.
@nhgrif That.
I had a few
14:58
A few problems with SO moderators? I regularly have a problem with some of the members, but never, absolutely never with the moderators. They're good guys.
Well, I had problems with the users too
Martijn visits every once in a while if we have a SO/CR scope problem.
0
Q: jQuery plugin that make a div slide to the side of the page on scroll

D4V1DThis is my first post on Code Review Stack Exchange. I'm pretty active on Stack Overflow but as I don't have any specific problem and rather seek for a review of my code, here I am. So I wrote my very first jQuery plugin. In short: it makes, on scroll, a div to move from outside the page to any ...

We will be starting out Q&A read-only test in a few minutes.
Yeah, I saw him a few times.
He's ok
15:02
What's wrong with this question? Should I hammer-reopen or you're on it?
-1
Q: Improvising Code Into A More DRY Approach?

John SpiteriThis code feels like it can be drastically improved. Should the for loop be replaced with an array.filter()? $scope.categories = inputCategories($scope.item.categories, $scope.settings.categories, "category"); function inputCategories (input, settings, category) { var updatedSettings = []; ...

@StackExchange That means?
@Morwenn expect the site to go readonly for a few minutes
It's the "test" part that I have troubles putting in its place.
You gotta test that those sprinklers work, no?
@Mat'sMug During office hours?
15:05
It is Saturday, right?
@skiwi lol ...on weekends?
@Mat'sMug I meant testing the sprinklers ;)
You know what I mostly like about free-world games?
If this code is working, then it may be a more suitable question for codereview.stackexchange.comnha 28 secs ago
Read-only Denver data center failover test is starting now.
15:19
Anyone else is seeing this?
Me, too. For a second, I thought my IP was being hobbled or something.
yeah
I guess their failover already failed
It's gone now
Blheargh!!!
any idea how long read-only is supposed to last? I just finished an answer.
I would say 1 hour
This Saturday we’ll be testing our new DR datacenter in Denver, Colorado. We will begin around 10AM EST (14:00 UTC). We expect the test itself to be approximately 15-30 minutes in duration once it begins and the total window for this op to be around 4 hours. We’ll begin prepping at the start which means actual user impact will begin some time after that.
15:46
0
A: Recursive function to show directions for multiple locations

nhgrif private func getDirections(#fromLocationCoord: CLLocationCoordinate2D, toLocationCoord: CLLocationCoordinate2D) { let fromLocationMapItem = MKMapItem(placemark: MKPlacemark(coordinate: fromLocationCoord, addressDictionary: nil)) let toLocationMapItem = MKMapItem(placemark: MKPlacemark(co...

Nice, it isn't read-only anymore
It looks like I still have some time to register for a community college class for the fall. Some (still open) choices include advanced C++, intro to scripting languages with Python, and fundamentals of MySQL.
@Jamal Haha, advanced C++ will not be advanced enough for you :D
We're bringing all traffic back to New York (exiting read-only) now.
I would see it as more of a review anyway. My next job will most likely use C++. Unless I happen to get a job this fall or next spring, then I can take another class the following semester. The MySQL class intrigues me as well.
15:53
Still haven't got the occasion to use C++ in any job.
> Further application of C++ programming techniques including file access, abstract data structures, class inheritance, and other advanced techniques. The following C++ programming topics are covered: classes, objects, function and operator overloading, inheritance and dynamic polymorphism, templates, exception handling, reference counting, complex data structures, complex input/output standard and file handling techniques, program documentation...
I don't see anything about concurrency :o
One advantage of the MySQL class is that, according to the instructor's syllabus, there are no exams. So, I wouldn't have to worry about going to a testing center if I get a job in another city. Also, a classmate has told me before that SQL is rather quick to learn. This class only has homework and projects.
SQL is really easy
Specially MySQL
I could give it a try, then. I have little to lose anyway.
16:07
Exactly
After that, you could go into more advanced SQL
Right, and maybe I can review some code at least.
@Mat'sMug It was off-topic, now it isn't.
Damn, I didn't read the fine print. :-P The class is restricted to some special program, so I cannot sign up for this class.
Jul 7 at 17:37, by Simon André Forsberg
in Code Review Moderator Election 2015, yesterday, by Simon André Forsberg
We need mods who can read. ;-)
You can still learn it
16:14
Yeah, but when I have time. Now I may have to consider my alternative: advanced C++.
Then go for it
Specialized sorting algorithms for 0 to 20 values. Still 12 left to write...
@Jamal, that makes perfect sense... will apply that logic to other parts of my life. Thank you — John Spiteri 5 mins ago
I could try Intro to Oracle SQL and PL/SQL.
The 32-value sorting algorithm has ~600 lines of code.
16:17
@Mat'sMug lol
3
There, all cleaned up :-)
16:34
Okay, I'm registered for advanced C++. The total is only $306 (I forgot that community college can be so cheap), and I'm sure I won't need a book. I have an advanced one anyway.
Only that much?
Not bad. Tuition only at my U is 5k+ plus books for a single semester of 5 classes.
2k a year if it's your first degree, 8k a year for every after that.
They don't give single courses AFAIK.
I paid like ~30€ a year for my engineering school where I also managed to get a reaserch master's degree (not sure about the actual names).
I have a 20k scholarship based on grades (so I get 2.5k each semester), at least.
16:42
@IsmaelMiguel Yes, for community college. University would be even worse, and it's not offered there anyway. This class is actually part of the information technology curriculum, not computer science.
@Morwenn: I could still consider asking you or someone else here for help, at least when the topics get harder (such as advanced data structures). I won't be posting my full code, though.
@Jamal Eh, if you have problems understanding things at some point, I would be glad to help you, but I don't think I am that far ahead. Fortunately, there are many people willing to help on CR :)
Ok, after two days, I think that my sorting library is mature and one of my best well-defined projects. Now I can go back to messy things.
We'll see what happens. It looks like it'll start off easier. At least I can focus on just this one class and may have at least a week for each assignment.
@Jamal Well, I don't think you have to worry.
I have to go, see you later everyone! :)
I think I'm still having bad memories of my first data structures class at this same college, which was horrible. This class is the real deal.
Later!
17:11
you can submit your code to the codereview part of stackexchange for feedback and advice, and you can also try working through the tutorials first. The tags all have a wiki with information and links to get you started. — Mousey 59 secs ago
@Jamal I'd recommend learning some more of other languages as well. Demonstrating an ability to learn new technologies looks great on resumes.
cough cough
So... the company I work for... they intended to be expanding to 60 employees at this location by the end of 2016.
This week, they changed that number.
From 60 to 160...
17:32
@nhgrif I can. I had fewer choices this late into registration.
Just-saying-hi ...
0
Q: Little applet for elo rating system

Dr XorileI have written a bit of python code with tkinter to make a small applet to allow people to enter game scores and keep track of their rating (using the elo rating system). I have an initial meta-question for using this forum: Can I just post the entire code here for review? Or is that not how ...

@rolfl Hi!
@mats -about the 99 comments meta question. Sometimes good answers prove a poor question is on topic
It can be irritating to have crap qs... but better to have the good answers
Back to the pacific for me
17:48
@rolfl agreed - it was brought up in the mod room, I figured a meta post would seal the question's fate once and for all :-)
-2
Q: binary search return type error

Tarun Vermai have written a code for binary search using recursion but when i am compiling it i am getting the following error: error: control reaches end of non-void function [-Werror=return-type] here's my code for binary search. bool bisearch(vector <int>a,int start,int end,int value) { int mid=...

0
Q: Little applet for elo rating system

Dr XorileI have written a bit of Python code with Tkinter to make a small applet to allow people to enter game scores and keep track of their rating (using the elo rating system). I have an initial meta-question for using this site: Can I just post the entire code here for review? Or is that not how i...

0
Q: Print the lexicographically smallest permutation that satisfies the given formation

Darth ShadowProblem Statement: A DOTA game has N heroes, each with a distinct rank from [1..N]. In DOTA every formation is characterized as a permutation [1...N] of ranks of players. A formation is Imba when the sum of ranks of every two consecutive players is less than or equal to (N+1). Given N, you are ...

0
Q: Transactions with hibernate

morbidCodeI have two methods both performing a hibernate transaction public static List<User> searchAllUsers(String searchby, String search) { Session session = getSessionFactory().getCurrentSession(); session.beginTransaction(); List<User> result = session.createQuery("from User where "+searc...

18:04
@Jamal But 300 dollars is cheap AF. I hope the classes' quality isn't cheap.
It's an online class, so I will be expected to teach (or review) myself. This can help with refreshing my mind with C++, adding another completed programming class, and possibly increasing my GPA a bit.
So THAT'S why it's cheap....
Possibly, but I'm not entirely sure. It should still include some required fees. I don't think I'll need the textbook, either.
My trust on online classes is pretty low
It'll mostly involve working on assignments individually and taking exams on-campus. This isn't my first online class, either. I already have my degree, so any class I take at this point is mostly for staying busy and adding to my skillset.
18:13
Still, I don't trust online classes
Besides, I don't know their value when looking for a job
Degree programs can still be completed online, even at good state universities. Most people don't take that route, though. Plus, my resume only lists my university, so an employer will only know about my community college experience if he/she checks my LinkedIn page.
Other thing I don't get: LinkedIn.
Why people even use that?
Yesterday I got a potential job offer via LinkedIn for programming in Java even in the town I'm living right now
Any reasons not to use LinkedIn?
Boring "social" network
Was it meant to be exciting?
18:20
Not boring would be enough
And, it is somewhat pointless
You have a resume
I'm not sure what you are expecting from LinkedIn, but it seems like you're expecting something it's not made for
I told that I don't get it
@skiwi That's neat.
I dumped my LinkedIn account after I got a flood of spam from Indians.
I never had one
@Mast That's interesting... and weird
18:23
@IsmaelMiguel LinkedIn was at least partially responsible for me getting my newest job.
You need an email now to be able to connect to someone you don't know, I believe
@RubberDuck I got my job purelly out of luck
Except job hunters (or how are they called?) probably
It was at least 4 years ago, so perhaps they changed something in the meantime.
Headhunters
Or, the PR way to say it is "recruiter"
18:25
Yeah... that
Job hunters are the ones looking for jobs, right?
Probably.
Yeah.
So, does anyone else have trouble understanding how my edit here "was an attempt to comment"?
Your edit seems fine to me
@RubberDuck I can see why they rejected it, although I don't necessarily agree.
Care to explain that viewpoint? I don't get it. I added necessary info to make it a complete and useful answer.
18:31
Hey guys, this is @Phrancis, on friend's PC/account
Hey @Phrancis @Jay1148
@RubberDuck Technically it's not part of the answer and shouldn't be there. However, you could add the code in the original question in a Update section stating that's what fixed it for you and it's based on guy's answer.
... That's not how SE works.
I'm running into a really odd issue, wondering if it's a weird bug with this PC, anyone know a bit about Windows 7 inserting weird characters when copy+pasting plain text from one file to another?
Another course of action which would be more SE style, is to self-answer it instead of making an update.
@Jay1148 Do they use the same encoding?
If not, that's your problem.
18:33
Actually, it's not while copy+pasting, it's when saving the file in notepad
Just noticed that
Still sounds like a charset issue
Yeah, but that doesn't make sense to me either. Why split the necessary info across two answers? Editing answers is an accepted practice.
@RubberDuck Yes, but you're changing the answer by adding the code.
@Jay1148 That seems to be the UTF8 BOM. Try to save it without BOM.
@IsmaelMiguel How do I do that? (OS is Windows 7)
18:36
How so @Mast?
The reject reason seems off-though, there must be a better reason around.
You asked why the interrupt never fires. The problem is you never set the required register.
Right?
@Jay1148 Save as UTF8.
If it doesn't work, save as Unicode.
It is set as UTF-8 right now. I'll try Unicode. Also have Unicode big endian, and ANSI options
Don't save in ANSI
@RubberDuck Yes, adding that line of code solved it for you. But there may be more ways of fixing it. My AVR is rusty, but I think it allows configuration files or something in which flags like that are stored. As an initialization. Do not pin me on that though. But I think the possibility of multiple 'solutions' based on that answer make the edit flawed.
18:40
Right. He pointed me in the right direction, and I added the code for the next guy.
Yes, which you should probably do in a self-answer while accepting and up-voting his answer.
@Mast Someone did once ask me to add them, but did so as a comment on my Summary. I suppose he was trying to get around adding me with the "I don't know this person" option. I never added him.
Hm, looks like the encoding changes when I even just open the file. It is a .groovy file opening in Notepad, might be the issue right there
@Jamal LinkedIn was infested with guys like that a while back. Which is one of the main reasons I dropped it.
@Jay1148 Maybe you are opening in ANSI or Unicode?
18:41
I've never did like that "I'm accepting this answer because it's the right thing to do, but here's what actually solved it" answers. IMO an edit is the right thing to do.
@Jay1148 That's the extension, what's the encoding?
Mighty good question... How do I find out? File properties?
@RubberDuck CR style would be writing a meta, but EE isn't as friendly as CR.
Or do I need command prompt?
None
Open Notepad
Then you go on File > Open
And manually pick the encoding
18:43
AH, set to ANSI
Should I open as UTF-8 to avoid issues as much as possible?
Try UTF8
I may write a meta if it gets outright rejected. Still in the queue atm.
@IsmaelMiguel @Mast that worked (opening as UTF-8) thanks so much for the help!
@Jay1148 You're welcome. And please, consider using Notepad++ next time. It saves you a bunch of time.
2
18:52
@RubberDuck RSA
Yeah it's not my PC (and it's crap, can barely run Java, Chrome and Notepad together) so I don't want to install stuff just for this
@Jay1148 I don't see anything unexpected in that.
Also, Notepad++ is extremelly light.
On a slow as hell computed, running Ubuntu, with Notepad++ installed on wine, I could actually write code quite well. You can't get any worst performance than that!
But, you have Chrome running, which is a huge RAM hogger
So, nothing unexpected there.
> Why is my machine running so slow? Oh. I have gmail opened in chrome...
@RubberDuck Can't get any slower than that!
I actually can play games with IE running, but with Chrome it is a tad harder
> Chrome: blazing fast browsing while the rest of your machine crawls.
2
Sadly, it is one of the best browsers to debug Javascript
18:58
0
Q: September 2015 Community Challenge

Gareth ReesIt's time to choose a community-challenge for September 2015. Post your challenge as an answer to this question. Feel free to resubmit non-winning ideas from previous months. Vote for those answers which interest you. At the end-of-day on Monday, August 31st, the top-voted post will become the ...

Firefox is somewhat tied, but it always uses hardware acceleration even if it is disabled.
Look at @Mat'sMug all moderating and stuff.
@IsmaelMiguel If you're running Ubuntu, Notepad++ is the wrong choice.
2
A: Little applet for elo rating system

Mat's MugWelcome to CR! First things first, questions about the site belong on meta - every Stack Exchange site has a meta counterpart. So I've migrated your question over here. Feel free to browse some of the site's top-voted questions - you'll find they mostly share a number of common points: they pr...

Try Atom.
My TIS-100 question has only gotten 25 views so far, wut...
19:06
@Mast Nah, I use geany. Light and tons of plugins. Also, it takes only a few KB on your disk/pendrive (if you use Puppy Linux)
@Mast I vieded it 10 times.
@IsmaelMiguel Puppy Linux? HDD space is cheap nowadays. Use it.
@Mast When you don't have an HDD, you can't do anything about it.
@IsmaelMiguel You have a PC without HDD?
Yeah, a laptop. But I use a desktop with an SSD
But, a while ago, my desktop was dead
So, I had to use a laptop without HDD
Consider your SSD as HDD in this context.
Storage space is cheap. Use it.
People call me insane because I didn't put a SSD in this laptop, but the extra storage is worth it IMHO.
Plenty of space for a dual-boot with plenty of software on both sides.
19:11
Well, at the time I had no money, a job where I was paid below the minimum wage and the laptop uses IDE drives
Besides, the laptop isn't worth it
Intel Centrino 1.6GHz with 1GB RAM DDR2
With a VERY crappy Intel board
Yea, don't upgrade that.
Save for a new one.
Or for none
I should buy a better CPU for my desktop
Upgrading your CPU often isn't worth it, but it would depend on the rest of the rig of-course.
Well...
It's just a bunch of old parts
That's the CPU I have now
The core speed is low... Really low.... And the FSB is only 1066MHz
I have 1600MHz RAM modules
:/
I have the same one in my old rig. If it happens to be located in a E520, don't upgrade. I made that mistake and while it did make the thing last a while longer, long term it wasn't the efficient alternative.
19:22
@RubberDuck lol
While it can be fun to do so anyway, it's now sporting a GTX 560 Ti which didn't fit. Had to make it fit, looks horrible but works like a charm.
I'm trying to look for a better CPU
@Mat'sMug That's a nice answer by the way.
Socket 775 is really old
@IsmaelMiguel I know, but if your desktop is still using DDR2 it isn't worth it. Applications nowadays are more RAM intensive.
19:24
@Mast thanks! was a phone post :-)
DDR3
Not DDR2
And I have 6GB RAM
Which has proven to be enough, as long as I don't use Google Chrome that much
I'd say drop the rig and the laptop and get a new laptop. Keeping two machines up to date is more expensive.
I have 8GB RAM and I want to throw my laptop out the window...
@Mast The laptop is under the bed
Or somewhere
@Mat'sMug Why? The RAM usage is too high?
IDK, just booting and starting VS takes forever. When you got used to Win8.1, that 4 year old laptop on Win7 feels sluggish
19:27
Maybe the harddrive is needing a rest?
Yeah, well, it's getting a rest soon. A long, looong rest.
What specs does it have?
Hold on, back in 10 minutes when it's booted up
10 minutes? o.O
@Mat'sMug I'm still hoping Win 10 will actually improve the performance of my laptop, but I should know better...
19:32
@IsmaelMiguel ready? Powering up.... now.
Starting Windows...
Please wait...
Login
and go
Welcome
My desktop takes around 10 seconds from the Windows 8.1 screen to the desktop
19:34
I'm still being welcomed here
You should feel honored
Oooh desktop... after a 30-seconds black screen
And now you wait a looooooooong time before you can open anything
Icons are still flickering
VS clicked
19:36
Wow...
UAC okayed
@Mat'sMug Too soon.
@Mat'sMug Should've turned that off ages ago.
Meh
At least the VS splash is pleasant
19:38
0
Q: Error-handling in promise NodeJS + PostgreSQL

user1775888Questions: Am I handling error messages correctly in insertUserPendingBase()? I check the return message to determine whether or not it equals success. And if so, what should then do in this example? I use pg when I do execute the query. Do I need to do anything to prevent SQL injection? I sa...

And hello VS
Clicked Rubberduck on the start page
@CaptainObvious Seems to be missing essential parts of the code.
Dude, that laptop is begging to check his disk
And good to go. How long?
Ah, 8GB is the work laptop. Hold on, starting chrome
How many GB that one has?
19:42
4
Page is unresponsive; kill or wait?
hello from laptop
@Mat'sMug Kill it out of cold blood End it.
12 minutes and lagging
Nuke it from space!
19:45
...where's the star wall?
2
ah, just loaded
@SirPython just got the DING!
0
Q: An Oracle query that's trainwreck-esque

Steve GreenMy original question was posted on SO, I worked with a couple of suggestions to achieve the desired result, however, I'm sure it can be refined but my Oracle knowledge is lacking so I come here for advice :) The scenario question: "I'm having difficulties with splitting a single row into two ind...

@Mat'sMug Are you using a really slow computer?
it's fine now
@SirPython A near-death laptop
a Samsung R540 with Intel Core i3 CPU 2x 2.53GHz, 4.00 GB RAM, running Win7 Pro x64
19:48
You really need a new HDD/SSD on it
CPU oscillating between 1% and 10%, memory steady at 2.91GB
@Mat'sMug Are you from USA?
Canada
Quebec actually, so ...Europe-in-America
19:50
Are you a guy who can do crafted stuff and all those things?
If so, you could try turning your laptop into a tablet
I can turn it into a pile of shredded plastic pieces, for sure
3
Nah, don't do that!
At worst, make it into a very bad server
not a bad idea. the battery is already dead anyway
if I pull the wire I have 7-8 minutes to plug it back in
...why is CPU going 40% all of a sudden...
If I pull the wire, I have a few milliseconds to plug mine back
Chrome
@Mat'sMug What OS are you running?
19:54
6 mins ago, by Mat's Mug
a Samsung R540 with Intel Core i3 CPU 2x 2.53GHz, 4.00 GB RAM, running Win7 Pro x64
I recommend you try running a Linux distro (mint?). I find Linux is much faster than Windows.
I need a windows box
or I could implement Excel, VBA and Rubberduck in JavaScript Java, and screw .net
Why not Javascript?
because then I'd have to implement ANTLR, too.
Oh
Java it is
19:58
well, no
lol
I mean... ugh, that came out wrong
Don't worry, we will pretend that doesn't exist
There
You could do what you did
I'm currently in a bad spot of the day

« first day (819 days earlier)      last day (3496 days later) »