« first day (832 days earlier)      last day (3483 days later) » 

11:02
So if you had a vector of People, what would you call it?
I would call it persons
people, because the word has no plural.
On the other hand, I would probably not have a People class at all because it's implicitly a plural.
Sorry for not saying anything, I was putting my finger on a Java review
But yeah, if I had a vector of Person, I would also call it persons.
Allright.
11:05
It's the logical name anyway
There's no "peoples"
@IsmaelMiguel there is, it just has a different meaning from "plural of people"
That would be people's
If you have a class modeling a collection of people, you can still name it Population then you can still have a populations variable if you need several populations.
That makes sense too
Anyone here knows Java for Android?
11:25
Every few months, I think about sex every seven seconds and how weird and implausible it would be.
5
0
Q: Mini shopping cart for a site on MODX

Anton K.Please help in improving the code. I would like to hear comments on: - syntax - an approach to development This is my first experience in writing a simple application for the site. https://github.com/keslo/modxEasyCart/blob/master/js/cart.js

@IsmaelMiguel Android is not Java and you don't run Java on Android
@CaptainObvious CBL and not enough context.
I was defining private variables as const. I feel stupid.
@IsmaelMiguel I know Java, and I've used the Android Java SDK before.
Hey hey. No arguing of English semantics here. Theres an SE for that. =;)-
Today a small piece of this legacy code will no longer be legacy. I can feel it in my bones.
11:38
Maybe you should ask this on (codereview)[codereview.stackexchange.com] rather than here... — Mathlight 21 secs ago
@RubberDuck // you ARE meant to understand this
@RubberDuck If the code isn't changed, it's still legacy. If it's no longer legacy, it's not the same piece of code.
3
Bah. Legacy code has no tests. Put it under test and it's no longer legacy.
@Vogel612 Well, it looks like regular Java to me
@RubberDuck Makes it the non-evil kind of legacy.
Definitely improvement :-)
11:40
@Mast Still legacy?
I've bought into Michael Feather's definition whole sale.
@IsmaelMiguel it isn't.
@Vogel612 But you want to see what I wrote, so you can criticize/downvote?
Without tests, you can't reasonably change it. With them, we can be (nearly) fearless.
Why not entirelly fearless?
11:41
@IsmaelMiguel I'm @work right now...
It still has to integrate successfully.
If anyone is interested:
0
A: Fastest way to change the HSV value of all pixels in a bitmap

Ismael Miguel Disclaimer: I am NOT familiar with Java, let alone the Android version. This may not compile or may be slower. I have no way to test this! First of all, You deserve huge congratulations!!! Even I could read and understand what is going on! From the bottom of my heart: Thank you! But still...

Some things just can't be reasonably tested with automation.
yesterday, by RubberDuck
Nay, though I walk through the valley of the shadow of legacy, I will not fear the code, for I have my tests.
5
If someone knows Java and is available, please critique on that
11:43
@RubberDuck For example, how something 'looks'. Machines are notoriously bad at judging user experience.
-1
Q: Connect Four game in Java

RandomPersonGuyThingI was wondering if you guys could point out any mistakes I've made in this program, and how to just generally improve the code //imports import java.util.Scanner; public class Main{ //global variables final static int WIDTH = 6; final static int HEIGHT = 6; final static int BOTTOM_ROW = WIDTH -...

0
Q: Minimum number of coins problem using dynamic programming

CyberLingoI previously posted a code here. Turns out, the code is not following the correct dynamic programming principles, instead it was based on a greedy approach. Hence, I started again, and now I would like to know if my code is efficient, or can be further optimized in terms of time and space complex...

However, they are great at detecting visual regressions
@IsmaelMiguel looks good
@Vogel612 Did I recommend something wrong?
what part of "looks good" implies you did recommend something wrong?
11:48
None
But doesn't say the oposite
I recently dared writing an answer, but I'm not sure it's clear enough. If anyone would mind taking a look.
3
A: Password hashing and matching

