« first day (1785 days earlier)      last day (2236 days later) » 
00:00 - 21:0021:00 - 00:00

@meowgoesthedog i didn't find a way to move the question to CodeReview, I didn't know about this community before — Omar Mneimneh 54 secs ago
RELOAD! There are 5196 unanswered questions (89.9817% answered)
 
OK.
It probably won't get fixed anyway.
 
The SE staff follow all tagged issues on all sites. They can mark it 'by design' if they want.
 
They'll probably mark it bug and never fix it.
 
12:02 AM
Nahhh... they're pretty good at fixing their bug backlog (or marking it 'by design'). They will get around to it.
(Or they were pretty good a few years back anyway)
 
slow but steady or something
 
Also, it has red markings added to the screenshot, it gets prioritized much higher.
 
they did get somewhat sidetracked with trying to get into being profitable
what with teams, docs, teams (FKA Channels)
 
@rolfl Do hand-drawn markings with mspaint get higher priority than say, nice marking from Greenshot? ;-)
 
hand drawn only, nice marking even gets a downgrade ;)
 
12:10 AM
3
Q: For actions in a user profile more than a year ago the year should be visible

rolflWhen viewing a user profile for a mostly inactive user (For example, akmad), the activity displayed goes back multiple years, but there is no year value for "ancient" activities and it does not make sense..... Note how in the above picture, it appears the sort-order is wrong because the Jan 12...

 
12:24 AM
0
Q: Drawing circles from array to a Form

RaystafarianI've actually been struggling with painting with VB.Net for a few weeks. All I know is that I shouldn't use CreateGraphics if I can avoid it, so I've done just that. One of the community-challenge questions comes from a CodeGolf challenge that requires users to draw sprockets. This is only my be...

0
Q: Simple URI-template expand algorithm

Peter KraussI need a light URI-template algorithm to 80% of most commom cases, and a complete lib when I really need generic URI-templates... So I want to start with this piece of code from here: String.prototype.expandUriTemplate = String.prototype.expandUriTemplate || function () { "use strict"; ...

 
 
1 hour later…
1:49 AM
0
Q: React native search API with google appengine python

Niklas RosencrantzI have to create a backend for mobile searches from react-native. Therefore I have arranged backend with webapp2 using json that seems to work. The backend: class API(SearchBaseHandler): def get_count(self, key): data = memcache.get(key) if data is not None: retur...

 
0
Q: Microsoft Office Suite Tags

RaystafarianOur MS Office application tag names aren't consistent - excel ms-word ms-access outlook sharepoint (I suppose this one is debatable) I suggest we should normalize how these are named.

 
 
2 hours later…
4:12 AM
0
Q: Is my OpenVPN Login Bash Shell script for DD-WRT router safe from Command Argument Injection?

Rocketboy235I was hoping if you guys could critique my code as I'm hoping to make it very secure and also robust/efficient. I was referred to this place by another user and so after I made some improvements based on the suggestions from there, I hope to see if I could receive some feedback from you guys. Th...

0
Q: Haskell Convert 1-800 Numbers

Jim WhartonThis little app converts 1-800 numbers (with letters) to actual numbers. I'm very frustrated by the insertDashes function as it's very brute force. I'm sure there's a far more elegant solution. I'd appreciate any feedback on anything else though. module Dial ( enter, stripDashes ) wh...

 
i have uploaded in code review @Bailey Parker — shruthi 17 secs ago
 
4:28 AM
0
Q: How to convert my python code into python module?

shruthiAs i made one project called card scanning which is used to extract the accurate data from card using pytesseract and OPENCV so i have completed that and i want to convert my code into python module i'm empty about that so can anyone explain how do i proceed this and suggest some links for me. i...

 
4:46 AM
0
Q: How to pass custom cell data to another view controller when tap on button within the cell

Raviteja IOS Developer in that above i want to pass title_label text and price to another view controller when tap on BOOK Button within the cell(side Button ) In this table i am using custom cell not xib file i am new to IOS . i am in learning stage so help me hope! Thanks in Advance

 
 
2 hours later…
6:54 AM
Monking
 
Monking
 
SO's election (election phase) is currently running.
3
 
Pinned^
 
Thank you.
 
I think I have written enough JS code to warrant a review, to make sure I'm not making things really ugly for the rest of the app...
Probably wait until later today though, to organize and hopefully more will be online
 
7:20 AM
possible answer invalidation by Zeta on question by FirstLove: codereview.stackexchange.com/posts/175097/revisions
 
7:32 AM
Monking
 
The code has many problems. You better move the question to [codereview.stackexchange.com]axiac just now
@axiac one of the problems is that it doesn't work, therefore it's off-topic on Code Review. Please read our guide for SO migration before you redirect users to Code Review. — Zeta 1 min ago
 
8:37 AM
0
Q: The seasoned Zombie sniper: a query to find unanswered questions with specific tags

ZetaZombies! The dread of any barbecue. The grilled brains are sticky, their odour is icky, and they never stop talking about crossdead. But that is not the kind of Zombie we suffer from. We are looking for easy-to revive question Zombies. Questions, that have at least one 0-score answer but count a...

 
8:51 AM
I'm voting to close this question as off-topic because it is a better fit for codereview.stackexchange.comBart Kiers 54 secs ago
@Bart Kiers that is not true. Code Review is not intended for help with code obfuscation / golfing. — Coal_ 39 secs ago
 
 
1 hour later…
10:09 AM
Mnkng
 
-3
Q: Urgent! Code for Snake and Ladder game in C++

JawiI urgently need the code in C++ for Snake and Ladder text game (Using loops and arrays for 4 players) based on the following image: Output Should be like that Player 01: Current Location: 00 Dice Rolled : 06 New Location: 06 Player 02 : Current Location: 00 Dice Rolled : 04 New Location: 04 FLD...

 
Monking
 
10:23 AM
@SamOnela @ThoseWhoAreInterested ^^ This is the answered questions ratio as reported by @Duga since December 18th
 
What happened early March?
Was there a similar trend last year in March?
 
wow what query language is that?
this looks fancy
 
@Zeta Don't know, I didn't have appropriate logging for it back then.
@Zeta No idea
@Vogel612 splunk.com/en_us/download/splunk-enterprise.html - Free to use for indexing up to 500 MB of logs per day.
Best invention since sliced bread Log4j.
We use it at work and it's honestly one of the best tools I've ever used. Insanely powerful!
and a looooooooooot easier to setup and use than ELK
 
correct me if I'm wrong: splunk is a timeseries datastore?
 
@Vogel612 Splunk is an indexing tool for logs / any textual data
 
10:30 AM
okay that is awesome
 
It is bloody awesome.
At first I thought it always costed money, but when I found out that it was free to use for up to 500 MB of logs per day I instantly decided to start using it :)
I am not affiliated with Splunk Enterprise in any way but I promote this tool pretty much whenever I can :)
</commercialBreak>
 
