« first day (862 days earlier)      last day (3157 days later) » 
00:00 - 20:0020:00 - 00:00

12:00 AM
RELOAD!
There are 1499 unanswered questions (94.4265% answered)
 
@Duga @SimonForsberg perhaps that should say 'the author of: {link}' instead of '{user} on question by {user}: {link}'
 
I think I saw this "question" a few hours ago, but apparently is has been deleted. Anyway "is this correct" is too broad a question. And "please check my code" is not a question, let alone on-topic. ( If you want a code review, go to codereview.stackexchange.com ) — Stephen C 2 mins ago
 
duga pls
@StephenC, the author doesn't necessarily want feedback on aspects of their code, rather to be checked that it does work as expected. This kind of question, similarly, isn't necessarily on-topic, but, with some wording changes, it could probably be on-topic for both Code Review and Stack Overflow. — Quill 4 mins ago
0
A: Why did Leia give the stolen version of the Death Star plans to R2-D2 instead of a copy?

Blink Too FastIt was the 1970's. The audience was using vinyl LP's and backups were impractical without the master recording and Sony's or EMI's pressing plants - not likely found on a Corellian Corvette. While some of the nerdier audience members might have been able to make copies between 8-tracks, they woul...

 
12:37 AM
Correct. But in its current form it won't get any meaningful answers, either here on on code review. And simply deleting and reposting it won't help. — Stephen C just now
I suggest putting this on [Code Review](codereview.stackexchange.com) instead. It's too open for Stack Overflow, and you look like you need quite detailed advice. — Veedrac 19 secs ago
 
0
Q: C-style `for` loop alternative in Rust

xiver77I program in C, and it's my favourite language. I've recently found rust. I like their ideas. Sometimes looks like a weird mixture of C++ and Haskell, but overall it looks nice. The for loop in C is very flexible, and I truly miss them in rust. Just look at my messy beginner rust code below. Bel...

 
1:48 AM
0
Q: Hacker Rank - Poisonous Plants

PushCodeI have the solution for the problem, but it is taking me 7 sec to run on large dataset.I am trying figure out a better way of doing this. https://www.hackerrank.com/challenges/poisonous-plants static void Main(string[] args) { Stopwatch timer = new Stopwatch(); timer.Start()...

 
2:14 AM
Is anyone around?
 
Nope
 
Is an interface that the view implements in MVVM part of the model or part of the view?
 
Ouch.... I am not a GUI person, no idea.
 
It isn't the user interface itself, but it is directly tied to it.
Oh well, I'll just say it is the view.
 
On the other hand, the I always thought the view was an interface, and then you registered concrete implementations of it.
 
2:17 AM
Well, the view is the GUI, essentially.
I'm writing a blog series on WPF with MVVM, and I got stuck within the first couple sentences :P
On another note, I'm becoming quite the expert in financial analysis (according to my grades, anyway).
 
0
Q: Login Authentication & Sign Up

Imraaz RallyThis is a Login Authentication / Sign-up Models for my class project in PHP. I'd really appreciate criticisms and any suggestions to improve... security/code quality/...etc Hashing.php class Hashing{ public static function getHashedPassword($username, $password, $regTime){ //Prepen...

 
I'm by far not an OWIN expert, but that seems to be OK, besides you should use try/finally like I did above to make sure the semaphore gets released in case of exceptions. You may want to post it to to SO Code Review so it can get more exposure. — Noseratio 53 secs ago
 
@Hosch250 the view
 
@Mat'sMug Looks like I chose right then.
 
you're assuming I'm right ;-)
 
2:36 AM
0
Q: Android XML parser to parse themes

T_TI used XML to control the theme of an InputMethod for Android, a theme XML contains the color and the shape of keys. XML file <color name="FIRST_LINE_LETTER_COLOR" value="#263238"></color> <color name="SECOND_LINE_LETTER_COLOR" value="#263238"></color> <color name="THIRD_LINE_LETTER_COLOR" va...

 
2:53 AM
0
Q: Simple event emitter

