« first day (930 days earlier)      last day (3090 days later) » 

12:00 AM
RELOAD! There are 1622 unanswered questions (94.3864% answered)
 
12:12 AM
So here's one thing I would really like to be able to do, if any C# people are around...
I'd like to make a function or something like that where it can be called from within Management Studio in SQL code, and does actual RegEx. Is that possible?
 
Zak
12:25 AM
@Duga Oh, yeah, DST ended, it's back to midnight now
 
This might be in the right direction
no experience with that myself though
0
A: How to call C# function in stored procedure

JeffreyTake a look this TSQL example USE [XXX] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF GO CREATE PROCEDURE [dbo].[Testing_XXX] @broadcastId [int], @XXXTemplateHtml [nvarchar](max), @XXXTemplateText [nvarchar](max), @XXXTemplateSubject [nvarchar](max), @XXXTemplateEmailHeaders [nvarchar](max...

 
@JeroenVannevel Ah nice! Didn't even know that was a thing
 
Note that that is a really old article
Talking about an even older software package
but you can look for the feature in a recent release
 
12:41 AM
Gotcha, I did notice he was talking about SQL 2005 so I figured
 
In the following code:
if (winChance < .5)
is .5 a magic number?
 
@NathanMerrill Probably... what's the context?
 
a function that is determining whether to take an action or not
 
Assuming it represents 50%? Also, what language?
 
correct, Python
 
FIFTY_PERCENT = 0.5
if (winChance < FIFTY_PERCENT):
    #do something
So yes, I'd say it's a magic number, and would be better served using a constant :)
 
Zak
reminds me of some of the global constants I have in my standard module these days
Such as HYPHEN = " - "
Anyway, 'night
 
@Phrancis no
no no
That variable does not give any new information
it's redundant
it can by definition only have one value: .5. Otherwise the name wouldn't make sense
A good name would be chancePercentage or whatever is the context
 
^^
Jeroen Is Right (tm)
 
But I'd just keep it as .5 with a comment that explains why you're doing this in the first place
Not every literal should be turned into a variable
 
1:01 AM
Incoming newb Java question [from me]
 
Until that .5 starts repeating all over the place
 
Having to look up a value that's defined elsewhere is annoying
yes, until you start repeating of course
 
Having to change a value in 50 different places is more annoying
 
You should change it the second time you use it though
 
@JeroenVannevel Wait... am I being informed just now that it's better to name a variable after what it represents, than after what it is?
 
1:03 AM
Lazy evaluation, but for code writing.
@Phrancis That's a good way to put it. The value is represented by the value of the variable. It's the same reason why you write var name = 'josh' and not var josh = 'josh'
 
Maybe (likely) I'm just being pedantic, but to me it just makes more sense to name a var according to what its value actually is...
float FIFTY_PERCENT = 0.5;
float HALF_OF_ONE = 0.5;
 
What benefit does that offer over just using .5?
 
They're the same but can mean different things, depending on the context
Maybe a more concrete example, that I see day in, day out (and get annoyed by)
DECLARE @VendorId INT = 42; -- "Acme Vending Company"
I'd write, DECLARE @ACME_VENDING_COMPANY INT = 42;
 
The difference here is that you can change the VendorId variable and it would still make sense
You also know that the variable holds a single ID
In your second option, you don't know what kind of data is held by the variable
is it the name? An object composed of fields?
 
Ah... so the name could be lying to you eh?
 
1:09 AM
You also can never re-assign that variable because what would happen if I do ACME_VENDING_COMPANY = 666?
 
Hm, that would break everything
 
0
Q: PatternMatcher class

PhrancisI thought of writing a utility class where I can implement patterns that are useful for day-to-day parsing of strings, without having to to import java.util.regex everywhere. So I wrote this simple class as a model. Right now I only added two patterns, with the intention of adding more as the n...

 
A variable's name describes a property of something. A variable's value describes the actual value that property holds
"Acme_vending_company" is not a property
"ID" is a property of a company
 
Hmm, something to put in the bank from now, I guess!
 
