« first day (483 days earlier)      last day (3516 days later) » 

12:13 AM
TTGTB
 
'night!
 
Debating if I should search for a good FF/Chromium bug to fix... or do a code review...
 
As far as CR is concerned, you should probably do a Code Review @hichris123 ;)
 
I need a good question to answer, first. ;)
 
12:36 AM
Yeah, the title matters, but I think it helped that it was
It's a meta-meme. The webz cant resist.
 
KTHXBAI
 
@RubberDuck I don't think one can tell what tags are involved just through the hot network questions list...
perhaps "LOL" sold it ;)
3
 
I'm right here, right?
@AlexisWilke Actually, even GCC isn't 100% C99 compliant; but you should develop C in concordance with the standards despite that. If a feature isn't supported, then a bug report should be filed. The the request isn't honored, then you should be using a different compiler with more apt developers. — syb0rg 38 secs ago
 
Is C99 dated at 1999? Just curious...
 
12:44 AM
If say so @syb0rg
 
@Phrancis Yes
C89 is 1989
Don't use C89
 
What's C for 2014?
 
The standard hasn't been updated since 2011 to my knowledge, so nothing?
 
-.-
 
I think there might be plans to update it...
 
12:46 AM
C11 then?
 
Yeah
 
Well, hell's gonna break lose in 2089...
4
 
Fair enough. I still see sometimes scripts that fail SQL 92...
 
Which reminds me of a bug I pointed out in someone's calendar code. It wouldn't show up until 2400 or something or something like that.
 
@RubberDuck sounds like somebody else's problem
 
12:49 AM
So. Ya know, long after even the program was dead.
There's a wiki?! I'll be back...
 
> The technology involved in making something properly invisible is so mind-bogglingly complex that 999,999,999 times out of a billion it's simpler just to take the thing away and do without it....... The "Somebody Else's Problem field" is much simpler, more effective, and "can be run for over a hundred years on a single torch battery."
^^HHGTTG
 
I HAS ROKZ PAPR SCIZR
 
NO.
Lol
 
yeah
 
I seriously hope I'm retired before you get that badge.
20 years from now, everyone will sing praises of the foresight of the creator of LOLCODE.
 
12:56 AM
oops I HAS BUGZ
3
 
0
Q: Script for keeping track of teams in a class - Am I making efficient use of the Google Sheets API?

PrairieProfI wrote this script to help me keep track of who has worked together and for what project or discussion in my classes. I make a Google Sheet with the names of the students going across the first row and down the first column. Each student gets a number corresponding to their location in the spre...

 
Bbl. GAS code.
Official acronym btw^
 
1:12 AM
and bug fixed
hehe
 
hello
 
hey there
 
1:35 AM
My Java assignment asks for a menu, and I'm not sure if it should just be done in main(), or if it could be a class (the instructor recommends having multiple classes for good design).
 
We, we, we, is Friday, we is tomorrow is Saturday
 
@Jamal do you mean a GUI menu, or console-based?
 
1:50 AM
Console-based
 
even if it's for something small i'll extract it into a method so that readability in your main() method can be improved. :)
 
That could work. It seems odd to make it a class anyway.
 
I think so as well, that would be over-development
 
I guess the "use more classes" thing is more general, assuming that the main class doesn't count as one of them.
 
2:35 AM
For an ArrayList, how would I determine if an item exists based on a given field? In this case, I have to see if a Car exists based on the given license plate number.
 
could you use a HashMap?
otherwise, over-ride equals() to compare by the plate
there are pros and cons either way
 
I have to use ArrayList.
 