jackwilsdonI have written a simple event emitter in Python, which allows subscribing to events and emitting events (along with monitoring events too). I'm rather new to Python, and would like some feedback on the overall style of my code (I tried to follow PEP 0008) as well as how it works. import inspect ...

 
 
1 hour later…
4:08 AM
A bunch of first posts in the queue.
 
 
1 hour later…
5:18 AM
0
Q: 2048 Pythonic Merge Function

RafehThis post goes over how I updated my 2048 Merge Function code from spaghetti code to being somewhat more readable. Many thanks to the people right here on CodeReview. I tried to post this as an UPDATE in the original post but I was told to make a new post about it, so here it is! This is not so m...

 
5:41 AM
0
Q: addnode to linked list - function - c data structures

cslrnrI have written code to add a node to the head of the list, criticisms , feedback , reveiws are welcome .. typedef struct sList { void *data; struct sList *nextNode; }sList; sList *addNode2Head(sList *psList,void *data) { if(psList == NULL) psList = newNode(); else { ...

0
Q: directory watcher and notifier for files added or removed using pyqt4

Ciasto piekarzI have written a piece of code that notifies if something is added or removed from a folder location. from PyQt4 import QtGui from PyQt4 import QtCore import sys import os def xor(lst1, lst2): """ returns a tuple of items of item not in either of lists """ x = lst2 if len(lst2) > l...

 
6:18 AM
Firstly, SP's existed long before SQL injection had even been thought of so no I think this is a primary reason. Thousands of SQL based apps have been built without them that are safe against this attack. I've also code reviewed insecure SPs that are vulnerable to SQL injection (typically based on dynamic SQL). — Tony O'Hagan 44 secs ago
 
0
Q: Finding the maximum value of expression

user84365There is a 1-indexed array A of N elements.I want to find the maximum value of expression (A[I1] ⊕ A[I1 + 1] ⊕ ... ⊕ A[r1]) + (A[I2] ⊕ A[I2 + 1] ⊕ ... ⊕ A[r2]) where 1 ≤ I1 ≤ r1 < I2 ≤ r2 ≤ N. Here, x ⊕ y means the bitwise XOR of x and y. Please donot suggest a brute force approach which check...

 
@Dan Firstly, SP's existed long before SQL injection had even been thought of. Thousands of SQL based apps have been built without them that are safe against this attack. I've also code reviewed insecure SPs that are vulnerable to SQL injection (typically based on dynamic SQL). So no I don't this is a primary reason. There's plenty of other ways to prevent this attack further up the stack. — Tony O'Hagan 45 secs ago
I'm sorry to tell you that you posted this on the wrong forum - this is not a code-review site but you are not completely out of luck: you can repost it in codereview.stackexchange.com if you like — Carsten 26 secs ago
is asking for code-review - should be moved to codereview.stackexchange.comCarsten 43 secs ago
This will be a nice question on Code Review SE. Please migrate! — janos 1 min ago
 
6:36 AM
0
Q: simple game of hangman, comment on logistics and cleanliness?

Kevin LiStarting out with learning how to program in python and created a hangman game ... I think there is a lot of unnecessary code but I am not sure how to improve it. import random # Global Variables d = {'barnyard':'place', 'airplane':'transportation', 'daughter':'loved ones', 'vacuum':'objec...

 
possible answer invalidation by cslrnr on question by cslrnr: codereview.stackexchange.com/posts/104554/revisions
 
@Simon I looked into fixing the html issue in the answer invalidation messages, but I have a feeling you haven't pushed your latest version to GitHub
oh my bad. it's in develop now, I don't know how I missed it
 
6:52 AM
0
Q: Cannot come up with an algorithms for this

Shubham AggarwalI recently came across an issue which goes like: We are given an array of numbers There are two players. They have to play a game such that they can only select one of the extreme ends of the array in their turn. For example: array is 1,4,2,6,8,5,3 A choses 3 so the array now becomes 1,4,2,6,...

0
Q: Are there problems with this non-blocking, non-threaded http client implementation?

Lance WiselyThis is a C# WinForms program targeting .Net 4.5. I am using it for a movie organizer application that will contact sites like OMDB, MyApiFilms, etc. for data about the movies. At the main application level a new movie list needs to have its movies matched to their info, which means searching the...

 
7:19 AM
0
Q: Intercepting a graph walk in Java

coderoddeI have that girl whose graph walk I want to intercept, but because I am not good at running algorithms in my head, I had to program my computer to do that for me. I would not consider the problem to be a problem in its own right, but can be thought of as an extension of the shortest path problem....

 
 
2 hours later…
Zak
9:03 AM
morning everyone
 
If this is working code that you think could be improved, consider Code Reviewjonrsharpe 30 secs ago
There is not much of a question here; you did not explain what the code is trying to do, for example. As Jon said, for general code critiques for your own, working code, you can ask on Code Review, but do try to explain a little more about what the code is supposed to do. — Martijn Pieters ♦ 24 secs ago
Why do you have while (fileScanner.hasNext()) two times? Btw it was presumably closed, because this is non working code and CodeReview request working code. — Tom 1 min ago
 
9:56 AM
1
Q: Basic CRUD application for Product, Category & Location with SQLite

Mithos-YggdrasillI improved the code from my previous question. At this moment, the 3 entities have not yet a connection with each other. They should only be available for CRUD actions in a SQLite database. I would like to have a review of this basic CRUD application so I can improve and learn from your experie...

 
 
1 hour later…
11:10 AM
@Quill I think it's more clearer to show the exact name of the author and the editor.
 
Monking
 
11:42 AM
Done @SimonForsberg.
That was fun. I've never reopened an SO question before.
 
11:54 AM
I posted an answer here. Take a look. :-)
0
A: Using BubbleSort to sort numbers into ascending & descending order

ambigram_makerPoints On Your Existing Code unsortedData and unsortedData2 look weird to me. Try appending a 1 to unsortedData to make them line up. Arrays has a utility method called copyOf(array, length) that internally uses System.arraycopy(). It will save you a few lines. sortedAscendingData or ascendingS...

I feel sort of guilty of keeping redundancy. But the OP wanted performance, so...
Dear @Santa, 41 more to being an established user. ^>^
 
possible answer invalidation by Lance Wisely on question by Lance Wisely: codereview.stackexchange.com/posts/104562/revisions
 
seems okay to me
anyways: guests.
bbl
 
 
1 hour later…
1:26 PM
I'm seeing a lot of new reviewers around. =)
 
@Vogel612 @SuperBiasedMan @Quill @syb0rg @SirPython : Well established off-topic threshold: "To the best of my knowledge, does the code work?" - then: "So, I did the CodeEval 'Longest Lines' problem and it works fine for any input data I can devise." .... When did the site's scope change ?
 
@rolfl so you are asserting that CodeEval is bugged?
 
No, I am asserting that the user believes his code works.
 
I challenge that.
it works for what the user thinks it should do
 
I ran his code, and, to all intents and purposes, I agree with the user,.
 
1:33 PM
not for what the requirements (aka. pass at codeeval) are
 
His code produces the same results as mine... for the tests I ran.
 
The challenge states there is a count of how many lines need to be put out
 
Anyway, the user is now pissed off, and I feel like the victim.
 
I don't see any code solving that part
 
   public void loadNextLine() {
        if (outputSize > 0)
        {
            currentLine = fileScanner.nextLine();
        }
        else
        {
            outputSize = Integer.parseInt(fileScanner.nextLine());
        }
    }
 
1:36 PM
hmm.. I stand corrected...
what about this part?
        System.out.println("Loading '" + filename + "'");
I don't think that's warranted output.
 
No, it's not, and it would break the results, I agree..... but, he has/had a number of debug statements in his code.
Still, the user believed it was working, and that debug statement may have been as a result of his trying to get the dataa println results as he claimed here:
> Because it's a "moderate" problem, input data is not provided. After some System.out.println nonsense I got the test data, and my solution seems to work.
 
I still prefer to trust the online judge over the user, personally.
I see your point though..
 
The judge also has a time limit reason... and does not report time-failed problems....
 
That I did not know.. so you have optimized the sorting and got a pass without changing other code?
after removing the superfluous printlns that is?
 
I have not submitted my answer's code.
 
1:42 PM
do you want to do that?
If not I can do that for you, I want to check that platform out anyways.
 
Nope. I am not registered, and don't plan to.
If you want to, feel free ;-)
Apparently it requires a class called "Main" which makes me think it is a poor eval site anyway
 
