« first day (699 days earlier)      last day (3617 days later) » 

00:00
There are 1271 unanswered questions
0
Q: Haskell: IO operations

GeneralBecosI have a simple function that takes an Integer n and return a string representing the array from 1..n. nthLine :: Integer -> String nthLine n = intercalate " " $ map show [1..n] The main function takes input n from the user and prints the nthLine out to screen: getInteger :: String -> Integer...

Maybe you can also post your question here: Code Review It seems more on-topic :) — FLefèvre 1 min ago
00:24
I'm voting to close this question as off-topic because it is asking for code review, not help with any particular issue. — IMSoP 13 secs ago
Hmm, just got "Refiner" badge on SO.
2
Anyone around to help with problematic C# code?
00:39
I can look at it.
@Duga Star reset!
My toolbox is big.
for (int i = 0; i < items.Count(); i++)
{
    if (item.Equals(items.ElementAt(i).Value))
    {
        for (int j = 0; j < branches.Count(); j++)
        {
            if (branches.ElementAt(i).Key == i)
            {
                return branches.ElementAt(i).Value.GetChildren();
            }
        }
    }
}
Did I miss the star-fest?
So, I implemented a breadth-first search, like this:
        public IEnumerable<T> GetChildren(T item)
        {
            for (int i = 0; i < items.Count(); i++)
            {
                if (item.Equals(items.ElementAt(i).Value))
                {
                    for (int j = 0; j < branches.Count(); j++)
                    {
                        if (branches.ElementAt(i).Key == i)
                        {
                            return branches.ElementAt(i).Value.GetChildren();
                        }
                    }
AHHH!!!
Dumb, old me!
NVM, you rubberducked me into finding the problem myself :)))
@nhgrif I don't get the joke.
Hmm, I don't know how to one-box.
You may post this on Code Review as long as it works correctly for its intended purpose. I might recommend to make sure to post all the code you'd like reviewed, some of this seems example-ish (or do you really have a table called STUFF?) — Phrancis 10 secs ago
How to configure a custom IdentityUser for Entity-Framework: http://www.vannevel.net/2015/04/03/how-to-configure-a-custom-identityuser-for-entity-framework/ #dotnet #CSharp #EntityFramework
How did you do that?
00:44
And it works.
Oh, I don't know.
I went to your Twitter, went to your profile, went to your latest tweet, clicked View Details, copied the link, and pasted it here.
Yes.... it says it should automatically one-box twitter links
but it didn't do that for @JeroenVannevel and it didn't do it for me.
How to configure a custom IdentityUser for Entity-Framework: http://www.vannevel.net/2015/04/03/how-to-configure-a-custom-identityuser-for-entity-framework/ #dotnet #CSharp #EntityFramework
@Hosch250 found a different link than I found
I don't get it. That's the same link I have
what
Learn about unit tests: @VannevelJeroen wrote a great article on the topic! http://www.vannevel.net/2015/03/31/introduction-to-unit-testing-what-is-unit-testing/
00:46
I just copied my old link
Here is a trick
Right-click the day/time posted link (just like SE comments) and paste that link. It will one-box it.
meh, I'll just delete and retry next time. Seems like it just had a little off-moment
It started working because I released my Twitter superpowers among you ;P
Can even one-box from the one-box :D
:)
I just implemented a cross between a depth-first search and a breadth-first search for my tree, and I can have menus within menus now :))
Now, I just need to post it for review.
(Crucial part of the implementation process.)
00:54
Nice, sounds useful!
It is, with one exception.
Before, I was basing my implementation on the fact that an item was prefixed by a space, and a menu wasn't.
My menus opened and closed properly.
It is very hacky, I know, and now I have a reason to fix it.
Because menus in menus don't close properly.
I'm going to try to LINQ-ify it first.
Time to go get some food
0
Q: Mini console based life simulation thing.

djscrewI made this mini life simulation thing. I got the idea from the Eloquent Javascript textbook, and just kinda ran with it. I've been programming for a little less than year and this is probably the most largest thing i've made to date, so I'm looking for a little feedback. Anything you see that c...

01:12
What in the world?
Did I miss a starfest?
0
Q: Asp.Net Web Api - Identity Repository Pattern with Unit of Work - Unity