I'm voting to close this question as off-topic because recommendations about coding style belong on codereview.stackexchange.com. — Barmar 29 secs ago
 
1:12 AM
And for things like var count when looping, you could say that they are properties of the state machine you're creating. But that's getting too pedantic.
Time for bed now. Long day with a dinner date at the local turk makes a man sleepy
Did I mention I had a dinner date?
 
Good for you man
 
There was a dinner date.
Yeah I'm quite pleased
 
Did you also make sure to mention you had a dinner date? It wasn't immediately clear...
 
Talk to you later!
No, it was a dinner date. I almost forgot
 
Later
 
1:24 AM
And, I'm a victim of copy-paste coding again :|
 
possible answer invalidation by Phrancis on question by Phrancis: codereview.stackexchange.com/posts/111264/revisions
 
yea yea I know
I rolled back my edit
didn't realize someone had already answered
 
1:40 AM
0
Q: optimize longest substring with at most 2 distinct characters

LiondancerI think I solved the following problem. However, I was wondering if there was a faster or more efficient way to solve this. I believe the the runtime is O(n) and space is O(1) (O(256) assuming ASCII) # Longest substring with at most 2 distinct characters # # Given a string S, find the length o...

 
@RubberDuck @Mast It's winter in the embedded room.
 
@Mat'sMug Do you have a git hug account?
@Mat'sMug Please go and decode the message here: codereview.stackexchange.com/q/111268/507
 
2:00 AM
@elonmusk http://codereview.stackexchange.com/users/27623/syb0rg
Whoa, that worked!
I wonder if the big man himself will see it
 
1
Q: Encrypt message for sending over non secure network

Loki AstariRecently needed to swap keys with a colleague on the other side of the country. This script encrypts a file using the other persons public key that is stored on github. It outputs a script that will re-generate the original message (if you have the private key). #!/bin/bash # # Usage: # ./crypt

 
2:18 AM
@LokiAstari yeah I like to git hugs
lol
Hey that's me!
 
@Mat'sMug So did the message de-code?
 
AFK/phone, gimme a few minutes ;-)
 
Man. I just saw you have three public keys. I wonder if it worked.
 
must be codereview org, rubberduck org and my own account
 
2:36 AM
What shenanigans are you all getting up to?
 
@rolfl just breaking things as usual
TIL about static also
 
Unfortunately, unless you have a particular problem you're trying to solve, I don't think this question is appropriate for this site. If you do want help making your program better, the Code Review stack exchange does that sort of thing. — cantido 48 secs ago
I'm voting to close this question as off-topic because it's a code review question and there's no clear problem. — Szymon 38 secs ago
 
2:51 AM
@LokiAstari I thought bash was a linux thing?
 
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancis 58 secs ago
 
0
Q: Solving Robot Paths with Pascal's Triangle

devdropper87I wanted to take on the challenge of the classic Robot Path's problem but solve it using Pascal's triangle. The approach was generate pascal's triangle, then grab the middle element from the row. I saw the following pattern: //where combos are on pascal's triangle: // 1x1 grid on the 1st line ===>

 
@Mat'sMug Nope. Its available everywhere. But the output simply requires a command line (as long as you have bas64 and openssl installed).
 
3:06 AM
got none of that :/
you're making me work! ;-)
 
@Mat'sMug Then I failed. It was supposed to be trivial send messages to any developer (that had a github account).
 
0
Q: Game in Pythonista App

JamerackI've written this Wack-a-mole like game on my iPad in the app Pythonista. Keeping that in mind, it uses a different graphic interface from the one I have usually seen used, Tkinter. I'm a beginner and this is my first major project, so any tips on how to code more efficiently and improve this pro...

 
when I declare functions with type hinting (and often default parameters), I am ending up with really long function definitions (despite having only a few parameters).
I can't find any definitive way to style my parameters, but I'm curious if you guys know of anything in PEP
(or other commonly used techniques)
def select(self,
           choices: List[Union[GameObject, str]],
           min_choices: int,
           max_choices: int,
           game_state: GameState,
           current_action: int):
