« first day (217 days earlier)      last day (2174 days later) » 

12:00 AM
Aaaaaannnndddd tooo late....
Hey @Jamal
Welp, my latest stats homework grade was horrid, as expected. Happy Friday to me.
Whoo hooo .... Now, you Know that your studies are more important than CR... right>
So, you ready for WEC?
Ooohhh... I got a 'k' on my rep now.
Except I could barely understand anything in that class. Calc II seems like a walk in the park compared to that.
What is that number in chat, anyway? I know you don't have 10K on the main site. :P
12:10 AM
It is the sum of rep on all SE Sites.
My 3.xK here and 6.9K on SO make it up.
Frankly, I'd rather learn to program statistical applications... yet I don't have the stats knowledge for that.
Ah. Well, mine is 4.2k. :-)
12:43 AM
Current Weekend Challenge: Poker Hand Evaluation
@Jamal Noticed your comment. Like it. Go ahead and make it CW.
I wonder if this user actually have seen any of my answers...
I'll handle this.
@Jamal If there is any way to announce the current weekend challenge somewhere for the entire site, please do so :)
I will use Java this time as well, I might actually have some use for this code I will write...
Q: What is te best way to deal with multiple return types in Python's is_number?

BertieI have not tried decorators yet or functions within functions, but this current un-pythonic method seems a little convoluted. I dont like how I need to repeat myself when I check the return_type (3 times)? Any suggestions are welcome, especially if the repetion can be dealt with in an elegant wa...

Q: Wrapping every expression with % 2 ** 32 to get a C-like behavior

d33tahI'm trying to port the following C loop to Python: for (int32_t i = 32; --i >= 0;) { v0 += ((v1 << 4 ^ v1 >> 5) + v1) ^ (sum + k[sum & 3]); sum -= delta; v1 += ((v0 << 4 ^ v0 >> 5) + v0) ^ (sum + k[sum >> 11 & 3]); } The problem i...