And I still haven't found an use for it :o
 
10:46 AM
0
Q: Generic Graph using Adjacency matrix - Java

sanbhatThe main purpose of representing Graph using adjacency matrix method is, to check the vertex and its neighbor's existence in constant time proportional to O(n). In the various tutorials I have seen, Graphs contain only integer vertices and it becomes straight forward to represent them in v x v ...

 
@skiwi Well, if you don't have any logs, then you don't have any use for indexing your logs either :P
 
> in constant time proportional to O(n).
that is not how this works...
 
@SimonForsberg Fair point
Hmm, I should have some logs around though..
 
@Vogel612 Maybe they meant s/proportional/instead of/?
 
or just s/constant //
 
10:54 AM
Possible.
   //Maps vertex with its adjacency matrix index. O(1) to retrieve index of a vertex
Is Map in Java based on hashes?
Oh, nevermind. It's just an interface and he uses HashMap. Carry on.
 
@Zeta Exactly. There's also TreeMap which is not based on hashes, but HashMap is the most common implementation to use.
 
Tree map is O(log n) though, so you're correct that it's a dangerous assumption
 
Hmm, my log file is 264 MB
(I don't even know what's in there anymore)
No usable numbers at least..
 
^^ Who triggers the most "possible answer invalidation" messages?
^^ Same but only for those where editor == asker
 
11:10 AM
possible answer invalidation by sanbhat on question by sanbhat: codereview.stackexchange.com/posts/190359/revisions
 
^^ speaking of which...
^^ Who triggers the most "possible answer invalidation" messages where editor == asker, and each post only counted once
 
What query language is that?
 
50 mins ago, by Vogel612
wow what query language is that?
 
Ah okay
 
11:25 AM
@SimonForsberg can't you search asker = editor instead of using eval?
 
Monking
 
@Vogel612 For some reason apparently not. I just get 0 events then.
 