hmm. probably, yes.
then again that's how incredibly many sites work.
oh cool.. the site only supports java 7....
damn junk
okay your solution works just fine
 
You sound surprised ;-) ?
 
nvm it doesn't
 
Oh?
 
1:49 PM
the site is a goddamn piece of junk
"solution was submitted sucessfully" -> Compilation Error: Symbol not found
ARGHHH
Files.newBufferedReader seems to not accept an overload with Path only in Java 7...
grrr
okay now it works...
if your output and that of OP are not different .... alas.
@rolfl you may want to remove the paragraph about "debugging" from your answer.
After running rolfl's code (which has the same output as yours) through the online judge it got accepted. As such I voted to Reopen. It seems that code_eval also judges for timeouts, but does not properly report them back. In general that site still seems lacking wrt. Java. Please excuse the confusion. — Vogel612 42 secs ago
 
2:06 PM
@Vogel612 fifth re-open vote just in!
I love it when I can actually pretend like I'm voting, not deciding.
 
@SimonForsberg feeling nostalgia?
 
oh yes
 
monking!
hey look, The 2nd Monitor CR chat lost its beta label too! ---------------->
 
was about time :)
 
@Vogel612 that I noticed, or that it happened? ;-)
 
2:15 PM
the latter
 
I wonder when the community ads will be enabled now
 