AccountantI am creating simple web api/ SPA application using EntityFramework, IUnitOfWork, Repository pattern, Unity DI along with Asp.net Identity. 1: Unity configuration public static void RegisterTypes(IUnityContainer container) { // TODO: Register your types here cont...

0
Q: Search for Tree

Hosch250Here is a search implementation for my tree. It searches each node in a breadth-first manner first, but it goes deeper in a depth-first manner, in the event it needs to go deeper. I know there may be multiple items in the tree (well, not my current use of it, but I still need to presume that), ...

01:34
0
Q: Search for Tree

Hosch250Here is a search implementation for my tree. It searches each node in a breadth-first manner first, but it goes deeper in a depth-first manner, in the event it needs to go deeper. I know there may be multiple items in the tree (well, not my current use of it, but I still need to presume that), ...

0
Q: PHP: For a login portal, what security measures are needed to prevent unauthorized access?

JustinI'm designing a login portal that has one angularjs page that displays/processes data queried from a database. I'm relying on a few php pages (a loginpage.php [verifies credentials/loads session variables], a check.php [page that is included in all php pages, verifies session variables are 'okay'...

So... how does one go about making a chatbot, and how would 2nd Monitor feel about a chatbot that listened to RSS feeds for approved-user's blogs and pasting links in chat when new posts are made?
@Hosch250 I don't understand what this means. How do you cross these two?
01:56
@Hosch250: can you give an example of an abstract tree and how it would be traversed with your code?
The description sounds just like depth first
@JeroenVannevel Sure.
0
Q: Finding Pattern score

SteephenYou are given 3 strings: text, pre_text and post_text. Let L be a substring of text. For each substring L of text, we define pattern_score as follows: * pre_text_pattern_score = highest n, such that first n characters of L are equal to the last n characters of pre_text and occur in the same exa...

0
Q: Finding Pattern score

SteephenYou are given 3 strings: text, pre_text and post_text. Let L be a substring of text. For each substring L of text, we define pattern_score as follows: * pre_text_pattern_score = highest n, such that first n characters of L are equal to the last n characters of pre_text and occur in the same exa...

Hold on, though, just waiting for my dryer to catch up, then I'll have to do more dishes.
I'm going to bed now, but if you edit it in your question that would be helpful
I'll read it tomorrow
01:57
It could be a while, and yes, I will edit it in.
Good night.
@nhgrif I'm going to edit my question in a while.
Thanks Captain
@Hosch250 Someone just starred... all that stuff!?
Welcome to The 2nd Monitor, @Steephen
Did I miss the star-fest?
@sᴉɔuɐɹɥԀ Apparently...
01:59
Indeed, welcome!
@nhgrif We all did, and no idea who did it, either.
@nhgrif Anyway, what is the joke?
1
Q: Avoiding callback chaining

W.K.SI'm developing an iOS Application in Swift that uses Google Cloud Endpoints as its backend. For now, I've just written the code for the user to login with his Gmail account and I've refactored it as much as possible but the callback chain is making me nervous. The reason I'm worried is because f...

You might like that, @nhgrif
Thanks Hosch250
OK, leaving again.
BBL
3
Q: Avoiding callback chaining

W.K.SI'm developing an iOS Application in Swift that uses Google Cloud Endpoints as its backend. For now, I've just written the code for the user to login with his Gmail account and I've refactored it as much as possible but the callback chain is making me nervous. The reason I'm worried is because f...

@CaptainObvious Hey that's the guy I commented on SO a bit ago! Glad they made it to the "light side" :)
02:31
0
Q: Implemente Blackjack in Python with OOP

yrenI feel the best way to learn is practice. I have written a simple Blackjack game in Python which supports multiple-players and functionality like Hit, Stand, Surrender, Split and Double_Down. I need some help to review my code, try to remove any redundant code, simplify the implementation, and im...

simplest way to get stars, get a random comic from xkcd, upload it here
0
A: Avoiding callback chaining

nhgrifI tend to not like callback closures myself and I agree with your sentiment toward "spaghetti code". With time and experience, these will tend to make sense, and you kind of just know what they're doing, but they still tend to give me pause. I personally vastly prefer the delegation pattern whi...

6
Q: Convert a 24bit bitmap to grayscale

JaDoggI wrote this so I can learn CUDA. This is coded to work on my laptop's Nvidia GeForce GT 540M. Main points I need reviewed: CUDA programming conventions Performance, especially kernel speed C programming conventions Preprocessor and macro conventions Making it DRY kernel.cu /*************...

02:54
@JaDogg Sorry, already voted on everything.
@JeroenVannevel @nhgrif Updated my question:
5
Q: Search for Tree

Hosch250Here is a search implementation for my tree. It searches each node in a breadth-first manner first, but it goes deeper in a depth-first manner, in the event it needs to go deeper. I know there may be multiple items in the tree (well, not my current use of it, but I still need to presume that), ...

This guy deserves more votes:
1
A: Music Theory Website

unorAbout your document outline Page heading <div class="mainHeader zero-border"> <h1>GCSE Music Revision</h1> <h2>Edexcel Based</h2> <h3>By Jack Winstanley</h3> </div> Instead of using h2 and h3 for the "subtitles" of the page heading (which creates a wrong document outline), use p inste...

@import url(fonts.googleapis.com/css?family=Lato);
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
What is the point of that? (asking curiously, not criticizing)
03:11
They are applying the items there to every single HTML element that exists, I think.
It should probably just be body {}
Oh yikes, didn't realize that was actually a CSS style
Guess the cascading part didn't occur to them
Yeah.
Why don't you write an answer?
0
Q: Using swing and creating JPanel

user255572I watched bunch of videos about swing and GUI in general and created my first component (correct me if it is not one). JPanel class: package gui.pane; import javax.swing.*; import javax.swing.event.EventListenerList; import java.awt.*; import java.text.DateFormatSymbols; import java.util.Arra...

Did you guys know that SE accepts animated GIF's for profile pictures?
NO, do they?
03:24
This is not really a code review answer... Can you add more detail about !important if you find it is a concern? Sounds more like a style review as it is... — sᴉɔuɐɹɥԀ 14 secs ago
@Hosch250 I just did
@rolfl Yes, they do.
Link to one?
I just tried it in my own - the Koch Snowflake GIF:
I didn't save the changes, though.
Yeah, good luck with that. FWIW youc an change your profile picture often, but the name only 1 time each 30 days
@rolfl NVM.
I just saved it, and it didn't animate once it was saved.
I changed it back again.
03:28
K , that' what I would expect.
TTGTB4Me
Night.
Good night monkey!
03:52
@Jonathan Leffler True about the speed up using various code and len. Though typically the speed-up pales to the time spent in getline() itself. Trimming fgets(): strlen() or strtok()chux 1 min ago
Ok..If possible please narrow down this question specific areas that you would want to be reviewed. This question might be more suitable for the Stack exchange code review site..codereview.stackexchange.comLittlePanda 59 secs ago
This is not a code review or debugging service. Please ask specific questions. — Stephen C 38 secs ago
0
Q: Stack and arithmetic expressions

Zion ToddI have to do this assignment for my coding class about Stack and arithmetic expressions, and I am not sure if this is all correct. I don't want to submit my assignment if it is wrong or has any errors, I just want to make sure it's supposed to be doing what the assignment asks. The assignment is ...

@beginnercoder010812 If the code works as intended, you are welcome to post your question at the Code Review site and we can certainly help you improve your code! If you do so, please delete your question here so we don't have duplicates. Do keep in mind though, if your code does not work as expected, it would be off-topic on Code Review. — Phrancis 38 secs ago
04:18
The "code review" site is for code that works properly, but which you think might be improved somehow. If you've got an error, like the one you described, then this site is the correct place for your question. But you have to SAY you've got an error, because not all computer programmers are psychic. — David Wallace 1 min ago
What the ...
Now: 105188864.000000 Result:  1
110.000000 :(float)
Now: 105210914.000000 Result:  2
5161385300429885440.000000 :(float)
Now: 105232964.000000 Result:  Buzz
10322770600859770880.000000 :(float)
How does 110.000000 goes to 5161385300429885440.000000 in one iteration ...
@sᴉɔuɐɹɥԀ What are you doing?
Something wrong, apparently
Got my ear drums really hating me right now playing these stupidly high frequencies
But I suck at math, I'm sure that's the issue... Here is something
// audio oscillators
SawOsc fbOsc => dac;
110 => float OscFrequency; // 110Hz, or "A -1" musical note
OscFrequency => fbOsc.freq;
Later on:
( OscFrequency + ( Math.pow ( OscFrequency, ( OscFrequency/12 ) ) - OscFrequency ) ) => float stepExponent;
And at the end of the loop...
// operations for processing next iteration
<<< OscFrequency >>>;
( ( OscFrequency + stepExponent ) ) => OscFrequency => float fbOscFreq;
fbOscFreq => fbOsc.freq;
beat +=> now;
1 +=> stepCounter;
I'm really not sure about this whole math operation, I need a sanity check because it's clearly not doing what I want it to do
I also find it very odd that all the digits in the output after the period are zeroes, might be doing some weird implicit ... thing...
Exponential things... I'm not good at, clearly.
But I need to add the remainder of OscFrequency^12 / OscFrequency... maybe I should use modulus?
I'm not sure that's even right... But basically, you have a frequency, say 100hz, and the same note but one octave up is double, say 200hz... And the span in between is divided into 12 distinct musical notes... ugh.
I'm guessing that's probably what modulus was designed for (besides FizzBuzz), I'll try that
04:45
I love the modulo operator.
I'm afraid I'm not following your rant, and I'm not sure what you are doing.
Hope you solve it, I'm going to bed now.
Just about have, turns out modulo looks to be my savior
OscFrequency + ( ( Math.pow ( OscFrequency, 12 ) % 12 ) - OscFrequency ) => float stepExponent;
Works a lot better, let alone is much simpler
JS1
JS1
I'm not sure what you are doing but I think the value you are looking for is 2^(1/12).
@JS1 That looks beautifully simple... Would 2 be a constant or variable, if you don't mind me asking?
(or, worded more practically, is that where my variable goes?)
JS1
JS1
05:06
2 is the number 2. The expression is the twelfth root of 2, or 1.059463094359. That is what you have to multiply a frequency by to get to the next half note.
Oohhhhhhhh! @JS1 that helps a lot, thanks for taking the time to stop by, I would never have thought of that :D
06:00
[janosgyerik/todoman] janosgyerik created repository
06:22
Meh, this is just ... perplexing ... I might try to hit one of the math sites ... Either this programming language is crazy (less likely) or I am crazy (more likely)
Monking :)
06:40
0
Q: Making the ruby method more logical with && and || operators

Yatish Mehtadef parse_line(line) continue = true unless @open_elements.empty? continue = process_open_elements line end # Process factories, if we still can. if continue process_block_elements line end end The above method if process_open_elements executes decides the fate of proces...

0
Q: Audio frequency increment yielding wrong results

PhrancisI am writing something in the ChucK programming language, which is designed specifically for audio time functions (in this case, hertz). I'm having a really difficult time with a mathematical calculation; I'm not very good at mathematics, I hope I can get help here. The operation I'm attempting...

07:44
Whoa Hi * 5 !!
now => string "TTGTB";
2
 
1 hour later…
08:56
Monking
Hey ^^
What's up? :)
Not much today
@rolfl Might also be the IDE that has the issue, but the type argument can't be retrieved from the context, I believe Comparator.<MathEquation>comparingInt will also work
13 hours ago, by skiwi
TTGTBATIWSAAPPHSASSMGNA
I should be studying today, but I'll likely also play a lot of HearthStone
Haha, you're doomed :D
Also working on a 3D engine on top of LibGDX, but not that easy
LibGDX is a Java 3D framework
Fighting against quaternions currently
09:06
Uh, good luck with that .___.
Next step is octonions. Then sedenions :D
09:46
Monking!
hey @DJanssens
0
Q: Extending ProgressBarUI for modifying the look of a JProgressBar in Java

coderoddeI have this visual mod for a javax.swing.JProgressBar: import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.GridLayout; import java.awt.Toolkit; import java.awt.geom.Rectangle2D; import javax.swing.JCompone...

Should probably move this to codereview.stackexchange.com — fijas 1 min ago
10:01
I may have found a new method to perform a Gray codes addition. It relies on powers of 2 decomposition and I suspect it will be slower than my current solution provided it even works.
It is based on the fact that there are a few things that we can do (I have yet to prove them) with Gray codes: multiply by 2, subtract if they have the same msb, and add a power of 2 to a smaller Gray code.
I guess it's crazy enough not to work at some point. You will hear of Gray codes again in a few days. Sorry x)
@Morwenn I want to hear from you on CR, not on SO :)
@skiwi I guess I will add a second self-answer on my question on SO, then post a "Gray codes addition - Take 2" here :p
Don't worry, I definitely intend to spam everybody.
10:21
0
Q: Reading a matrix and computing the determinant

rubikAs one of my firsts C programs I want to read in a matrix and compute its determinant. I don't pose limits on the size of the matrix and this makes things more complicated. Here's the full program: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #define MATRIX 8 #...

10:41
@sᴉɔuɐɹɥԀ Is there a way to recreate what you're trying to do in a language that others here will be more familiar with? That way perhaps we can help identify if the error is in your logic or in your syntax?
4
Q: Avoiding callback chaining

W.K.SI'm developing an iOS Application in Swift that uses Google Cloud Endpoints as its backend. For now, I've just written the code for the user to login with his Gmail account and I've refactored it as much as possible but the callback chain is making me nervous. The reason I'm worried is because f...

> The reason I'm worried is because firstly, I'm fairly new to programming, and secondly, the company where I work now uses a similar callback-chain method to make network calls and I sort of dislike it because it takes a while for a new developer to figure out the sequence of events and it feels a bit like spaghetti code.
I'm glad I don't work for that company.
0
Q: Project Euler #5 in Ruby with Prime class

Chris YeungQuestion: Smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I tackle the problem with reference to how I solved #3, which is using the prime_division method in Prime Class. I have created an array of prime_divisions for 2..20. The array looks like this: ...

11:01
I have to admit that I like Swift's function syntax.
Isn't it about the same as a lot of languages (function syntax specifically)
11:14
0
Q: How much ideal to sleep program

Abhishek GoswamiIn my legacy code, The use sleep for 10 which is delay process. I would like to reduce in 5. will it impact any things?. int do_message=0; void sigalrm(int i){ signal(SIGALRM, sigalrm); if(do_message) alarm(6); printf("Processing.....\n"); } signal(SIGALRM, sigalrm); do_messag...

0
Q: I have these tasks to be done and i have limited knowledge on it. anyone could help to solve?

anonymous(a)Write a function bool readFile(char *filename, BST *t1) in main that reads student records from a text file and stores them according to the student id in a binary search tree (BST). The function prints to screen the number of student records successfully read. The function return false if fil...

@nhgrif Well, sort of. But I probably never used a language that used the colon to denote the parameters type and an arrow to denote the return type.
Python 3.something almost qualifies but you only put hints and they are not used by the language nor the standard library.
0
Q: Is placing view models inside Web project of n-tier application a good idea and how to do it?

LandeeyoLet's assume we have an ASP.NET MVC web application with following tiers: Business logic Entities (business domain and database POCOs) Common (resources, consts) Data access (database EF queries, EDMX EF models and so on) Web application (MVC web application) We're using view models approach....

Oh right, I see. The colon denoting type actually makes a lot of sense when you look at how the functions are called.
You just replace the type with the parameter you are passing pretty much.
Yep.
The -> ReturnType is kind of how VB does it.
11:49
It even made its way to C++. It is the symbol used in type theory too.
This question would be better on Code Review in my opinion.. — Soner Gönül 1 min ago
4
Q: Finding Pattern score

Steephen You are given 3 strings: text, pre_text and post_text. Let L be a substring of text. For each substring L of text, we define pattern_score as follows: pre_text_pattern_score = highest n, such that first n characters of L are equal to the last n characters of pre_text and occur in ...

@Morwenn like to see your review comments
@Steephen Hey, you just made me realize that I reviewed some of your questions :p
12:04
Thanks Morwenn, it was amazing to see your insights on my mistakes!!
0
Q: How to protecting my clean code for growing rules?

bookmarkerI have created a controller action method as clean at first.(I have so much Response methot buh here is one of them) public Response Get(){ Response response = new Response(); try { response.Data = service.GetData(); } catch(Exception ex) { response.Erro...

No problem, but your new question seems a little bit harder (probably because I never got to use std::regex yet).
Greetings, Programs.
Monking all
@Donald.McLean Hey :)
@rolfl Hey too :D
12:08
If you see me on here today it is because I should be tidying the house .... got company coming
Hi Rolfl
Sometimes, house tidying can be fun. For example when you're already drunk.
haha
Yeah, 20 people for an easter lunch
We're mostly ready, already... so I should be OK to finish up learning abourt CSS float containers....
which , apparently, are not what I want.
I want the opposite.
Hey @Steephen
Happy Good Friday roflfl!!!
12:13
Yeah, no work, that has to be a good thing, right?
Did somebody say... Friday? :D
Tomorrow I am off to my inlaws, spending a couple of days there.
Hmm yes yes
Good thing they have the 'net too.... you won't see much change from me.
Bring it on, Morwennn... I am warming up my voice already
Well, no. I'm reviewing some code.
12:15
Oh, good, at least someone is. I have been ... distracted from that
If the code works, this belongs to codereview. — Dion V. 1 min ago
Thanks Donald!!
You guys could have saved me a few hours if you had told me that <div class="foo" /> is not the same as <div class="foo"></div> .... My XML experience is a liability.....
@Steephen I'll second that! Thank you @Donald.McLean!
12:30
This question has been cross-posted on Code Review, and should be deleted on Stack Overflow. — 200_success 1 min ago
0
Q: how to reduce calculation time in foreach loop

user3652702How i customize this code to reduce the calculation time using foreach loop. The problem my code is that it take more time to calculating answers, so how it possible to reduce this time any clue please. foreach (SixSeconds.Models.ItemAnswer a in q.Answers) { //get the persona...

Friday afternoon interview, hmm. :/
@nhgrif find a potential VB guy?
Dunno. I do know that I have a deadline for a project that I am never afforded time to work on.
@Steephen Here you go :)
0
A: Finding Pattern score

MorwennThere are at least a few places where you seem to be doing unnecessary extra work: First, even if not related to the sentence above, if you don't intend to modify a variable, pass it by const reference, not by simple reference. The most obvious unnecessary work is text_copy, even the name is a ...

Hope I didn't make any false assumptions. It still works for your two examples.
12:40
This question is off-topic on Stack Overflow, but it has been cross-posted on Code Review: codereview.stackexchange.com/q/85778/9357. — Protron 1 min ago
0
Q: Make my Custom iComparer less verbose

ThomasI've got a base class GraphUIControl which is inherited by 4 child classes: BubbleGraphUIControl BatchGraphUIControl LineGraphUIControl StackedGraphUIControl I, sometimes, put all my GraphUIControl in the same List<GraphUIControl> for some obscure reasons. I wanted to order my list (first by...

0
Q: I have implemented few functions in a DOUBLE ENDED LINK LIST

user4275686import java.io.*; class data{ String name; int roll; int age; public data(String a,int b,int c){ name=a;roll=b;age=c; } public void displaydata(){ System.out.println("Name : "+name+" Roll : "+roll+" Age : "+age); } public String retname(){ return name; } } class Link{ data d; Link next; pu...

Thanks @Morwenn great!!!
@rolfl Do you mind to review my code?
5
Q: Finding Pattern score

Steephen You are given 3 strings: text, pre_text and post_text. Let L be a substring of text. For each substring L of text, we define pattern_score as follows: pre_text_pattern_score = highest n, such that first n characters of L are equal to the last n characters of pre_text and occur in ...

12:56
@Steephen No problem. I don't know how often result.length() == 0 though so I don't know whether it will make a noticeable difference.
@CaptainObvious Umm… does your mother know that you format your code like that?
5
@200_success When I started programming, I didn't indent anything.
When my code became bigger and bigger, I began to understand the power of indentation.
Yea that is true, but over all your comment turned it from O(nlogn) to O(n).
It is marvelous!!
@Steephen Can you cite the source of the challenge?
I took it from careercup.com
13:00
Please note that in the question then.
@200_success Guys will post questions, there, I will pick one or 2 per day to practice
The original posted question was a dump, I made a few changes in it
@200_success do you mind to review my code?
13:20
> Microsoft: An Open Source Windows Is ‘Definitely Possible’
2
13:35
@JeroenVannevel What about Open Source customer support? :p
13:46
0
Q: How to Eliminate Left Recursion having epsilon Production?

setu basakI have seen this link.But i am little bit confused how to eliminate the ∈ production here. I have the following grammer S-->Sz|Sxw|xw|yw|∈ I can see after removing the epsilon productions the grammer becomes S-->Sz|Sxw|xw|yw|z Now if i solve this i got like below S-->xwS`|zS`|ywS` S`--

0
Q: Create a 2D array from SQL table

CartyI am a beginner to PHP programming. I wanted to make a 2D array that would store the values of a table into the array. Below is the Frankenstein code I created (every time I wanted to achieve a task I researched a solution, so this is a bunch of solutions plus my own doing put together). I woul...

0
Q: C# Chat - Part 1: Server

ArtOfCodeSo I've been building a simple C# server-client chat-style app as a test of my C#. I've picked up code from a few tutorials, and extended what's there to come up with my own server spec. In this post (the second will be the client), I'd like to get some feedback on the server. To me, the code se...

@sᴉɔuɐɹɥԀ Monking
@nhgrif I'll see if I can... "translate" it into something more common
14:07
@CaptainObvious may the gods have mercy on my soul. I just left an answer on a question.
@nhgrif I added an example in Java to the question. I tried to think about what it would look like in Mathjax but couldn't come up with something intelligent
float OscFrequency = 110.00;
// setting up loop
while (now < stop) {
	float stepExponent = (OscFrequency + 1) - (pow(1, (OscFrequency / 12)));
	// other irrelevant things happen here
	OscFrequency = OscFrequency + stepExponent
}
You need a sigma expression to express that in mathematical terms.
It's a sum over a ..... what's the word... sequence?
I wouldn't know a sigma expression if it hit me in the face lol.
@sᴉɔuɐɹɥԀ Sure you would. Ever used Excel before?
Sigma ^
this is a topic which probably is more suited to Code Review, seeing as you mention that the code is working as written... codereview.stackexchange.comClaies 1 min ago
14:16
Ah... is it where Σ = a + b + c + ... + n ?
Yes.
Hard to type into chat, but there's some additional notation wrapped around Sigma.
We need some ChatJax, or MathChat.
@Morwenn Even Math.SE don't have that... just don't hold your breath ;)
@sᴉɔuɐɹɥԀ Yeah, I know. And it would be horribly hard to type for a chat anyway.
14:25
@Morwenn there is some userscript I think available. @rolfl uses it IIRC.
Yes, there is.
It is a bit messy, and requires individuals to enable it on their chat session.
The folk in the math chat room have it.... let me dig.
Ahh, that must be why I kept seeing people there post $some expression$ in there
90
A: Should chat have TeX support?

robjohnI will leave the original post for historical reference, but as mentioned in the Update below, all four bookmarks are located on this installation page. There are four bookmarks: start ChatJax installs MathJax and starts a loop that renders $\LaTeX$ as needed. This is intended for use in chat, ...

For the record, I have used it gor like 10 minutes, in the past.
I don't have it running by default.
0
Q: Using async & await .net 4.5 mvc c#

William HumphreysI've been experimenting with some old code that needs refactoring in places and was testing if there was any improvement to iis threads etc by uploading file asynchronously (Server Side). Using jQuery file upload client side. The original code [HttpPost] public ActionResult UploadDocument( Http...

14:47
42
Q: My wife has died

Aggie KiddIn 1980, a man lives on the 30th floor of his building. Every morning he wakes up, gets ready, kisses his wife, takes the elevator down to the first floor, and goes to work. One morning, he wakes up, gets ready, kisses his wife, and gets in the elevator, exactly as he always has done. The morn...

Sad puzzles
Would this be better on CodeReview.SE? — Rich 1 min ago
Why are you altering what i have written? If you have an answer then I'm all ears otherwise leave it alone. Don't tell me this site is full of badge collectors as well................. — William Humphreys 3 mins ago
@Jamal As if you hadn't already earned that badge lol. For real though, this guy has a crappy attitude.
If I roll this back myself, it may just anger him even more. But that part of the title should still be removed.
14:53
@Jamal I'll do it. I just hit him with an auto-comment too
We're all here to receive constructive criticism of our code. However, the current title of your question is very broad and doesn't really state the purpose of your code. We've found over time that questions with more descriptive titles get more attention from potential reviewers, so editing your question's title to describe what your code does will benefit both you and the people reviewing it. You may also want to read How to get the best value out of Code Review - Asking Questions. Thanks! — RubberDuck 48 secs ago
Yes it is quite sad Sam that this site seems to be full of more badge collectors than answers. Its amusing that they never supply an answer after their complaints. To be fair to some of them they do answer a lot of questions and some of the questions are silly. But I also have to wonder with the amount of time they spend on here if they actually have real jobs................... Sorry very off topic but true. — William Humphreys 16 mins ago
@Rich If it gets closed here, then yes. If it does not, then it works just as fine here as on Code Review. — Simon André Forsberg 52 secs ago
And for all the badge collectors above its interesting to note that I did post it on code review and that seems to have more badge collectors than here lol. codereview.stackexchange.com/questions/85790/using-async-awaitWilliam Humphreys 1 min ago
People must think that we're omniscient. We know whenever somebody mentions Code Review.
You mean we're not?
I know I am!
2
15:02
Big Brother Code Review Is Watching
It makes me sad that people call badge collectors people that only strive to improve the site's quality :/
5
So... now William's question exists on both SO and CR... now what?
@WilliamHumphreys Please understand that Code Review is not about collecting badges or other form of imaginary internet points; rather, we have standards that we use to try and make questions and answers what we consider high quality. We really do want to answer your question and give you some good reviews. You're welcome to join us in The 2nd Monitor chat room if you wish to discuss this in more detail. — Phrancis 18 secs ago
SO's should be closed, then.
@Morwenn a simple star isn't good enough for that statement.
15:05
@RubberDuck Add a theorical one then.
@WilliamHumphreys Please understand that Code Review is not about collecting badges or other form of imaginary internet points; rather, we have standards that we use to try and make questions and answers what we consider high quality. We really do want to answer your question and give you some good reviews. You're welcome to join us in The 2nd Monitor chat room if you wish to discuss this in more detail. — Phrancis 1 min ago
Owait, I posted that on SO. Whoops
There's a lot going on in your question, and there's no code to look at. I would suggest making one or two smaller questions like, "How to pause a thread besides a busy loop", or "how to pause threads in an executor" and in each paste a small, runnable bit of the code that demonstrates what you're currently doing. Also, codereview.stackexchange.com might be a better place for these kinds of questions. — kuporific 1 min ago
@kuporific not without any code to be reviewed it wouldn't. With the question in the state it is, I don't think it would be on topic anywhere on SE. — RubberDuck 8 secs ago
There, posted on CR question instead.
15:08
@Jamal I am not so sure about that.
15:19
Welcome to Code Review, where the objective is to review the code in the question. Your answer contains interesting code, but it is not a review. Additionally, you indicate that the accepted answer has problems, which may be true, but that should be posted as a comment to that answer. I am deleting this answer, but I encourage you to post your code as a new review, perhaps using the tag: rags-to-richesrolfl ♦ 24 secs ago
Question: is example code on-topic for Code Review? :( seriously.......
I have this HTML/CSS example I have extracted from other code: git.tuis.net/ubench/sccse.html
and I want it reviewed ;-)
I was using it as what was going to be a question to SO, but, in writing it, I solved my problem,.... now I want to know if I solved it right...
6
A: Growing Code Review, One Idea... :-)

Jeff AtwoodSure, you can, as long as people are clear what code review is for -- essentially, functioning, working code that needs to be improved in some subjective, perhaps even aesthetic, way. If the code is in any way broken or does not work, that is not the purpose of Code Review.

^^ Four years, still valid.
@rolfl huh?
@rolfl I don't think that's real example code.
You stripped context, sure... but..
The problem is I want just the last column in a table to 'resize' if the container it is in is resized.
so, if you open that in a separate window.... and resize the window, only the last input box resizes.
0
Q: Insertion sort in Java

Calculus5000I've written a stable implementation of insertion sort, that sorts an array in ascending order. Please let me know of any improvements/optimisations that can be made. import java.util.List; public class InsertionSort { public static void start(List<Integer> arrayToSort){ for(int i ...

0
Q: Selection sort implementation in Java

Calculus5000Here's an implementation of selection sort, that sorts an array in ascending order. Please let me know of any improvements/optimisations that can be done. import java.util.List; public class SelectionSort { public static void start(List<Integer> arrayToSort){ for(int i = 0; i < ar...

-1
Q: Search Bar in Swift......Please direct me

TomCould someone please point me in the right direction. I need a search function in an app that I have. At the moment I have a working app but want to put a search function in it. The search would be working on two files, both formatted in HTML, and all text. I have looked for something but all I...

15:31
Regardless, I am out of here for some hours.
I've locked that C# question for now. Unfortunately, it still blocks answers (all locks are still equal), so it'll have to be lifted quickly.
15:46
@Jamal Why the lock?
Last edit was 52 minutes ago. What's the problem?
It was for the comments, but it still affects other things. That's by design.
@Jamal I think a lock is a bad choice in this case. Just remove the comments, add a note that comments were cleaned up and invite the user to chat here.
Locking doesn't help anyone here IMHO.
Alright, then. I'll keep watch in case the comments continue.
16:05
My co-workers found a Space Invaders-style typing game... now everyone is playing it and laughing out loud. groan...
Kids...
@nhgrif Nice article!
@KrishnaKumar SO isn't the appropriate site for code reviews; the Code Review StackExchange is. — Dave Newton 1 min ago
@RubberDuck How about a compound one?
@DaveNewton This would not be on-topic for Code Review site. Please check the Help Center before recommending a question to another site to make sure it would be on-topic there. — Phrancis 1 min ago
I am not asking for code review, to suggest an answer I am just giving one suggestion, we can point out easily the change based on the code. — Krishna Kumar 1 min ago
16:48
in VBA, 19 mins ago, by sᴉɔuɐɹɥԀ
Today I learned about Turing completeness.

    Yes, that Tom. Did you know Tom likes the number 256?

    Yes, I mean that Discord. Discord did letters of
    "++++++++[>++++[>++>+++>+++>+<<<<-]>+>->+>>+[<]<-]>>.>>---.+++++++..+++.>.<<-.>.+++.------.--------.>+.>++.+++." .
    Yes, that Sweetie Belle. Today I found a book named Sweetie Belle, because she is the memory.

    Did you know Pinkie Pie likes the number one, because she is the memory pointer?
    Did you know Rarity likes Pinkie Pie, because she is the instruction pointer?
0
Q: Fizzbuzz - debugging this particular logic

thewildlingSource: http://programmers.stackexchange.com/questions/178567/i-failed-fizzbuzz-would-you-hire-me void FizzBuzz() { for(int i = 0; i <= 100; i++) { bool isThree = i % 3; bool isFive = i % 5; if (isThree) { print "Fizz\n"; } else if(isFive) { print "Buzz\n"; } else ...

0
Q: implementing a date validator using enum in java

Nilzone-First and second post on the same subject. This is such a great way to learn. Once again I'm open to suggestions. I have implemented almost all of the suggestions from before, which have resulted in the code looking like this: import java.util.Set; import java.util.HashSet; import java.util.Ar...

0
Q: Project Euler #6 in Ruby

Chris YeungQuestion: Difference between the Sum of squares from 1 to 100 and the square of sums of 1 to 100. Answer in Ruby: range.inject(:+) ** 2 - range.map{|x| x ** 2}.inject(:+) This one seems pretty straight forward but welcome any improvements to make it more elegant! Thanks

@CaptainObvious moar
sighs and runs off to get closer to a badge
@RubberDuck Nope, it is off topic.
sure is...
Would a compound star be a pin, or something?
16:53
lol. idk
I should write a meta post - rename "pin this message" to "apply compound star"
0
Q: Project Euler #7 in Ruby

Chris YeungQuestion: Find the 10001th prime number I answered it in Ruby: require 'prime' Prime.first(10001).last Hmm... A very useful class to calculate prime. I wonder if most programming language has this class to help with. What if we don't use the prime class. how do we calculate it. Probabl...

Not sure what to do, almost looks like asking for code to be written.
0
Q: Sequence processing problems

overexchangeProblem 1: Sum the even numbers for the first n fibonacci numbers Solution: def fib(k): """Compute kth fibonacci number. >>> fib(1) 0 >>> fib(2) 1 >>> fib(11) 55 """ def recursive_fib(prev, curr, k): if k - 1 == 0: return curr el...

It does have working code, though.
@RubberDuck I think if you can't pull off a simple FizzBuzz correctly on the fly in at least one programming language... You should probably consider a new profession...
@sᴉɔuɐɹɥԀ I don't think that's fair at all.
Once, maybe twice in the last 5 years have I needed to understand how to use the modulus opererator.
16:59
Well, fair enough. There certainly are much more important things than knowing how to do FizzBuzz, I'll admit to confirmation bias on my part.

« first day (699 days earlier)      last day (3617 days later) »