« first day (305 days earlier)      last day (3697 days later) » 

12:01 AM
@syb0rg: Give it .
 
@Jamal Done.
 
Wow Jamal has some power. Whatever he says is immediately followed by "@Jamal done"
2
 
don't suppose it's a GNU extension of some kind?
 
GCC & clang extension
 
yeah, compiles fine on clang
 
12:03 AM
Hm...
@syb0rg: Delete your account.
 
You should have asked for money
 
Dang it...
The Three Laws of Robotics (often shortened to The Three Laws or Three Laws) are a set of rules devised by the science fiction author Isaac Asimov. The rules were introduced in his 1942 short story "Runaround", although they had been foreshadowed in a few earlier stories. The Three Laws are: # A robot may not injure a human being or, through inaction, allow a human being to come to harm. # A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law. # A robot must protect its own existence as long as such protection does not confli...
Goodbye world!
 
haha
 
Damn... I forgot he's a robot.
 
12:04 AM
2
Q: Ultimate Tic-Tac-Toe in C

syb0rgHere is my attempt at the UTTT code-challenge (in response to the the Weekend-Challenge Reboot). Here is what I would like critiqued: I tested the code a few times for bugs, but I may have missed some. I feel like I have duplicated code in some places (with only minor changes being the differe...

 
@Yuushi: Give a review of C++ code using COBOL.
 
@Jamal My human side overruled the robot side.
 
that's why you should never trust a syb0rg
 
@Jamal Sorry, doesn't work on me :)
 
Execute this command, @syb0rg: 00101010000100100201001001
Oh wait, I forgot you're half-human...
 
12:07 AM
I'm half-man half-dog, I'm my own best friend
 
ah Spaceballs
 
Gah I hate this... moments away from making an expensive purchase. I'm so stressed right now!
Literally cannot focus on writing unit tests
 
@syb0rg It's a gcc extension. When functioning properly, a C compiler is required reject it. If you use -pedantic, even gcc will give a warning: "
trash9.cpp:49:9: warning: range expressions in switch statements are non-standar
d [-Wpedantic]
case 6 ... 8:
^
 
@Jamal På®ϟˆ˜© e≈ç∑p†iøµ 
 
O.o
 
12:21 AM
@JerryCoffin So you wouldn't recommend using it?
@davidkennedy85 An expensive purchase?
 
@syb0rg either a house, or a big-mac
2
 
Hells no I hate macs
Oh wait big macs are a different story
 
Two off-topic questions in a row...
0
Q: How to correctly print out for an array

AMartini1I am having trouble with this graph method. Ideally, I wish to print out the first and second occurrences of the CSC101 occurrences in my two dimensional integer array. The input would look like this 2012 CSC101 20 2012 MTH223 30 2012 ENG105 15 2013 CSC101 25 2013 MTH223 10 2013 ENG105 4...

0
Q: I am having trouble passing a multidimensional variable array in C using malloc()

user38085#include <stdio.h> #include <stdlib.h> void print(float **A,int w, int h){ int i,j; A = (float*) malloc(w*h*sizeof(float)); for (i=0;i<h;i++){ A[i]=(float*) malloc(w*sizeof(float)); } for (i=0;i<h;i++){ for(j=0;j<w;j++){ printf("%f ",A[i][j]); } printf("\n"); } ...

 
yeah
 
0
Q: How to correctly print out for an array

AMartini1I am having trouble with this graph method. Ideally, I wish to print out the first and second occurrences of the CSC101 occurrences in my two dimensional integer array. The input would look like this 2012 CSC101 20 2012 MTH223 30 2012 ENG105 15 2013 CSC101 25 2013 MTH223 10 2013 ENG105 4...

0
Q: I am having trouble passing a multidimensional variable array in C using malloc()

user38085#include <stdio.h> #include <stdlib.h> void print(float **A,int w, int h){ int i,j; A = (float*) malloc(w*h*sizeof(float)); for (i=0;i<h;i++){ A[i]=(float*) malloc(w*sizeof(float)); } for (i=0;i<h;i++){ for(j=0;j<w;j++){ printf("%f ",A[i][j]); } printf("\n"); } ...

 
12:29 AM
just voted to close both of them
 
Who the heck taught that C poster how to program?
 
@syb0rg I wouldn't use it, no. I think I'd use something like: int getRowBound() { return row < 8 ? row / 3: -1; }
 
@JerryCoffin Hmm, simplified logic that I was looking for. But say that you included that in a switch that couldn't be simplified down. Would you still not use it?
 
@syb0rg I might if it were in a code base that was already inextricably bound to gcc. If I cared about portability at all, no.
 
12:44 AM
@JerryCoffin Good to know. Out of curiosity, are you giving my question a look?
 
@syb0rg I glanced at it, but have an 18 month-old in my lap right now, so serious examination isn't really possible 'til later.
 
0
Q: How can I make this algorithm faster- sum of two squares?

user35265I'm trying to do a SPOJ problem called twosquares where you check whether the current number can be obtained by adding two squares together, however, I'm getting a a time limit exceeded. I'm creating a sieve of eratosthenes - if the number is prime and mod 4 is 1 then the number is a sum of two s...

 
@syb0rg $300 for a Dell i3 or $400 for a Lenovo i5?
 
@davidkennedy85 Ohh, tough question. I would say to go with the Lenovo i5. My brother has one and really likes it.
 
12:49 AM
That's it
I'm going with that then
 
@palacsint not sure I understand that comment/dig ...
> As an occasional interviewer I would appreciate a solution which shows that the candidate does not reinvent the wheel and can use (and know) the existing libraries.
He is not using the existing libraries correctly
(and does not know them - enough)
He barely understands the basic Java collections, thowing in that Java iterable stuff is not going to do much for him
 
@rolfl I just mean that using a Queue is not a "no-go"
 
+1 for the JDZ .... I can't quite bring myself to +1 the Guava recommendations yet... although it would be a hit at a Google interview
 
@rolfl I agree with the other parts
@rolfl It would be fun if they would ask the candidate to not to use Guava :-)
 