no idea.. there's 2 eligible answers and 2 deleted answers, right?
 
3 eligible, 2 deleted
 
Depending on how you define eligible.
 
I just found a question on Programmers where the title starts with "MEAN stack".
 
2:28 PM
MEAN is well known, right?
 
Well, I don't know it.
 
Wikipeadia appears to be down.... but, when it's up, it should be here:
MEAN is a free and open-source JavaScript software stack for building dynamic web sites and web applications. MEAN is a combination of MongoDB, Express.js and Angular.js, all of which run upon Node.js. == Components == The components of the MEAN stack are as follows: MongoDB, a NoSQL database; Express.js, a web applications framework; Angular JS, a JavaScript MVC framework for web apps; Node.js, a software platform for scalable server-side and networking applications. == Branding == The term MEAN was coined by Valeri Karpov, who was a MongoDB developer at the time. He introduces the term in one...
 
Yeah, I found it.
 
@Santa Can you please give 6 more rep to make me an established user? ^.^
Thank you @Santa! :o)
Man, this guy has dedication:
 
@ambigram_maker welcome to the establishment!
2
 
2:39 PM
@Mat'sMug Grazie, grazie. :-D
 
Lol
> I make programs and program accessories.
 
The guy has GARY written all over him (literally!!!)
 
possible answer invalidation by alexwlchan on question by Rakesh Ranjan Sukla: codereview.stackexchange.com/posts/104464/revisions
 
looks okay too
 
3:30 PM
possible answer invalidation by PushCode on question by PushCode: codereview.stackexchange.com/posts/104544/revisions
 
3:40 PM
Hey @SimonForsberg could you update the auto-comments available from zomis.net?
I updated the answer on meta to include two separate comments for missing code..
inb4 closeworthy question btw.
Captain is being slow again..
 
@rolfl I apologize for the misunderstanding.
 