1:17 AM
@Jamal - how do you C folk survive: In C, the result of right-shifting a negative value is implementation-defined ... what about right-shifting an unsigned value... what comes in to the highbit (i.e. with byte is 0xff >> 4 => 0xff or 0x0f
1:51 AM
Q: Hard time dealing with smart pointers

oaoI try to implement a neural network in c++, using the library Eigen. It is my first project in c++ and I am from a gc background so I am not really sure about what I do when I use pointers. I try to use smart pointers because they are safe. I don't want to use C++11 so I use only shared_ptr. Is i...

2:33 AM
@rolfl: I honestly don't quite know about that.
3:29 AM
Q: Determining whether or not a number is prime(Simple method)

Razor1692import java.util.*; public class PrimeNum{ public static void main(String args[]){ Scanner x=new Scanner(System.in); System.out.println("Enter the number : "); long y=x.nextLong(); long i; for( i=2;i<y;i++){ long z=y%i; if(z==0){ S...

3:41 AM
I've got my PlayingCard and CardDeck up and running :)
I love this week's . It's my Programming-1 end-of-semester project all over again. Time flies, that was over a decade ago. We had an eternity to code this logic in ; now I'm writing this project in a weekend, in .
4:17 AM
So, how exactly is that program supposed to work? Do we just provide a hand, and the program determines what kind it is?
Yup. I just tend to go creative when I write the specs :)
I can do that, if I have time. I do have working Card and Deck classes, and I may just skip the Hand class and focus on the algorithm.
I mean, if I'm going to evaluate a poker hand, might as well do it with cards; the says what we're implementing, not how we're implementing it :)
Cards are for amateurs. :-) I'm gonna use sticks and stones.
Someone could just as well post a single function that returns a string ("Full House!") given an array of integers...
4:30 AM
I'm okay with that! Short and easy.
5:17 AM
Q: Finding Divisors of a number

Razor1692Can i make this code shorten to find all the divisors of a given number? import java.util.Scanner; public class PrimeNum2{ public static void main(String args[]){ Scanner x=new Scanner(System.in); System.out.print("Enter the number : "); long y=x.nextInt(),i; System...

2 hours later…
6:52 AM
Q: Poker Hand Evaluator Challenge

retailcoderThis week's review challenge is a poker hand evaluator. I started by enumerating the possible hands: public enum PokerHands { Pair, TwoPair, ThreeOfKind, Straight, Flush, FullHouse, FourOfKind, StraightFlush, RoyalFlush } Then I thought I was going to need c...

7:40 AM
Q: Find elements occurring even number of times in an integer array

Rohit JainI came across an interview question, which is like this: You have an array of integers, such that each integer is present an odd number of time, except 3 of them. Find the three numbers. I tried implementing it using a HashMap<Integer, Integer>, by mapping each integer element to a number t...

3 hours later…
10:35 AM
Q: My First Attempt of ModelView Programming in PyQt4

sanIn my first attempt, I have tried to load images from disk and load it to a QTableView using QAbstractListModel. The only thing I have experienced not seems to work better is it gets slower if number if images huge on the location. import sys import os from PyQt4 import QtGui, QtCore class MyL...

2 hours later…
12:41 PM
Q: Optimized Query

user33133I am having a structure of 3 tables Table min consist of matcode,min_qty,jo_no,mr_no Table min_out_body consist of matcode,out_qty,jo_no,mr_no Table eu_min_out_body consist of matcode,out_qty,jo_no,mr_no And data as follow: [min] matcode min_qty jo_no mr_no xxx ...

Q: Why do i get this output in this simple java code?

Razor1692Why do i get 10 2030 as the out put? I cant figure out why it doesnt output it as 10 50 ? public class Testing1 { public static void main (String args[]){ int num1=10,num2=20,num3=30; System.out.println(num1+" "+num2+num3);

1 hour later…
2:06 PM
Q: Is my code implementation correct to find out the smallest integer in an unsorted array?

Jabir Al FatahI have the follwing codes. I am confused if my code is ok to find out the minimum integer in an unsordted array. My codes run fine and it's able to print out the integer also. But the problem is that it prints out 10, which is the first element of my array but not the smallest. Can anyone please ...

Favourite statement:
`My codes run fine and it's able to print out the integer also. But the problem is that it prints out 10, which is the first element of my array but not the smallest.`
I wonder what his definition of "run fine" is?
If/When reviewing the close queue ... read my comments on:
Q: Optimized Query

user33133I am having a structure of 3 tables Table min consist of matcode,min_qty,jo_no,mr_no Table min_out_body consist of matcode,out_qty,jo_no,mr_no Table eu_min_out_body consist of matcode,out_qty,jo_no,mr_no And data as follow: [min] matcode min_qty jo_no mr_no xxx ...

2:48 PM
Q: unit-tests and DBC concept

user2491179I would like code review about the DBC concept and unit-tests. package restaurant; /** * Warehouse is an objects container. This object contains: * (1) a collection of available kitchen tools * (2) a collection of available ingredients. * This object is the shared storage component where th...

3:30 PM
Q: Python Socket bind block until successful

deed02392Is this an appropriate way to block until I have successfully bound a socket? while sock.bind(server_address) == 0: pass Possibly a time.sleep() would be a little less aggressive?

4:00 PM
Q: php foreach loop to slow?

vimes1984Ok I have a nested array that returns objects which are then traversed to retrirve the id's which are then used to retrieve another array which is traversed and the values returned are echoed out the problem is this seems to take ages in the browserto work across how do i go abut speeding this up...

Q: Convert Sql LIKE to Regex

dkackmanI have a bit of code that converts a Sql Like expression to a regex expression. For some time I have been using this conversion. This conversion replaces all "%" with ".*?" which works for contains patterns but is over matching for starts with or ends with patterns. So the conversion of %abc to ...

1 hour later…
5:13 PM
Q: How to make this csv reading php code more efficient

user33142OK, so I have the following code that reads a csv file that than ourputs the result in the form of a HTML table: $fhdrop = fopen("ac.csv", "r"); while (!feof($fhdrop) ) { $at[] = fgetcsv($fhdrop, 1024); } $fhdrop2 = fopen("rc.csv", "r"); while (!feof($fhdrop2) ) { $at2[] = fgetcsv($fhdrop2...

5:57 PM
Q: Reviewing unoptimized code in public repo. Are these type of question appropiate?

Carlos Eugenio Thompson PinzónCurrently I have a problem from a system that is not working properly (ref in stackoverflow). It surely has many issues that might be related to both code optimization (PHP) as well as DB optimization. I have made most of the code public at GitHub. I will not ask for volunteers to review all m...

6:48 PM
Q: How to improve this nodejs code for streaming variable length integers from a file

NatI wrote this script as a proof of concept of reading a file from disk as variable-length quantities (ints encoded using 7 bits from as many bytes as required). I'm mostly making use of the file system ReadStream, for reading byte buffers from files and the varint package for decoding variable len...

7:42 PM
with regards to the way earlier C right shift conversation: there's a reason the common advice is to avoid bitwise operations on signed types in C. bitwise operations on unsigned types are very well defined and intuitive. on signed types, they vary from undefined to "wtf?!" inducing when they are defined.
@Corbin thanks.
C doesn't require that signed integers be implemented using 2's complement. Because of this, the standard can't really require any kind of bitwise behaviors on signed integers without potentially causing a major performance impact. In the case of unsigned integers, there's only 1 reasonable representation. In that situation, they can make a lot stronger requirements
So, did you see that question come through just before that ... let me dig up the reference....
Yeah... that one.... ;-)
I startted to look at it, and then loked at the reference for the C to see what it does in the case of the >> operator.
7:46 PM
I looked through it, but my Python is woefully lacking, so I shall let it be :)
then gave up ....
for unsigned ints it's simple: shift to the right and fill any empty bits with 0.
I can't believe that the python code has to be so complicated.....
for signed ints, it's a bit more.... complicated.... basically it's "do't do it!"
well the reason is that python only has signed integers
java brings up the same problem when you start doing bitwise operations
luckily java guarantees 2's complement, so you can work around it in a standard defined way. im not sure if python requires 2's comp.
Yeah, but Java has the >>> operator.... and you can ignore the sign
7:48 PM
it does? hrmm interesting. i wonder when that was added. i havent done bitwise stuff in java in 5 years now lol
might've just never known it existed :)
( >>> is a right shift and alsways puts 0 in high bits).
but it keeps the 1 bit hgih bit from signed negative numbers?
then... meh
for a byte, 0xff >> 4 is 0xff, and >>>4 is 0x0f
7:49 PM
idk i guess in java, it's simple enough to just avoid shifting on negative numbers. coming from a C++ background though, the thought of bit ops on a signed number makes me feel icky.
I can imagine, but the thought of 'implelementation defined' makes me queezy
welcome to the world of C++
it makes sense though when the language compiles to machine code. if you define something that a machine can't natively do, then suddenly a simple operation like right shift turns into 10 operations to emulate what the standard thought rsh should do.
8:19 PM
still recovering from the trip. just checking in. will be back later
Checking in to check out? huh... smart man.
@Malachi I thought there were fewer stared messages than usual around here...
@SimonAndréForsberg sorry it has not been a starry night lately...lol
8:49 PM
Q: Poker Hand Evaluator, take 2

retailcoderThis is following up on my previous attempt, which was admittedly done fast and not-so-well. This one is more tested, and abstracts the dirt away into an interface: public interface IPokerHandEvaluator { bool IsPair(IEnumerable<PlayingCard> cards); bool IsTwoPair(IEnumerable<PlayingCard>...

9:31 PM
Q: Running a block of code on every interval except the first iteration

KeikokuI am working with an encryption algorithm that looks like this The key is a number stored in 4 bytes. For each byte in the message, XOR it with the corresponding byte in the key When you reach the end of the key, multiply the key by 13, and then continue looping Translated, it looks like this...

10:07 PM
This really should be a site I visit more frequently. It has a good, involved community.
I'm surprised this site hasn't graduated actually. The stats are really good.
@syb0rg You have no idea how happy we are to hear that :)
What we currently need is more users in the 20k+ range. So vote for our questions and answers to help us reach that goal :)
@syb0rg: Have you read Grace Note's review on Meta? We've already been told that the main things holding us back are voting and unanswered questions.
@syb0rg I second. You have no idea how happy we are to hear that :D
@SimonAndréForsberg @Jamal I'll try to visit more often to vote on questions and answers (I do already, but it's more sporadically). The problem is that I am heavily involved in the core community over at the Raspberry Pi beta site.
Then you do have an idea :)
10:12 PM
If you look into my profile, you'll see that I am the 15th top user, joining only 4 months ago.
@retailcoder Yes I do. The core community over there is small.
Votes are few and far inbetween.
@Jamal I believe I have read it. By the way, belated congrats on becoming a moderator.
@syb0rg Well done :) You seem to be raspberry's version of @rolfl and myself. rolfl is #20 and I am #40. Both of us have only been members here for approximately one month :)
and CR-hyperactive ever since
@syb0rg: Thanks!
@rolfl nothing jumps at me in your answer. Byte-shifting is a bit more lower-level than my comfort zone though
I've been here for nine months and I'm pretty much eating their dust. :-P I'm only "good" with one language, though.
10:17 PM
@Jamal English?
Ha ha ha...
(and English is my only fluent language anyway)
@SimonAndréForsberg Good work! Maybe you can catch up to @Jamal and become a moderator?
He's kinda mocking you though and saying you can't...
@syb0rg Right now I'm not very interested in being a moderator. Maybe I will nominate myself (or even get nominated by someone else) once CR goes out of beta and will hold real elections.
@SimonAndréForsberg Too much work?
@syb0rg Too few things to do :P
CR users behave too well
10:22 PM
Well, if CR graduates, other mods are elected, and my rep doesn't increase, then I'll feel like a low-rep user again. Sort of how Magneto felt after he "lost" his powers.
@SimonAndréForsberg Haha, there are too many new users on the Raspberry Pi site (and the Stack Exchange network overall), that I am constantly flagging their answers.
It's like none of them take the tour.
@Jamal I doubt that your rep will never not increase.
@syb0rg Our main job here sometimes seems to be to redirect people to Stack Overflow (sometimes even re-redirecting, since some people tend to redirect them to Code Review from Stack Overflow)
I mean, not enough to at least be a trusted user. We don't seem to get too many beginner-level C++ questions here.
@Jamal Whenever I visit to answer a Java question (because that is my "best" language), there are always answers that are more than sufficient.
And the C language doesn't have that many questions asked in it.
I can sort of answer C questions, but I have to be very careful not to mix in C++-only aspects. For instance, I was told this semester that C doesn't have a built-in bool.
10:29 PM
@Jamal Unless you define it or include stdbool.h :)
But usually I don't use booleans in C, I use integer values
True. My computer architecture projects were in C, but I never needed to use a bool.
Integer values are so much more useful for things like returning from an error.
By the way, I just upvoted an answer for everyone in this chat. Gotta get the voting badges haha.
@syb0rg thanks! that answer is now 1 vote short of getting me my first non-meta [badge:nice-answer]!
@retailcoder ... are you braining me? Which answer?
10:35 PM
A: How to avoid the repeat of the code?

retailcoderDoing Copy+Paste in your IDE should raise a big red flag and then there should be a neural inhibitor that prevents your left hand from doing it, causing your right hand to move your mouse further down the module and then start typing Private Function... Now the first thing you need to do before ...

Sorry, mate, already upvoted that one .... and it's two braining late to unvote it too.
Someone wants a badge. :-)
@Jamal wouldn't you?
Oh, I would.
Me too ... I hope to score great answer with :
A: Searching in an array in less than O(n) time

rolflWhile other answers make good points, I have to wonder why you are using recursion. This is such a simple problem to solve with a for loop. I assume that you are not supposed to start from any index other than index 0, so consider the following routine: public int searchArray(int[] arr, int ele...

10:37 PM
I just gave @rolfl A badge.
No... where>?
ahh ... thanks... ;-)
@rolfl already upvoted - great answer indeed!
@rolfl Anytime :)
10:38 PM
@retailcoder - you do know I was sarcastic there.... great-answer is score 100.... :(
I'd really love the [badge:populist] for this answer:
A: How Can I make This Mess of Java For Loops Faster?

Simon André ForsbergBefore I get started I have to say: Thank you for coming here. Mess of Java For Loops is almost an understatement. Now, let's get working, shall we? In the below answer I assume that sortedDictionary and anagram_words is both of type List<String>. I also assume that anagramCharacters is of type ...

If You Give a Monkey a Badge
If You Give a Mouse a Cookie is a children's book written by Laura Numeroff and illustrated by Felicia Bond. Described as a "circular tale," it is Numeroff and Bond's first collaboration in what came to be the [http://www.goodreads.com/search?utf8=%E2%9C%93&q=Felicia+Bond+if+you&search_type=all_results If You Give... Book™ series]. Text The book is known for its playful, circular pattern. A boy gives a cookie to a mouse. The mouse asks for a glass of milk. He then requests a straw (to drink the milk), a mirror (to avoid a milk mustache), nail scissors (to trim his hair), and a broom (to ...
@SimonAndréForsberg Already upvoted that one :/
OK, Thanks :)
I just need 4 more upvotes, and the accepted answer also needs 4 upvotes.
@SimonAndréForsberg ... ditto ....
@syb0rg - you need to 'star' one of retail-coders chat's here.
He needs toget [outspoken] badge
10:41 PM
Star all of us while you're at it :P
@retailcoder .... say something worth startting ..... ;-)
I like you guys haha.
Oh... wait, that won't happen ... ;-)
@syb0rg I am the only person on CR with the outspoken badge.... go figyure
(It's lonely at th top).
@rolfl I starred one. @retailcoder Did you get it?
The problem with chat is he needs 10 distinct users to star, and really, there are only a few regulars in gere, so he has to ambush the stragglers ... ;-)
Also, there is no metric as to who starred your chat.
So, he does not know how close he is till he gets it... ;-)
(like it was a surprise for me when I did).
10:44 PM
@rolfl Well, I know that I am a unique one for him. This is the first time I've ever starred someone (I think).
@syb0rg nice!!
@all ... here's where you check... and, @retailcoder I think you're still out:
@retailcoder I tried...
@syb0rg I can get that one ^^ in the CR Main chat room there's a pinned message with 9 stars :)
click on the top star on the right margin ... doid it!
10:47 PM
@retailcoder Got it.
True .....
@rolfl Got it!
Waiting ......
(Refreshes page).....
it seems there's a delay.
slow like you?
10:50 PM
hmm I'm starting to wonder
@rolfl you had it with a delay too right?
Looks like I'm almost to 3K. :-) My goal is to reach that by my profile's birthday (sometime in March).
Ohh, I got the talkative badge!
(there will be cake)
@syb0rg ... you are, for a syborg.
@retailcoder Perhaps it needs to be 10 different messages that gets starred by 10 different users?
10:52 PM
@rolfl got that?
@Jamal There you go.
I give up
@retailcoder of course.
Never been very outspoken anyway
Have to get back to bit twiddling.....
10:55 PM
I need to figure out how to get a great community like this over at the Raspberry Pi beta site. We have mainly 8 core members if you look at the highest earned reputation users for this quarter.
@syb0rg: Thanks. I hope you've found them useful, too (C is close enough to C++). Do be wary of the serial voting script, of course.
@syb0rg I have been plying with my rpis.... and w have a project going at work...
I shoul dget over there (I have gotten some answers from there already)...
I read that "I've been playing with my ribs"
@syb0rg I was surprised to even see a Raspberry Pi SE site at all. And I have to admit I am still unsure what it is exactly.
@Jamal Of coarse. While I'm not fluent in C++, I have been reading a book about it recently. All the answers I voted on were excellent.
10:58 PM
@syb0rg: Thanks. It means a lot, considering I'm still learning the language. It's not easy.
@rolfl You can look at what my main project is in this answer(which reminds me that it needs updating).
@sysb0rg it starts with a healthy meta. At least here it's what gelled it.
@Jamal I know. I haven't gotten into it very much because I've been very busy lately. :(
@SimonAndréForsberg Start by looking at the Raspberry Pi, or my answer to this question.
@syb0rg Thanks
I technically should be studying for finals now, but I've also had a hard time getting my mind away from programming (I also don't have any programming classes at the moment). Funny thing is, my computer architecture professor would be lecturing on hardware while I'm writing code on my laptop.
11:00 PM
@retailcoder We don't have the healthiest meta right now, unfortunately.
@Jamal Haha, I am caught up in things such as sports, my job, homework, etc.
@SimonAndréForsberg Check out the FAQ's as well.
I think I really am too attached to CR. Had it not been for SE, I probably would still be that average programming student knowing only things taught in school.
@Jamal I totally agree. And I'm not even a moderator.
I've just realized that we're off-topic for this room (this isn't the general room). I'm not sure I can move all these messages over there at once, though.
@Jamal Haha, sorry. That's kinda my fault.
@Jamal baby-unicorn rampage?
11:05 PM
@syb0rg: You're okay! You're new to these rooms, so no worries. I'll see if I can move these messages.
Q: Is there any possibilite to make this javamail code faster?

Diego MacarioI´m developing a application that get e-mails from a server and deal with then, I get only xml files and organize in folders the e-mails that have xml attatchment and organized by sender e-mails, the others are deleted, I create a list of file and create then in the temporary folder, so I have on...

135 messages moved from Weekend CR Challenge
cracks knuckles
@Jamal Nice.
11:12 PM
I'm not sure if it was possible to select many at once, so I had to click on all 135 of them.
@Jamal Did you try Shift + Click?
@Jamal That could be a future moderator tool request.
I could ask about that right now.
[remembers sooper-dooper-top-secret mod-handshake]
11:17 PM
Yeah, I'd rather not bother with MSO myself.
@Jamal Yeah, I used to have an account on there. I had it deleted after a while.
Got to go. I'll be back :)
I post on there every once in a while, and sometimes I make a funny.
oh god. that baby is terrifying
But Hugh Laurie is awesome. :-)
Hey, @Corbin.
11:30 PM
@Jamal So what do you think of the new top bar then?
he is awesome indeed
and hello
Too contrast-y. Now it kinds looks like Meta's colors, and I sometimes have to double-check to see which site I'm on.
If I end up deleting a programming question because I think I'm on Meta, I hope someone will catch me. :-P
@Jamal So if the contrast was different, you would like it?
I still prefer the old colors. I'm okay with the bar itself.
@Jamal They do need a better way to tell the difference between the normal and meta sites. I just checked on a beta site to see what the difference was, and it was hard to notice.
11:39 PM
There are only two color differences on the front page: 1.) the border around the site name and 2.) the title colors.
@Jamal I tried to find more, but I failed. It's kinda poor UX design.
Actually after a week or so of constantly having it at the top of my 2nd monitor, I kinda got used to its darkness.
@retailcoder I'm getting more and more used to it as well. It was hard to adjust to at first though.
@SimonAndréForsberg how close are you to posting your project?
@retailcoder Depends on how many more tests I should add.
Since time is soon 1 a.m. here, it is likely that I will post it tomorrow.
11:53 PM
You've earned the 'enlightened' badge for your answer on [...] See your profile
@retailcoder Nice!

« first day (217 days earlier)      last day (2174 days later) »