public Car {
argh
public Car {
nvm
public Car { public boolean equals(Object o) { return o != null && o instanceof Car && ((Car)o).plate.equals(this.plate); } }
something like that
and then you can call listOfCars.contains(car)
since that will compare by your Car.equals() method
the con is you have pretty much dictated what is the 'equivalence' for your Car class, instead of simple method to loop through your list to compare by an element's specific fields
 
public boolean search(String plateNum) {
        for (Car car : cars) {
            if (car.plateNum == plateNum)
                return true;
        }

        return false;
    }
 
car.plateNum.equals(plateNum)
 
2:44 AM
Ah, right
 
;)
 
Darn C++. :-P
 
yeah i know :D
no { } for your ifs too? Just curious
 
Oops. Yeah, there are supposed to be braces there.
 
and maybe just one more point on the method naming, consider containsPlateNumber as well?
search is quite generic-sounding
or hasPlateNumber
 
2:46 AM
Okay
 
3:20 AM
A serious code review about code written in a joke language? And asking about the idiomaticity of said code? Sometimes I wonder about this place. — fluffy 3 mins ago
 
Clearly he has been observing us for quite a while... with no posts whatsoever.
 
so where's the CHEEZEBURGER, Mat :D
 
3:52 AM
  HOW IZ I GETAMOOV BTW gets a move from STDIN

    VISIBLE "WHAT U PLAY?"
    VISIBLE "[C]HEEZ [B]URGR [L]OL"

    I HAS A MOOV
    GIMMEH MOOV

    VISIBLE SMOOSH "Y U PLAY " AN MOOV MKAY
    FOUND YR MOOV

  IF U SAY SO
  HOW IZ I PLAYAMOOV

    I HAS A MOOV
    MOOV R I IZ GETAMOOV MKAY

    I HAS A ULTIMAETMOOV
    ULTIMAETMOOV R I IZ PIKAMOOV YR MOOV MKAY

  IF U SAY SO

  I IZ PLAYAMOOV MKAY
 
So, it looks like I cannot create instances of an inner class in main() (unless I make that class static, which I don't want). I was able to solve that by moving the inner class into a separate file, within the same package.
 
me reads transcript
 
4:08 AM
I suppose there could be a problem with it. I just can't figure out the right syntax for when it's nested.
 
what have I come back to...
 
JAVA
 
0
Q: To rename html files using C# for input to eBook creation software

GeorgeI have designed a tool that generates some html files and a css file in a directory , which then feed into a tool called Jutoh that uses these to make eBooks. However, my output files are of the form 1.htm , 2.htm and so on. Jutoh ranks 10.htm to preceed 2.htm and therefore, I wrote a method to ...

 
This works: CarDealershipRepo.Car car1 = repo.new Car("ABC", "Chevy", "Impala", 2014, 5000);
 
Don't overuse inner classes. My intuition says that Cardeserves to be a standalone class independent of CarDealershipRepo.
Use inner classes only when the inner class is highly dependent on the outer class.
 
4:24 AM
hey @200_success - I wanted to point out that there's not much conversation on meta about reviewing these languages.
 
@200_success So Car can be in a separate file?
 
A serious code review about code written in a joke language? And asking about the idiomaticity of said code? Sometimes I wonder about this place. — fluffy 1 hour ago
 
For any non-trivial Java project, expect to use multiple files.
 
Okay. I don't think he cares too much at this point, but eventually he'll expect good design.
 
Conversation about reviewing which languages?
 
4:27 AM
And yes, Car doesn't depend on the other class.
 
languages said to be "esoteric"
 
0
Q: Reverse text content in all of the HTML elements

editionI am attempting to reverse the text present in all of the HTML elements, inside the body tag of a document. This is the terrible code thus far: function reverse(string) { return string.split("").reverse().join(""); } function doThePage() { var x = document.body.getElementsByTagName("*"), i...

 
Should you bring your sarcasm detector unit in for servicing, or should I delete my comment?
3
 
lol
sorry
I'm cogitating a selfie answer on that meta
 
0
Q: implementation of tower-of-hanoi iterative procedure

cracknutI have been working last night on implementing Tower of Hanoi without using recursion. I have found an algorithm on Wikipedia about the same topic on the wikifor TOH. I have implemented it, it's working fine (for odd numbers :for now). But I am not happy with the code, its kinda bulky, and hence...

 
4:38 AM
meh.. too tired :[
TTGTB
 
4:56 AM
0
Q: String Interpolation in Routes View

JohnsonI'm trying to create custom routes for every web page in my show action. Movie.all.each do |movie| match "/#{movie.title.downcase}", to: 'movies#show', via: 'get', as: :"#{movie.title.downcase.gsub(/[:.]/, '').gsub(' ', '_')}" end This code actually works perfectly. The only problem i...

 
5:08 AM
0
Q: Was this a good question for this site?

JohnsonI hope this question was good for this site. String Interpolation in Routes View If it isn't is it possible to move it to another site?

 
Anybody home?
knock knock
 
@Anirudh hi.
 
Hi @Yuushi
How are things?
 
not too bad thanks, yourself?
 
Little bugged.
 
5:19 AM
@Anirudh why's that?
 
Well it's about work actually.
My employer is literally forcing me to learn and work on python
while all this while I have worked on Java...
 
hrm, Python isn't so bad
 
Nope it isn't infact I like it's descriptive nature and fast paced coding
I deal for writing unit tests...
*Ideal
but the problem is I am neither a starter no an expert with Java....My plan was to master one language first then move to the other.
 
I think the experience with another language is a good thing, personally
 
yeah it does add to your skill set unless you don't end up with something like a 'Jack of all trades and master of none' ;)
 
5:24 AM
not only that, it also broadens your horizons
and in the working world, that can sometimes be how it is. Have to pick up whatever technology they decide they want to go with.
 
of course it makes you eligible for more opportunities in the industry
Which language do you work on Yuushi?
 
funnily enough, I'm using Python at the moment as well
 
I found my tutor.
Hah
Have you worked on Java before as well?
 
yeah, but not for quite a while
my Java is probably quite rusty
 
Humm that's what I fear.. _
 
5:29 AM
I don't think it's a big deal, if I really needed to work on it again, I'd pick it up again pretty fast
 
cool...good for you!
 
I think that's true of most programmers
if you've worked with it before, picking it up again isn't too bad
 
Can you suggest any good books to start with from the point of view of writing unit tests?
for python I mean
 
hrm, I don't really know of any books on it, but I'd just have a browse of the unittest documentation
(if you haven't already)
 
I see...I looked up the Nose framework..a bit kind of similar to junit
 
5:33 AM
monking
 
heya @janos
 
monking?
 
hi @Yuushi
@Anirudh monking =
13
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: Monking Originator: Morwenn Cultural Height: The 2nd Monitor Background: A morning greeting to the Monkey doing his monkey-business, in other words: monking Examples: A small chat search Variations: Monkernoon, Monkevening, Monknight, ... Important is only that it begins with Monk... ;...

 
Yeahhh very cool.
 
@SimonAndréForsberg try asking something reeeally stupid ;-)
 
5:39 AM
Can I help?
 
Three days so far without any rep gain. I'm not feeling up to reviewing much at this time anyway.
 
You could start asking Java questions
for example the car filtering homework you were discussing above
of all people, you'll be a great asker ;)
 
I'm not going to post any of these homework questions now. I can probably do so after the semester, for any of the most interesting ones.
 
5:56 AM
If anybody wants some good DS, algo questions
pls visit careercup.com
 
0
Q: How to have full atomicity against all the threads without impacting performance or throughputs?

WebbyI am working on a project in which I construct a url with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main application thread. I also have a single background thread in my application which parses the data from the url and extracts the block ...

 
That's cool..Thank you @janos
taking a look
 
6:21 AM
0
Q: How to spread the load more evenly from a background thread?

WebbyI have a background thread which runs every 5 minutes. I am using ScheduledExecutorService for this. Every five minutes, I am making a call to one of my service and parsing the response coming back from that service. public class ThreadScheduler { private final ScheduledExecutorService schedule...

 
6:32 AM
-7
Q: What main(++i) will return in C

sreeI have a program like this. ‪#include<stdio.h> #include<stdlib.h> int main(int i) { /* i will start from value 1 */ if(i<10) printf("\n%d",main(++i)); /* printing the values until i becomes 9 */ } output : 5 2 2 2 Can anyone explain how the...

 
6:52 AM
0
Q: My first jQuery plugin: Gmail Mouse Gesture

Daniel AlmeidaGmail had this awesome feature and it was discontinued for some reason. Nowadays I have installed a nice google chrome plugin for this job. A couple of months ago I had to develop a similar feature for a project and I think that could be improved but I don't know how.. So I'm here asking for ...

 
7:43 AM
0
A: Is this a good question for this site?

JaDoggIf you are unsure about question fitting the scope of a site, Most of the stack exchange sites has chat rooms, you can put the question(whole question) in a GitHub gist and then ask users in a chat room to see if it will be a good question before posting it. Here we have the 2nd Monitor. But ...

 
 
1 hour later…
8:52 AM
^^^ Saturday is always slow
 
9:31 AM
0
A: Generate random numbers without repetitions

Bruno CostaThis is more of a theoretic algorithm than a practical one, because as you will see there is some complexity in the implementation, that may be unworthy for a real use case scenario. This is also a algorithm that tries to balance out memory impact with performance by avoiding collision, but unfo...

It took me a while to find a balanced solution but it's finally there!
 
9:47 AM
0
Q: Reading int / long from stdin - the fastest way

pwasI need to read all integers / longs from input splitted by whitechar. I need to do very (really fast) - std::cout with sync_with_stdio is to slow. I've prepared the following function: #define getchar_custom _fgetc_nolock // gcc version: getc_unlocked template <typename T> inline T read_number(...

 
10:26 AM
0
Q: Get object in a Set that is an instance of a generically specified type

sehlstromI have a class Load that contains a Set of LoadComponent objects. I what to retrieve from the Load object the first occurrence in the set of LoadComponent objects the T that extends LoadComponent where T is given as a generic argument to the getLoadComponent method. But I can't make it work. Her...

 
@janos Is your computer calendar doing alright there?
 
I was bored, I just faked that
meant as a reference to the zombie movie
 
Monking
 
monking
 
10:41 AM
Uh...
starting to wonder if this is correct or someone is trolling me
 
@skiwi I think that ^^ is the problem
It's bazola who needs to make a few changes in his configuration/settings for it to work
 
ah okay
that probably explains
 
0
Q: Getting Skype Chat Log back

Hassan AlthafI had Skype on my Windows 7, and it had all chat-log for Skype. Then, I faced some Issues with the OS, so I deleted it and Installed Windows 8.1. I now have Skype Desktop on my PC, but It doesn't have chat log, and I am in need of all my old chat log. Is there any way to recover all my lost chat ...

 
10:58 AM
0
Q: Wrapping up the redundant try catch blocks with a helper

saravananI am working on a project that uses a three tiered approach. There is a Business logic layer [BL] that in turn calls a Data Access Layer [DAL]. I am always going to call the BL from the presentation tier and this BL will call the DAL. The point here is that I am always wrapping the DAL calls wit...

 
11:09 AM
user image
6
 
@MadaraUchiha lol, I've never understood why anyone would buy that. I've actually never installed a free version of WinRar. Total Commander FTW :)
 
11:28 AM
7zip
Nice and simple
 
WinRAR and 7zip :P
 
Total Commander and Total Commander
 
12:29 PM
This answer needs votes.
1
A: Gmail Mouse Gesture

Jan DvorakFirst, a word about usage: $().mousePointer is sub-optimal. Why instantiate a jQuery object that you never even touch? Instead, you can attach your plugin as $.mousePointer = ... and call it as $.mousePointer(...). In line 5 you do $.extend({}, {...}, options). The point of passing an empty obje...

 
12:41 PM
ho ho ho
 
WHAT U MEAN WIF HARSH 2 EYEZ?? IZ PERFECTLY READABLE!! — Philipp 15 mins ago
Monking!
 
Monking @Mat'sMug
 
1:00 PM
Monking.
A serious code review about code written in a joke language? And asking about the idiomaticity of said code? Sometimes I wonder about this place. — fluffy 10 hours ago
Bahahahaha
I'm heading out. Just came here to shamelessly pimp.
1
A: Script for keeping track of teams in a class

RubberDuck I like your argument names for fillInTeam. I think they were good choices. You declare the variable first and only use it here. for (var z = first; z < numbers.length; z++) { You can just set z = i + 1 instead. for (var z = i + 1; z < numbers.length; z++) { Speaking of, use j instead o...

I'm gonna get a GAS badge eventually....
 
@RubberDuck getz teh checkmark
 
Why? Rofl's answer was better.
 
Right. Monkey getz teh checkmark. Damn it's a tough one to decide!
 
Lulz
 
1:15 PM
Tough decision here, I'm giving you the checkmark on this one.. but I'm surprised nobody mentioned that I'm doing 3*5 at every iteration, could have used a I HAS A FizzBuzz ITZ PRODUKT OF Fizz AN Buzz outside the loop. — Mat's Mug 45 secs ago
 
I think it was the FGITW effect.
Monking all.
Random numbers in C# is still going strong....
24
Q: Generate random numbers without repetitions

KaoI want to generate a list of N different random numbers: public static List<int> GetRandomNumbers(int count) { List<int> randomNumbers = new List<int>(); for (int i=0; i<count; i++) { int number; do number = random.Next(); while (randomNumbers.Contains...

 
0
Q: Better way to write this wordpress code

FedeI want to know a better way to write this code, I know there are some repeated code, but I don't know how to handle in other way. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> > <div class="row"> <!-- If the current post is even display the image --> <?php...

 
@rolfi it really is rolfi, I'am going to see if I can generate them in order to fullfill that hole.
 
Wait, generate random numbers in order?
 
yup, without repetitions, then shuffle them
 
1:24 PM
0
A: Loop Animation on several UIButton's NSLayoutConstraint

nhgrifI'm not completely familiar with animating auto-layout constraints. Fortunately (or unfortunately), I've not yet ever had the need to do this. So, I'm not sure if there's a better way, but I'd say if it's working, that's a good sign. What I do want to comment on is your readability: constrai...

It's not that particularly hard to generate random numbers in order
 
within a limited range?
 
Depends. Is there a specified number of random numbers to generate?
 
it's variable
 
I mean, actually, no matter what it's not that complicated. There's a couple of different approaches.
If they want 10 random numbers from 1 to 10 generated in order without repeats...
Just return them all 10 numbers.
 
and then shuffle them like they're playing cards!
 
1:27 PM
Why do I have to generate the numbers in order? Don't I just have to return them to the caller in order?
 
that's an easy scenario
 
Why do we need them to start in order then shuffle them?
What do we need in the end? Ordered cards or shuffled cards?
There's no point in specifying they be generated in order if you want them shuffled in the end.
Right?
 
shuffled cards
 
Then why must they be generated in order?
You just need X random, unique numbers, right?
In a particular range.
 
yes that's the requirement, I was talking about generating numbers in order, because that's my approach to the solution
 
1:30 PM
I like @Jeoren's order by new guid answer.
 
while (someSetObject.count < specifiedCount) {
    // generate random number and add it to the set
}
 
that generates repetitions, and @rolfi already did that
 
someSetObject being a Set collection which won't add duplicates.
 
I am avoinding collisions
 
Like in Objective-C, NSMutableSet
It will only add the object if the object doesn't exist in the set.
I don't know what language you're using.
But surely there's a set collection that doesn't add duplicates to itself
 
1:31 PM
@nhgrif I'm trying to say that that implementation was already made by @rolfi
 
What's wrong with it then?
 
It creates collisions, I'm trying to avoid them
 
Define "collision"
 
if a random number is in the set you can not generate that rundom number again
random*
 
Clearly you don't understand how a set works, right?
Scroll to the addObject: method.
There are collections like this in most every language (Objective-C just happens to be the one I know best)
Adds a given object to the set, if it is not already a member.
 
1:34 PM
You don't add it to the set, but you still have generated it. If you're unlucky it could be a very long loop
 
<-- that. Thanks @Mat's
 
Then you optimize it.
 
Tha'ts what I'm trying to do
 
There's another approach
Create an array bools with one index per random number
 
that occupys to much memory I want to occupy O(requested numbers) memory
 
1:37 PM
Unless you can demonstrate to me that it definitely occupies too much memory (in a way that it is problematic for your application), then I'm not sure I want to continue helping.
A bool takes 1 byte.
An array of 1000 bools is 1000 bytes.
Even smart phones all have at least 1GB of RAM.
And I know there are other things going on besides just this random number generation...
 
@nhgrif I'm not the owner of this problem, and question. I'm just trying to provide a solution that follows this requirements that I'm stating.
 
I'd advise you take the same approach then.
Premature optimization is the root of ALL evil.
 
@nhgrif I don't even know if that's possible yet but let me try and i'll let you see if I get here.
 
In fact, in my experience, I've seen programmers attempts to optimize things end up resulting in a worse end product.
Lately at work I've been working on an app to talk to assembly line machines. They store information in various registers.
The protocol they use to communicate to the network allows them to transfer 125 registers at a time. The actual registers they use though (in this particular case) are no where near that many.
The C++ programmers who write the code for the machines suggested that I should only grab the registers that actually have data. That's fine...
I'm not "wasting" execution time parsing registers that will always have all 0s.
But the machines also have a polling frequency limit.
And the time it takes to parse all 125 registers is FAR less than the time I have to wait between polling opportunities.
Just grabbing the useful registers uses less processing power and less memory... but it's slower.
Because even with an old iPad set up polling 5 different machines on 5 different threads, plus a main thread updating the UI, even when I'm polling all 125 registers, I'm still seeing less than 20% CPU usage.
 
@nhgrif I'm laughing at this moment, I'm sorry. I don't know how a talk about random numbers ended up in network protocol problem...
 
1:44 PM
Don't waste time optimizing what isn't a problem.
That's the point.
Don't waste your efforts optimizing something that's not a problem.
 
@nhgrif I'm well ware of that, just let me try ;)
@nhgrif THERE IS A PROBLEM. That is the point!
 
What is the problem?
Is this problem posted to CR or SO somewhere?
 
see @rolfl implementation and see what the problem is if you need 1.000.000 random numbers from a 0 to 1.000.000 range
 
Then you just return an array with all those numbers in it.
If the number of randoms needed is greater than half of the range, then you start with a full array and remove random objects until you have the right count.
 
gotcha but I will still try to do that in other way. May I?
 
1:49 PM
You're welcome to, certainly.
 
@nhgrif @rolfi is well ware of that problem. and he suggested that discussion should continue here.
 
I know. I at-ed him to see if he were around.
The last character in his name is a lowercase L by the way, not an I
 
I always mess up with his nick <.<
 

« first day (483 days earlier)      last day (3516 days later) »