Mast However, there is a lot of talk about what implementations are secure and not secure. How does my method measure up? Is it secure? Are there more secure methods in PHP for hashing tokens and matching with tokens later on? Since you're specifically asking about security, I think reviewing you...

12:03
It seems to me that you're looking to get a review of your code. You could check out CodeReview.StackExchange, but be sure to read their FAQ though! For one, you'd need to show more code I'd think, e.g. the CustomerAccount class. - Additionally, you should look around for "unit testing" tutorials, which gives you executable tests (instead of "WriteLine" style tests). — Jeroen 51 secs ago
12:34
That's it. I've had it with VS2013.
I fixed my Git yesterday and now VS broke it.
I've had it with VS2013 too. I think I'll go write some Scala.
Greetings, Programs.
Hello, @Donald.McLean.
There, I fixed it.
No more VS for me.
@Phrancis I read that with Stephen Hawking's Digitized voice
12:51
0
Q: Best practices for testing / caching in node.js

radiovisualHey there code reviewers, I have some code for you to review! I have started working on a open-source project called Birdwatch. The purpose of Birdwatch is to allow developers an easy way to serve cached tweets from one or more twitter feeds (and let them filter the tweets based on hashtags). A...

Hey guys, question to throw on the floor.
I have a Page that is logically 3 different views.
Two of those views should implement the same interface.
How would you go about implementing that?
@Malachi lol
So, something like this...
Class MainPage
    Implements IView
    Implements IAlertView
    ' there's a second IAlertView on the main page....
Maybe I should ask on Programmers.....
I think it'd be on topic...
@RubberDuck What language/framework is it? Android Java?
@EBrown obviously C#
Implements is not a keyword in Java
13:06
It's not?
@Vogel612 It's not a keyword in C#, but it is in Java.
How do Java classes implement interfaces?
Though, Java typically has it as implements.
So, again, I'll leave it to RubberDuck to inform me, rather than speculate.
We reject edits that change code indentation/formatting, correct?
Greetings
@EBrown Yes, generally. The only time you should edit the code is if it's fixing something that clearly got lost in copy & pasting. (For example, if everything needs one more indent level)
13:18
@nhgrif I just skipped reviewing that edit as I was unsure.
He only fixed indents, but it was for about 1/2 the code. (Which, could have been a copy/paste error, as the first line in the function was indented further in than the rest.)
@nhgrif starting with a minuscle
@EBrown revising and calling .NET stack -> guess: VB.NET
0
Q: Does using an intermediate variable instead of array.length make your for-loop faster?

Jeroen VannevelThe "Performance Tips" section in the Android documentation has a pretty bold claim: one() is faster. It pulls everything out into local variables, avoiding the lookups. Only the array length offers a performance benefit. where it refers to this code snippet: int len = localArray.length; ...

First 3 hours after I woke up: learned bytecode and learned how to benchmark in Java
0
Q: Python - How to test the type from a variable?

M.MatthieuHere is my problem. my code : myvar=int(input("enter a number : ")) Works well, but, if the user type a string, python returns a ValueError. So, how could I test the type of the variable ? like : myvar=str() while type(myvar) is not "int": myvar=int(input("enter a number : ")) Thanks ! ...