^ what I typically do
 
@NathanMerrill This chat room is probably not the best resource for something like this
 
do you know of a better place?
 
3:19 AM
Stack Overflow comes to mind
 
really? I thought they didn't deal with style-related questionss
 
Depending on how high-level the question is, it could also be good for Programmers, but they mostly only handle very high-level, no-code questions
 
ah, apparently, there's a
 
It really depends on how you phrase the question
 
ok, thank you
 
3:22 AM
np
 
@200_success I don't know! I might get a 0 and have to defend the work or something.. waiting to see lol
 
You should probably be able to prove that the others plagiarized from you.
 
4:19 AM
If you can get your code into a working state you might get a lot of good advice by posting it on codereview.stackexchange.com. Honestly I see a huge problem here with the sheer number of variables you have. You really should look for a way to use lists here as opposed to a whole heap of individual variables for each cell of the table. — shuttle87 38 secs ago
 
4:40 AM
@Barmar - I am not aware of separate link for code review. I have posted same question there. — sri 49 secs ago
 
0
Q: How to Implement Multi tenancy Database(mysql) with spring boot

Kumarour application structure is multi-tenant with database. each customer has their own database. i have store all tenant information in separate database. when user request api i need connect specific database. how to implement in spring boot. i am using mysql database. Now my api ready with single...

0
Q: Submitting FORM after validations using jQuery

sriThis is my simple jQuery form validation/submit logic and it is working perfectly fine. But still I am posting this to see if someone check the logic and suggest me if there is any other simple way to get the same results. More, in my form I put all input boxes and select into .valid1 class, all...

 
5:09 AM
0
Q: C++ Video Game Beginning