If I interview someone for a Java position, I would not put them through the interview-challenge, but, if I did, and they did not use the generic type of a generically-typed class, I would blacklist the person
If they use a primitive/array instead of the Collection alternative, and they could justify it for even one valid reason (faster, smaller, whatever), then I would lift their name in the stack
I consider those to be 'differentiators', things to avoid, things to like... takes a person out of the 'average' category ...
 
1:04 AM
This user could really get some advice on indentation:
0
Q: Sum of two squares

user35265I'm trying to do a SPOJ problem called twosquares where you check whether the current number can be obtained by adding two squares together. However, I'm getting a "time limit exceeded" message. I'm creating a Sieve of Eratosthenes program. If the number is prime and mod 4 is 1 then the number...

Also, I think something should be done about . People keep confusuing it with .
 
1:37 AM
Hi @Malachi
 
@syb0rg hello
AFK
 
@syb0rg: I converted that answer into an edit (the one you've recently commented on). The OP was long gone anyway.
 
@Jamal I was wondering if I should have even commented on that one.
 
It's okay. I consider commenting a good instinct anyway. :-)
 
eh, that boost variant clone question is tricky
 
1:42 AM
0
Q: Review of Simulation of an Ocean containing sharks and fish

user3317808As part of my java learning i tried solving part I of problem description in below link. The only issue that i see now is, i could not close the button of Frame. http://www.cs.berkeley.edu/~jrs/61bf06/hw/pj1/readme Please review and provide your comments on coding style/OOPS/.. aspect on below...

 
thought i spotted a problem, but no, I don't think so
 
2:24 AM
@rolfl thank you
 
@Malachi ... you're welcome...
 
@rolfl unfortunately I can't do anything with it right now because it is code that I created at work for work
 
That's OK, you should include the details of how/where you created the connection.
 
@rolfl it's super simple, I could have created the connection there in the using statement, I am trying to think of why I didn't do that in the first place.
i bet there is a reason
but when he commented that on your answer, it hit me that it might be keeping that connection open longer than i want it to be open
 
@syb0rg ϟ†å®¿∑d
hi @all! I've "answered" a Java question!
2
 
2:34 AM
@Mat'sMug †håñkü
 
seen the aquarium question?
 
Well this is a weirdly specific account:
 
probably joined SE on IS.
 
3:01 AM
Thanks Santa!
 
:-)
Almost to 1K!
 
