« first day (1789 days earlier)      last day (2233 days later) » 

12:00 AM
RELOAD! There are 5189 unanswered questions (90.0040% answered)
 
12:19 AM
0
Q: Bootstrap 4 multi row navbar with big branding

JeremyI'm an asp.net web forms app using, for the first time, Bootstrap 4 as a responsive design framework. I've built a 2 row header navigation with big branding on the left, where the branding spans both rows. Note, I haven't decided on menu placement, which is why you see menus on both left and ri...

 
12:44 AM
Working code that you are concerned with performance or style should go on code review, not stack overflow. — Ron Beyer 36 secs ago
 
Computer ordered! Estimated ship date is April 11.
 
@Hosch250 Nice! What did you order?
 
There is a lot of // ... Do stuff... indicating this is missing a lot of code which would make it off-topic for Code Review (unless/until the missing code is added). See What topics can I ask about? for reference. — Phrancis 31 secs ago
 
HP 17" with 16GB RAM, 7200 RPM 1TB HDD and 128 GB SSD. Plus a 23.8" monitor.
Totaled about 1.4k, which I think it's really good. (Student discount in there.)
s/it's/is
Phone is nice, but a pain to type on. Thank goodness it has a Swype keyboard.
And it even has a sort of up arrow that works to edit messages :)
I have a brilliant idea.
At work, they have a logging system on our computers, right? I should find one of those websites that converts QWERTY text to DVORAK output. So everything looks like gibberish if they really look at it.
Of course it would be really easy to crack, but I wonder if they'd bother. On the other hand, it might make them suspicious.
 
1:02 AM
lol
Whew, finally mostly caught up with tickets, now I can chill a bit and more on userscript again
 
Nice.
Did you ever look at the Katalon browser addon that uses Selenium?
 
1:24 AM
We've installed one of the userscripts for all workers on my team and I've had feedback that it makes their lives a lot easier
@Hosch250 I did, doesn't seem to fit as well though, Tampermonkey does a nice job
I like that it lets me modify the page too, as in add menus and stuff, I'll be using that for templating eventually
 
Cool.
Yeah, Selenium seems to work best just querying the page and clicking things and filling out forms. Not building a web page on top of another.
I'm tempted to say who I support in the election, but I don't want to discourage anyone else, so you won't know at least until after the results are in.
I wonder what they do if they get a tie for last place.
Probably just pick one.
And they've probably not had it yet.
 
I think they have some complicated voting system for elections
 
1:39 AM
Meek STV.
 
e.g. if your first pick is eliminated then they use your 2nd pick as your vote instead, something like that?
 
Think it has the potential to have ties, but unlikely.
Yeah.
I can't prove it though, either way.
Wonder when the Roslyn team will get back to me. I don't like waiting :(
(Thinking of algorithms.…)
So, anything interesting in your life?
Other than CardShifter and userscripts, that is.
 
Not a whole lot, been playing Monster Hunter World off and on, and working on re-watching Mr. Robot
Been spending most of my non-work hours learning/coding/on CR
 
You really should learn a backend language sometime. It's so much more powerful and rewarding. Difficult in a nice way too.
Because you don't end up solving the same problem a million times.
I.e. Why some text doesn't sort right or why a comparison is wrong.
So you can work on new problems.
 
1:55 AM
@Arash : this is not a matter of good or bad practices - using these definitions breaks the format of the language and IMHO is a 'crime against humanity' - ie. will not pass a code review. — Rann Lifshitz 18 secs ago
 
LOL @Duga!
See you tomorrow.
 
2:23 AM
-1
Q: check if two timestamps are on either side of each 5-minute boundary in an hour

STNI have two datetime objects, x, and y. x.minute or y.minute gives the minute of the hour, such as 15, and x.hour or y.hour gives the hour of the day, such as 2 or 14 (24-hour clock). The following if-statement works, but it's terribly verbose. I would like to more concise way to implement the sam...

 
2:58 AM
0
Q: Fastest way to Determine if C-Style String is Alphabetic

esoteI'm looking for the fastest way to determine if a C-style string contains only alphabetic characters. For this question, there are a few assumptions: strlen(c) > 0 Strings are null-terminated Continuous character encoding from a-z and A-Z is not guaranteed, but likely. Here is my attempt: #...

 
3:15 AM
0
Q: C++ Poll Socket Handling