Version TewHere is our C++ Video Game Beginning/Character Creation, give us feedback, ideas, and suggestions.` //Seasons Divided #include <iostream> #include <string> #include <iomanip> #include <stdlib.h> using namespace std; void LegalStuff(); void CompanyIntro(); void TitleScreen(); void intro(); int G...

 
5:33 AM
0
Q: Making John Conway's Game of life in java. Unsure why it's not working properly

AuvanginkPlease help me find my mistakes. public static void main(String[] args) { int[][] grid = new int[10][10]; int i, j, steps; boolean loop = true; Scanner Input = new Scanner(System.in); //prompt user for info System.out.print("Please enter a list of (i, j) pairs for popu...

 
Monking
@CaptainObvious broken
 
6:06 AM
@Heslacher Is there a more appropriate forum for it then? — David Pilkington 3 mins ago
 
@200_success Yeah that's what I'm thinking. Going to the prof on Monday :3
 
-2
Q: Variable naming in lambda expressions

David PilkingtonI am busy rewriting a large section of code that has multiple lambda expressions in that vary in complexity. My question is regarding the naming of the parameters in these expressions. We often see MyList.Select (x => SomeConverter.Convert(x)); as one of the more simple options. Now my quest...

 
6:21 AM
Where would you guys suggest finding programming project ideas? :P
Google is surprisingly empty
 
What kind of project do you have in mind?
 
0
Q: This DbGeography search query is taking too long

Dawood AwanI have a situation in which I need to get the Closest road to a DbGeography Point. This takes 5 - 8 seconds to run in some cases. I have a Spatial_Index on the Column and I re-organised it, so it is not fragmented. This Query is quite heavy, sometimes the CPU usage raises to 100% because of ...

 
@200_success I just want something to work on since I no longer have any assignments left in my C programming course. It's hard for me to just think up something I guess
 
May I suggest searching for [c] [beginner] is:question and seeing if anything interests you?
Hangman?
 
6:46 AM
Ah, nice. Yeah I'll look through those :D
 
7:00 AM
possible answer invalidation by Dawood Awan on question by Dawood Awan: codereview.stackexchange.com/posts/111282/revisions
 
^^
 
@Duga thats ok
 
@Heslacher You aren't supposed to edit typos. I did and @200_success rolled it back, same thing applies with that edit, no?
 
As I have removed that part of my answer it doesn't invalidate any answers. I have thought that it had been a type while I wrote the answer.
type -> typo ;-)
 
7:16 AM
 
0
Q: Adding text after format spec in Python

PaulI've got a program here which asks for initial ball bounce index (initial height divided by how far the ball bounces back up) and tells you the distance traveled from the first drop, until the ball is inert. def main(): init_height = eval(input("Enter initial ball height: ")) while ini...

 
Maybe this can help — MadProgrammer 37 secs ago
 
7:59 AM
Since you aren't having a problem, codereview.stackexchange.com might be a better fit. — Drazisil 33 secs ago
 
Zak
Monking
 
monking Zak
 
@BilltheLizard: please use the standard options for this. Too Broad is just fine here. See A guide to Code Review for Stack Overflow usersMartijn Pieters ♦ 16 secs ago
 
0
Q: Removing duplicates from multiple arrays at once

Alex BykovThis (working) code is supposed to return a new array that consits of elements of both arrays that were not marked as duplicates (find duplicates in both arrys, remove such elements from both arrays and create an array from the leftovers, if any) Is there a way to simplify this function? functi...

 
@tripleee: please use the standard close reasons for this; 'because code reviews are not welcome' is not a valid close reason. See A guide to Code Review for Stack Overflow usersMartijn Pieters ♦ 53 secs ago
possible answer invalidation by Oscar Guillamon on question by Oscar Guillamon: codereview.stackexchange.com/posts/111178/revisions
 
8:17 AM
@Duga rolled back
 
0
Q: Script to determine the outcome(s) of any number of dice rolls

Ricky WilsonI think this code has far to many if else clauses and not enough abstraction via functions. I would like to break the code down into a series of small functions, or methods if i decide to go OOP, but I'm not sure of the best way to do so. If you brilliant Pythonista's could guide me in the write ...

 
hi, trying my hand at the Codility tests/lessons and I've got a question...
I've written a function for one of the tests. it passes 100% but the evaluation says that the time-complexity is O(n) or O(n * log(n)) but I don't see how it is the latter...
// Write a function that, given a zero-indexed array A, returns 1 if array A is a permutation and 0 if it is not.
int solution02_02(vector<int> &A) {
	size_t size = A.size();
	vector<bool> found = vector<bool>(size, false);
	size_t N = 0;

	for (size_t i = 0; i < size; i++) {
		size_t val = A[i]-1;
		if (val >= size) return 0; // beyond length
		if (found[val] == true) return 0; // duplicate
		found[val] = true;
		N++;
	}

	return (N == size) ? 1 : 0;
}
why is that possibly O(n * log(n))?
 
8:59 AM
The limitation is there so we don't have to go through 10000 lines of css. Paste here only the relevant parts of your code - we're not supposed to go through a code review of your full css file. — vard 42 secs ago
possible answer invalidation by Tushar on question by Alex Bykov: codereview.stackexchange.com/posts/111290/revisions
 
@SirPython Yea, it's what happens if we don't use it.
 
9:39 AM
Does it work for you? If it does not, then please post particular case when it does not work. Otherwise, you might want to post it at codereview stackexchangePetr 29 secs ago
 
@LokiAstari Why exactly should I read that? I am no Python expert...
 
@SimonForsberg You'll know after you've read it.
 
oh... hmm...
I'm at work now, can take a look later tonight, or tomorrow, to see if it works.
 
Besides, it's Python, everyone can read Python
 
Should I just execute ./bin/crypt Zomis T or what should I do exactly?
 
9:50 AM
It's already encrypted, I doubt encrypting it again will decrypt it.
2
 
Well I don't understand what I should execute to verify anything, or maybe I haven't read it enough. Kinda busy at work.
 
Besides, you probably need to input your private key somewhere.
 
Just tell me what to do and I'll do it.
2
 
0
Q: Distill function to 5 lines of code

Mawuli Adzoefunction uniques(array) { var result = [], val, ridx; outer: for (var i = 0, length = array.length; i < length; i++) { val = array[i]; ridx = result.length; while (ridx--) { if (val === result[ridx]) continue outer; } result.push(val);...

0
Q: Arithmetic Expression Infix to Postfix to Answer

G_ManI'm aware that there's already stuff here regarding this but I'm just posting to check if my logic lines up with my code (if I'm thinking about this whole infix Postfix thing the way I should be). The code I've seen regarding this topic on this site look a little different from mine. I'm kind of...

 
possible answer invalidation by Mawuli Adzoe on question by Mawuli Adzoe: codereview.stackexchange.com/posts/111302/revisions
@Petr Had to "undelete" this question because "codereview" wants me to put it here. — G_Man 56 secs ago
 
10:06 AM
0
Q: How to simplify simple foreach adding to list

John MathildaI am having a simple foreach where I add objects to list: List<SoonestDrawDateModel> soonestDrawDateModel = new List<SoonestDrawDateModel>(); foreach (var item in drawDates) { SoonestDrawDateModel sdModel = new SoonestDrawDateModel(); sdModel.DrawDay = item; ...

 
Ok, now I see you say that "it's not working as it should". Note than the first part of my comment: it it does not work as it should, then just post a particular case when it does not work. I suggested codereview only if the code does work for you. — Petr 19 secs ago
 
Zak
@Duga Doesn't look like any code was actually edited?
 
@Petr Oh, sorry about that. My question's off codereview now. — G_Man 24 secs ago
 
Zak
I hadn't realised @Duga had an Anti-Freeze function :)
 
@Zak Formatting, a bit. Not a problem in this case.
 
10:40 AM
possible answer invalidation by Simon Shine on question by Simon Shine: codereview.stackexchange.com/posts/111210/revisions
 
Zak
@Duga 'tis fine
 
@Zak You mean this?
in The CRonicles, 11 hours ago, by Duga
Anti-freeze
Nothing different about that really and this:
Nov 1 at 0:00, by Duga
RELOAD!
It's just a scheduled task with a cron trigger, that's all.
 
0
Q: Select() server implementation

bumblebeezMy task was to write a server class, which uses select(), for a student projet. It was working, but i'm now willing to improve it a lot, and be able to use it in other personnal projects, so any critique and improvement idea is welcomed ! Here is the main.cpp : // example packet typedef str...

 
Monking all
 
10:57 AM
sounds like something for codereview.stackexchange.com — CyberSpock 51 secs ago
 
0
Q: Python. How to speed up my script?

user3328469I am looking for the way to speed up my script. It is working fine, I mean, the final output is as required, but it is clunky and really slow. It is slow because of the double 'for..in..' loops, I know. So, how to make it smoother a bit? What my script do: - it is updating existing feature classe...

 
11:19 AM
0
Q: Regex for finding a date string seems convoluted. Better solution?

Jonathan BrooksMy regex takes the form of the following: /(\w{3}, \d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2} GMT)/ And it matches all date strings with the format: Thu, 19 Nov 2015 17:57:44 GMT But it seems very convoluted. Is there a better / more concise regex for achieving this? Thanks in advance!

0
Q: json response best practice

Mina FawzyI work as android developer we work in application selling vouchers we have some api , one of them to check if voucher is valid or not second to validate this voucher here is my situation , I ask web developer to make both response the same when I check and validate voucher. second I ask hi...

 
How can it be sunny in 5 trillion years when the sun blew up after 5 billion years?
I don't think this is real science
 
@JeroenVannevel I think the first tile is t = 0
 
Oh, and then the left-hand side is the time between each step?
I thought the step was 1 day and the left-hand side set t as a baseline
 
11:35 AM
First tile is t = 0, next tile is t = n*timestep
 
Yeah, I wonde rhow long he sits there thinking about units, before posting. Today happens to be sunny and 4C ... which is close enough to 38C, but really, who cares about those temperatures.... it's the -452 that irritates me.... is that zero-K or warmer?
 
Zak
Considering there's -453, I assume it's not quite zero-K
 
Just had to look it up, it's 4.2611 kelvin
 
-453 = 3.7K
Which is probably as cold as it gets before the entire universe goes extinct
 
@DickieBoy seriously..... no. Code Review reviews code.... where's the code here? — rolfl 15 secs ago
 
Zak
11:44 AM
@Duga How, exactly can you think that is appropriate for CR
 
After posting
Surely you have been around long enough to know thats not how stackoverflow works. — DickieBoy 10 mins ago
 
Firstly... read my first comment, then read the comment in reply, the solution has been achieved, but @Vamsi wants a more effecient way. Which is why I gave the codereview SE. — DickieBoy 28 secs ago
 
0
Q: Why Codility Tape Equilibrium solution with writes to stdout gets O(N * N) and O(n) without

Marian PaździochI've taken the Codility Tape Equilibrium (like here) and I've put my code with writes to stdout: import java.util.Arrays; class Solution { public int solution(int[] A) { System.out.println("A " + Arrays.toString(A)); long minDiff = Integer.MAX_VALUE; long[] leftSum...

 
Stop piling up on that question
> I have tried and can achieve the solution with the conventional map, split and select method combinations.
That's what he's referring to
 
12:00 PM
Monking
 
Zak
Woo I'm writing Regex
 
Woo I'm doing Physics homework to get my CS degree
 
possible answer invalidation by Stan on question by Stan: codereview.stackexchange.com/posts/111201/revisions
 
@Duga It's not necessary to add what he did, but it isn't invalidating anything.
 
Zak
@JeroenVannevel I know that's what he's referring to. But he simply points the OP our way with a question which (as written) is completely inappropriate
 
12:10 PM
A reasonable person would alter his question to include his own code after that exchange.
 
@Zak Your comment on the question was not constructive though.
@JeroenVannevel You still expect the world to be filled with reasonable persons?
 
I like to think they're in the majority
 
Interesting article for the ones interested: wired.com/2015/11/fallout-4-bugs
It's about how using relatively small AAA-teams is better than massive teams
 
In grammar, a tautology (from Greek tauto, "the same" and logos, "word/idea") is an unnecessary repetition of meaning, using more than one word effectively to say the same thing (often originally from different languages). It is considered a fault of style and was defined by A Dictionary of Modern English Usage (Fowler) as "saying the same thing twice", when it is not apparently necessary to repeat the entire meaning of a phrase. "Fatal murder" is an example of a tautology. If a part of the meaning is repeated in such a way that it appears as unintentional, or clumsy, then it may be described as...
#GrammarMatters
You're a fault of style
 
I am the style
 
12:16 PM
They're getting a little clingy
 
> # GrammarMatters
> You're a fault of style

What
 
> It is considered a fault of style (..)
 
Ah, I didn't read the blurb.
 
@DanPantry hey there handsome
Imma need you over here for a moment
 
Huh. Is JSON considered on topic? Someone's just asking about JSON display style, wondering if a sample follows best practices.
 
12:20 PM
I've got a function that returns its value through a callback but I need to use that value inside my string.replace() call. If it's asynchronous the replacement happens with value 'undefined' because the callback hasn't finished yet. How do I wait for that callback?
 
@SuperBiasedMan Not always.
Link?
 
0
Q: json response best practice

Mina FawzyI work as android developer in application selling vouchers. We have some APIs and one of them checks if a voucher is valid or not and another to validate this voucher. I asked a web developer to make the responses from both functions the same. I also asked him to make json easier to read, and h...

 
0
Q: Clojure. merge sort

Roman MakhlinI made my own realization of merge sort and I have two questions: Is this code correct implementation of Merge sort algorithm Is there a way to make this code better. (defn rsort[a] (cond (<= (count a) 1) a :else (let [half (/ (count a) 2) [lh rh] (split-at half ...

 
You should ask this on [codereview](codereview.stackexchange.com) ;) — dingo_d just now
 
@SuperBiasedMan Off-topic IMO
 
12:24 PM
It's borderline in two ways, because it's someone else's JSON format that they have to use for an app. So not actually their own code. But even at that what in particular is it closeable for?
Yeah, in effect they just want to ask about best JSON practices to check that the web dev is correct.
 
> Note that the API is entire asynchronous. To get data back from the server, you'll need to use a callback. The return value from most of the API is a backpressure indicator.
A what?
 
thank you for answer , I know this , but there are structure of json , that I want you to review and advise my web developer to make changes — Mina Fawzy 2 mins ago
The profile of that user is hilarious.
This Mina I am working as Android & iOS developer for more than two years , I love help people , challenge myself

fell free to contact me at:
His grammar is a bit iffy for someone who likes to challenge himself.
@SuperBiasedMan One more VTC
 
Yeah I was #4
Might be a she I think. To be fair, English is a challenge for non-natives who don't learn it growing up... but that doesn't stop engrish being funny.
 
On the internet, I don't give a rat's ass about sex.
He, She, who knows?
Some people don't even know it themselves what sex they are, so I stopped bothering and just started calling everyone he.
 
Sure, but that's why I use they instead of he.
 
12:34 PM
On the internet, that is.
 
Haha, would be a bit different doing that in real life.
 
According to my English teacher, they indicates plural. Not somebody with undefined sex.
 
It's both, third person plural and third person singular of unspecified sex.
 
@JeroenVannevel good time for me to wake up, huh?
 
Wake up? Only just now?
 
12:37 PM
I have a day off.
 
Obviously not a hard working individual like me
 
"I can't do my job.. Dan.. where are you?"
"hard working"
pick one ;-)
 
I arrived in the office at 11:30 -- I've sort of got a day off
Hey listen up punk
this is because of JAVASCRIPT
 
lol
what do you need help with
 
Javascript needs to revise its threading model
can you do that for me?
 
12:38 PM
if you need threads in javascript you're doing it wrong.
 
I want less threads
 
0
Q: how to input decimal number and calculate it ? (Calculator)

Cruserimport java.awt.BorderLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JTextArea; /* public class Panel extends JPanel implements Actio...

 
Are you asking him to rewrite Javascript to do threading better?
 
javascript only has the main event loop
 
let me find that love room again
@SuperBiasedMan that would be ideal, yes
 
12:38 PM
btw, there are things like fibers which are lightweight threads.
there's a package on npm for that.
 
nonoononono I want less threads
 
called fibers, funnily enough.
okay :P
 
I want callbacks to become good old synchronous shizzle
 
we could dicscuss this in

 Web Development

Everything Web
seeing as that room is dying
 
Outside of my safe space?
Fine then
Pizza arriving in 15 minutes, let's do this
 
12:41 PM
Come on people, one more VTC on this question?
-1
Q: json response best practice

Mina FawzyI work as android developer in application selling vouchers. We have some APIs and one of them checks if a voucher is valid or not and another to validate this voucher. I asked a web developer to make the responses from both functions the same. I also asked him to make json easier to read, and h...

 
@Mast closed
 
12:53 PM
LOL. I think I coined a new term: Now we could call fucktions to functions that not pass on Code Reviews and should be refactored. Not that I have ever read the std::find_end implementation and thought it would be classified as a fucktion. I will not change the spelling on my post just to not make this comment out-of-date. Thanks for the observation. — sergiol 48 secs ago
 
Zak
1:09 PM
I was learning regex, and now my head hurts
 
Greetings, Programs.
@Zak It helps when you learn it as part of a Formal Languages class.
 
I just had to explain javascript generators again and my head hurts..
It would be nice to just explain it as "it does this thing, its black magic, I don't know how"
2
 
Zak
1:39 PM
Just read some stuff on it. They're basically a loop factory?
 
@Zak they're a way of expressing asynchronous or infinite sequences.
The upshot is you can also write semi-synchronous-looking asynchronous code with them if you're only interested in the return value of each generator.
function getLastValueForBeId(customer, beId) {
  return getKeyLastValueForBeID(customer, beId)
    .then(function(keyLastValue) {
      if (!client.ready) {
        return null
      }

      return client.get(keyLastValue)
    })
}
function* getLastValueForBeId(customer, beId) {
  const lastKeyValue = yield getKeyLastValueForBeID(customer, beId)
  if (!client.ready) {
    return null
  }
  return yield client.get(keyLastValue)
}
First one is standard, second one uses generators.
You need a third party library for the second example to work properly as generators don't usually wait for promises, but a 3rd party library can be added to fix that and you essentially end up with async/await.
 
Zak
I understood none of that :)
 
lol
basically its a way of writing sequences that are infinite.
but if you only care about the last value that sequence has, then you can use it to write synchronous-looking asynchronous code.
 
I think this Questions belongs to the progammers stack exchange, since it's about code review instead of an programming problem — KhorneHoly 31 secs ago
 
Zak
1:59 PM
@Duga Who wants to bet it gets closed on SO and PG before being redirected here and making it 3 for 3?
 
0
Q: Tape Equilibrium O(n)

Marian PaździochProblem (Tape Equilibrium): A non-empty zero-indexed array A consisting of N integers is given. Array A represents numbers on a tape. Any integer P, such that 0 < P < N, splits this tape into two non−empty parts: A[0], A[1], ..., A[P − 1] and A[P], A[P + 1], ..., A[N − 1]. The d...

 
For curiousities sake you could better post this question on Codereview SE. — kayess 11 secs ago
 
Mornkinhg
 
2:15 PM
@EthanBierlein typos all oevr the palce
 
Zak
@skiwi Pot. Kettle.
 
@skiwi llo I konw rihgt
 
Is it appropriate to do a LINQ ForEach inside another LINQ ForEach?
 
@EBrown o(n^2) eh?
 
Not really, more like O(nm)
Because one ForEach is from one List, the other ForEach another.
 
2:23 PM
It would appear that someone is trying to break into my Facebook account
 
possible answer invalidation by Roman Makhlin on question by Roman Makhlin: codereview.stackexchange.com/posts/111320/revisions
 
annnnd changed my passwords to randomised ones. thanks keepass. <3
 
@Duga rolled back
 
0
Q: Blinking Console Start Menu

RubixHello Butthoarders, I figured out that code I was trying to get help on, but was rudely denied assistance and I present it for your all-mighty review! gotoxy() - allows you to place the blinking text wherever you want. I wasn't able to get it to behave the way I wanted, so you will notice I had ...

 
Review/refactoring requests are offtopic here. Go to CodeReview. — hindmost 46 secs ago
 
3:18 PM
There's some creative insulting at the start of this post
(don't bother editing/commenting. I've flagged it)
 
Zak
@SuperBiasedMan And yet they still persist
 
Pretty sure they're trolling at this point.
 
Zak
I was pretty sure the moment I saw the old title
They edited it again
 
Yeah, I'll leave it in Jamal's hands now.
 
Zak
Always useful to find a source of validated flags though
@Mat'sMug seems to have it in hand
 
3:32 PM
-2
Q: Blinking Console Start Menu

Rubixgotoxy() - allows you to place the blinking text wherever you want. I wasn't able to get it to behave the way I wanted, so you will notice I had to insert a bunch of spaces in the cout portion of the blink function. Obviously this could be refined. blink() - I put a "/r" to set the cursor back t...

Good riddance
Oh, that comment was removed
Careful to avoid feeding the troll here
 
Yeah they seem pretty hungry
 
Zak
I've already done everything I plan to there.
 
Unless such humour goes against site policy. — Mast 10 secs ago
Just rolled back a troll edit from OP. If he edits one more time in similar fashion I'll request a lock.
@Mast Good lord! I had no idea I was so out of line. Forgive me my trespasses. As you see, I have edited out any fluff and will stick to a strict format of serious and relevant commentary on the provided code. — Rubix 24 secs ago
 
I wonder what the actual beef was.
 
3:50 PM
Jamal locked it down.
So, do we need a meta post about this question or are we all clear on what happened?
 
We're clear. I'm handling things now.
 
Zak
@Mast It's pretty unambiguous
I'm guessing from the initial post that the OP has had that question closed here before, when it was still broken in some way.
 

« first day (930 days earlier)      last day (3090 days later) »