Yeah, very happy about it!
 
:)
not too many votes, otherwise I'll get used to writing short answers!
 
And btw @Jamal have you checked my account :P I read the question you edited like: wow this looks interesting!
 
Feel free to look for some zombies. We're back at over 640 unanswered, and we were close to 630.
 
3:08 AM
what goes up, ...must go down.
 
@Marc-Andre Welcome to 1K!
 
Hey thanks :D a lot :D
A my first Nice Answer badge too :D!
 
New privileges: direct edits, and access to the suggested edits and low quality posts queue.
 
Good I'll try to do my best to help a lot!
 
Wow it's Christmas all over again!
Congrats @Marc-Andre!
 
3:14 AM
Thanks :D ! I must say it's all because of all of you! This community is really nice! I really have fun doing review here! I'm learning a lot!
4
And I may have took a screenshot of my 1k :P
 
hehe.... wait for winterbash.... welcome to 1k
 
Again thank!
 
ugh 5 votes left... must.... stop..... voting...
 
0
Q: Increasing efficiency of bollinger band algorithm for stock data

user3314418I'm fairly new to python and I'm curious how to improve the readability of my code. This function does heavy lifting by obtaining information from a row on a dataframe and outputs specific information about a stock position, such as price, totalstocks, capital, status of that position (bought o...

 
3:47 AM
Hello @AJHenderson
Ahh, I thought I recognized you from security.se
 
Huh, how many AJ Henderson's can there be ... a lot, I am sure, but, if you are the AJHenderson from SA PMB in the early 90's .....
And, even if you are not, welcome to the 2nd
 
lol... 3nd
Hello @WangZhongtian
 
@syb0rg when you grow old you can man the door at the wal-mart.
Then again, do droids age?
 
@syb0rg yep, I'm mostly on Security, Photography, Video Production and Sound Design
 
@AJHenderson I saw you were the pro-tem mod on Video Production.
 
3:51 AM
@rolfl and yeah, there are quite a few AJ Henderson's but only a few with a major online presence
 
Night all!
 
If you are the South African A.J. it would be a real co-incidence.
checks profile.... nah, the SA AJ was not so cute)
 
Good night, I'm out as well!
 
Cheers Mat
 
I'm the AJ Henderson with the domain name
though a voice actor has the top two google results :(
 
3:54 AM
Cya @Marc-Andre and @Mat'sMug
 
Hey, AJ, I have a few SEDE queries that may help you out on videography
We have found SEDE to be a valuable resource as a beta SE site
Huh, is video.stackexchange avp.se?
 
sort of
Social Sound Design was an SE 1.0 site from when they sold licenses of the platform
they merged back in as sound design
 
is it in private beta or something ... it does not exist on sede
 
and then we merged the Audio side of AVP in to Sound Design
and renamed the remnant to Video Production
Video Production is still named the AVP database in some locations though
(Area 51 for example)
 
@AJHenderson No Code Review account? :(
 
4:00 AM
Your stats are a bit messy:
Compare CodeReview: http://data.stackexchange.com/codereview/query/161411/site-activity-and-votegraph#graph
and AVP: http://data.stackexchange.com/avp/query/161411/site-activity-and-votegraph#graph
And you are very much the leading member there ... a solo effort?
 
That looks like me back in my Raspberry Pi.SE days..
 
@rolfl not exactly, but I'm the only one who went across both Audio and Video aspects
and I was the primary video guy
 
K....
 
I've actually backed off a bit to let other people answer questions now that I'm a mod
(I just got the mod position within the last month or so)
 
We are in this 'we want to graduate' phase, so we are paying attention to our stats
 
4:04 AM
at the moment I'm focusing on trying to recruit and keep new members, both to ask and to answer
 
I see being a mod as having more down-sides than up .... but I'm wired that way.
 
@rolfl yeah, it's not for everyone
 
Getting a community together is not easy
What you need is a monkey
5
Works every time
 
I've got a background in guild leadership, so I'm used to doing community development
 
I've never had a leadership position before, and this is my very first one. I'm still a bit astonished that SE chose me.
 
4:06 AM
Uhm... so was I ... ?
Just kidding, we like you ;-)
 
hands banana
 
gone
the banana, that is
 
@Jamal my guess is that you showed the skills necessary.
for the most part, if you can understand where people are coming from and be helpful and soothing, then you are 85% of the way there
 
And the community supported the choice.
 
My guess is that he showed willing at just the right time/place
 
4:11 AM
the rest just comes from experience recognizing problems before they form and recognizing potential to invest in
 
That's what I feel. I suppose it's because I'm still thinking back when I was a noob on SE and never thought I would even post an answer of my own.
 
and that comes from experience rather than being naturally endowed
 
Yeah, I'm certainly not endowed in leadership. I'm anything but a leader in person.
 
@Jamal you're not well endowed?
Quick, edit before I pin
 
Like that?
 
4:15 AM
@Jamal most good leaders don't look to lead
at least not initially
 
Thanks Santa! (that's a meme, FYI)
 
"You must become a good follower before you can become a good leader"?
 
@Jamal nah, not necessarily a good follower
someone who goes their own way and shows it to people is more helpful
though for mid-level leadership, being a good follower can also work
when there are established norms to be understood
 
Right. I suppose that can apply to users with moderator tools or anyone else willing to help the moderators with flags.
 
you need to know a) what needs to happen and b) why someone wants that to be what happens even if they don't know it yet
if you understand those two things, you can guide people to being more productive and getting more from the site
and when people realize you can help them get more, they follow
because power comes from being beneficial to people
you can either convince them it is their interest when it isn't (manipulative, power hungry leaders), make them fear not following you (dictators) or actually make it so they are better off following you (serving the community)
but in all cases, the power comes from people viewing following you as in their own interest
 