I really can't see how the language is important here... C# VB.Net take your pick.
@JeroenVannevel it's still not java
13:28
What?
Android != Java
the bytecode is similar, the API is similar, but the VM is different
One is a framework, the other is a language
Now you're talking about VM's
wrong
13:30
That's the JVM, not the language
Android is not a framework
try using try-with-resources in Android
Dalvik is the VM in Android. Oracle VM is the normal JVM. Android SDK is the framework. Java is the language
Android is java 6 with some other things running on a completely separate VM which uses a partly different set of Bytecodes
Interesting, had no idea
JVM has invokeindy (which java relies on for lambdas)
Dalvik doesn't have it
as such Android is currently runnable on a JVM (with minor bytecode modifications) but not the other way round
13:35
@JeroenVannevel - got some interesting numbers with your loop variable. The numbers are .... odd ... in a few ways.
I ran four bits of code:
    public static int methodArr(final int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }

    public static int methodConst(final int[] arr) {
        int sum = 0;
        final int len = arr.length;
        for (int i = 0; i < len; i++) {
            sum += arr[i];
        }
        return sum;
    }

    public static int methodStream(final int[] arr) {
        return IntStream.of(arr).sum();
    }

    public static int methodEnhanced(final int[] arr) {
So, that's 4 ways to sum the values in an array. The interesting parts are in the results:
(results when running the sum of 100000 values 10000 times)
public static void main(String[] args) {
    final int[] data = IntStream.range(0, 100000).toArray();
    final int expect = IntStream.of(data).sum();
    UUtils.setStandaloneLogging(Level.INFO);
    UBench bench = new UBench("Loops");
    bench.addIntTask("Array.length", () -> methodArr(data), s -> s == expect);
    bench.addIntTask("Const length", () -> methodConst(data), s -> s == expect);
    bench.addIntTask("Enhanced For", () -> methodEnhanced(data), s -> s == expect);
    bench.addIntTask("Stream Loops", () -> methodStream(data), s -> s == expect);
The results are:
Task Loops -> Array.length: (Unit: MICROSECONDS)
  Count    :     10000      Average  :   32.3140
  Fastest  :   30.5870      Slowest  : 1514.3230
  95Pctile :   38.3340      99Pctile :   42.3000
  TimeBlock : 35.099 31.836 31.480 31.449 32.566 31.915 31.407 32.096 32.713 32.582
  Histogram :  9991     5     2     0     1     1

Task Loops -> Const length: (Unit: MICROSECONDS)
  Count    :     10000      Average  :   32.1790
  Fastest  :   30.5800      Slowest  : 1283.1110
  95Pctile :   38.3940      99Pctile :   42.7400
which, pointing out the oddities, are:
- the three non-stream loops all run in pretty much identical times. 30.5 microseconds to sum 100000 values.
@rolfl not everybody has vertically oriented monitors :D
- the three non-stream loops also all have very similar avg. times, and so on.
But, the real odd one.... is the streaming solution.
Normally I expect things to speed up as the Java VM optimizes things... but, it started off "fastish", then got "pretty damn fast", then slowed doen a hige amount.
So, the TimeBlock for a simple loop looks something like:
  TimeBlock : 34.974 31.665 31.448 31.402 31.848 31.837 31.305 32.085 32.612 32.615
That line is "simply" computed by taking all the runs (all 10000), and then splitting them in to 10 groups, the first 10%, the next 10%, etc. Then averaging each group.
So, the avg time of the firs 1000 of the 10,000 is 34.9 microseconds.
then it gets down to about 31.5, then stays there until it goes to about 32.5 micros.
In other words, pretty constant.
The Stream solution, though, is backwards:
  TimeBlock : 40.995 32.409 32.319 32.020 32.474 32.659 100.108 312.796 318.345 318.084
it starts at 41, then drops to 32 micros, then it "deoptimizes" by 10X to 300 micros.
I would've guessed that maybe it had to clean up a lot of resources involved with creating Stream objects
But it seems like the "cleanup" started too soon for that
What do you think is the cause?
The garbage collection should not factor in here... at least not in this way.... it will have an impact, but not that significant.
I think it's just a bug in the stream optimization.
It's a pretty big bug too
13:48
Looks like Array.Length gets compiler optimized. Interesting.
Streams often have to do odd things to accomplish potentially parallel execution, etc. I suspect that there's just some factor that is making it do things wrong.
From 30 to 300 is a huge increase
It's an easy error if some code thinks it needs to lock a resource, or something.
@rolfl I doubt that IntStream.of(Array) will not report Spliterator.ORDERED
It's not a problem with the code, it's a problem with the optimizer.
13:49
which would kick out parallelization of the Stream
It's also something that will be specific to a particular Java implementation.
0
Q: jQuery realizable

MathematicsIs there anyway I can simply this re-sizable solution, it seems too difficult and messy to me, $.ui.plugin.add("resizable", "alsoResizeReverse", { start: function (event, ui) { var self = $(this).data("resizable"), o = self.options; var _store = function (exp)...

0
Q: jQuery code that has a handlers module with a setTimeout above it

George JemptyI'm a couple of weeks into writing a web application with jQuery that is due in 3 months give or take, so there won't be a lot of time for refactoring. This is the structure that I've come up thus far (though the variables and handlers have been sanitized) and I would appreciate some feedback as...

0
Q: XML serialization helper class

EBrownYesterday was JSON serialization, today is XML serialization. I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but should be made. /// <summary> /// Provides methods for Serialization and Deserialization ...

14:11
0
Q: Is my use of HTML divs and spans correct?

GR412I have this fiddle: https://jsfiddle.net/xuujy9qo/3/ which is a cross section of my website with a HTML index page and the css styling for the entire website. I was just wondering if my use of span and div is correct. I understand that span is for in-line and div is for block-line, and I've tried...

@CaptainObvious Missing code (it's on a link)
Monking!
Greetings
Do you accept a piece of advice?
Dear diary, today I initialized a reference in a class with *this. I've been very naughty.
5
Today I drank freezing-cold water after eating 4 mentos (mint) at once. I'm almost crying!
14:17
x)
You have no idea!
It's awful, really
Consider posting to codereview.stackexchange.com if you want a more comprehensive look at performance. — Erick G. Hagstrom 31 secs ago
0
Q: Most elegant NOP linq expression

Jon HannaIn answering this SO question I needed a NOP/NOOP linq expression; takes no parameters, has no side effects, returns void. At first I thought of using Expression.Block(), that is a block of expressions of which there are zero such expressions. However, much as the querent in that question had fo...

0
Q: Fading Alert boxes

user4985641I am currently working on some fade out alert boxes where once the fa-close is clicked, it will then fade out and then slide the rest of the alerts/content upwards. Here's what I've got: $(document).ready(function() { $(document).on('click', 'div.alert > i', function() { var trg = $(this)...

14:35
@CaptainObvious Doesn't have code, only pieces of example code
@IsmaelMiguel code is fine, however the context is in the SO link.
Expression is a BCL / LINQ Expressions class
just edit it in and don't antagonize a high-rep SO user who's here for his first time, all because the context is in a different site on the SE network
the request for CR is, once again, not about the other pieces of code
thanks for that edit @JeroenVannevel
@Mat'sMug The code is Expression.Label(Expression.Label())
@IsmaelMiguel did you even bother to read the linked post?
14:46
No
Then you should refrain from policing if you can't do that
It's an interesting problem and the OP was perfectly clear, all it needed to be entirely on-topic was a small edit
He added more code, with a full context
By nitpicking you're only throwing off new users on CR who might provide valuable content in the future
And then the next day people complain about there not being diverse enough people on CR
We're already picky enough ^_^
4
it's actually a very interesting problem
14:53
Take a look at his PR to the CoreFX library
Somtimes, I have the feeling that I'm not even trying to solve problems, just trying to make the chat atmosphere better ^^"
@JeroenVannevel here is the CR part
I think this is not the place for this question - Instead of you, I'd take a look in code review in stack exchange. — A. Abramov 24 secs ago
ah yes
So we're actually talking about a code review of two statements
Are there services frome where code reviews can be bought?
14:55
Even more reason
@JohanLarsson yes. Hire a programmer :D
2
0
Q: Remove switch statement when dealing with models: Simplifying this method

Zach M.I have a switch statement that works just fine, however, it has a lot of duplicate logic within it. I have an enum that my controllers use to say which is making the publish request, so ProductInfo controller passes in ContentFields.ProductInformation into PublishTable public static void Publis...

@CaptainObvious Cross-posted from StackOverflow
@IsmaelMiguel Well yeah, it was more on-topic here.
15:07
I know
It just needs a link
@Vogel612 Not easy to find a skilled programmer though.
@JohanLarsson Define "skilled programmer"
@JohanLarsson careers.stackoverflow.com?
@IsmaelMiguel Who knows the language and can write idiomatic code.
And designs the code so that everything is not a terrible mess.
have you considered a freelancing-platform like elance?
15:18
gotta afk, back in 15'
I was almost confused there. ' is an overloaded operator - it can mean minutes or feet.
nobody civilized uses feet though
2
Yeah, I walk on my knees.
@Morwenn really? I prefer my hands for longer distances.
Way too much code here -- I don't think I can help answer the question without spending several hours trying to understand the code first, which I don't have. If you want an answer here, you need to break the question down into a smaller problem that requires less code. But the state of your code may make that difficult. You might benefit from a code review and fix up some of the other problems that make it difficult to work with first. — Simba 45 secs ago
Would this not be more appropriate for Code Review? — IKavanagh 22 secs ago
@SilverWarrior If you look at Code Review performance is one of the topics that should be brought up on it. — IKavanagh 52 secs ago
15:27
@JohanLarsson Well, that could be anyone in this room. But now comes the question: what language?
@IsmaelMiguel He's having trouble finding an expert in the language, so it must be exotic and crazy difficult.
our BrainFuck expert should be back soon
3
@Mast Brainfuck.
Damnit @Mat'sMug
@Mat'sMug Yea, that's what I thought
Officially tooling requests are off-topic on Stack Overflow. As to your question, it's not easy to exclude specific lines and keep that exact line excluded over time as the class/method changes. It would be hellish to maintain. It would probably be more of a code review tool you're looking for, one that can highlight the coverage information as well, instead of a coverage tool. — jessehouwing 39 secs ago
15:34
@Mast C, C++ and C# are exotic languages and crazy difficult
@Mat'sMug I think he will be back on 17th
@IsmaelMiguel C# is no longer exotic.
Disaster?
A pain?
@Mast I would go so far as to say none of those are exotic or "crazy difficult."
@EBrown C is crazy difficult
@EBrown Depends on what you're trying to do.
15:36
But if you want to go down the difficulty barrel, you can try Assembly
@Morwenn Mostly programming.
@IsmaelMiguel Are you available to lend some help with a JavaScript problem?
@SirPython For some values of available, yes
Shoot me a link
@IsmaelMiguel C#
@Vogel612 Not really
@JohanLarsson I'm not a C# expert. Still re-learning
15:51
0
Q: A safer way to return a generic indicator object indicating failure

CarcigenicateI'm writing a singly-linked list that implements the List interface. I decided going in that I'd try to implement every method as an exercise; even the optional ones. I started writing the ListIterator, and found the need to return the node previous to a given node for operations like add. Unfor...

0
Q: Wallpaper downloader

highlycorrosiveI'm not sure i'm doing this right(the threading part) because I start a thread for every image that has to be downloaded. The site I'm talking about(no advertise intended) is in the code. Any tips? import urllib.request import urllib.error import threading import os import sys try: from b...

16:02
@JohanLarsson Well, you could just post your code on CR, no?
@JeroenVannevel Unless he wants the whole project reviewed, which could be a bit excessive.
Well, a class or two should be sufficient.
I have nothing right now, it was a general question
I have a specific scenario where I think it could e worth a try: Geekfights, if two devs gets stuck in trenches.
Perhaps a neutral third party could help moving things forward
perhaps not
@JohanLarsson Ah, you refer to the "holy wars" of programming.
would be nice to find a way to resolve waste of time & energy deadlocks
Guess I could just ask Reed Copsey, he is really good.
16:08
0
Q: Chat: Github link oneboxer

ᔕᖺᘎᕊI've made a userscript that oneboxes links to Github repos, issues or pull requests in Chat after seeing the request One-box repositories, issue tickets and such on GitHub in the chat on Meta. It uses the Github API to get any relevant information and displaying it in a onebox-like manner. It us...

0
Q: AvoidRoads - TopCoder Challenge

James FargotsonI'm learning Dynamic Programming, following the topcoder guide. I just solved the AvoidRoads challenge. It passes all the test cases, but I don't have much experience, so I don't know if it's good. Challenge Description Linked description contains images and better illustrates the proble...

0
Q: Javascript search class with static methods?

James FenwickMost of my programming experience is in PHP and I have always been a bit wary of Javascript. I have a javascript class to manage executing, caching and displaying search results. class Search # @property {string} The previous search term. @previousSearch = undefined # @property {H...

Has anyone been informed that it's Friday yet?
I see that @Donald.McLean is here, but where's that "The Cure" video?
@EBrown Just wait until people start flagging these too.
I've seen flags on that R Black video more than once (not mine).
@Hosch250 They flagged the videos? :(
Well I can understand the R Black one, but not the "The Cure" one.
I've not seen flags on that.
I don't watch them.
That's a disappointment.
16:22
@EBrown "Friday I'm in love - The Cure"
Why would people flag a music video? That's just silly.
6
@Donald.McLean "Because it doesn't actively build the CR community." I'm sure that's a reason.
@EBrown flags are reserved for offensive / spammy content
if you want other stuff removed (e.g. non-offensive, non-spammy trolling) use Mod flags
Building a community is not just about working together, it is also about having fun together, so that argument is just pure hog wash.
also ^ that
@Donald.McLean I would start that again if I could.
Mostly, I've been limiting myself to posting music videos in the Music Fans chat room where, not surprisingly, they are entirely on-topic. :-)
I am so hungry - almost lunch time and I'm not even sure where to go.
That reminds me, I need to get the leftover pulled pork out of the freezer.
I'm thinking I might do Qdoba today.
16:34
Never mind, I'll have the leftover stuffed pepper.
16:45
@Donald.McLean link to the room?
0
Q: Javascript function that will analyze word length in a string?

Charles WatsonI have to write a single function in javascript. Takes in a string (full sentence). Analyzes which words have the highest count of repeated letters (i.e. rabbit, happy, there, etc). Repeated letters don't have to be consecutive. Returns the one (or more if there is a tie) word(s) that had high...

 Off the record

Welcome to the main chatroom for musicfans.stackexchange.com. ...
@Donald.McLean What's wrong with the pork?
inb4 user influx
@Vogel612 What?
16:49
@IsmaelMiguel Not a thing, but the stuffed pepper is not frozen.
@Donald.McLean But it's pepper... Vegetables... You really want that?
I like peppers.
I only eat raw pepper
@Donald.McLean What have you stuffed it with?
If it isn't raw, it's disgusting
16:51
@EBrown ground beef, rice, and tomato sauce.
@Donald.McLean Sounds delicious. I would have problems deciding between that and the pulled-pork, personally. :)
There's also a very tasty vegetarian vegetable noodle soup.
I got my first accepted answer on CR ^^
0
Q: Removal Of charachter to make string Palindrome

Suraj PalweAim of the question is to find at which index for a given string if that character is removed will produce a palindrome string. For eg s = "baa" After removing b the string "aa" is palindrome. Here this is what I have written till now but due to time complexity problem, it is exceed...

@Mast Congrats!
16:55
Stupid thing is, I didn't touch the code...
It was a security question and I basically told him "don't do it yourself, do it this way".
But hey, everybody happy so who gives.
@Donald.McLean Thanks :-)
@Mast That's still a valid review.
@Mast The most important is that you showed the right pointers and showed how to do it. That was indeed a really good review. A top one! Worthy of 100 upvotes
@EBrown Yea, that's why I wrote it. He was focussing on security so I wrote him a fitting answer.
@IsmaelMiguel Thank you :-)
@Mast We both know I'm simply saying the truth

« first day (832 days earlier)      last day (3483 days later) »