-1
Q: My JavaScript Code

Joshua HartshorneI am relatively new to JavaScript and have started developing an Web-based app for the Rugby World Cup. It is a simple app that allows users to view each team and their relevant statistics - I plan to add more features in the future, such as comparison etc. However, today I am asking whether so...

 
@CaptainObvious now that's a title
 
just nuke it.
also I think I killed my gaming mouse's right button..
and mousewheel click..
after.. a year or so..
 
eh, my kids blew up my mousewheel click within 2 weeks
 
3:50 PM
but not the RMB, right?
also.. kids..
 
kids + electronics = new(electronics)
3
but yeah, the rest of the buttons work fine.
 
4:05 PM
possible answer invalidation by Pep on question by Pep: codereview.stackexchange.com/posts/104477/revisions
possible answer invalidation by Lance Wisely on question by Lance Wisely: codereview.stackexchange.com/posts/104562/revisions
 
Did @Caridorc ask the first Io question on here ever?
Certainly there wasn't a tag for it before he made one.
 
4:19 PM
0
Q: jQuery plugin to cycle through text and "typewrite" it out

CJDI have written a jQuery plugin (my first for a long time) that simply cycles through strings of text in a data attribute and uses setInterval to type it out - it's a common effect you've probably seen hundreds of times. I'm looking for a code review of the JavaScript/jQuery portion of the code ...

 
4:45 PM
1
Q: Just wrote my first ever code. Please suggest improvements

Inteemum AhsanJust wrote my first code. It's basically just a calculator. Please rate it(keeping in mind that I'm an absolute beginner) and also suggest improvements (keeping in mind that I'm a beginner) import math #Returns the sum of num1 and num2 def add(num1, num2): return num1 + num2 import math #...

 
@CaptainObvious dat title
 
4:57 PM
It's fine. I'll re-add my last comments that have not yet been addressed. Thanks for the info and for a great site. — Lance Wisely 25 mins ago
hmm maybe I was a little quick in flagging those as obsolete
 
Anyone have a moment?
Oh, and, btw.monking.
 
@EthanBierlein sure what's up?
 
@Mat'sMug lmao
 
@Phrancis look at the edit history for more lulz ;-)
 
Hey, it isn't too bad for the very first code written.
 
4:59 PM
Suppose I'm defining simple math functions, like add, and then mapping them to operations in a dictionary. Would it be fine to use an anonymous function?
Hmm. I just answered that myself.
Use the standard math library.
 
#Returns the value of pi
def pi():
    pi = 3.14159265
    return pi
 
That should be math.pi
 
I would expect Python to have a built-in function for Yeah
6
 
@EthanBierlein you're welcome ?
 
55 reputation from 9K. Gotta go find a question to answer.
 
what the heck is up with that comment thread..
 
no idea. seems like it got a little out of control.
 
"Cide Review" - "Kill Review"
In other words, deadly reviews.
 
6:20 PM
@EthanBierlein I always make that typo!
 
lol
-7
Q: How can I access Youtube from school?

friend manSo my school is using something called Dan's Guardian to blacklist a whole bunch of proxy sites and stuff. Yes it's a blacklist because I can still access other random sites and stuff. Dans Guardian is really tricky to bypass because they update the blacklist really frequently and on top of that ...

Just, wow.... ^^
Isn't the point of school to learn stuff?
Not just to watch stupid YouTube videos all day.
It's a shame how many people would choose to goof off in school, rather than learn valuable information.
Anyways, bbl
 
@Vogel612 updated
 
@EthanBierlein Calm down gramps
99 out of 100 students in every school everywhere would rather do anything else than focus on class
 
6:47 PM
@JeroenVannevel In the case of the male students, it's a well-defined subset of anything
 
@itsbruce Does it equal the empty set?
 
@skiwi nope not really..
completely unrelated... need some advice..
resxFiles.map(this::parseFile).map(entry -> {
      Map<String, Document> intermediate = new HashMap<>();
      intermediate.put(entry.getKey(), entry.getValue());
      return intermediate;
 }).forEach(translations::putAll);