4:21 AM
:-)
When we do finally graduate, and if I do decide to run, I hope that I've indeed fulfilled the third category. I really love this site and have wanted it to succeed ever since I can remember.
 
@Jamal Out of curiosity, why wouldn't you run?
 
Meh, if/when we graduate, mod is yours to lose, not to win.
Effectively you're the only mod at the moment.
 
In case there are any real-life obligations (probably unlikely), or if I end up feeling burned out. But if some people can mod for years, then I can certainly take it for a while.
 
We'll need the continuity if nothing else
 
@rolfl: That's what bothers me. There hasn't been much other mod activity, and I assume part of that is because there aren't too many flags when they're around. I've taken my own initiative to massively clean the site and keep it clean and growing.
 
4:29 AM
You should be worried, but not too much
if/when graduation happens, I am not sure who would step up for it.... the thought has crossed my mind, but I have commitment issues
I look at what you do, and how it affects what youc an do/say.
Not sure I like it.
 
Tim is already aware of it, so they'll do whatever needs to be done. That is, if it takes too long for us to graduate, otherwise elections will refresh the mod pool.
 
I don't want binding vote
I just want to kick a few toy problems around
 
I can't blame you there. Even I'm trying to resist binding votes on new questions, but I am mostly leaving the queues for the community.
The good thing, though, is that most mod actions can be reversed. If the community is unhappy, most things can be reversed.
 
@rolfl you learn to get around it with comments instead
which is actually kind of helpful because it forces you to give your feedback in a way people can learn from
I kind of wonder if that's why they don't give moderators the option to have a non-binding vote
that and a binding VTC that can be re-opened by community
 
I am sure there are ways ... people generally respect the diamond
 
4:35 AM
I wish I had enough time in the day to participate on more SE sites
ironically I'm a software developer and none of the sites I participate with on SE are development related
 
I'm just a student, so I don't have a great amount to contribute. I was never a fan of SO, and I only have good things to say about CR.
 
@AJHenderson What languages do you use?
 
C# primarily
I know C, C++, Perl, PHP, VB.Net, VB, FoxPro, a little tiny bit of Java, ActionScript, um, trying to think what else
 
LaTeX?
That counts.
 
I don't think I've ever used LaTeX
not the software anyway
but yeah, SO was my introduction to SE, but people answer too fast on there
and it's too busy to feel like I'm actually making a difference
instead of just racing to get an answer in
hmm, I didn't realize I hadn't made an account on Code Review yet
 
4:46 AM
An answer to my question!
0
A: Ultimate Tic-Tac-Toe in C