@SimonForsberg Shiny.
 
huh. weird
 
11:39 AM
0
Q: detect and crop a rectangular shaped image in real time

raoI am trying to detect rectangles of an image in real time. The task is to detect the rectangles and crop them automatically. I can able detect rectangles partially atleast (not fully) and crop them manully like pressing 'c' or whatever key that is provided in the program. But I am unsuccessful do...

 
Hmm, @Zeta, did you have another nickname before?
 
@skiwi Not that I was aware of. IIRC, I was always Zeta on SO/SE.
 
Hm okay, I just saw you answered a Haskell question so I got wondering :P
There's not too many that answer Haskell
 
@skiwi Roughly 53% of my posts are answers on Haskell questions :D.
 
You must be crazy ^^
 
11:45 AM
 
@SimonForsberg Ssssssh
 
@skiwi Given that the next language is C++ with 30%, followed by C with 7%... Yeah. That's obvious, duh.
@skiwi I think there's Gurkenglas, Vogel, 200, Petr, Erik and gallais as regulars.
The SO Haskell community is somewhat larger. I wonder whether duplode, dfeuer, Willem or some others would be interested in reviewing Haskell code too.
Heh. The PCG community has a chat room named "Of Monads and Men".
 
12:08 PM
I see
Haskell looks interesting, but writing something maintainable seems difficult, and Leksah is a bit of a pita in my opinion
 
emacs+evil+Intero is allright, as is VSCode+Intero. I've never tried Leksah.
 
0
Q: (MVC console app) View methods binding