somebody more proficient with lambdas: how can I make this suck less?
and yes, that actually seems to work.
 
@Vogel612 Did you try using C#?
hohoho
 
@Vogel612 Let me decode that
 
@JeroenVannevel that'd be stealing from Hosch
 
6:49 PM
@skiwi No, but it certainly involves the naive sex - I mean set theory
 
@Vogel612 What are you even trying to do there? ;)
Judging by this, it looks like flatMap may be your friend
@itsbruce Ah...
 
I have a Stream<Path>. I want to resolve these paths, extract a String from their filename and put a Document parsed from the file into a map under the String extracted from the filename
 
You want to resolve paths and extract a String from the filename?Huh?
 
the path resolution already happened...
resxFiles is coming from a nontrivial call to Files.find
 
So one string key in the map corresponds to one path in the stream? Then map, not flatMap
 
6:54 PM
so far so good, yes.
but I also want the content of the file
 
On the other hand, if one path generates multiple sequences of keys, yes, flatMap
 
one path generates a pair of <String, Document>
 
0
Q: Array to function to int arithmetic

Evan CarslakeI am unsure if there is a better/ cleaner way to do this (the value function): struct Cool { int map[5]; }; int value (Cool* coolPtr, int x) { return *(*(&(coolPtr->map)) + x); // Here } int main() { // Test Cool* foo = new Cool; // Fill for (int i = 0; i < 5; i++) foo->map[i] = ...

 
actually a Map.Entry<String, Document> through this::parseFile
 
But you don't insert them into the map as a pair. so flatMap
 
6:56 PM
@Vogel612 What I'm mostly confused about is what that big map(entry -> { }) is doing
It's creating a map out of a single entry of a map?
 
By that I mean the pair isn't a key. The pair is two keys
 
@skiwi exactly
@itsbruce it isn't.. it's a Key and a Value
 
And .forEach(translations::putAll) is in a lot of cases very dangerous
Can you not construct the full map via a .collect(Collectors.xxx) call?
 
that's fine, since translations was cleared before the stream runs..
 
@Vogel612 Oh. I thought each string was a key
 
6:57 PM
@itsbruce it is...
but each String has an associated Document
 
Oooh, functional/lisp concept of pair was what I was thinking
 
So you have a stream of paths, you parse those paths into Map<K, V>, now you have a Stream<Map<K, V>>, then I'm confused because this isn't correct
 
@skiwi carry on, please
'cuz that's exactly what I'm doing right now..
 
It looks like that before the map(entry -> { } call you have a Stream<Map.Entry<String, Document>> then?
 
correct
I should probably manually put that entry into the target path..
 
7:00 PM
So resxFiles is a Stream<Path>, you map(this::parseFile) that into a Stream<Map.Entry<String, Document>>, then you map(entry -> { }) that into a Stream<Map<String, Document>>, and then you for all entries of those maps (which are by definition always exactly one), put them into translations which is a Map<String, Document>
That's not making a lot of sense to me
 
so what would you do?
 
I don't understand why this::parseFile takes a Path and returns a Map.Entry<String, Document> to start of with
 
would you consume directly?
 
Maybe you think it's a clever trick to use a Pair<A, B>, but I found it confusing
I don't know exactly how I'd do it, but there must be a better way :D
Also, why is translations already defined?
 
classwide private final field
 
7:02 PM
I'd definitely want something like Map<String, Document> newTranslations = resxFiles.stuff().collect(Collectors.toMap())
Actually, I believe it's so simple what you are doing
Yes
 
.. that seems useful.
 
So let's assume we have a proper parseFile() method that takes a Path as argument and returns a Document, okay?
 
0
Q: Audio in python script

NeslessI want to do a simple text game with a music background in it. I tried different methods to do it, and most of all i liked to use Snack Sound Toolkit. Here's my code: from Tkinter import * root = Tk() import tkSnack tkSnack.initializeSnack(root) mysound = tkSnack.Sound() mysound.read('nameofmy...

 
@skiwi stoooop.
I need something else from the Path, you know?
actually .... it's even simpler.
resxFiles.collect(Collectors.toMap(this::extractKey, this::parseToDocument));
 
Map<String, Document> newTranslations = resxFiles.collect(Collectors.toMap(Path::fileName, this::parseResxFile));
translations.putAll(newTranslations);
(pseudocode)
 
7:05 PM
yea i need to do some stoopid stuff with fileName
 
Yep, that's all you need :)
 
but that's the gist.
wonderful, thanks
 
No problem, I haven't even coded Java in months :P
 
I wrote a haskell script to print an arrow of asterisks
like this:
9
Q: Printing star greater symbol in Java

user3272408I need to print this in Java, but I feel that my code is too big: * ** *** **** *** ** * public static void main(String[] args) { for(int i=0; i<=3; i++) { for(int j=0; j<=i; j++) { System.out.print("*"); } System.out.println(); } for(int j=1; j

But I do not know if I will gain something from posting it for review
my code is incredibly trivial
Should I post it in your opinion?
 
heck why not?
 
7:16 PM
@Mat'sMug posted
 
great!
 
Java and Haskell are about the most different languages in existence
it is amazing that my code and the code in that question produce the same output while having nothing in common
 
@Caridorc Done much Scala? Switching between Scala and Haskell can teach you a lot about both
 
@itsbruce I know nothing about Scala
 
And every time Scala frustrates you (which it will, if you like Haskell at all), you can always say "Thank god I'm not doing this in Java"
 
7:25 PM
@itsbruce well Java is the easiest programming language in existence, not good, easy. Verbosity is its main defect
 
Functional Programming in Scala is a very useful book if you know even basic Scala but have some Haskell knowledge. It teaches you how to build all the things Haskell makes easy. Streams for example. There's a chapter on building a stream type which will, along the way, teach you a lot about how Haskell laziness works under the hood
 
Streams are not functional in my opinion. Python is imperative and has those built-in
 
Haskell lists are all streams and there's nothing non-functional about them. (Python copied it's list generators directly from Haskell, btw)
its*
 
@itsbruce python only copied streams and list comprehensions from haskell as far as I know
 
Comprehensions I meant, yes. Picked wrong word.
 
7:29 PM
1
Q: Printing an arrow of asterisks in Haskell

CaridorcThis code will print an arrow of asterisks, like: * ** *** **** *** ** * raisingAsterisks, decreasingAsterisks, arrow :: Int -> [String] raisingAsterisks n = take n $ iterate ('*' :) "*" decreasingAsterisks = reverse . raisingAsterisks arrow n = raisingAsterisks n ++ (tail (decreasingAsteris...

0
Q: Parse a plain text Nonsense NYC newsletter and show it with nicer Markdown formatting

kuzzoorooI wrote some code to parse an e-mailed events newsletter I'm on and redisplay it with better formatting. I like the output, but I'm not thrilled with the code. It feels like there's a lot of boilerplate, and the code bmay be overly abstracted for the simple task it performs, so I'm seeking advice...

 
There's an early chapter in FPinScala where you built your own List ADT. A couple of chapters later, you build a Stream type (some tough exercises in there). And suddenly a whole bunch of functions that were hard with strictly evaluated lists suddenly become very concise and expressive with lazy lists.
 
@JeroenVannevel Clearly I'm that 1 out of 100 then.
 
Laters
 
7:47 PM
@Caridorc It's all about readability vs verbosity in my opinion
When you're deep into a project you'll dread Java's verbosity, but when you want to glance at some Haskell project, you'll run away screaming
2
And maintainability is also a huge factor
 
You know you're doing things right when your code is terse, readable and reasonably unambiguous.
 
00:00 - 20:0020:00 - 00:00

« first day (862 days earlier)      last day (3157 days later) »