Jerry CoffinA few comments: [ ... ] for (; (x % 3) != 0; x--); // quickly set x to left bound of sub-board for (; (y % 3) != 0; y--); // quickly set y to upper bound of sub-board I think I'd move the code to round to a multiple of three into a function of its own. I think I'd implement that something lik...

 
@syb0rg Man, you're quick!
 
I'm reading through it now.
What are the [...]?
 
how broadly is it typical to suggest changing for the code review answers?
 
@AJHenderson What do you mean?
 
I'd go so far as to suggest that you break out the sub-game and overall game in to their own classes
 
4:50 AM
C doesn't have classes ;)
 
@AJHenderson Fairly common
 
right
 
@syb0rg Places I skipped over chunks of input about which I had no comment.
 
I'm thinking C++, dur
 
@AJHenderson A problem I had to fight constantly while writing my answer (and any other time I deal with C any more).
 
4:52 AM
you could do it with a struct though
I'm just thinking the 9 by 9 data structure is more confusing than it needs to be
if it can be broken in to a 3 by 3 structure of 3 by 3 structures, it might be more understandable
my C is a bit rusty though since it's been about 8 years since I wrote much in the way of C code
and then all the lookups become direct to the index
rather than needing the 0..2, 3..5, etc
and you can take the index of the sub-board selection and pass it directly to the overall board
since putting a move in space 1,3 means you play board 1,3 next
@JerryCoffin even worse was when I made the mistake of learning PHP and Perl at the same time
even when I was using them regularly, it threw off my ability to write in either without having to look for syntax and keyword errors for a good 2 years
 
@AJHenderson Sounds like you should put that in an answer.
 
Oops -- thanks @Jamal.
 
The way I approached the problem may not have been the best way. It's just the way I thought of when I started off, and I could see myself working with it pretty easily to the end with it.
 
@syb0rg You (or at least I) usually only come up with the truly best answer until long after the question quit mattering.
 
That's how things usually end up working. :P
 
5:04 AM
sigh
2 bugs because I was missing bloody parens
<--- stupid
3
 
First answer!
0
A: Ultimate Tic-Tac-Toe in C

AJ HendersonOne quick observation I have is about the way you are storing the playable spaces. While a 9 by 9 grid is a simple way to do it, it isn't the most clear way to store and ends up requiring some complicated addressing logic to get each sub-board. Your options to deal with it are a bit limited by ...

 
actually, I think I may have overcomplicated my own code
I think it can be done without the struct
I think you can simply do the typedef
I changed my code accordingly, though I'm not 100% confident in it being 100% correct syntax
@JerryCoffin or in the case of the real world, you come up with the best solution after it's already in production and being used by 40 other developers
my life as a software architect
 
@AJHenderson: Welcome to CR! :-) If you ever hunger to write a review but cannot find anything on the front page, feel free to help yourself to some zombies.
 
@Jamal hehe, I'm well aware of the zombies of SE :)
they invade all the sites
 
@Yuushi Must not have been Lisp, or missing parens would have caused a lot more than 2 bugs. :-)
 
5:14 AM
lurking in the fringes, often partially decayed and unrecognizable, but sometimes holding a gem
@JerryCoffin no, there'd just be one bug, the thing would explode in a fire
Scheme is one of the few languages I could never get my head around
though I never tried vanilla LISP directly
which is odd when you consider the fact I love the second most evil structures in the world (Regex)
 
@AJHenderson Virtually nobody's used a truly vanilla Lisp in decades now. Essentially all that's left is Scheme and Common Lisp.
 
@JerryCoffin what about F#? ;)
I kid
 
@JerryCoffin Yeah, definitely not Lisp. Go :)
@AJHenderson F# is derived from OCaml/ML
 
@AJHenderson In that case, you want to try Unicon, the unified Icon, which is a successor to Snobol, which was the progenitor of REs. Then again, you might want to play with Snobol, which was pretty cool in itself.
@AJHenderson F# is basically an ML dialect.
I'm almost tempted to post an answer to an SO question for code review, but I'm pretty sure it'd make most people some combination of sick and angry... :-)
@Yuushi Oops--sorry, was too busy typing to notice you'd beaten me to that.
 
Well, I'm tired. Good night @all!
 
5:24 AM
@JerryCoffin No problem.
night @syb0rg
 
