« first day (369 days earlier)      last day (3946 days later) » 

19:00
off-topic incoming
0
Q: how to build a CSS?

user3612640I am new at CSS but I know I should be using it for code like below. Can someone help me build a CSS for this? <div style="text-align: center;"> <span style="font-size:22px;"><strong>Lehigh Athletics Awards and Achievements</strong></span> </div> <hr /> <div style="text-align: center;"> <sp...

there ^^
Score: 26
Created: Apr 28 at 2:03
Clicks per day: 25.5 (255 total)
hmm..
@Mat'sMug there's so much at play there in a very subtle way. Why would something think that downvotes wouldn't imply that your questions are--in fact--not valuable?
It would be unnerving though I guess to see that like 95% of new questions on SE sites get downvoted.
how to build a CSS?.. I have the solution

var sb = new StringBuilder();
sb.Append("S");
goto toughstuff;

toughstuff:
return "C" + sb.ToString() + sb.ToString();
@Mat'sMug I've reassured him with a comment, but we can still suspend for low-quality posts if it gets very bad. I don't think this user will get to that point.
19:06
o_O
@200_success The first field must use the user's site ID number.
That's why it didn't turn into a name.
You still need the "@@" before. :-)
@anmolsinghjaggi Welcome to the Code Review chat room. We may be able to help you better here.
(poor unicorns)
That should work.
@Jamal I gave him a welcoming upvote, but I don't know enough PHP to tell whether there's reviewable material in his post. Looks quite high-level architectural at a glance..
19:13
This question was flagged for migration. Should we take it?
9
Q: JavaScript: Sandbox or safely execute eval

Senica GonzalezIn a large project of mine, I've run into a situation where a client might need to run eval'd javascript code. I know, it makes me cringe too. One option is to manually parse it, but for future flexibility, I would like to eval the code...safely. Everything I've seen and researched says, NO. Ah,...

1
Q: Morris inorder traversal