Kyu96So I created a C++ socket handler using poll and events. The creation of the listening socket and binding is already handled in another method. I'd like to get feedback to the socketLoop() method, if there are any bad habits, unhandled exceptions, bugs or anything else I can improve. I appreciate...

 
3:32 AM
0
Q: Dutch partition

saneGuyDutch Partition problem. Partition the given array using the pivotIndex into groups with elements smaller than the pivot, equal to pivot and larger than the pivot. public static void partition(int[] inputArray, int pivotIndex){ int smaller = 0, equal = 0, larger = inputArray.length-1; in...

 
3:51 AM
0
Q: Processing game user movement

devolitzThis code is a cycle method. It gets ran every 500 milliseconds to process the movement for users in the game. I've been told that it's been poorly coded and could use some optimizations but they didn't really go into detail. I'm asking if anyone could leave any suggestions on how I can get this ...

 
4:04 AM
Monking
 
4:25 AM
Monking
 
0
Q: A Basic Thread Pool for modern C++

Francis CuglerI've noticed that this has been done several times already, but I have come across a particular implementation that can be found from this YouTube Video. Before I came across this video for working with multithreading tasks; I had dove into one of my older projects that were from the era of MS...

 
 
1 hour later…
5:28 AM
Follow this Site,Hopefully you'll solve your problem : codereview.stackexchange.com/questions/119144/…Maijied Hasan Shuvo 32 secs ago
 
5:55 AM
0
Q: Compare two lists to see if one is a rotation of the other 2

Anonymous3.1415Second attempt to solve this rotation problem, implemented a double ended queue as was suggested in a comment of my first attempt. So did I finally do the problem some justice or is there perhaps a better solution? Also anything I can and should clean up? I wanted to thank everyone from my previo...

 
your code has several bugs For example sizeof(addend) / sizeof(addend[0]) will not work, addend has already decayed to a pointer. getChar and operator[] are inconsistent (shouldn't they be equivalent?). operator = leaks memory. When you are done, you might want to submit it to codereviewWorldSEnder 34 secs ago
 
6:25 AM
What have you tried so far. Maybe you could use reflection? Maybe something similar to codereview.stackexchange.com/questions/159881/…JKerny 54 secs ago
 
6:45 AM
@CaptainObvious Some god-method in there
 
Monking
 
possible answer invalidation by Developer11 on question by Developer11: codereview.stackexchange.com/posts/190621/revisions
 
@Duga rolled back
 
@skiwi type Instruction = String doesn't really introduce new types :P
 
Monking :)
 
7:31 AM
phrancis.isTired ? console.log("TTGTB") : console.log("Monking!");
TTGTB
 
0
Q: Make class more testable/injectable

user1472672I have a simple class which currently has some code in the constructor which makes it difficult to ingect and also test. public class FitsParser implements Parser { private Header header; /** * Constructor from a FITS File object and a HDU position. * * @param file The FITS file object from...

0
Q: multidimensional array swapping

An studentI have a multidimensional numpy array "a" from which I select a row randomly. Then perform swapping operation using randomly seleted row with other rows. Given the following array a = np.array([[1,2,3,4,5,6],[50,51,52,40,20,30],[60,71,82,90,45,35]]) Suppose if third row i.e. [60,71,82,90,45,...

 
7:53 AM
wrong place. you should post this question at codereview.stackexchange.comnozzleman 39 secs ago
 
8:17 AM
0
Q: fourth order Poisson equation iterative solver

shamalaiaI want to calculate the stream function psi starting from a velocity field (u,v) (such that u=-dpsi/dy and v=dpsi/dx). I thus calculate the vorticity omega (such that omega=dv/dx-du/dy) and then solve the Poisson equation del2(psi)=omega. To easily specify the boundary conditions, I choose a suc...

 
Monking
 
Monking
 
How did "Still Alive" (Portal ending) suddenly get stuck in my head?
 
> Aperture Science
We do what we must
because
we can
2
 
8:44 AM
I'm voting to close this question as off-topic because it belongs to Code ReviewJiri Tousek 14 secs ago
 
1
Q: Nearly Illegible Prime Number Calculator

Ben RiversThis is my first reasonably large C# program. Considering my code looks like it was written in an esolang to me, I'm guessing I did something wrong at some point. My main priority is readability, although speed is also a plus. using System; public class PrimeSearcher { public static string ...

 
9:10 AM
1
Q: Math Vector Header Library Templated on Data Type and Size

WillI have created a vector math header library where the size and data type stored are template values, and I'd like it peer-reviewed please. I have a few main questions: Will using my SizedVectorBase struct prevent template instantiation code bloat like I intend it to? Are the functions I defined...

 
@JiriTousek Please do not vote to close with a custom reason that "it belongs on Code Review". Nothing in the Stack Overflow rules justifies such a custom reason, and sloppy reasoning perpetuates inappropriate referrals. Not all questions about analyzing code are off-topic on Stack Overflow, and not all code review requests are on-topic on Code Review. Instead, vote to close as too broad or primarily opinion-based. See the CR guide for SO users. — Zeta 33 secs ago
 
9:30 AM
1
Q: C# Method Chaining for Email

Praneet NadkarI have been looking into stuff like method chaining, Cascade-Lambda pattern etc. I have created a class which seems to work fine. However, I just wanted to confirm if this is the best way and the right way to implement this. For the cascade lambda pattern I was unable to use Action action as a ...

 
9:47 AM
posted on March 28, 2018 by lambidu

Initially I've posted this question on SO, but as some people suggested, Code Review may be better place for this. I'm working on a large API with multiple modules (projects). Each module has its own ecosystem: DataContext (EF), Models, Services, Repositories and so on. The problem is that almost all projects in some way must be linked to User's Account, and at t

 
Monking
 
@CaptainObvious no code no glory
hey @MathiasEttinger
 
I swear I saw a Python question yesterday that was about rate limiting a bunch of Tor clients to fetch data.
Where has it go?
 
@MathiasEttinger Can you see deleted posts ?
 
Oh... OK...
sad face
Anyway, how is the morale around here? Anyone else planning to propose themselves as moderator?
 
9:56 AM
I won't. For the others I don't know
 
 
1 hour later…
10:59 AM
0
Q: Trying to search a palette efficiently

Mark YisriThis is my first Code Review question so I hope everything is written right. I have the following piece of code which is designed to search a palette. It should return a palette index that is the closest to the passed RGB value. The code works great, from a theoretical standpoint. However, it i...

 
11:15 AM
possible answer invalidation by Skryptix on question by Skryptix: codereview.stackexchange.com/posts/190216/revisions
 
-1
Q: php standalone server doesn't render "\n" correctly?

Stefan BoehringerI just started learning object oriented php with Matt Zandstra's Book: https://www.amazon.com/Objects-Patterns-Practice-MATT-ZANDSTRA/dp/1484219953/ref=sr_1_1?ie=UTF8&qid=1522235005&sr=8-1&keywords=matt+zandstra I wanted to try out his examples and started a php standalone server on my Debian 9 ...

 
possible answer invalidation by Praneet Nadkar on question by Praneet Nadkar: codereview.stackexchange.com/posts/190647/revisions
 
@Duga rolled back
@CaptainObvious broken
@CaptainObvious don't know about the license stuff on the first line
 
11:35 AM
1
Q: 2D raycasting implementation

TomekI have implemented a 2D raycast algorithm in SFML to detect walls in a 2D game: How it works Player can move in every direction by w s a d keys. Cursor sets actual player direction vector, which is calculated from atan2() function. Program is calculating next vertical and horizontal side dis...

 
371 lines in one method. Uncle bob would be shedding tears to this :D. — Isac 3 mins ago
 
11:48 AM
@Heslacher I checked it out, looks like it's not theirs
 
ok
 
@Duga Rolled back. @Peilonrayz, that's your answer, so your call, but I think you're fine with a rollback?
 
@Zeta I'm fine with a roll back - it's a common reason to roll back :)
 
0
Q: Programming language lexer in Rust

Joe ClayI'm working through Crafting Interpreters and trying to apply what I've learned in Rust. I've got the lexer working in what feels like a reasonably idiomatic way (hooray!), but I have a feeling it could be simplified. The main part I'm unsure about is the code for reading strings, numbers and id...

 
Lecture slides can be somewhat funny... on the topic of approximating curves:
> Option 1: pure magic, pulled them out of thin air, weirdly they approximate the controlpoints
 
It's not clear to me what you mean by just asking if it "is correct". Is there some problem you're running into while using it? Are you just looking for a general code review? (In which case, you may want to try posting on the Code Review site instead.) — Peter Cooper Jr. 48 secs ago
 
12:57 PM
@William There's a million different ways, but thsts to broad for here. If you get your code working, you an post it on Code Review to get improvement recommendations. — Carcigenicate 1 min ago
 
Greetings, Programs.
@Vogel612 When I was taking numerical methods, I thought it was amusing how integration methods are almost pathologically stable and differentiation methods are almost pathologically unstable.
 
stumble upon or stumbleupon ?
 
-1
Q: Node.js Simple Web Scraper

Gab De JesusI wrote a simple Node.js scraper that gets a Medium post's title and author. I put question comments in the relevant parts of the code. Advice on them, as well as the flow and structure of the program would be great! // Should these be const instead? let cheerio = require('cheerio'); let re...

 
@Malachi I guess it depends on whether you're talking about the action or the site.
I guess I'm not really qualified to be moderator since I actually have a life.
 
1:26 PM
I was alerted while using Google Docs that it should be stumbleupon
@Donald.McLean what? who told you that?
even though I am talking about the action
 
@Malachi I was looking at the candidates and told myself that. I have a paltry 4k rep and very few of the moderation badges.
Meeting cancelled - bonus!!
IDEA 2018.1 released yesterday.
 
1:41 PM
0
Q: Transpose tab-delimited Table in C

conI have looked online for transposing programs, but have found that they have extreme RAM use for large tables. The RAM use is so extreme I can't run most jobs on my laptop. I also have a Perl program, this uses less memory than online tools, but the RAM use is still extreme (~50 GB RAM for a 8 ...

 
1:51 PM
@Donald.McLean our team meeting keeps getting postponed....no meeting today! lol
 
@Malachi Our team lead decided to take a vacation day today. I'm kind of disappointed because I'm actually in the office today and could have attended in person.
 
it's always nice when you can be in person to a meeting
 
2:20 PM
0
Q: Scala - Solution for a While loop with an Iterator ? and also with a state checker

WDrgnFirst of all, I'm new to Scala. I have the following (working) Scala method(s) that has to wait up to 15 sec for a record to be completed. Usually, after 7 seconds, the record becomes complete. So, I put an Iterator that goes to maximum 15 seconds, if the record is complete it stops (I didn't kno...

 
@RMunroe Well, supposedly the Greeks invented the alarm clock.
Smoke alarm appears to be συναγερμός καπνού.
Also, monking.
 
2:38 PM
0
Q: Passing arrays as parameters to functions in C++

Eyad_SyIf I wanted to use two functions: the first one is Input_array, and the second is Show_array. How can I pass an array as a parameter to the Show_array function??

 
2:53 PM
any of you guys sail?
@Mast lol
 
0
Q: Subclassing pandas DataFrame for an ETL

Rebecca AckermanI'm writing a small ETL, which loads data from CSVs, cleans each table a bit, and then loads everything into a PostgreSQL database. I was planning to use pandas for its built-in capabilities, but am wondering whether to subclass DataFrame or whether to just do everything functionally. The subcla...

 
I'm voting to close this question as off-topic because questions about improving working code belong on Code Review. — Gert Arnold 29 secs ago
 
3:09 PM
That's implementtion defined, too. Anyway, we don't do code reviews like the one requested. Please refrain from answering off-topic questions. — Olaf 45 secs ago
 
0
Q: SQL query performance improvements?

NinjaArekkuI have written the below and am seeking any way that I could improve its performance. DROP TABLE [dbo].[#PLUTotals]; IF OBJECT_ID('tempdb..#Level4Totals') IS NOT NULL DROP TABLE [dbo].[#Level4Totals]; IF OBJECT_ID('tempdb..#WasteTotals') IS NOT NULL DROP TABLE [dbo].[#WasteTotals]; I...

 
This question belongs on codereview.stackexchange.comcezar just now
@William There's a million different ways, but that's too broad for here. If you get your code working, you an post it on Code Review to get improvement recommendations. — Carcigenicate 18 secs ago
 
3:30 PM
@GertArnold It is okay to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 51 secs ago
 
0
Q: Maximum Difference in an Array

saneGuyMaintain a minimum and max difference as we scan the input array. public static int maxDifference(int[] input){ int maxDifference = Integer.MIN_VALUE, min = Integer.MAX_VALUE; for(int i = 0 ; i < input.length; i++){ if(input[i]-min > maxDifference){ maxDifference = input[i]...

 
3:44 PM
@Duga interesting comment thread ensued... "Because sometime, it's hard"
 
-2
Q: left shift operator

pm40I can't understand what this line does! if (buf[0] == 0x00 && buf[2] == 0x00) { int acc[3]; for (int i = 0; i < 3; i++) { //WHAT DOES THIS LINE DO? uint16_t temp = (uint16_t)((((*((uint8_t*)&buf[3 + i * 2]) << 8)) & 0xFF00) | (*((uint8_t*)&buf[3 + i * 2 + 1]))); //?? acc[i] = (int)*((uin...

-1
Q: heartbeatjs, finding bugs

Flame_PhoenixWhat? heartbeatjs is a small light weight library that helps you run periodic heartbeat functions and detects timeouts when they occur by launching events. It was mainly designed for tcp/ip connections, but you can use it with any protocol you want as it designed to be generic. Project The pr...

 
@CaptainObvious OP is asking for explanation of downvote... I am considering saying that it may be because the description is very brief. Are there any other reasons to suggest?
 
4:00 PM
Comment placed as answer @SamOnela
 
@SamOnela one might be that they apparently couldn't be bothered to check whether their code is bugfree from the description
 
check
 
Rep capped today btw
 
ohh gratz
 
posted on March 28, 2018 by CommitStrip

 
4:07 PM
Thanks
 
Monking
 
Monking
 
Monking
 
Monking
 
Monking
 
4:18 PM
Monking
 
Wow, learned a new word today
Een rimpelbuisobstakelbeveiliger, vaak afgekort tot RIMOB is een constructie die op autosnelwegen wordt gebruikt om obstakels te beschermen. Doorgaans is het een V-vormige constructie die op een kleine vangrail lijkt, en tussen de poten van de V zitten buizen. De constructie is bedoeld om de botsingsenergie te absorberen, en wordt geplaatst voor pilaren van bruggen of bebording of pilaren van bijvoorbeeld straatverlichting. Bij een aanrijding van de RIMOB van de voorzijde, worden de buizen geknikt, waardoor de botsingsenergie wordt opgevangen. Bij een zijdelingse aanrijding zorgt de geleiding er...
 
@skiwi nice: "Wrinkle tube obstacle protector"
 
@skiwi lol
Don't recall seeing much of those around.
Vangrail, yes. RIMOBs? Not really.
 
Same.
 
@SamOnela Impact attenuators.
@skiwi RWS uses a couple of mobile ones now I think about it. Not sure what they're called officially, we call them bumpertrucks.
It's a truck with a large bumper on it's behind.
 
4:28 PM
@Mast Me neither, but it's being talked like it's very common
 
@skiwi Never trust Dutch wikipedia.
 
@skiwi I've never seen them on the autobahn. Unless they're not required to be coloured. Hm.
 
Googling seems to give some results, but it seems like it's almost one piece together with the guardrail
 
@Zeta Would/do you listen to the Autobahn song by Kraftwerk while driving on it?
 
No.
 
4:38 PM
@Zeta German autobahn usually has proper far-range buffer zones around any "Wrinke Tubes"
 
Mobile "bots absorber".
 
@Vogel612 Wrinke what?
 
Wrinkle, I suppose.
 
@Zeta I don't know the proper English term for Leitplankengabelung
 
Ja, die sind etwas ausgeprägter und könnten einen Auflprallabdämpfer enthalten. Sind aber nicht gelb :P Ah. k.
 
4:42 PM
Like those?
 
17 mins ago, by Sam Onela
@skiwi nice: "Wrinkle tube obstacle protector"
 
Ah.
 
Missed that one too.
 
Wrinkled guard rails.
 
@SamOnela Would not. too boring....
 
4:44 PM
Yeah I don't listen to it very often...
 
5:20 PM
@Aconcagua: You're right, I'm an idiot. This is why code reviews exist :). Agree on the throw, and somehow didn't think of that when I wrote the answer. — Stephen Newell 56 secs ago
I would recommend checking out the Code Review stackexchange site as it deals more with recommendations such as this. Definitely check out their FAQ before posting though. — scrappedcola 11 secs ago
This question is better suited for codereview.stackexchange.comFrancis Bartkowiak 18 secs ago
possible answer invalidation by esote on question by esote: codereview.stackexchange.com/posts/190625/revisions
 
@Duga hmm... tough call... I don't see any answers that mention that changed included header...
 
I'm voting to close this question as off-topic because it is belong to codereview.stackexchange.com — Al-Mothafar 26 secs ago
@Al-Mothafar It is okay to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 58 secs ago
 
5:38 PM
-3
Q: How to make an executable key-logger for windows

hacker worldi want to make an executable key-logger code which gets executed when i enter a pen-drive in computer

-1
Q: C# how to find word from textbox WPF

SurenI need to find any word in textbox.Text.I have two textboxes,in first textbox i write any sentence, for example Hi,how are you? and in second textbox i write any word, for example "you",then when i click on button find, it must underline that word and say me that there is 1 word with Label. Someo...

 
5:53 PM
@ShaiRado I'm putting down my mug (stepping down as a moderator on CR), and decided to "unify" all my online profiles - so I now have the same mugshot everywhere (except on Twitter, where I'm remaining @rubberduckvba) =) — Mathieu Guindon 9 secs ago
 
@Duga so many mug puns
OHAI @ThomasWard nice seeing you around :)
 
Should Brainfuck interpreters accept non-ASCII input?
 
-4
Q: Find the median form an arrayList in Java

gbensonablepublic static void printMedian(){ ArrayList sortedList = new ArrayList(); sortedList.add(1); sortedList.add(2); sortedList.add(3); sortedList.add(4); double median = 0; // If our array's length is even if (sortedList.size() % 2 == 0) { int firstIndex = (sortedList.size() - 1) / 2; int seco...

0
Q: Get files recursively as relative paths

Kyle DelaneyI want to get a recursive list of files in a directory but I want relative paths and not the full paths that Directory.GetDirectories() would return using the AllDirectories search option. This is because I want to move the list of files to another location and perform a custom check on each file...

0
Q: java beginner change calculator

kp-aHere is a currency calculator. This is my first java program > 5 lines. Here goes: There are 4 coins; dragons, stags, pennies, halfpennies. The relationship is as follows: Gold Dragons (Dragon) each is equal to 210 Silver Stags (D); Silver Stags (Stag) each is equal to 56 Copper Pennies (S); C...

 
> , accept one byte of input, storing its value in the byte at the data pointer.
Hmm by definition that wouldn't be possible though
In that case my whole interpreter setup is screwed as I'd need to save the second byte of input since the Char I get is 2 bytes I think?
 
6:10 PM
@skiwi Why?
Unicode?
This may even be one of those things done differently by different BF interpreters/flavours.
 
@Mast Yes
Taking one byte of input seems pretty clear to me though ^^
 
1
Q: Ring Timer Animation with Chasing Tail using CoreAnimation

theodinspireAfter a fair amount of trial and error, I have gotten the animation acting in the manner that I want it, as seen here. However, I always feel like I'm writing way too much and too sloppily when trying to use Core Animation. The animation is as follows: The view begins with a point of light at ...

0
Q: UserScript to Highlight tab for queue item

Sam OnelaIt may seem a bit obsessive and/or pedantic, but the following script allows me to see when posts are ready for reviewing. addicted-to-cr I developed this UserScript for use with TamperMonkey to allow me to have a tab open for a review queue, and then when an item is ready for review, the tab wi...

 
6:23 PM
Except not quite, because if I treat all as Unicode then I'm getting lots of zero bytes as input
 
Thanks, Santa!
 
@skiwi Char is most likely 4 bytes.
Not counting the additional pointer.
 
0
Q: A minimal wc for stdin

ZetaThis is a minimal reimplemtation of wc. It supports only stdin at the moment and no command line arguments, that's for a later version. This is my first complete Rust program/package, so I'm interested in any comments, including but not limited to: documentation, comments, general style and ty...

 
Never mind. It's 2 words: wiki.haskell.org/GHC/Memory_Footprint
 
@Zeta That's what I was looking for
2 words.. wow
and a Word is two words big
 
6:33 PM
Boxed values/types.
 
@Vogel612 I'm always around. I just don't talk much :P
unrelated I"d nominate myself to be a moderator here, but I've got enough to moderate already elsewhere :P
 
data BFInstruction = > | < | + | - | . | , | [ | ] deriving (Enum)
That doesn't work, not too surprisingly
data BFInstruction = Right | Left | Increment | Decrement | Output | Input | LoopBegin | LoopEnd deriving (Enum)
Guess this will need to do, perhaps it's even more clear
Except using Right and Left is not that great of an idea
 
Yeah. Next and Prev maybe?
 
@ThomasWard Bah, that's just Ask Ubuntu, surely you can handle more than that?
 
@skiwi How will BFProgram then look like?
 
6:40 PM
data BFProgram = BFProgram [BFInstruction] BFInstruction [BFInstruction]
 
@SimonForsberg Probably could. Not active enough here to be considered mod material, even though I'm visiting the site daily to find interesting things to code review (and failing)
 
@ThomasWard Why are you failing with finding interesting things? What's missing?
 
@SimonForsberg the 10+-hour-days the past few weeks might be a problem :p
... also 50000 Ask Ubuntu moderation tasks but :P
 
So it's time? Then why are you visiting every day and trying to find things to review?
 
@SimonForsberg because I am an insomniac and when I can't sleep i need something to do :p
and at 2AM I usually don't find interesting things :P
... the other issue is most people already address what I would note in code reviews anyways :P
(I'm always a bit late to getting to things...)
so my review adds nothing :P
 
6:44 PM
@ThomasWard Plenty of zombies around.
Go be a necromancer or something.
 
pulls out the flamethrower WHERE
4
:P
though, I might end up with some code that I'mma ask for reviews on by the end of the week
so there'll be more activity from me 'soon'... and a lot of it, because the project i'm after a review for is large
 
> advance :: BFProgram -> BFProgram
advance (BFProgram past current next) = BFProgram (past ++ [current]) (head next) (tail next)
Looks compact :o
 
0
Q: Project Euler problem #1 solution: rate my code

SavedbyZer0Any suggestions or comments? Is my style any good? Initially I struggled with this problem as I found that using the "+=" operator gave the wrong results. I also tried a while loop the first time which was a baaaad idea. But what actually worked was using a static accumulator variable. #include <...

 
@skiwi That can encode a broken Brainfuck program, though.
@ThomasWard There are 354 possible insta-kill zombies. Feel free to use your flamethrower on them :D.
 
@Zeta That's entirely correct
 
6:54 PM
@Zeta there's a few on there :P
 
Hi, I didn't know about the codereview.stackexchange.com, thanks for the information. — Joao Felipe Rodrigues 5 secs ago
 
@skiwi To be honest, I'm not sure whether that's sarcasm :D
 
@Duga darn I think those VTCers got the majority on off-topic "because it is belong to codereview.stackexchange.com"
 
0
Q: Boilerplate-free mixin pattern for typescript

PaceThe TypeScript handbook provides a mixin pattern but it requires a bunch of boilerplate, doesn't work for getters/setters and doesn't support defining default values (or any constructor work) in the mixin (only on the composite object). I wrote an alternative mixin pattern for a charting library...

 
Before you post anything on Code Review, take a look at this guide. — Mast 31 secs ago
 
7:07 PM
@CaptainObvious @200_success not applicable, since it is ?
 
7:22 PM
@Zeta You disagree? :P
advanceBy :: Int -> BFProgram -> BFProgram
advanceBy advancement = case advancement of
    x | x < 0   -> decreaseBy' (-advancement)
    0           -> id
    x | x > 0   -> advanceBy' advancement
I can just leave of parameters from the right hand side if I want to?
I know it's allowed to do it if there's only one parameter
 
advanceBy :: Int -> BFProgram -> BFProgram
==
advanceBy :: Int -> (BFProgram -> BFProgram)
Therefore, yes :)
 
Which menas?
Hmm, you can just do whatever you want as long as you follow the rules then?
 
Not sure what you mean by follow the rules, but as long as your program typechecks, sure.
 
Cool
And I lost track of time again.. That's what Haskell does
 
@Unlikely. Also remember when you have working code, you can get it reviewed at codereview.stackexchange.com (do check the rules for submitting a code review). — Martin York 25 secs ago
 
7:28 PM
I have refactored a fair bunch to use BFProgram now, except it doesn't work yet, but that's not something for now :P
 
Heh.
By the way, I've used a similar BFInstruction, although I only have 7 constructors, not 8.
 
laughs evilly as he uses chaotic evil black magicks to semi-necromance a code review post with a new and 'wall of text'-like review that is typical of his overly-descriptive review post style
 
killcam? don't just tease
;)
 
TTGTB. gniknoM!
 
@Vogel612 it showed up in the potential zombies list that Zeta linked to on SEDE
 
7:53 PM
@Zeta After this I want to do an AST based version that can store loops with lists in them again
 
0
Q: Creating a Basic Success Function for Http

jacksonecacI got sick of every time I make an Http request validating that the response was a success. I did a lot of: if response.class == Net::HTTPOK or if response.is_a? Net::HTTPSuccess I wanted something a little prettier so I came up with the following. I don't write a lot of class extensions li...

 
in my case i want a blank branch so I can create a pull request from master into it so I can do a code review on existing code. — Betty 7 secs ago
 
8:19 PM
There are many ways to do this, the "better" way depends on your code requirements and architecture. I think you'd be better reading about "php reusable db class" and such searches here and Google. When you have final code, put it on Code Review (if it fits their requirements etc) — James 29 secs ago
 
@SamOnela The standard that I apply is that if it's not syntactically valid JavaScript, then the tag shouldn't apply. The fact that TypeScript is often transpiled into JavaScript is irrelevant: by that standard everything could be tagged .
 
This sounds like a Code Review and that would make it off-topic for this site — Nkosi 25 secs ago
 
8:34 PM
0
Q: Efficiently track changes to a List<T>

jeromeyersThe following code fulfills some requirements that are not obvious from the title. First of all, we want to avoid memory allocations, that is why it operates on preexisting lists. Secondly, we don't need to track the items that are unchanged between the two instances of the list. Thirdly, it i...

 
Woot, hlint is working finally
Best/Worst part is that I didn't actually to anything to make it work
It wasn't working last time I checked, now it works
 
@200_success is that a yes or no?... Basically is this scenario just like this one?
 
Right. That isn't JavaScript.
 
@200_success Not quite.
Many languages bypass assembly entirely. They could all be labeled bytecode.
 
Let's create and tag every question with it
4
 
8:56 PM
Haskell is too addicting, please send help!
 
@skiwi try fixing the remaining 5% of HasStackSTV...
that should cure you pretty easily...
 
Functional programming is so straight forward once you think you understand it: You tell the compiler what to do, and it will decide how to do it
@Vogel612 Looks rather complex..
 
FWIW it's what cured my addiction to haskell
 
Why?
 
9:38 PM
because the regression required for MeekSTV just doesn't play nicely with haskell
or at least I haven't found a way to make it...
^^ this method is a mess...
nextRound election round = if filled == seats election then round else (Round $ map (calcWeight q) d) -- to be implemented
    where
    calcWeight q' data' = (c,s)
        where
        c = fst data'
        d' = snd data'
        s = if c == Lost then Hopeful else asState $ (getRatio $ fst d') * q' / (snd d')
    cullLowestScoring cData s = map (\(x,y) -> (x, if x == lowest then Excluded else y)) cData
        where
        asc = M.toAscList s
        idx = fromMaybe 0 $ findIndex (\(x,y) -> x /= Lost) asc
 
0
Q: Optimizing a pre-made Sudoku Solver

user165570I am currently having trouble with a project that I have to finish in a few days. In the project, I am given a Sudoku Solver that uses a recursive method. It solves the Sudoku puzzle correctly, but it recalls itself over 87 thousand times. My objective in the project is to optimize it so that th...

0
Q: add and delete lists

Jason MatneyIs there a more efficient way to ensure a list is cleared after an iteration than what I currently have written? Apologies for the lack of list comprehension - I usually program in R... import arcpy import csv import os import numpy as np from datetime import date arcpy.env.workspace = "F:\\P...

 
9:54 PM
That looks like a mess indeed...
 
possible answer invalidation by Ogglas on question by Ogglas: codereview.stackexchange.com/posts/190188/revisions
 
-1
Q: Streaming a csv file and feeding it line-by-line into a function in Python

whpThe snippet below pulls a utf-8 tab-separated file hosted over the network, converts each line into a dictionary based on the first row, and then feeds that line into a function, my_function. The file can be large, so the response is streamed into a temp file and then read back line by line afte...

 
10:23 PM
@Duga hmmm... one answer, OP added response based on that answer...
I guess I should roll it back, per the meta CW post
 
11:00 PM
0
Q: Naive php web hook endpoint for use in a production environment

pcgbenBelow is the WebHook endpoint in its entirety. I have five seconds to acknowledge if the payload is correctly formed. After that, the payload is inserted into a queue for processing. Importantly, it works, but it feels naive outside a Class and without any exception handling or error checking ...

 
11:43 PM
That's a question for codereview.stackexchange.com :) — Paul 47 secs ago
This would indeed be good for Code Review, you may want to fix the code indentation though, looks like it may have got mangled when you copied it from your IDE/editor. — Phrancis 26 secs ago
 

« first day (1789 days earlier)      last day (2233 days later) »