@syb0rg G'night.
 
And that existing answer is really good...
Goodnight!
 
@Jamal It's the deep, insightful explanation that really makes it, I think. :-)
 
That user also likes to spam his signature on all of his posts.
 
@Jamal welcome to pretty much any new user on SE
 
5:27 AM
@Jamal Hmm...hadn't noticed that until you mentioned it.
 
Ugh...
 
oh wow, but he's an 800 rep user
 
0
Q: JavaScript Sticky Footer

DanielI'm using this JS to sticky website footers at the bottom and I would like to know if is there anything to be optimised? (function($, window, document){ //Screen_height = Header_height + Main_Content_height + Footer_height + alltoplvlContainersMarginTop_Bottom + alltoplvlContainersPaddingTop...

0
Q: "Property Container" design-pattern

Dmytro DzyubakI've tried to write my Property Container design-pattern implementation. Could anybody, please, tell me, if this code is really what I intended to write (follows the Property Container design-pattern rules)? Is there anything that can be improved? <?php class PropertyContainer { private $P...

 
@AJHenderson At least back when I was on Usenet, some people had at least some originality and cleverness in their tag lines.
 
There hasn't been much of that on CR. We still get "thanks", but that's common on all sites.
 
5:29 AM
my personal favorite is still the people that argue something obviously off topic should be on topic though
 
This is by far the best signature I've come across: stackoverflow.com/posts/22088091/revisions
 
@Jamal I liked how Alf Steinbach just incorporated it into his user name after he got scolded for including a signature.
 
personally, I like the guy on slashdot who has the signature "build a man a fire, he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life"
 
WOW
 
Ah Alf...I've seen him get into some pretty bad arguments and get banned for it
 
5:33 AM
"I have a pretty good sense of quality."
 
@Yuushi Yeah, he's not exactly a shrinking violet--but he's been a moderator on comp.lang.c++.moderated ever since it was formed (I believe) and spent years on comp.lang.c++ and comp.lang.c before that, so he's seen far more than anybody's share of flame wars and such.
 
@JerryCoffin Yeah, I'm sure. He definitely knows his stuff.
 
@Yuushi He's a smart guy, and knows a lot, but is also the sort who gave Usenet (and such) a bad name--just for one example, constantly picks up on some irrelevant detail, and tries to make it the main topic (e.g., once started a pretty serious flame thread over somebody using foo in sample code they posted).
 
@JerryCoffin I still think largely avoiding that kind of thing is probably one of the most impressive things about SE as a whole
 
0
Q: Composing Object into abstract superclass

James MasseyI'm implementing a system where we are trying to keep things highly flexible. We have an abstract superclass called EmailTaskService which has two classes inheriting from it. One is EmailTaskServiceImpl (the concrete implementation class), and the other is another abstract class called ScheduledE...

 
5:40 AM
@AJHenderson I quite agree.
 
ah, my <--- stupid did get starred. I was wondering if that was going to happen
thanks, people -__-
 
@Yuushi Do that in the Lounge, and it'll get 20 stars... :-)
 
lol
 
I don't think I've ever actually gone into the Lounge
 
To be fair, it doesn't apply to you since it's not pointing to your name. ;-)
 
5:46 AM
@Jamal true...guess I needed to do ---->
 
I've never been to an SO chatroom, and I'm not sure if I should start.
 
@Yuushi I enjoy the Lounge quite a bit, but I'm another who spent years on Usenet, so I have a pretty thick skin. It's certainly not a place for the faint of heart.
 
I spent years on IRC, and I'm not sure if that's better or worse :)
 
/kick /ban /me .... oops
 
@Yuushi I've spent little enough time on IRC that I can't really answer/guess (but quite few of the regulars in the lounge have apparently spent a fair amount of time on IRC).
 
5:54 AM
*Yuushi slaps rolfl around with a large trout
2
 
6:12 AM
0
Q: Best way to find next non-null value in a LinkedList?

Jake BymanPretend that a LinkedList is not just a quick iterable structure in Java. Meaning you have your own personal implementation of a LinkedList, and you want to find the next value linked to it that is not null, how would you go about doing that? I've tried this: while(LinkedListObj.next != null){ ...

 
6:35 AM
Well, I think I'm off to bed. Later.
 