Максим КолодниковI'm writing an MVC app with console as a View. In the View module, there is an actions dictionary, which maps user's input char to a _controller methods like this: class View: self._controller = controller self.actions = {'a': self._controller.method1, 'b': self._cont...

 
@Zeta VSCode could be interesting, I'm hearing positive sounds of it
Now I wonder if I could apply it to my idea to make a Factorio music blueprint of one song
 
Leksah is quite the pita, mainly the windowing system and the fact that it takes two hours to build the thig
@Zeta I wouldn't say that I can review much more than beginner haskell, though...
Gurkenglas reviews are very heavy. They don't really explain all that much.
 
Feb 12 '17 at 13:32, by Zeta
@Vogel612 To be honest, I have no idea whether my knowledge of Haskell would be enough for a productive environment.
@Vogel612 True. They usually provide an alternative solution that's semi-golfed. But there's almost always some explanation. It's just too heavy for questions.
 
1:05 PM
This should be asked on: codereview.stackexchange.comAndreas 59 secs ago
 
1:40 PM
0
Q: C++ Random Phone Number Generator

wardialerI was tinkering around with C++ after about 3 days of learning and decided to make a random phone number generator. This is the code I came up with #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; int getrandomdigit(); int main() { srand(tim...

 
I'm voting to close this question as off-topic because questions about working code belong on Code ReviewMichael 40 secs ago
@T.J.Crowder goo point on map... I've changed the code to forEach - I need a bunch of puts generated - how exactly do you propose to generate them given I have an array of tasks to call? sorry I wasn't posting this to get a full code review - but just because this was one of the few instances where SO didn't rapidly point out the error of my ways - even despite a review of existing questions — ErichBSchulz 25 secs ago
 
2:15 PM
0
Q: javascript, blackjack game

enoyI am learning javascript with the course Javascript Getting started by Mark Zaymota. Currently the code is being created in a script.js file, and I was wondering how could we refactor it to extract classes from it. The code in a file, until cards' generation and shuffle is: index.html: <!DOCT...

 
2:51 PM
-1
Q: Span tag effect on CSS layout

Ali HazimI'm a beginner at learning HTML & CSS, below is my html code and it's css styling, my problem is when I add any word in the (#HeadName) tag the page layout will change (add your name and see the difference before and after), how may I solve this problem? ` <!DOCTYPE html> <html> <head> ...

0
Q: Pushing conditionals into private methods

BrianThis is primarily concerned with the style of pushing the conditionals to perform an action into the private methods that perform said actions. I am extending a non-blocking API call to be blocking. I want to check if certain inputs were passed in and if they were to wait until the request is ac...

0
Q: collecting.py module and OOP for working with in Tweepy

AriefI have a module collection.py that functions as a tool to collect tweets using tweepy. It has two classes : Authentication and Collection. Authentication class will create an object that acts as a starting point to collect data from twitter. An instance of this will the an argument for Collectio...

 
3:04 PM
@CaptainObvious Broken.
 
3:17 PM
Have you compiled your code? Run it? I don't see a question here. If this is working code and you're looking for tips, I'd suggest posting to the Code Review stack exchange. — ShadowRanger 36 secs ago
I'm voting to close this question as off-topic because it doesn't ask a question beyond asking for code review, which belongs on the CodeReview stack exchange. — ShadowRanger 38 secs ago
SO is not a code review site. You should have a clear question / explanation and what you have tried to do to solve the problem. — James Z 39 secs ago
 
0
Q: Is there a clean wya of conditionally increasing or decreasing a value?

HimmatorsThis is what I'm trying to achieve: var direction = (getState() < state) ? -1 : +1; //check direction var state = state + direction But I don't like this solution at all. Would like something like: var state = (getState() < state) ? state++ : state--;

 
3:35 PM
If this code works fine, then this question is off topic on Stack Overflow. It may be good for our sister site Code Review, but please remember to check their rules before posting. — Joe C 49 secs ago
I'm voting to close this question as off-topic because the code works. Code Review is a more appropriate Stack Exchange. — AJNeufeld 8 secs ago
I'm voting to close this question as off-topic because questions about improving working code should be posted on codereview.stackexchange.com. — Jonathon Reinhart 43 secs ago
This is not a code review site. Try codereview.stackexchange.comMad Physicist 41 secs ago
 
4:00 PM
0
Q:  appleseed is a command line widget (CLW) [macOS + iTerm2]

Matt─── appleseed on GitHub  appleseed v1.0.0 Is a command line widget (CLW), I designed for macOS and iTerm2. It's a flexible platform for process automation and added eye candy. It utilizes imgcat to view image files inside the terminal with the help of shell integration. • For best results, ...

0
Q: Why the toast gives me zero-size and how to get it populated?

Michael ShenoudaI'm working on a client-server application where pc is the server and android is the client, I want to populate an arrayList (cu) from the server but the toast gives me zero-size for the arrayList (cu) although it gives me the right size inside the class MyTask which extends AsyncTask, please Hel...

0
Q: Define assign member function in map

MakCould anyone advise, below source code is according to Task Description. In addition, kindly advise any improvements Task Description interval_map is a data structure that efficiently associates intervals of keys of type K with values of type V. Your task is to implement the assign member func...

 
4:13 PM
@CaptainObvious Broken.
39
Q: Is there any harm of leaving Ethernet outlet unplugged?

John doeI was wondering if leaving an active Ethernet port with no plug in it was safe . We have one in our kitchen right next to our face level and I was wondering if leaving it unplugged in the open was safe like does any radiation or infrared laser/light come out of it. Might sound very paranoid but I...

Holy carp!
 
0
Q: Self-made string class C++

David Quintero GranadilloSince I've been working with C strings these days, I decided to make a string class from the ground-up just to see how it would go. I wrote all labels in Spanish (my mother language) just for the sake of it. If you have problems understanding it, I'll simply translate them into English (DISCLOSU...

0
Q: I want to know the standard way of function call in inheritance

vaibhav kulkarniI have 2 types of user helper and helpee. I have created the user class which is my base class for two types of user. Both user helper and helpee have some common functionality like login, logout forgot passord etc for this reason I have created the user class and i am extending the helper and he...

0
Q: how to get all the files and show them on jsp stored inside a folder using java

s.nainwalfor (Part filePart : fileParts) { filename = Paths.get(filePart.getSubmittedFileName()).getFileName().toString(); InputStream fileContent = filePart.getInputStream(); filePart.write(savepath+File.separator+filename); } using this co...

 
And it isn't even September...
@CaptainObvious Broken.
@CaptainObvious Fun with Unicode being not universal.
 
4:36 PM
0
Q: java - A* search algorithm

John DoeI'm having trouble with my homework implementing A* search algorithm in java, I'm given the graph, origin and destination, I had to follow some specific tasks in the homework so the code might be a bit weird(for example each time I'm adding to openlist I must call the protected boolean addItem(O...

 
@Mast Huh?
 
This might be a better fit at Code Review -- but even there, be sure that you first read the posting guidelines. — John Coleman 23 secs ago
 
@Zeta Oh, it's an old joke that still holds. Related.
 
Oh.
 
5:09 PM
Huh, Visual Code takes less than thirty seconds to install
How did Microsoft manage to make something good?
 
Sure that isn't the pre-installer?
 
No this was all
Need to find out what this Intero for Visual Code is
Oh wow I don't have Git yet on this PC
@Zeta I can't find Intero in VSCode, but I do see Haskero and Haskelly, any clue?
 
@skiwi I'm currently in the middle of a spanish C++ review. I haven't used VSCode+Intero yet. I'll check in a minute.
 
@Zeta Ah okay, I thought you were an user of it
 
I usually use GHCi+any editor (even plain old notepad) or emacs+intero. But I have to setup VSCode either way these days.
 
5:15 PM
> Haskero is a full featured haskell IDE using Intero backend
What surprises me a little bit is that I would install an IDE extension inside Visual Code, an IDE
I know my PC is a beast, but installing that extension under one second... I don't quite believe it worked
 
@skiwi VSCode isn't an IDE, though. It's a heavily modifiable editor.
It's like Sublime Text in that regard.
 
Now it starts to make a bit of sense
 
Usually you don't need more than an editor though.
I do everything in Atom nowadays.
 
> Initializing Haskero...
Spawning process 'stack' with command 'stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load'
[Error - 6:19:02 PM] Server initialization failed.
Message: Request initialize failed with message: Failed to start process 'stack', Haskero must be used on stack projects only. Details: Error: spawn stack ENOENT
Code: -32603
Fun times to come..
 
@skiwi Yeah, that's the one. Haskero. That's VSCode intero layer.
@skiwi Allright. I'll grab an energy drink and be right back. This will be fun, as I'm going to delete my Haskell environment so that I can follow you into the darkness.
 
5:21 PM
Don't mess up too much!
I need to get dinner now though
 
@skiwi Looks like you didn't install stack, though. Did you follow the instructions?
 
@Zeta Were there any instructions?
I'll follow them after dinner then
 
@skiwi On the extension's description, although they link to an external document.
 
-1
Q: Basic Python - Scorecounter and Randomizing Questions

RichardMy goal here is to add a scorecounter for this text-based game, as well as put the questions in a different order each type someone plays it. I am new to Python, still learning, which is my reasoning for asking this here. import random play = True while play: print() print('This is a ...

0
Q: matrix calculator in c

maxhow can I make the code look cleaner, what can I do to reduce the amount of lines I have wrote. /* This program calculates the addition, subtraction and multiplication of matrices as well as a scalar multiplication (PROJECT 3) */ #define _CRT_SECURE_NO_WARNINGS #include <stdio.h>...

 
@Mast My problem with Atom was that it didn't account for QWERTZ :/.
 
5:29 PM
@Zeta I don't use QWERTZ, so I wouldn't know :-)
 
Mad Physicist my concern is that I'm not supposed to have one UDF for adding and another one for subtraction and I wanted to know how to create a single one that will do both things. I'll check to codereview.stackexchange.com, thanks for the advise — max 49 secs ago
 
But I imagine that could be a deal breaker.
 
3
Q: Regarding editing questions

yuriI'm confused about several aspects of editing, specifically editing questions. I often see editors such as the speedy Jamal and others making relatively minor edits (such as changing "i" to "I"). However the help center seems to advise against such edits and even the system will block them. Sev...

 
@Feeds Heh. That's ironic.
 
6:15 PM
Perhaps a more productive question would be "What cases does my code get wrong?", although even that is close to Code Review. — Davis Herring 36 secs ago
 
0
Q: General Purpose C Dictionary

user2418731I'm trying to create a general purpose C dictionary (as an opaque data type) capable of dynamically allocating basic types (ints, floats, strings and longs) as well as accepting void pointers to already allocated custom types. It works as far as my testing shows but I question the basic architect...

 
@DavisHerring I wouldn't say such a question would belong at Code Review. This questions seems to be more of "What's the difference between code A and code B?" Code Review is for "How can code A be better?" (preferably no code B included) — Simon Forsberg 49 secs ago
@SimonForsberg & Davis On top of that: the 2nd piece of code wasn't written by the OP. On Code Review, one is supposed to know why you wrote the code you posted and be at least the maintainer of said code. — Mast 14 secs ago
 
6:38 PM
I'm setting up stack now, and now I wonder if I shouldn't have used WSL instead of Windows
 
0
Q: Find all pairs that sum to a given a number without using hash map

Exploring Find all pairs that sum to a given a number without using hash map. Duplicate pairs is not allowed. Input array cannot be modified. input: {-2, -1, -1, 5, 7, 7, 7, 7, 8}, target = 7 output: (-1, 8) As it is mentioned using map is not allowed, decided to use binary search. He...

 
@Duga @Mast I don't think that applies for the code B there. That was just provided for reference
@skiwi stack?
Oh, Haskell.
 
@SimonForsberg Yes
 
@skiwi I don't know whether VSCode can call into WSL applications.
If the WSL applications are not available in your %PATH% it probably won't work.
 
@Zeta VSCode can be installed too on WSL, can't it? :)
 
6:45 PM
No idea, I'm on Win 8.1
 
:o
It's close to working, but not quite there yet
> Could not find module `Distribution.Simple'
Use -v to see a list of the files searched for.
|
 
That's Cabal. Huh.
 
And still need to figure out where my actual executable is
 
The one you've build with stack?
 
yeah
At least managed to find that one now
 
6:54 PM
@skiwi Yeah, that step sucks, to be honest.
@skiwi Oh. How did you create that project? With stack new? Let me try to reproduce that.
 
stack new factorio new-template
Oh, the guide also has individual steps..
 
@skiwi Ignore the Setup.hs. It's necessary for cabal and will be inspected by cabal build, which knows where Distribution.Simple lives.
 
@Zeta so I can delete it?
oh, I need a debugger too
Or running the program from VSCode, or is the idea that I use the console for that?
 
@skiwi Err... No. It's part of your package and instructs cabal how to build your program, as far as I know. I usually don't change it.
Yay. My package database is broken.
Well, that borked stack installation was almost 2 years old. It's about time I'll reinstall it.
Err. I just noticed that you've never participated in , neither on SO or CR. Is this your first Haskell project ever?
 
@Zeta I remember having used Haskell before, but I forgot what I did and how it worked
I think it was Project Euler related stuff, cannot find it though
Makes me wonder if I even bothered saving it, I spent more FP-time with Clojure I realize now
Learn Haskell in 10 minutes... Yeah, right
 
7:17 PM
This is yet another trash-comment mentioning Code Review (just for debug purposes for my bot Duga, I wonder how many of these deleted comments I have now) — Simon Forsberg 41 secs ago
 
@skiwi s/minutes/months/ ?
> [2018-03-24 20:17:00.485] INFO net.zomis.duga.tasks.CommentsScanTask - Code Review comment 85940148 on question 13880202 posted by Simon Forsberg with 10195 reputation: This is yet another trash-comment mentioning Code Review (just for debug purposes for my bot Duga, I wonder how many of these deleted comments I have now)
Perfect.
In a week or so I'll show you some more powers of Splunk ;)
 
:o
 
@skiwi Any learn X in Y minutes tutorial is a lie.
Except for "learn to hate X in Y minutes". Those are somewhat accurate.
3
 
Haskell is still magic to me
 
Consider deleting the question. It may be appropriate for code review, but even there it would need to be improved quite a bit, including specifying exactly what metric you would use to define "improve". — Hovercraft Full Of Eels 39 secs ago
 
7:32 PM
-1
Q: Random Tower of Hanoi for robots

tdk408This puzzle is similar to the Towers of Hanoi, but with looser rules. Usually smaller disks must be placed on larger disks, but in my application, disks can be placed on any other disk without regard to size. Another way to put it is, a robot needs to physically sort a random pile using two hold...

 
@skiwi Allright. I didn't knew that, but there is a Haskell debugger for VSCode. It needs another package called phoityne-vscode. Use stack install phoityne-vscode intero to install both the vscode and phoityne-vscode. Afterwards, you can install the Haskell GHCi Debug Adapter Phoityne in VSCode.
phoityne-vscode can take a long time to build. You can use -j <numberofprocesses> to speed it up somewhat.
@skiwi "Any sufficiently esoteric programming language is indistinguishable from witchcraft."
 
@Duga Wohoo, more data for Splunk!
 
@Zeta I'll look into the debugger in a bit, need to figure out a new error though
I cannot find System for some reason
 
There is no module named System as far as I know. At least in base.
 
Ah.. System.Environment, might've been looking at something I shouldn't have been looking at
 
7:41 PM
hoogle and hayoo might come in handy
 
Woot, got my first working Haskell program!
 
Congratulations! What does it do?
 
@Zeta Print the first program argument, unless there are none, then it shows the help
Now waiting on installing the debugger before I can test the next one :D
 
@skiwi Actually, you might want to skip that.
Might be my installation, but it's borked here.
Sorry :/
 
I'll double-check, it's over halfway already anyway
How fast is Haskell actually?
 
8:01 PM
@skiwi That's a horrible question.
 
@SimonForsberg Compared to C++, to be more clear then ^^
 
Still a bad question.
How fast is any language?
It depends on the code you write and the performance of your computer, and what problem the code solves.
Some things are probably faster in C++, others faster in Haskell.
Both Haskell and C++ compiles to native code.
 
131
Q: Why is Haskell (GHC) so darn fast?

PyRulezHaskell (with the GHC compiler) is a lot faster than you'd expect. Used correctly, it can get close-ish to low-level languages. (A favorite thing for Haskellers to do is to try and get within 5% of C (or even beat it, but that means you are using an inefficient C program, since GHC compiles Haske...

 
How fast is native code?
 
Maybe the question is somewhat valid :P
 
8:07 PM
I'm not afk, by the way, but as Simon said, it's a hard question.
Haskell brings it's own runtime with it, so there's some overhead. It's lazy, many types are boxed, you have to take care not to produce a space leak...
On the other hand, there's no undefined behaviour.
Copying a file is as simple as main = readFile "input" >>= writeFile "output", so for the question "is it faster to write a file-copying program Haskell than to write one in C++" Haskell would win :P
 
^^
I think it's the least of my concerns in any case
Figuring out how to use a function that returns an Either is of higher priority
Is it normal to write do statements instead of putting everything on oneliners?
import Data.ByteString.Base64

blueprintJson :: [Char] -> [Char]
blueprintJson str = do
    let (decoded, _) = decode str
    decoded
Magic ^^ Which doesn't work
 
@skiwi Yes, but it depends.
@skiwi That's because... oh. Gimme a second.
Do you try to learn Haskell by code examples?
 
@Zeta I'm trying to do that yes, and using a tutorial where necessary
 
It's normal to use do for monadic computations.
 
But if you use do a lot, then Haskell is both imperative and functional?
 
8:15 PM
@skiwi I'll grab a drink, then.
 
Though somehow it feels wrong to ignore one of the two values
 
@SimonForsberg is it OK if we continue to talk about Haskell here?
 
@Zeta Go ahead. As long as there's nothing more important going on.
Just don't ask me anything about it :P
 
Oh :(
@skiwi Either way. do is syntactic sugar. Everything that's written with do can be written with >>= or >>.
Both following functions are the same:
askUserDo = do
  putStrLn "Hello User"
  putStrLn "What's your name?"
  name <- getLine
  putStrLn (name ++ "? That's a nice name!")

askUser = putStrLn "Hello User"
       >> putStrLn "What's your name?"
       >> getLine
       >>= (\name -> putStrLn (name ++ "? That's a nice name!"))
The first one is just sugar for the latter.
@skiwi Which decode function is that?
 
0
Q: Player Marking , Optimal marking Using Graph

Espoir MurhabaziI was asked this problem for a challenge, And I decided to share my solution here to search to review the code : here is the problem statement : For this challenge, we are going to cover some graph problems. We shall imagine a game of basketball or football. If we think of each of the players a...

-1
Q: Delete from linked list C given key

user165170#include <stdio.h> #include <stdlib.h> struct item { int key; int data; struct item *next; }; struct item *head = NULL; int main() { extern void insert(int key, int data), delete(int key), printall(); extern int search(int key); insert(38, 3); insert(20, 2); in...

 
Either is not a pair.
And a ByteString is not a [Char]
 
I figured that out about now
bpDecode str = do
    let bstr = pack (tail str)
    decode right bstr
I want to write this, but it cannot resolve pack
hackage.haskell.org/package/bytestring-0.10.8.2/docs/… That should be the way to go from String to ByteString
 
Right. Did you include bytestring in your .cabal file?
bpDecode :: String -> Either String ByteString
bpDecode str = decode (pack (tail str)) -- why do you take the tail of the String?
 
@Zeta No
 
Ah, Factorio blueprints always start with a 0?
 
8:31 PM
@Zeta Correct
 
Monking
 
Monking @Phrancis
 
@skiwi That's the issue. Dependencies of dependencies aren't made available automatically.
 
dependencies:
- base >= 4.7 && < 5
- bytestring
- base64-bytestring
Maybe I did something wrong but it's not being picked up yet
 
Can you post the exact error message?
Hi @Phrancis. Did you put your JS up for review?
 
8:35 PM
import qualified Data.ByteString.Char8 as C
import Data.ByteString.Base64

blueprintJson :: [Char] -> [Char]
blueprintJson str = str

bpDecode str = do
    let bstr = C.pack (tail str)
    let (_, decoded) = decode bstr
    decoded
I know the method is unused, but it should work, right?
It seems like it cannot find the internal package, even though I added it as dependency
 
Cannot reproduce the error.
Err. Did you modify both the package.yaml as well as the .cabal file?
 
I didn't modify any .cabal file
> -- This file has been generated from package.yaml by hpack version 0.20.0.
 
Allright. That's good. Otherwise the .cabal file would take priority.
 
When calling stack build I haven't seen that file getting pulled though, but that maybe because the Base64 variant is already using it internally?
That's my issue now, VSCode says the import failed, but I think the compiler says it succeeded
 
Ah, but that's not a pack error :D.
Restart VSCode. Intero hasn't picked up the change.
 
8:41 PM
Apparently I needed to reboot VSCode after installing a package..
bpDecode :: [Char] -> C.ByteString
bpDecode str = do
    let bstr = C.pack (tail str)
    let (_, decoded) = decode bstr
    decoded
Now this says that it couldn't match types, but I don't understand why
 
Because Either isn't a pair. With let (a, b) = ???, ??? needs to be a pair.
However, Either is a Sum type. It's either Left or Right.
 
Ah... you can't deconstruct it like this?
 
No. You'd need let (Right decoded) = decode bstr, if you don't care about missing patterns.
 
For step one
 
But then C.ByteString isn't an instance of Monad, so do won't work to begin with.
 
8:45 PM
0
Q: Find all triplets that add up to a given sum

Exploring Given an array and a value, find all the triplets whose sum is equal to the given value. For example, if the given array is {12, 3, 4, 1, 6, 9} and given sum is 24, then there are triplets (12, 3 and 9) present in array whose sum is 24. 6, 9, 9 6, 6, 12 3, 9, 12 ordering of ...

 
bpDecode str = Right (decode C.pack (tail str))
I now completely messed it up ^^
 
It's almost there. Almost.
 
And the outer parentheses should be superfluous
 
First of all, function application binds strongest, so you'd need another pair of brackets: decode (C.pack (tail str)).
 
Ah of course, functions are arguments too
 
8:47 PM
Next, if you use Right x in that context, you pack whatever is in x in another Either.
You need to pattern match.
The easiest way in that context is a let ... in ... expression:
bcDecode str = let (Right decoded) = decode (C.pack (tail str)) in decoded
 
@Zeta Not yet, thanks for reminding me :)
 
It works, but why?
 
Witchcraft.
 
So decoded is something pattern-matchable? In this case an Either, and we only have one pattern? That's why?
 
decode's result is an Either. There are two constructors for an Either: Left and Right.
Usually, we would use pattern matchin to check which constructo has been used to create the Either:
whichHasBeenUsed :: Either a b -> String
whichHasBeenUsed (Left  _) = "Left"
whichHasBeenUsed (Right _) = "Right"
We're using (Right decoded) = ... here. If decode returns a Left instead, we end up with a pattern matching error on runtime. GHC will warn you if you enable the right warnings about those cases.
 
8:53 PM
Alright
 
I should add Either's definition:
data Either a b = Left a | Right b
An Either a b is either a Left containing an a or a Right containing a b.
Think of template <typename a, typename b> using Either = std::variant<a,b>;.
 
I understand now
(This is not in 10 minutes though)
 
I think the 10 minutes don't include a base64 decoder for Factorio blueprints.
 
And it's JSON. So you'll need aeson.
 
8:56 PM
For some reason library maintainers don't provide examples?
 
We follow the... ugh... types.
It's a little bit of a hassle.
 
For that you first need to be able to read the API :D
 
Well, it's like Tetris or playing puzzles. You have already bcDecode :: String -> ByteString.
So it should be reasonable to use ByteString -> ByteString now :P.
... damnit.
*sigh* The library you just linked uses another ByteString type >.>
 
I just see it uses the Lazy type.. fun!
 
Right.
 
00:00 - 21:0021:00 - 00:00

« first day (1785 days earlier)      last day (2236 days later) »