« first day (388 days earlier)      last day (3927 days later) » 

18:09
0
Q: Improvements on small utility library

user3293653I would like to decrease the scope of this small library ( Not increase it ) Does it meet the claims I state? It is meant to complement other libraries such as underscore and lodash. It is not meant to be used instead of them as there is far less functionality. /******************************...

well, I am off, good bye @all
Well waddaya know..
^ linked at a specific time
18:32
When do you guys create a new branch on git or similar vcs?
Because I see examples of creating one per issue, but that seems a bit overkill
With Git that is relatively common
But is that also a remote branch, or purely local?
@skiwi When I am about to make a major refactoring or implement something big and I suspect that it can break a lot of things. But that's just me.
@SimonAndréForsberg Well... now you are talking about a major refactoring already
18:49
Hello, World!
0
Q: Convert sorted linkedlist into balanced binary search tree

JavaDeveloperConvert a sorted linkedlist into a balanced binary search tree. Looking for code-review, optimizations, and best practices. public class SortedLinkedListToBalancedBST<T> { private TreeNode<T> root; private static class TreeNode<T> { TreeNode<T> left; T item; Tr...

is this correct UML to show two classes inherited from another?
...or I got the arrows reversed?
meh.. while I'm at it:
0
A: Using Models and Entities in MVP pattern

Mat's MugIt's not clear exactly what you're referring to as Model classes, I think you're over-thinking it. I'd go with the else snippet, the POCO (Plain Old CLR Object) that does nothing but exposing auto-properties. The snippet that exposes a public Advance field doesn't look right. Do not expose publi...

@Mat'sMug When Op said he was using VS for a "replacement" for EF, I was like yeah dude you know what you're talking about.
@Marc-Andre totally.
18:59
@Mat'sMug Reversed
@skiwi dang, I knew something was off! .......really?
You now have a really weird structure that breaks my brain
@skiwi while I'm redoing them, is this one reversed too?
(showing db table relationships)
@Marc-Andre I hate UML
2
19:00
@Mat'sMug I think it also is, I'm used to drawing them the other way around
let me see if I can find one autogenerated one
Why do you have inheritance in your database anyway? @Mat'sMug
Maybe I was thinking in OOP style
@Mat'sMug Welcome to the club!
Is it a sheme like this?
@Mat'sMug I guess that makes.... three of us here then.
Or are you talking about different ones
@Mat'sMug Fourtify that.
lol
allright so
and
look more "normal"?
19:05
You didn't change the directions, did you?
@skiwi the inheritance doesn't get to the database
@skiwi yup ;)
Ah so you are just talking about OOP schemas
the 0..1 -> 1 is DB, the other one is OOP inheritance
It looks a bit better, though I find them a bit weird sideways
@skiwi believe it or not, I had taken the URL's from the wrong browser tab ;)
19:08
@Mat'sMug I have so many tabs open, that there's always a right one.
Indie rock. Or something.
@Morwenn Oh... worth checking out then
@Morwenn Chill Trap?
19:10
hey @Mat have a look at this Q&A
1
Q: Simplify ASP.Net StreamWriter for appendtext to file

Jrags87Is there anyway to simplify this code so there aren't so many redundant w = File.AppendText(filePath) and w.flush() and w.close() in each if statement? Anything else I have tried ends up locking the file, and crashing the site because to text file is in use by another process. Public filePath A...

Baghhhh ..... a drive failed on my home machine
Randomly looks into spam mail, sees -> "Seductive local chicks want to get your ram now."
anyone run FreeNAS? wanna help me later when I get home?
This is an automatically generated mail message from mdadm
running on panabox

A DegradedArray event had been detected on md device /dev/md/0.

Faithfully yours, etc.
@rolfl Ouch
19:11
@Malachi trap?
Snarky brat
@Morwenn is that SFW?
@Malachi Probably. That's merely a clothed guy.
I thought it was more than the picture.....
19:12
@skiwi In theory ..... all I have to do is add a drive, tell it to fail-over on to the new drive.
'joys' of RAID1
@rolfl In practice... you don't have that drive available right now?
up to 100 Rep today
@Malachi +1 nice [obvious] answer, I was expecting that to be pointed out when I read the question :)
@Mat'sMug IKR
@skiwi Actually, it's worse than that ;-)
md0 : active raid1 sdb1[1](F) sda1[0]
      2930133824 blocks super 1.2 [2/1] [U_]

md127 : active raid1 sdf1[1] sde1[0]
      1953382208 blocks super 1.2 [2/2] [UU]

md3 : active raid1 sdd1[0] sdc1[1]
      2930263876 blocks super 1.0 [2/2] [UU]
19:14
@Mat'sMug I am not sure about this though
> w = File.AppendText(filePath)
Has anyone had a chance to look this one over? Would be curious to have a more experienced SQL programmer look at it and comment.
http://codereview.stackexchange.com/questions/51603/modifying-sakila-database
The failed drive is sdb1 ..... (with the (F) )
@rolfl Which means... something bad?
@SimonAndréForsberg next answer is #200!
I have 7 drives in the machine.... and no spare power, and not spare SATA ports.
19:14
and I'm 10 points short of Simon's score for the day...
And I don't know which drive physically is SDB.
I almost feel guilty. I received to bounties today for not-so-great answers :/
Then, when I get the drive in, it's only 3TB of data that needs to be resync'd
@Morwenn not-so-great is better than none-at-all if it's not plain wrong, right?
@rolfl Russian Roulette, IT style?
3
19:16
Also, I really need to do some space-upgrades .... (3TB is not enough anymore).
@Mat'sMug Probably, but some great answers sometimes get less than they deserve.
So, perhaps I should create a new RAID1 array with two 4TB drives, and migrate the logical volume?
Why on earth would you have 7 drives though? :o Are they all in some form of RAID 1? Like 7x 3TB?
I have 3 RAID1 Pairs....
The primary data is on one pair....
@Malachi please edit that part: If (CurrentUser.IsLockedOut = True) Then to say If (CurrentUser.IsLockedOut) Then
19:17
then it backs up every hour to the second pair using a time-stamped snaptshot system.
Then I have an external drive pair I alternate monthly backups to.
@Mat'sMug oh yeah
What data is on it that it's so important? It sounds a bit overkill to me... But trust me, if I had the money, I would build very interesting cool systems too ;)
And, then I have another internal RAI1 pair I have things like bittorrent, and other volume-crap on.
Then I have the SSD drive with the OS installed.
@skiwi The backups are very, very useful.....
especially snapshots.
As for what;s on there, I have about 1.5TB of photos.....
(porn)
5
and now I am in to video too... (and the kids).
19:19
@rolfl Holy.
@Mat'sMug I'll have to find a very good question post that on... perhaps a selfie?
But yeah photos and video I can understand
Then I have all my e-mail since about 1997
2
a TCG selfie?
Most of my other stuff is shared via dropbox though
19:20
And a lot of source code too.
Also, remember, this is for me, my wife, and two kids ;-)(
1.5TB of pure source code would however make a very interesting thing
She takes pictures of her kindergarten kids, and videos their process.
Is it your home PC or server btw that failed over?
Yes
@Mat'sMug Probably not the TCG. I want actual comments on that, not make a selfie. Perhaps my horrible Delphi code I posted yesterday though :)
19:22
Yeah, if I were to plug in the backup drives, I would have ..... 20-something TB of storage attached
That's impressive
About 3 TB of live data, mirrored 6 ways
I don't have many backups, though I have some
live*2, snapshot*2, cold*2
Ironically, my Dropbox (which has an online and laptop backup already) has at least 20 backups living around on my PC and laptop
I'm sure I haven't lost data of my old PC though, as I just took the raw files (~500GB) and put them on an external harddrive, don't want to lose something
I've heard the horrorstories from my dad.
19:25
@Mat'sMug how does it look now?
I am just trying to figure out how to set up FreeNAS. I don't know much about that kind of stuff either
is this answer really better than mine? codereview.stackexchange.com/a/51443/18427
312 rep until I pass @sepp2k in total rep
and he hasn't answered since September of 2012
It seems that besides and , I don't answer specific questions. My third tag is with 41.
anyone have a query for seeing how close I am to generalist?
@Malachi why not implement the ToString() remark in the code block? ..and you missed a typo in "no Matter what you do", should be "No matter what you do" ;)
I think the AI of this game still needs to learn: youtube.com/watch?v=Y8cUhUxaRmU
@Mat'sMug I thought I did
19:31
@Malachi Yes... ;-)
What on earth:
(Conway's Game of Life)
@skiwi I wonder how on earth they did that, the space is huuuuuuuuuge. I would love to see the code for that version of the game
@SimonAndréForsberg True, that's also first thing I noticed!
Proper 3D programming to start off with, perhaps?
@Malachi lol you made it "No Matter what you do"
19:35
Too bad they didn't include the random mutations :(
@Mat'sMug Freudian slip of Keyboarding
I am short in Linq and Unit Testing...
well and a couple of others.
You only need two more.... whichever ones you want those to be.
any idea why i can not access chat in stack overflow??
it is strange
i see a cat sayin
One thread per Game of Life entity.
workin on ur problemz
19:40
0
Q: Write Program to Send Messages Automatically on Facebook from List of People

VictoriaI'm new to programming. I have a lot of friends on Facebook that do not have email addresses listed that I would like to send an invitation to. What I would ideally like to do is write a program that takes their names from a list in excel and writes and sends a message with their name in the sal...

@SimonAndréForsberg This pretty much simulates cellular automata in real life:
this is entire message from cat
We apologize for any inconvenience, but an unexpected error occurred while you were browsing our site.

It's not you, it's us. This is our fault.

Detailed information about this error has automatically been recorded and we have been notified.

Yes, we do look at every error. We even try to fix some of them.

It's not strictly necessary, but if you'd like to give us additional information about this error, do so at our feedback site, meta.stackexchange.com.
but chat exchange workes
*works
13.4K!
@Phrancis answered your question - I think that's my first answer, feel free to downvote as appropriate ;)
@myth Join me here: chat.stackoverflow.com/rooms/139/java .... <--- try ... I just did, and it works.
Nope?
i get still "You must be logged in to talk. See the faq for more information."
:-(
19:44
That's different, have you logged in?
SE chat is sometimes flaky with authentication
i try on "logged in" but nothing happen
There's two separated systems, chat.stackoverflow.com and chat.stackexchange.com
try accessing it from the SE drop-down menu when logged in on SO
im seen it now unfortunately
19:45
incoming off-topic question
@skiwi Well that's gotta cause some serious lag.... I did see some time a video with 3D game of life where each generation where built on the 3d dimension. So the rules were only applied to 2d, but the 3d made it interesting to see the "history". Can't find it now though. If you find it, let me know.
0
Q: Basic Area shape Calculator

JacobMy aim is to make a area calculator, I am struggling to make the jbuttons open a new window, I'm not sure where I'm going wrong with this, is anyone able to review my code and assist? import java.sql.*; import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.even...

i am connected to so and from se drop down like you suggest i go to stackoverflow then chat but now appears that cat
^^ @CaptainObvious VTC'd
im not really new user
19:50
@SimonAndréForsberg Sounds cool... my only version is an old ass assignment where it was text based :p
@rolfl I have work to do
in both the sense of Work at Work and Work on CodeReview....lol
this is too obvious, there has to be something I missed: codereview.stackexchange.com/a/51856/23788
Thank you @Mat'sMug I'll test your code tonight. SO if I understand well if you UPDATE without a WHERE clause it would just update all the records accordingly then huh
that's how I messed up a production SQL database, yeah ;)
2
I have done that too
@Mat'sMug looks very sane to me, except there will be no bad side effect for gaps-in-range.
yeah I figured gaps wouldn't be harmful, it's just somewhat inefficient to iterate over ID's that don't exist, if I had to use a CURSOR to iterate ID's, I'd probably select them into a temp table and iterate that.
^^^ I hope not ... I hope you would select them as a cursor ... ;-)
No need for the temp table.
@myth - you sorted out now?
Nope :-/ but will try tomorrow and see if change
You have 'refreshed' the page?
20:03
yes i even try login button in right top corner of toolbar
maybe is issue with network so will wait
@rolfl then I'd read the code I wrote, and scrap the temp table and iterate the SELECT that populated the temp table in the cursor. (facepalm)
^^^ technically, there could be a resason to do the temp table, it isolates the transaction levels.
but, that is normally the opposite of what you want.
@Mat'sMug / @rolfl - Can you think of a better way to write the proc in Step 2? It seems to have ran pretty quick, possibly because I was not joining tables. I could see having to repeat a INNER JOIN a thousand separate time could bog it down pretty good
TTQW later all!
@Mat'sMug (and others) I think there's one Cardgame which you haven't seen....
Battle of the StackExchange sites: Code Review vs. Codegolf: zomis.net/cards/ZonesCardsGWT.html?mode=CR
20:18
later @Marc-Andre!
@Phrancis I am uncertain on the semantics of RAND
@rolfl RAND() selects a random float number between 0 and 1. Then I used CASE WHEN...THEN to decide on approximate distribution.
The question is whether rand() will produce a different value for each record it updates, etc.
Or one for the whole statement.
@SimonAndréForsberg why isn't [rolfl] clickable?
oh nevermind
you need a UI review :)
@Mat'sMug Once you play a user-card, it's just there, it gives your site additional hours to spend each turn
@Mat'sMug I know, I'm visiting ux.stackexchange.com way too little :)
20:25
Hey, I scored really big on UX yesterday and today.
I'm not sure if the folks at UX does reviews though. Perhaps I'll have to ask @kleinfreund :)
lol, I love this question: ux.stackexchange.com/questions/57929/…
haha I like "tag: nooooo | Create a linked list question on opponent site"
@Mat'sMug The memes provided lots of inspiration for the cards :)
@SimonAndréForsberg I should at one point take the time to actually understand your game (not right now) instead of randomly mashing buttons ;)
@skiwi I should at one point take the time to actually explain the games (not right now) instead of letting the users mash buttons to figure out how they work...
20:28
@SimonAndréForsberg You should upvotes the answers!!!!!!
Ha! I took down PCG with a [Mat'sMug] card!
Code - not a problem. Tutorials, documentation, user interface.... that's where I'm lacking
@SimonAndréForsberg - have you seen where two of th three top answers come from?
@Phrancis - I'm building up an answer for you.
@rolfl They seem to focus on how animals interact with doorknobs.... All I can think about with this question is our good friend mortal enemy from PCG.
I've still got so much to do on my TCG before first playable version :(
20:32
@SimonAndréForsberg ahhh.
@skiwi Then drop the tests ;)
@Malachi posted a non-overlapping, competing answer: codereview.stackexchange.com/a/51859/23788
@SimonAndréForsberg That'll only create more bugs
@rolfl Each iteration of RAND() produces a new number, see this for instance: sqlfiddle.com/#!2/a2581/25519
@SimonAndréForsberg Having added hitpoints to players and adding all kinds of actions with unit tests would probably make up for a lot of progress :)
TTGTB
20:36
@rolfl I like that you address the "don't use the mouse"-issue in your other answer. I also love using key-shortcuts
@skiwi Remind me about showing you my component-based approach tomorrow. Sleep well!
TTQW
later!
Bye guys!
@Mat'sMug not as good as my answer but still got an upvote from me
@Mat'sMug leaving work early?
0
Q: Take previous element from array if condition on current element matches

MarkusAny ideas to simplify this beauty; I would prefer a LinQ expression if possible: private object[] array; public abstract bool Condition(object); //... for (int i = 0; i < array.Length; i++) { if (Condition(array[i])) { return i == 0 ? null : array[i-1]; ...

@Phrancis Yes, but if you do case when rand() < 0.65 then x when rand() < 0.9 then y .... what then?
What are your odds going to be?
20:51
did I Write this C# right?
0
A: Take previous element from array if condition on current element matches

Malachiyou could write it like this: for (int i = 0; i < array.Length; i++) { return Condition(array[i]) ? (i == 0 ? null : array[i-1]) } I hope that this isn't the only code in the Method/Function because it doesn't always return something, which could crash the application if there ...

@rolfl Looks like the odds are right about where I wanted them, 65/25/10 %. Being that it's random there is not a way to predict very accurately.
I know it is not a big deal to all of you high rollers, but I am 9 votes from Rep Max today!
Way to go @Malachi
I am trying to increase my Rep on Stack Exchange while learning new things so that when I go looking for a new job in a year or two I can put my Stack Profile on my resume!
one of these days I am going to find a fun open source project to work on as well.
@Malachi - 9 votes .... is far from @max at this time of day.
21:02
So besides SQL, what would be a common and useful language to learn for business purposes? C#? Java? etc.?
I am looking for more stuff to answer right now, while I am working lol
@Phrancis VB
lol
Ugh come on now lol :-P
@Phrancis For the finance industry? Java and SQL are pretty common....
@Phrancis VB , Ruby, Python, Java, C# seem like the big ones
the ones that you see most job openings for I mean
I see the need for a mod hammer here.... hang on, let me fix something....
21:03
Java used principally for application building?
@rolfl whoa where? I want to watch
@Malachi Oh, it's done already.
1 min ago, by Malachi
@Phrancis VB , Ruby, Python, Java, C# seem like the big ones
Well there is a throw Exception() after the loop. Your example however is not doing the same as the code above. It is always breaking the loop for i==0. — Markus 2 mins ago
anyone agree here? I don't see this at all?
I think I see it
Thanks for the review @rolfl
No problem.
@Malachi - you return whether the condition is true, or not.
21:09
can I do this "Condition(array[i]) ? (return i == 0 ? null : array[i-1])" in a C# ternary?
@rolfl I saw it...lol
^^^^ No.... you can't do that in a ternary.
But, what you may be able to do is a recursive thing, if the array is short.... ;-)
But that would be slower than what he has, even if it would be cooler.
@Malachi- there's an off-by-one bug in the OP's code.
See it?
I don't .
You deleted your answer, planning a re-do?
@rolfl I don't have anything at the moment to answer with. other than re engineering the if statement to about what he has.
my answer indeed wasn't the same as what the OP had
His loop should start from one, or something, otherwise, it is possible that the Condition(array[0]) will be .... oh, never mind, it's not an off-by-one
21:23
@rolfl he should start at the Second Array element though
No, he shouldn't....
He's got it right.
It returns null if condition[0] ...
it sounds like the "Condition" Checks the current with the previous
why check the current when there is no previous?
I am wrong, I don't know what the condition is
Part of the problem is it's a hypothetical question, but it's not too bad....
0
Q: Calculate fibo in O(logn)

JavaDeveloperCalculate nth fibo, in O(logn). Looking for code review, optimizations and best practices. public final class Fibo { private Fibo() { } public static int getNthfibo(int n) { if (n < 0) { throw new IllegalArgumentException("The fibo value cannot be negative"); ...

JDQ!
21:33
0
Q: django class-based generic views - am I doing it right?

Howard EdsonI am working on a simple "to do list" app in django (two models: List and Item). Trying to learn and make use of class-based generic views. I have the following three display views working, but am requesting a quick code review to see if there's anything I can do to improve my usage/understanding...

@rolfl: This line puzzles me a bit:
`SET @first = 0.65; SET @second = (0.90 - @first)/(1.0 - @first);`
I chose to answer this JDQ, because I just couldn't help it.
0
A: Reverse sublists of a linked list

200_successYou and @bazang are both very much into interview-questions, and I think you would benefit greatly from answering each others' questions. In fact, writing reviews would be more useful for preparing you for interviews than asking yet more questions, because: You get "no" choice in the matter of...

`@FIRST @SECOND
0.65 0.714285714286`
yes ^^^^ exactly.
Also, why is my back tick not working -_-
21:39
(multi-lines).
`Oh.
Oh.
There
@Phrancis - 0.65 of the time you want to use the first case.......
Shift-return should get chat to treat it as a newline within the same message.
Now, you have run 'rand()' for the first 'case when'....
which means you have 65% in the first bucket.... but, now you do a different rand() for the second casewhen
in essense, onc you have put 65% of your data in the first bucket, you are left with 35%
Oh I think I get it now. So 25% of the total set would be 0.71 of the remaining 35%
21:42
^^^ esactly.
I did it as the parameters so the three constants were in one place only.
Otherwise it gets messy in the actual statement.
The (0.90 - @first)/(1.0 - @first); .... is saying we want 0.25 of the remaining 0.35 to go to bucket 2.
It would be much easier if there was just one rand() call per record, but that is not possible.
I've been wondering, does calling rand() multiple times screw up the probability distribution?
I looked in to that, and apparently not... it's a PRNG...
which at any point on is well distributed....
it is also seedable... which, would be hilarious.....
I'm concerned about conditional probability… Bayes's Theorem…
It works out OK.... I tested it ...
Now we could build it in the WHILE loop like this right:
21:50
@rolfl Oh, I see that you already applied the Bayes correction.
`SET @RAND = RAND();
SET multiplier = (SELECT (CASE
WHEN @RAND < @first then 1.0
WHEN @RAND < @second then 0.85
ELSE 1.05
END))
No ... .... ^^^ absolutely not.
All values will be put in the same bucket.
(they all have the same 'random' value )
I see
21:53
@Malachi It's been quite a while since I rep-maxed actually. And 9 votes is.... 9 votes.
I haven't practiced working on a single interview question, the way JavaDeveloper and Bazang has... I wonder how I would do at a real interview?
@CaptainObvious anyone look at this yet? it doesn't look right. how does "1/2" equate to an Integer in Java? does division round to nearest integer or up or down?
@SimonAndréForsberg You would say: in real life, problems are rarely this well specified, and I always first challenge the specifications to ensure that the items that are mentioned really are required.
2
In this case, to get the job, it's not really necessary to do this... because you are looking for people who can think, not regurgitate code.
regurgitate? That's a new word for me looking up
btw, s/really/rarely/ ?
done.
Ah, it meant what I thought it would.
I really should apply to some jobs and see how I do...
The only problem is... I don't know what job I want xD
22:01
^^^ don't follow my advice ;-)
SELECT NOW() AS 'TTQW';
@SimonAndréForsberg I would say 'my job', but that... would be a problem.... for me.
Or perhaps I want anything except what @Mat'sMug is working with
Bye all
cheers
22:02
I am outta here too
@rolfl Relax. I don't plan on taking your job. I imagine it'd be totally awesome to be on your team though. But you deal with a whole lot more multi-threading and performance than I am used to.
When you run on systems like ..... say, the newly announced Power8 system (actually quite small) which has 2 sockets, 24 cores, and 'only' 192 hardware threads (i.e. the OS thinks there's 192 CPU's).....
Holy mother of cores...
Well, in a bit there will likely be a 4-socket version....
^^ That's what I'm using :)
22:11
Also, the memory goes to 512GB per socket, or 1TB for the system.
22:23
@sim lol, you sure? I predict they're going to be looking for a programmer in a few months...
Wut, 192 cores?!!
@Mat'sMug The OS thinks there are, It is like HyperThreading.... there are 24 real cores, and each has 8 'hyperthreads'
(it's not the same as hyperthreading, but similar)
SMT is the official name
23:03
0
Q: Unorganized code?

user2442110I decided on making a small notepad editor in Java using Swing and I think it functions pretty well. Unfortunately, my skills in making my project tidy and organized has abandoned me; it looks like spaghetti code, which many renowned programmers discourage from doing. So all I ask the fellow comm...

23:22
@Mat'sMug Considering what you've told us about your job.... yeah, I'm sure :)
Necromancer on SO!
5
A: Proguard and annotations?

Simon André ForsbergIn March 2013, Proguard version 4.9 was released, one of the fixes were: Fixed overly aggressive shrinking of class annotations. So make sure that your Proguard version is up to date and then use Eric Lafortune's solution: -keepattributes *Annotation* You can also use this configuration to...

23:54
> Going to leave this class for someone who knows Swing better than I do
That would be me :) I'll take a look at that question tomorrow, if no one else writes an answer before then. TTGTB
Sleep well!
You can't not know how to spell the Java keyword you're asking a question about. — nhgrif 24 secs ago

« first day (388 days earlier)      last day (3927 days later) »