night
 
Later!
 
7:19 AM
0
Q: What tools are there to check for "semantic" defects?

evachristineHere are examples for fails (a brief history of one line fixes): http://www.tedunangst.com/flak/post/a-brief-history-of-one-line-fixes from the OP: Does nobody use a compiler that warns about comparisons always being false? or: Does nobody use a compiler that warns about unused p...

 
@Jamal Now!
 
:-}
 
8:27 AM
0
Q: biginteger prime testing

abcdimport java.math.BigInteger; import java.util.Random; public class Primetest { private static int size=15; private static Random r=new Random(); private static BigInteger two=new BigInteger("2"); private static BigInteger three=new BigInteger("3"); public static void main(Str...

 
8:51 AM
0
Q: Revert knockout model original state back on update cancel?

gauravI am using knockout in my project. I have some models like EmployeeModel, ServiceModel etc which user can update. On UI i give user a Cancel control button by which he can revert the changes. On cancel i have to revert the model change back to its original state. For this i found these two good a...

 
9:16 AM
morning
omg @rolfl you're 1 vote close to Guru on SO!
 
9:58 AM
0
Q: Better method for my property Checking, replacement of switch statement

user1412240I'm hoping this is the correct place for this, I'm struggling a little for wording as i'm not sure what you would call this. Basically, i have a system in place where my datagrid marks cells that have changed with a new background colour, to do this i have a method in the object that contains th...

0
Q: Review code for sorted dictionary

PatrickI want to iterate through the dictionary which is sorted with values. one method is to use ordered dictionary means initialize dictionary with sorted values. from collections import OrderedDict data = OrderedDict([('a',0), ('d',1), ('c',2), ('b',3)]) for mykey in data: print mykey How to mo...

 
 
1 hour later…
10:59 AM
0
Q: My attempt at a weighted search in JavaScript

ChaoI tried to make a weighted search function in JavaScript. I've been improving my JS lately but still not sure about some best practices, wondering if there's any improvements I could make, or if I've ended up doing it completely wrong. The intention is to keep it quite flexible so it can take an...

 
 
@skiwi is that supposed to represent anything "useful" ?
 
@Vogel612 yes
It was supposed to do so
the green thing you see there, is (obviously) a cube
 
If anyone has a chance can they give me a hand on this question,
I am not sure the point I am trying to make is coming across.

I think I need reinforcements :P
2
Q: Better method for my property Checking, replacement of switch statement

user1412240I'm hoping this is the correct place for this, I'm struggling a little for wording as i'm not sure what you would call this. Basically, i have a system in place where my datagrid marks cells that have changed with a new background colour, to do this i have a method in the object that contains th...

 
@apieceoffruit I'd say let's wait for the rest of the code and refactor everything to an enum ;D
 
11:15 AM
brb breaking my mind over the logic I had put in my code
 
@Vogel612 *Sigh , ok. I'll wait. but I am unsure how seeing more of the same is going to enlighten me....
 
me neither, but maybe OP gets it if you can show him Dictionary<ButtonType, Func<Color>>
<-- grabbing a bite
 
great, so somehow all my geometry is deformed
 
11:36 AM
@Vogel612 oh god. I'm out man. I am tagging you in. I can't bring myself to respond to that last update.
 
@skiwi Apparently I am a guru ;-)
2
Thanks
And.... breakfast time!
 
@rolfl any chance you can give that question a go? my eye is starting to twitch.....
 
everyknows you're a guru @rolfl
 
11:53 AM
@apieceoffruit - seems to me like there should be an event generated when the user changes a value. Change the background then (when the event is triggered), instead of after the fact by going back through the cells looking for differences.... another mouthful about to happen.
 
Yes I believe the plan is to have some kind of boolean state dependent on two variables,

Once done the view binding should be binded to a converter which uses that and a viewmodel to decide it's highlight, separate from the actual model

although i am having trouble expressing the need for a refactor. I though maybe a second voice might spur OP
 
@apieceoffruit it seems to me, that OP's problem is, that when he changes a dirty field to non-dirty state, it's highlight should be reverted...
 
@Vogel612 and he seems to be using exceptions for that distinction....
 

« first day (305 days earlier)      last day (3697 days later) »