JavaDeveloperMorris Inorder traversal - an algorithm for in-order traversal, of a tree, without recursion of extra memory. Looking for code review, optimizations and best practices. public class MorrisInOrder<T> { TreeNode<T> root; /** * Takes in a BFS representation of a tree,...

@CaptainObvious Hah! I was first!
@Jamal Acceptable by my standards.
Alright
looks good (except I'd remove the OP's gmail address from there..)
(wut! I wasn't capped! )
wow retro-reply!
JDQ #122 has arrived.
Someday, we may see JDA #1.
3
Looking forward to it
I cannot use C++11 - nullptr is in C++11. — Jamal ♦ 17 secs ago
19:26
wtf
1
Q: Removing duplicates in horizontal and vertical checks

Bertie Wheen// Check horizontals for (int y = 0; y < sGridHeight; y++) { Shape* groupShape = nullptr; int groupSize = 0; for (int x = 0; x < sGridWidth; x++) { GridItem* gridItem = GetItem(x, y); Shape* shape = gridItem->GetShape(); if (shape == groupShape) { ...

Got that title edit in just in time!
I need 13 more answers and only 254 more votes in for my first gold tag badge!
3
3-year old zombie kill just now!
0
A: On Implementing a Lisp

Sean PerryWhen I went through the WYAS48 I made the same decision of breaking the bits of eval off into smaller functions. I found this made testing easier since I could focus on just one function at a time. I find that having a function be one massive bunch of logic is not helpful. In an imperative langu...

Aaand... Revival!
2
Congratulations! You are officially a zombie killer! Well done! — Mat's Mug 6 secs ago
2
1 more vote and that's a [badge:necromancer]!
wut, still not capped!!?? ...how can I track whether I'm rep-capped or not, without manually counting the upvotes in today's rep history?
19:40
Almost Guru!
38
A: Are the following IF statements acceptable?

WaffleStealer654What you could use is a function that returns whether an opcode is valid. private boolean isOpCode(Object opCode){ return opcode == OP_0 || opcode == OP_1NEGATE || (opcode >= OP_1 && opcode <= OP_16); } Then in your code you posted, call the function, and throw an exception if it returns f...

...and I count 22x +10 "upvote" events today... how's that possible?
oh wait.. there's 2x +5 "upvote"
still, something's not adding up. Did they remove without telling anyone?
A Meta-meta question? Awesome! — Canadian Luke 44 secs ago
How do you guys create quotes within comments??
> blah blah
@AnmolSinghJaggi hi!
Hi!
">" . This worked here
But this isn't working in the comments.
19:45
if you paste a comment's permalink (click its timestamp) in chat, you'll get something like what @Jamal posted
on-site comments work with a subset of markdown formatting ("mini-markdown"), quotes (and code blocks) don't work in comments :/
0
Q: jQuery: hide multiple elements' parent container (by child element id)

skerylSummary: I need to hide several (pre-determined) divs based on a child element's id Caviats: I can't alter the HTML directly in any way (by modifying the literal .html file) The ID's of the child elements for which the parents are to be hidden are known and not likely to change often (or e...

hello @AnmolSinghJaggi
welcome!
Thanks @BenVlodgi
@Mat'sMug I count 19x10 upvotes for you.
@MAt'sMug Then there should be a separate formatting help page for comments. Don't you think?
19:49
Five votes left and four hours until reload.
@SimonAndréForsberg yeah I counted the "accept" events instead (4x accepts + 1x accepted, +62), makes sense that today would be +262 - I'm rep-capped now, ...and apparently I can't count to 20 (19x +10, + 2x +5 == 20x +10).
@SimonAndréForsberg and now I beat you by +10 for the week :)
@Jamal I feel your pain
(looks at own votes spent today... need to answer less and vote more)
2
I want to do the opposite, but I haven't found too much to answer lately.
Watching Eurovision Song Contest Semi Final #2. Switzerland's song is called "Hunter for Stars". @Malachi would probably like this one.
lol
4
(wonders if the guys making the background check have discovered this chatroom, i.e. am I getting an offer or what?!)
Yay, I scraped 1 line code of my codebase!
0
Q: Can we move questions from stackoverflow to codereview?

QuestionCI see a lot of questions on stackoverflow that would be more appropriate on codereview (For example... Understanding Python for loops and functions). Is there anything I can do to just move the question over, where it would actually get answered in a useful way instead of being closed as off-top...

20:25
0
Q: Python Print Tweets/Mentions/Retweets

CurtisI've wrote some simple code to load a json file from the Twitter Streaming API, parse the data, and create relationships between users based on who mentions or retweets who. My ultimate goal is to have a file that I can load into a network analysis program to analyze. I wrote the code to first ...

20:38
0
Q: Merton default model with complex iterative approach

JackI am using Merton default model with complex iterative approach. I have already prepared my R codes but as I am quite new in R, they seem very inefficient, in sense that they runs almost 7 hours. My main problem is my for loop part. I kindly ask you review my R codes and give any corrections wh...

TTQW - later!
The OP posted non-working code. That doesn't belong on CR. CR is to critique working code. The fact that most people don't understand the scope of other sites is exactly why you don't have a migration path there. The fact that that question doesn't describe the problem at all means that it likely should be closed on SO to, but if edited, SO is likely where it would be on topic. — Servy 1 hour ago
^^ awesome
4
A: Can we move questions from stackoverflow to codereview?

rolflFrom Code Review Meta Site Checklist for migration to Code Review Is the question calling for a code review? The author of the question must be an author or maintainer of the code. Requests to explain others' code are off-topic. In Code Review, answers may cover any aspect of the code, inclu...

^^ even more awesomeness!!
@Mat'sMug how long has it been since that interview? after a week or two with no contact I would get a hold of them.
@Malachi I heard from them on Monday... but they're the ones reaching out to get me, I didn't ask for anything.. maybe they're just slow to get the paperwork done.
ok gone now
@Mat'sMug so did you already put in the 2 weeks at your current job?
sorry
this might apply here as well
30
Q: Why doesn't attempting to edit count as a pass for a review audit?

Dan NeelyI just got a question in the review queue that, though poor, I thought was potentially salvageable via editing. However when I clicked the Edit button I got the deleted post error. Since the post was gone, I clicked I'm Done (what is there do do with a deleted post?) only to get the review audi...

@Jamal @rolfl @200_success ▲▲▲▲▲
We don't have review audits ....
20:55
44
A: $180.00 for a Stack Overflow T-Shirt?

Geoff DalgasIt's a slamming deal considering that an actual Stack Exchange employee is included and shipped directly to your house. They will personly answer any question you have to ask - no markdown required.

@rolfl srsly?
Seriously. And I don't think we need them as we have good reviewers and not robo-reviewers.
I was just checking that.... BTW, and I have some concerns ... ;-)
oh well there is a 50 rep bounty on it
@rolfl what do you mean?
I mean, that I suspect people are not spending enough time reviewing things, and, especially on the first-post review, not enough people are voting
21:10
hello
Hey janos
hey @rolfl
@malachi not resigning until I signed an offer. Rule #1, don't do anything stupid ;)
And, I am out of here.
I did something stupid today
I ran an update without a where clause.....
2
21:13
ouch
(move along, I'm not here.. ) ;)
and it's another agencies server that we use to house some of our databases, so I can't just get the data back
they have to do it. so now I wait on them
41
A: Warn new users when they ask a question after a previous question is closed, downvoted, or deleted

Anna LearStarting today, we are going to show a warning to folks who are about to post a question or an answer when they already have a track record of ... suboptimal posts: or answers: The specific criteria for these aren't public largely for the same reasons the quality block criteria aren't publi...

I hate to say this but....
I'd really like to cap today :p
so.... here's an answer that might deserve some love, if you could take a look:
http://codereview.stackexchange.com/a/48647/12390
1
A: Trim string of words based on character count

janosYes, it's extremely inefficient, because in every iteration you count the number of words twice: once in count_words, and then wp_trim_words internally has to count the words again. Another problem is that the method won't work for content that is many words larger than the target limit length. ...

21:28
0
Q: MCRYPT - Is there any flaws or areas for improvement in this class?

ilovecodeI am working on a class for encryption to use on my site. I have read through many examples of these functions and would just like to clarify a few points I have read and check if this code is worthy. It is for storing sensitive information in a database. I am aware that making this method secure...

0
Q: Coin-Change algorithm is good but fails

BulaI have created a function which returns the number that corresponds to the given row and column from the pascal triangle. I have used the formula for this: n! / r! * (r-n)! The code: def pascal(c: Int, r: Int): Int = { def factorial(number: Int): Int = { def loop(adder: I...

@janos Santa hopes he helped a bit
yeay, thanks "Santa" :)
21:49
@janos did you mean to use is_letter instead of ctype_alpha in the for loop in custom_length_excerpt_max_char?
@Corbin I totally did, well spotted! fixed now
thanks @Corbin!
0
Q: Hard-to-test 3 Tier Architecture

xerosisI'm having trouble testing some code. It's laid out in such a way that the business logic relies on the persistence layer. Some classes require that an object be saved to a database. Some classes re-read the object they were working to get the "original" version of it. All of this tends to happe...

22:06
I wonder, is this @200_success? wimp.com/fishdrives
Let's see the code. =)
Advantage: no need to pay for gas!
:15418702
22:30
0
Q: Reduce Prime Sieve Memory Consumtion

hacatuI've made a prime number generator (for Project Euler). It uses Euler's Sieve (a modified Sieve of Eratosthenes), with a mod 30 step. I'd like to reduce the memory consumption to 4/15 what it currently is by keeping a boolean array only for the possibly prime remainders of 30. I can't get it t...

^^^ I'd consider that code to be golfed.
for(big i=7,s=1;i<=m;i+=ofs[s],++s==8?s=0:0)
0
Q: Replace for loop while with apply family function in R

user3618375I have trouble with for loop, my code runs very slowly. The thing I want to do is to use function from apply family to make my codes run faster (instead of using for loopand while). Here is an example and my loop: K<-seq(1,1000, by=1) b<-c(rep(2,250), rep(3, 250), rep(4, 250), rep(5,250)) a<-c(r...

0
Q: How to make ASCII borders for cards in c++ and make 10 not to move them

MonkeyTruckMy question is: how to make ASCII borders for cards in my poker code? Everything works perfect until number 10 comes. All other cards "12345678910JQKA" contain 1 symbol but 10 contains 2 so it moves my ASCII borders. Here is the code: printf ("\n\nYour cards are:\n"); printf (" ___ ___ ...

23:00
Code golfer was surprisingly quick to accept.
I can't seem to get right the spoiler alert markdown for a code block. Is there a way?
I'm trying to do it in this answer:
0
A: Pascal triangle algorithm is good but fails

janosThere is a simpler solution. Consider this logic: if it's the first column, the value is always 1 if it's the last column, the value is always 1. (You can check this based on the row!) otherwise, it's the sum of the value in the previous row previous column + previous row same column Spoiler ...

I used spoiler alert + blockquote instead, but it's not great
23:18
@200_success: that prime sieve question got updated with new code, probably should be a rollback then
no?
nevermind, already done!
@200_success Yeah, it seems to be common with new users. And the lack of whitespace just bothered me.
I was hesitant to do it myself since I saw you editing
@JeroenVannevel You can almost always assume that large code edits after an answer are invalidating. If you roll back anyway and you happen to be wrong, then hopefully the OP can correct you on that.
edited again: codereview.stackexchange.com/revisions/49275/8 ..OP added comments, I guess it's ok?
@Mat'sMug He changed his loops again
23:21
ugh.. rollback war?
0
Q: I need feedback on this code regarding security issues

Joe Ray<?php if(!isset($_POST['submit'])) { //This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!"; } $name = $_POST['name']; $visitor_email = $_POST['email']; $message = $_POST['message']; //Validate first if(empty($name)||empty($visito...

@Mat'sMug I've added a comment now. I really do not want to have to lock this one.
saw that as I was writing one myself, ..cancelled (has more weight when the commentor has a diamond next to his name) ;)
23:34
0
Q: Reduce Prime Sieve Memory Consumption 2

hacatuI've made a prime number generator (for Project Euler). It uses Euler's Sieve (a modified Sieve of Eratosthenes), with a mod 30 step. I'd like to reduce the memory consumption to 4/15 what it currently is by keeping a boolean array only for the possibly prime remainders of 30. I can't get it t...

And the OP's follow-up question doesn't take into account my feedback regarding std::uint64_t.
bah, it's not the first OP to not implement every recommendation in a follow-up question, and he did drop the 1-letter identifiers ;)
True. He also didn't vote on any of the answers. Apparently the up arrow is invisible to some.
he found the checkmark, which is also invisible to some... glass is half-empty?
0
Q: How to make ASCII borders for cards in c++ and make 10 not to move them

MonkeyTruckMy question is: how to make ASCII borders for cards in my poker code? Everything works perfect until number 10 comes. All other cards "12345678910JQKA" contain 1 symbol but 10 contains 2 so it moves my ASCII borders. Here is the code: printf ("\n\nYour cards are:\n"); printf (" ___ ___ ...

23:39
20 minutes to reload
The OP posted a solution in the question?
It's off-topic anyway.
0
Q: CSS and HTML5 for this fixed header on scroll

JGallardoWhen I had to create a fixed header on scroll, I found a few examples on Stack Overflow but they were terrible in the sense that they relied on a fixed page height. Have a look at what I created which does not rely on a wrapper around the header and the content. Demo on CodePen. HTML <header>

So many new questions today.
23:43
:15422223 I have this C++ code that draws ASCII borders for playing cards:

	printf ("\n\nYour cards are:\n");
	    printf ("   ___   ___   ___   ___   ___\n");
		printf ("  |%-2s | |%-2s | |%-2s | |%-2s | |%-2s | \n", pack[0].value, pack[1].value, pack[2].value, pack[3].value, pack[4].value);
		printf ("  | %s | | %s | | %s | | %s | | %s | ", pack[0].suit, pack[1].suit, pack[2].suit, pack[3].suit, pack[4].suit );
	    printf ("\n  | %2s| | %2s| | %2s| | %2s| | %2s| ", pack[0].value, pack[1].value, pack[2].value, pack[3].value, pack[4].value);
^^ edit pending. Should I hit "Save edits"?
Edit comment "made question reviewable using the working code"
I'm not sure. It's not even C++ anyway; it's C.
..which works in C++ right?
meh, I'll just mind my own business. OP wasn't looking for a review, that edit would change the intent of the post
Yes, but that's not a reason to have a question with both tags.
I've made some changes, but I'm not sure if I should remove the solution. I suppose it doesn't matter with this question.
23:48
oops
Sorry about that edit, was an accident (browsertab-fart) - thanks for posting your follow-up question! :) — Mat's Mug 12 secs ago
I accidentally removed the from the ungolfed code which I had left open in a browser tab..
clearly I need to stay away from :|
lol
2
Note, that if you're interested in getting the working code peer reviewed, this question could now easily be edited and made on-topic. Perhaps you could include the listing for pack as well, and anything else that's relevant - you'd be surprised with the things that can come out from a peer review! :) — Mat's Mug 17 secs ago
putting it on the OP to make their post on-topic.
This question has been crossposted on Programmers at programmers.stackexchange.com/q/238458/60357 from where it will soon be migrated to Stack Overflow. — amon 1 min ago
time to take a break. I started writing an answer like "This isn't 3-tier architecture. It's lasagna code." ...discarded the draft, will be back at it later.
Bloody cross-posting.
23:53
...useless, it's already answered!!
is there still time to notify whoever is about to migrate it?
I'm not sure who will be migrating it, but it probably won't be us.
@Mat'sMug Half-full!

« first day (369 days earlier)      last day (3946 days later) »