[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 387
Thread images: 31

File: dptphp.png (456KB, 934x1000px) Image search: [Google]
dptphp.png
456KB, 934x1000px
Old thread: >>56540659

What are you working on, /g/?
>>
D is just okay.
>>
pls respond
>>56545283
>>
>>56545322
D a shit
>>
File: employed.png (1MB, 900x1162px) Image search: [Google]
employed.png
1MB, 900x1162px
Employed Haskell programmer sighted
>>
import System.Environment

primes :: Int -> [Int]
primes n = sieve 2 [2..n]
where sieve _ [] = []
sieve p [x] = [x]
sieve p xs = p : sieve (head rest) rest
where rest = filter (\x -> x `mod` p /= 0) xs

main :: IO ()
main = do
(num:_) <- getArgs
mapM_ print $ primes . read $ num


Beautiful language, huh?
>>
File: ufo.jpg (89KB, 600x404px) Image search: [Google]
ufo.jpg
89KB, 600x404px
>>56545330
He was flying away in this vehicle when I spotted him
>>
>>56545328
Okay fine.
>>
>>56545343
I was just trolling anon
>>
File: persuasion.webm (2MB, 640x360px) Image search: [Google]
persuasion.webm
2MB, 640x360px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)
>>
>>56545326
Use a language with actual generics
>>
>>56545331
it either looks really good or really bad.
>>
>>56545331
Pretty clumsy.

import System.Environment

primes :: [Int]
primes = sieve [2..]
where
sieve (x:xs) = x : sieve (filter (dontDivide x) xs)
dontDivide d n = mod n d /= 0

main :: IO ()
main = do
(a1:_) <- getArgs
print (takeWhile (<= read a1) primes)
>>
>>56545450
neat
>>
>>56545423
Ok, going back to java.
>>
So I'm having a huge amount of difficulty with a program. The code below creates a simple java swing frame and allows the user to move a square left and right. If you hold down the direction key down the square jerks/lurches forward a couple of pixels about every 2 seconds. Why is this?


public class TestSquare extends JFrame {

protected static Keyboard2 key;

public static void main(String[] args) {
new TestSquare();
}

public TestSquare() {
setResizable(false);
setTitle("movesquare");
key = new Keyboard2();
addKeyListener(key);
add(new TestPanel(key));
pack();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setVisible(true);
requestFocus();
}
}

@SuppressWarnings("serial")
class TestPanel extends JPanel {

public static int x, y;
private Keyboard2 key;

public TestPanel(Keyboard2 key) {
this.key = key;
setPreferredSize(new Dimension(1280,720));
setBackground(Color.white);
}

@Override
public void paint(Graphics g) {
super.paint(g);
g.fillRect(x, y, 100, 100);

key.update();
if (key.left) --x;
if (key.right) ++x;

try {
Thread.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}

this.repaint();
}
}

class Keyboard2 implements KeyListener {

private boolean[] keys = new boolean[120];
public boolean up, down, left, right;

public void update() {
left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];
}

@Override
public void keyPressed(KeyEvent e) {
keys[e.getKeyCode()] = true;
}
@Override
public void keyReleased(KeyEvent e) {
keys[e.getKeyCode()] = false;
}
@Override
public void keyTyped(KeyEvent e) {}
}
>>
File: 1473572266237.png (12KB, 189x387px) Image search: [Google]
1473572266237.png
12KB, 189x387px
Hey OP of the thread with pic related, sorry that I didn't get the chance to reply before the thread got archived
I miss it too
>>
File: pierre here.jpg (98KB, 400x500px) Image search: [Google]
pierre here.jpg
98KB, 400x500px
>>56545331
>function named sieve
>not a sieve
typical hasklelfag
>>
>>56545322
>>56545328
https://wiki.dlang.org/Voldemort_types
>>
Planning on implementing a Rails-inspired web framework in Free Pascal. Might me the caffeine high because I just drank a coffee after a month without caffeine but I think it can be done.

Wish me luck
>>
i know it's a long shot but i need 2d data for some tests, problem is some of this data is literally "draw something at random", doing it by hand is going to be a pain, and i can't use function or distributions to create them because it's either gonna be not on par with what i am looking for or way too time consuming, is there something where i can draw random shit on a board and get back 2d data?

tldr need 2d data wich i draw out by hand
>>
>>56546695
not sure if you can program, but you can make an image with your drawings and then write a script to grap the x y values of the pixels that you need
>>
https://youtu.be/KlPC3O1DVcg

is c obsolete and am i better off learning c++ instead
>>
>>56546798
>>56546695
yeah ofc i can, but i need to do this very fast so i was looking for something already done, wich i found btw, linking in case anyone else needs

http://www.librec.net/datagen.html
>>
>>56546799

'Is English grammar obsolete and am I better off studying English literature instead?'
>>
>>56546839
so learn c then move to learning c++
!
>>
>>56546866

'so I learn grammar and then write a story?'


Do a small project in C and then do a small project in C++ - you don't just 'learn' them.

Go and write fizzbuzz in C or something and then post it here.
>>
File: win32gui.png (39KB, 1436x976px) Image search: [Google]
win32gui.png
39KB, 1436x976px
I'm currently trying to send commands to a background program without it being in focus. I managed to send a mouse click to it but I haven't figured out how to send it to a specific location within the program yet.

I am using win32gui for Python and the method I am using is called SendMessage(). I takes in 4 parameters:
1. The window object
2. The command you wish to send
3. No fuckin clue.
4. The x and y coordinates somehow mashed into one integer.
>>
>>56546572

>Rails-inspired
Gross! Such an over-convoluted mess.

>Free Pascal
Why not Ada?
>>
>What are you working on, /g/?

your mum
>>
File: 1454064985684.png (6KB, 273x115px) Image search: [Google]
1454064985684.png
6KB, 273x115px
>>56546799
>Hey Bjarne what kind of haircut do you want?
>just fuck my shit up senpai
>I got you familia
>>
>>56546956
>Gross! Such an over-convoluted mess.
I mean one that uses MVC and convention-over-configuration, of course not a carbon copy of Rails which in later versions has become quite bloated imo.

>Why not Ada?
I learned to program in Turbo Pascal. Just going back to my roots.
>>
>>56546971

savage
>>
>>56546893
well, I was going through K&R before going on vacation and now that I'm back I was thinking of continuing with it, that's what I meant by learning it, but a friend has been telling me recently that there was no point and I should just go for c++
>>
>>56546914
Wth WinAPI you'd use MAKELPARAM macro but since it's probably not available in Python's win32gui, you will have to implement one yourself.

The MAKELPARAM macro packs two 16-bit integers into a 32-bit one using the lower & upper 16-bit parts of the 32-bit integer respectively.

With that knowledge we can write this:
def makelparam(low, high):
return (low << 16) | high


Then you should be able to pass that to the SendMessage function, for example:
SendMessage(window, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, makelparam(x, y))
>>
>>56547003
actually just go with python or ruby if you wanna make money, sure you can't brag about your autism on /g/ with ruby but god damn does it pay well
>>
>>56547003

After a while programming/engineering you'll realize that you've stopped learning incremental chunks of information and started getting a ‘feel for things’. Your lessons will be more intuitive and exploratory and the problems you’ll face will be more sociological. At work I solve code problems all day but the bigger problems are with people management and process.

Do one thing and do it well. Do one thing and do it to completion before doing something else.

Programmers that don’t heed this end up with 3000 unfinished projects. Learn C and learn it until you have one single tangible project that you can show to someone else and which is a finished project because it fulfills a set of requirements that you set when you started it.
>>
>>56547027
I tried this but regradless of what integers I put in as the last two parameters the clicks stay in the same place where I left the mouse last in the window of the program.
>>
when trying to convert one markup language to another, is there any benefit to building a full AST instead of just translating the list of tokens?
>>
Is there a name for rounding errors that build upon eachother? I want to make a variable that will count the total incorrectness from built up rounding errors but I can't think of a name.
>>
>>56547089
I'm not sure then but I've one more possible solution. Have you checked whether the function needs the absolute coordinates in regards to the entire desktop or if they are relative to the window position?
>>
>>56547174
I have tried with both options sending both coordinates relative to the window itself and coordinates relative to the entire desktop but neither worked. I don't think that is the problem I have to focus on first though. My current problem is that regardless of what I send to the function I get no change in mouse position at all. I even made a loop that changed the value each loop just to see if I could get the mouse to click in a different spot at all but no such luck. I have a hunch that it is the third parameter (currently "win32con.MK_LBUTTON") that has to specify that it is by coordinates I want to decide where to click but I can't find any documentation on what the different input options does. Not even MSDN says anything about it:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx
>>
>>56547151
If it's small enough and/or you don't need to do a lot, you're probably better off using a list of tokens. But it really depends on what you're doing.
>>
File: 2016-09-11_14-21-43.png (230KB, 1208x911px) Image search: [Google]
2016-09-11_14-21-43.png
230KB, 1208x911px
Playing with distance fields in GLSL. It's easy to do csg and other fun stuff with this.
My work so far: http://glslsandbox.com/e#35177.0
>>
Modelling stream processors as continuous functions on final coalgebras.
>>
>>56547503
>look at me, I know words
>>
how should I rollback changes after a junit test which inserts into a database?

I'm not using any frameworks or anything, just JDBC.
>>
File: 1428089776090.jpg (123KB, 419x248px) Image search: [Google]
1428089776090.jpg
123KB, 419x248px
>>56547709
Thanks for the attention!
>>
>>56545311
Working on getting ROS setup on my rpi for my senior design project. Gonna use it with a kinect for some computer vision stuff.

The fucjing deadlines on this projct are ridiculous. Here's to hoping openni and ROS are well documented..
>>
>>56547503
I still don't understand co-algebras
Are they sort of like multiple branches / outputs?

For instance comonoids:
co+ :: m -> (m, m)
co0 :: m -> () -- useless in haskell, unless you make it a monoid in a monad category and give it an effect
>>
>>56547942
comonoid*

I suppose that would be a comonad though, like
m -> m (m a)
m a -> a

Do coalgebras help you understand comonads?
>>
>>56546218
You shouldn't put your square movement logic inside of paint. You should keep it all in the button press. Windows sends a keypressed event every X milliseconds when a key is held down. Linux distros tend to send a new event entirely. So you can increase the x position in the keypressed event handler.

After that, you need to invalidate and revalidate the panel. Paint will only be called when the canvas it's drawing on is invalidated or you explicitly call repaint. So, you should do this in your event handler. Not in the paint method itself.

Only do drawing in paint. Never logic. If you need to pass data to the class containing the paint method, that's what interfaces are for.
>>
>>56547982

I did some digging and wrote a version of this using a timer and action listener and another version using JavaFX and keyframes.

The same stuttering happens in both. It seems as though the every 2 seconds stuttering is something far more fundamental and related to how the drawing is distributed across hardware cores.

This gets the same problem:

public class MovementStutter {

public static void main(String[] args) {
JFrame win = new JFrame("Stutter Demo");
win.getContentPane().add(new GamePanel());
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
win.setResizable(false);
win.pack();
win.setVisible(true);
}
}

@SuppressWarnings("serial")
class GamePanel extends JPanel implements ActionListener {

private boolean running;
private double x;
private double y;
private double movementFactor;

public GamePanel() {
setPreferredSize(new Dimension(640, 480));
setFocusable(true);
grabFocus();
movementFactor = 1;
running = true;
new Timer(16, this).start();
}

public void actionPerformed(ActionEvent e) {
update();
repaint();
}

private void update() {
if (!running) return;
if (x < 0) {
movementFactor = 1;
} else if (x > 608) {
movementFactor = -1;
}
x += movementFactor * 200 * 0.016;
}

@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.fillRect((int) x, (int) y, 32, 32);
}
}
>>
Scapy is a Python library which allows someone to craft packets. You can use the command ls() to list layers and commands.

Does anyone know the Python equivelent of using ls() for some functions?

It would be really useful to know what arguments can be passed into functions, similar to what can be done with with Pycharm.
>>
How did oracle let java get overtaken by c# in features and quality so fast?
>>
>>56548285
By not having any features or quality
>>
>>56548285

Because Java has to wait for all 12 billion people on their mailing list to complain about potential features, and C# just goes for it, anyway.

There was also no historical baggage, so on C#'s end, things like type-erased generics and half-baked 'streams' were never a problem.
>>
>>56548360
Whats the actual problem is with type erasure?
>>
>>56548285

Because Oracle doesn't actually give a shit about Java.
>>
How did Bjarne Strousup let c++ get overtaken by rust in features and quality so fast
>>
>>56548394

It's just a shit system compared to reified generics where the type info is preserved.

>>56548408

That, too. It's unfortunate.
>>
>>56548445
What are the tanglible consequences to the programmer?
>>
>>56548440
No serious business will move to Rust.
>>
>>56548480

Runtime type safety, and also that pesky issue of primitives is not a problem.
>>
>>56548440

He refused to attach a CoC to his language, and that was really his downfall.
>>
>tfw no impredicactive types
>>
>>56548178

Just made a js implementation. I get the same thing with that also.

This is getting pretty spooky.
>>
I might try and make a really basic torrent client
>>
>>56548440
language growth should be taken cautiously
>>
>>56548665
c++ never stopped growing. It just stopped getting quality features and instead got a million more half baked datastructure objects.
>>
>>56548694
>got a million more half baked datastructure objects

what do you mean?
>>
>>56548706
How should I know, I'm just a shitposter.
>>
>>56548178
my brother please help me
i have compile the code but it does not run
i require the solution immediately email [email protected]
please do the needful
>>
What the fuck is the "Function Object technique" for Java? It came up in my class this week and I can't find any good online explanations. I can tell it's something about passing methods as parameters to objects or methods, but I'm not really sure how to use it or what it's useful for. My professor is really shitty so he didn't even mention this in class.
>>
>>56548828
it's higher order functions + OOP bloat
Higher order functions are insanely useful
>>
File: 2016-09-11_16-40-01.png (675KB, 1278x1044px) Image search: [Google]
2016-09-11_16-40-01.png
675KB, 1278x1044px
>>56547429
Replication is fun.
http://glslsandbox.com/e#35177.4
>>
Doing c++ and using google test framework, and using anonymous namespaces.
I can name anonymous namespace something like internal but that i really don't like them being seen from outside the namespace they were meant to.
I could #include the .cc files in the .cc test files and compile from there, is that seen as a dirty practise or acceptable?
>>
say I have a hierarchy of classes, and all of the concrete ones call a method after initializing variables:
public Dog(...) {
super(...);
someMethod();
}


and this too
public specializedDog(...){
super(...);
someMethod();
}


I only want to ever call method once. So what if I instantiate a specializedDog, then it calls super and super calls someMethod, and then specializedDog calls someMethod. I don't want that to happen.

what do?
>>
>>56549199
OOP IN LOO
>>
>>56549199
Depends what language.
>>
>>56549229
java
>>
>>56549199
the thing is that deep hierarchies are bad. remember: composition over inheritance
>>
>>56549199
You could do any number of things, pajeet, but given we don't really know what you're trying to achieve, it's hard to give advice.
I would be tempted to say you're doing OOP wrong, and make Dog more general.
>>
I was interviewing with a "too proud of my java skills"-looking person.

He asked me "What is your knowledge on Java IO classes.. say.. hash maps?"
He asked me to write a piece of java code on paper - instantiate a class and call one of the instance's methods. When I was done, he said my program wouldn't run. After 5 minutes of serious thinking, I gave up and asked why. He said I didn't write a main function so it wouldn't run. ON PAPER.
[I am too furious to continue with the stupidity...]
Believe me it wasn't trick questions or a psychic or anger management evaluation thing.

I can tell from his face, he was proud of these questions.

That "developer" was supposed to "judge" the candidates.
>>
>>56549254
some assignment for my architectures class on database to domain mapping. the professor specifically wants database mapping logic in the constructors. I'm stuck working with this design.

Basically each domain class is supposed to be like an active record.

Originally I thought of having all the logic inside each constructor, but then I realized that I would connect to the database multiple times. So now I'm trying to add an insert method that each concrete class overrides.
>>
>>56549331
Why not use a D atabaseCon nectionFactor yF actory?
>>
>>56549280
Did you get the job?

Also keep going.
>>
>>56549375
>not just using an AbstractBean
>>
I want to go full NSA and start a database to keep tabs on everyone I know. What language should I use to build it? I thought of SQL, but keeping everything need and tidy might be a bit cumbersome. Maybe javascript? It's not really fast, but I won't know those many people of interest in my life and being able to just add properties to objects would be helpful if I know someone's mother's maiden name, for example (which I obviously won't know for everyone). Maybe some sort of graph database language? Or SQL with those oop-esque extensions?

Any suggestions? And yes, I know it's creepy and "autistic", but I'm already too far gone to go back now.
>>
>>56549375
>>56549433
le haskell > java POO IN LOO OOP langzz

amiright?
AbstractBeanGatewayFinderFactory lololol

go back to india PAJEET
>>
>>56549468
>Guy is literally fighting with OOP
>Not a poo in loo language
>>
database constructor guy here. I feel like an idiot. obviously I just throw the method into the super class constructor and it delegates to the appropriate implementation at runtime.

I'm pretty much an honorary Pajeet at this point.
>>
Is there any valid use of multiple inheritance?
>>
>>56549468
OOP is a choice
>>
File: image.jpg (171KB, 640x1136px) Image search: [Google]
image.jpg
171KB, 640x1136px
I'm trying to find a way to grab the links from all the videos in a jewtube playlist and store those links to paste them elsewhere but Im so lost at this point. I think I might just automate my mouse to do it because Im losin hope. Any codeguru have any alternatives for a newcodefag?
>>
>>56549620
Inheriting multiple ABC classes in C++.
>>
>>56549465
calling attention to this post again

I just want ideas
>>
>>56549720
Just use MySQL or PGSQL, design a decent database, perhaps blobs to store data (like pictures, recordings and so on) along the meta.
Then slap simple web interface on top of it or some CRUD app for easy management.
>>
You can only understand Haskell if you speak Norwegian, because monads come from the Norwegian word måned.
>>
>>56549834
The only reason I'm not going straight to SQL is how hard it'd be to add random properties to certain rows without creating an entirely new attribute on the table. That's not possible, is it? Unless I use the oop extensions I mentioned

I don't want to end up with 1451612612 attributes where most of them are only not null for one or two rows
>>
how do you implement two way recursions in code?
ex something like:
A(k) = 1/2 * A(k+1) + 1/2 * A(k-1), A(0) = 0, A(10) = 1
>>
>>56549917
Then just do:
person_attributes

person_id, type, value


And then define constants for types as you need? Even for a single new attribute you wouldn't need to modify the database at all.
>>
>>56549936
haskell:

A 0 = 0
A 10 = 1
A k = (A (k - 1) + A (k + 1)) / 2
>>
>>56549962
maybe I'm rusty, but I didn't understand neither your snippet nor your rhetorical question.
>>
>>56549465
A text file you retard skid
>>
>>56550051
...would be harder to maintain than a simple database or serialised object? Don't call me a skid when you're a pajeet yourself.
>>
>>56550087
Anon, this is embarrassing
>>
>>56550087
You know, what, like five people tops? And you've got maybe three things about each of them?

>omg i'm so far gone i'm going full NSA
The cringe is real jesus christ.
>>
>>56550136
What's embarassing is shit like >>56550051. Please tell me how what he said is in any way relevant to my question. If I wanted a text file I wouldn't be asking /dpt/ for fucking suggestions.

>>56550143
>The cringe is real jesus christ.
this might be hard for you to comprehend, my fellow NEET basemenet-dwelling shitposter, but sometimes people make jokes. Yes, even on the internet. Do you honestly think that I'm actually trying to compare what I'm doing to what the NSA does? are you autistic?

/dpt/ is shittier than usual today
>>
>>56550193
anon was right
the cringe is real
>>
>>56550209
whatever you say. normally I might even second guess myself and whether what I was saying was cringey or not, but what the other guy pointed out was so obviously a joke that I'm just saddened by the level of shitposting this general has achieved
>>
>>56549465
Scheme.
>>
>>56549936
>not using well-founded recursion
enjoy you're non-termination
>>
Git sucks. There, I said it.

Now that I succeeded in irritating most people, let me explain: Git is an error prone overkill for most small and medium sized projects.

Remember, Git was created to handle Linux development; most projects have a single relationship with the remote server. So, first, it’s an overkill to use, like shooting pigeons with a Cruise missile.

Second, because of its power, it’s extremely complex and makes it really easy to shoot yourself in the foot.

Most version control systems need a page or two to explain the basic commands. The Pro Git book is 550+ pages long.

So why, you, as a developer would use Git? What happen to "the best tool for the job"? What happened to KISS (not the rock band)?

Is it because you want to look cool? Or you think your project is going to be as large one day as the Linux kernel? Or your company is forcing you to?

I apologize for my first post being a rant, but recently I was forced to use Git in a new repository and it has been nothing but pain, for almost every simple step my old trusty GitHub GUI started throwing errors.

Looking online, it’s like a rash – it’s not only me getting into issues. So the problem is deeper, I believe with the model itself. We need a simpler CVS; any suggestions?
>>
>>56545311
I have a CLI tool that reads its configuration from a dotfile in $HOME. How can I test this tool with travis? I know about encrypted files, but it seems to be that they need to be inside the repo, while I'd like to have mine in $HOME
>>
>>56550274
what if someone wants non-productive non-termination
>>
File: absolutely degenerate.png (100KB, 258x330px) Image search: [Google]
absolutely degenerate.png
100KB, 258x330px
>>56550353
>non-productive non-termination
Why would anybody want that? You could probably still use the partiality monad tho.
>>
>>56550331
Learn to use git on the command line, seriously
>>
>>56550331
L2git brainlet
>>
>>56550331
great pasta, is that from hacker news?
>>
>>56550398
infinite computation
>>
>>56550339
pls respond
>>
>>56548258
No Python programmers here then I take it?
>>
>>56550428
Any examples?
>>
>>56550443
what are ytou asking

can't you just use
help(function)
>>
File: 1465500529198.jpg (59KB, 640x932px) Image search: [Google]
1465500529198.jpg
59KB, 640x932px
>>56550439
>testing
>not formally proving your programs correct by construction
>>
>>56550479
How does that work actually? There was a module in my degree on this but I didn't take it
>>
>>56550444
Steam of Fibonacci numbers
>>
>>56550479
prove THIS correct

*unzips dick*
>>
>>56550467
This might be it thanks
>>
>>56550525
Your dick has a Coapply instance?
>>
>>56550510
That's corecursive/productive, I meant something that would actually take infinite time to do anything
>>
>>56550331
i dunno, i literally use git to be a glorified dropbox for my personal projects and i need like 4 lines from the cli
>>
>>56548790

Nigger the code works. It's an extract from a much larger program and present in a few other programs and tutorials I've found online. If you'd take the time to actually read the comments you'd see that I'm trying to find the source of a complex bug that appears to be present across multiple systems and languages.
>>
>>56550143
Yeah, he's retarded. The NSA is scary because they can read all your unencrypted (but private) communications like text messages and do things like attacking crypto through prime number reuse in Diffie-Hellman implementations.

This retard anon >>56549465 who thinks he can go "full NSA" by putting public facebook posts in a database is full-on cringefuel.
>>
>>56550331

Literaally literally literally sourcetree.

Git is only complex because the linux community insists on making everything a cryptic command line mess.
>>
>>56550615
>This retard anon >>56549465 (You) who thinks he can go "full NSA" by putting public facebook posts in a database is full-on cringefuel.

joke
noun \ˈjōk\
Simple Definition of joke

: something said or done to cause laughter

: a brief story with a surprising and funny ending

: someone or something that is not worth taking seriously

Source: Merriam-Webster's Learner's Dictionary

Full Definition of joke

1
a : something said or done to provoke laughter; especially : a brief oral narrative with a climactic humorous twist b (1) : the humorous or ridiculous element in something (2) : an instance of jesting : kidding <can't take a joke> c : practical joke d : laughingstock

2
: something not to be taken seriously : a trifling matter <consider his skiing a joke — Harold Callender> —often used in negative constructions <it is no joke to be lost in the desert>

Examples of joke in a sentence

She meant it as a joke, but many people took her seriously.

They played a harmless joke on him.

They are always making jokes about his car.

I heard a funny joke yesterday.

the punch line of a joke

I didn't get the joke.

That exam was a joke.

Their product became a joke in the industry.

He's in danger of becoming a national joke.
>>
File: 535169373.jpg (39KB, 500x512px) Image search: [Google]
535169373.jpg
39KB, 500x512px
I want to create a mobile (social) app from scratch.
I have basic experience with Android Studio but I'm not a fan of Java and I'm looking towards cross-platform developing using for example Xamarin/C#.

Do you have tips for beginning?
>>
>>56550644
Look up the definition for "autistic" next
>>
>>56550675
autism
noun au·tism \ˈȯ-ˌti-zəm\
Simple Definition of autism

: (You)
>>
>>56550644
>i was just pretending to be retarded/cringy
sure thing bud
>>
>>56550615
>do things like attacking crypto through prime number reuse in Diffie-Hellman implementations.
Speaking of which, if you're into crypto you should check out https://cryptopals.com/

Fun website with lots of crypto-breaking challenges
>>
File: 6009738673_3ae22be531_b.jpg (246KB, 681x1024px) Image search: [Google]
6009738673_3ae22be531_b.jpg
246KB, 681x1024px
Why is this book so good?
>>
>>56547164
compounding error
propagating error
cumulative rounding error
compounding rounding error

etc
>>
>>56550841
Dunno, I never tasted it
>>
>>56545326
what are you trying to do? why do you need []interface{} in the first place?
>>
>>56550841
>tfw you will never eat one of your college textbooks
feels bad man
>>
>>56550841

I wish I had a copy. :(

I've got a bunch of algo books, but I haven't caved and bought CLRS, yet.
>>
>>56549465
>tfw I've thought about doing this since I was a kid
but, yeah, creepy stuff.
are you german, paranoid or something?
>>
>>56550424
Looks like it's from plebbit.

https://www.reddit.com/r/programminghorror/comments/4qsywz/rant_git_sucks/

The talk of his "first post" gave it away.
>>
Morphing between a torus and box: http://glslsandbox.com/e#35177.5
>>
>>56551211
I'd like to know if OP ever responded, but you know, Reddit's layout is eye cancer and I don't want to navigate that shit
>>
>>56551279
*teleports behind you*
*downvotes you*
>>
Does anyone know how strong the 4chan API rules are enforced?
Especially the "Do not make more than one request per second." one?
>>
>>56551279
>being this n00b
>>
>>56551387
haiyai
>>
>>56550498
You've missed out on a lot of interesting stuff.
Here's the gist of one approach: http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf
Others might include model checking, SMT, etc.
>>
>>56548178

velocity.js has the same problem on it's page

maybe it's inescapable.

http://webdesign.tutsplus.com/tutorials/silky-smooth-web-animation-with-velocityjs--cms-24266
>>
is this faggot any of you?

https://forum.arduino.cc/index.php?topic=354368.0#msg2442924

it's weird when insane people call other people "insane"...
>>
>>56551794
> forum.arduino
>>
Just some basic MATLAB shit.

Proprietary bullcrap on one hand, but on the other I'd have no job now if it was free. Porting software to another language because someone needs to run it free sure pays the bill.
>>
>>56551855
>I don't visit websites other than muh 4chan sekrit klub
>>
>>56552069
it's a weeaboo hobby site and popularity is clearly ruining it atm, but seriously what did you expect from an arduino forum?
>>
>>56552097
>it's a weeaboo hobby site
ah, I had no idea

>what did you expect from an arduino forum?
to be not worse than 4chan itself?
>>
>>56552149
4chan is pretty good tbqfh.
>>
>>56550331
>Most version control systems need a page or two to explain the basic commands.

I can do that for git in a 4chan post.
git add [files]...
git commit -m "[Summary]"
git push ([remote branch])
git checkout [commit/branch]
git pull ([remote branch])


Literally all you need to host your fizzbuzz on github.
>>
primes = 2:filter(\x->all((/=)0.mod x)(takeWhile(\i->i*i<x)primes))[3..]


I can poo!
>>
File: 15090961835_c4f26e4890_b[1].jpg (197KB, 949x652px) Image search: [Google]
15090961835_c4f26e4890_b[1].jpg
197KB, 949x652px
If I learn programming, I want to create programs that are as light on memory as possible. Which language produces the least intense programs?
>>
>>56552190
sure...

>>56552254
it's pasta, you retard
>>
>>56552320
C, but it that lightweight doesn't matter unless your making something huge.
>>
>>56552337
I have an irrational hatred of programs I see running that take up a shit ton of my memory when something that does the same thing takes up much less.

I do not want to be responsible for making say a notepad clone that takes up 30,000K
>>
>>56552363
That would be because of shit programming, not a shit language.
Unless your making something big.
>>
>>56552320
C, but rust strikes the best balance between very high performance and plenty of features.
>>
Hey, trying to create a music player in C# in visual studio 2015. How do I get it to sort files into a folder based on the artist of the song. I would also like to create a list that shows off all the files that I have dropped into the panel and sorted by the program so I can play it.
>>
>>56552383
So assuming I don't act like a lazy fuck the language I choose shouldn't matter all that much as long as it's not big?
>>
>>56552322
Sorry for not recognizing a reddit pasta.
>>
>>56552320
what do you want to do?

>>56552363
look for scite/notepad++
>>
>>56552405
I would use the term "dumb" or "new" instead of "lazy". But you get the point.

Anyway, come join the C master race.
>>
>>56552410
>reddit pasta
most "reddit pastas" come from 4chan, retarded newfag
>>
>>56552451
Most, but not this particular one you drooling retard.
>>
>>56552471
just because someone said s/he found it in reddit doesn't mean it's originally from reddit.
and even then
>muh sekrit klub
kys
>>
>>56552401
use a dictionary with the artist as the key and the song as a value? Then save to a folder matching the name of the key
>>
>>56552502
What the fuck are you on about?
Kill yourself you fucking autist.
>>
>>56552410
>Sorry for not recognizing a reddit pasta.
>>56552515
>What the fuck are you on about?
>>
>>56552435
Right now I only have one idea in mind, I want to create a program that would read a .txt provided by the user and print them to the screen based on timestamps provided in the file or based on line length / preset time.
>>
>>56550841
Diabetes
>>
Recommend me some sound canceling headphones or even sound canceling earmuffs to wear while programming.

I have 200 dollars, I don't give a shit about anything except how effectively it eliminates noise, though cheaper is always better.
>>
>>56552601
I would love to hear about this too.
>>
>>56552601
ask >>>/g/csg
>>
>>56552647
why /csg/ and not /hpg/ ?
>>
>>56552673
well, that'd be of help, too
>>
>>56552537
>respond to pasta unused here
>"hurr retard responding to pasta"
>Sorry for not recognizing pasta from a site I don't use
>"hurr """muh sikrit klub"" get a lif nerd"
>>
The only beautiful c++ project that exists is idtech5/doom3's source
>>
>>56549465

I'm just using an access database at the moment but if you want to go full creep then I would recommend tapping their phones, installing cameras, intercepting mail and then placing it into new envelopes, keylogging, basically everything you could possibly do.

Then you'll be actual NSA.
>>
File: galfeel.jpg (60KB, 399x353px) Image search: [Google]
galfeel.jpg
60KB, 399x353px
Just finished rewriting an algorithm and could finally benchmark it. The work paid off, my program now processes and outputs data 60% faster! Very important as it's a real-time system. Dat feeling of accomplishment is why I love programming
>>
I like programming, but I also hate it. makes me nervous as hell, and since I'm slow, it feels like a waste of time. but it's cool to make tools
>>
File: IJnxZ3w.gif (432KB, 328x207px) Image search: [Google]
IJnxZ3w.gif
432KB, 328x207px
> have a deadline until wednesday
> code like my life depends on it
> error count goes down from 260 to 1 error
> have a bsod
> need to recode stuff and start back from 260

PANIC
A
N
I
C
>>
>>56553017
Should have used GNU/Linux, or GNU plus Linux as I've taken to calling it
>>
>>56545311
I'm learning SQL usign "Getting started with sql" from Oreilly.
So far it's a piece of cake (currently on page 35) since I know a bit of LINQ.
Once I finish this I wanna learn more about it, what's some intermediate SQL/Database design books that /g/entlemens would recommend?
>>
File: 1658_estimating_time.png (59KB, 607x278px) Image search: [Google]
1658_estimating_time.png
59KB, 607x278px
>>56553017
Why are you posting instead of working?
PANIC!
>>
>>56553017
Hopefully you've learned your lesson and save regularly from now on
>>
>>56553017
>what is autosave
>what is spamming C-s
>>
Logisim is actually pretty damn nice.
>>
>>56546799
>"C is bad at expressing abstractions"

No shit sherlock. The whole point of C is that it's close to the hardware.
>>
>>56553571
but it isn't though
>>
>>56552317
>nubBy(((>1).).gcd)[2..]
>>
>>56553571
not really.
>>
how hard is it to reinvent the regex?
>>
Is it possible to use div for a fizzbuzz in c++? If so, what context? I can do it with % but div blows my mind, you have to do it bass ackwards with div compared to % don't you?
>>
>>56553734
holy shit
>>
>>56553734
>>56553776
that composition doesn't work btw, gcd takes two args
>>
What skills are needed to make simple internet games like this?:

woto.io
>>
>>56551003
>why do you need []interface{} in the first place?

myreader := mypkg.NewReader(another_reader)

type mystruct struct {
myfield1 uint16
myfield2 uint8
myfield3 uint8
myfield4 uint32
// ...
}

mydata := make([]mystruct, 10)

myreader.ReadStructArray(mydata, mypkg.LittleEndian)


...

func (myreader *myreadertype) ReadStructArray(array []interface{}, endianness myendiantype) {
// ...
}


for something like that
>>
>>56553571
xdd
>>
>>56553953

1. be a webshitter
>>
>>56549988
>capital A
>>
>>56548285

First of all, it happend "fast", Java came in 1995, C# in 2001. Six years are a lot of time to learn from other languages, to make better desing decisions and so on..

Also, Java is slowly trying to catch up.

For example this is FizzBuzz in Java 8:

import java.util.stream.IntStream;

class FizzBuzz{
public static void main(String... args){
IntStream s = IntStream.range(1, 100);
s.mapToObj( i -> i%15 == 0 ? "FizzBuzz" :
i% 3 == 0 ? "Fizz" :
i% 5 == 0 ? "Buzz" :
i)
.forEach(System.out::println);
}
}
>>
>>56554030
so HTML and CSS?
>>
>>56554052
whoops
>>
>>56554069
>IntStream
They just can't let it go, can they?
>>
>>56553953
1. be an indian or a retard or a female
>>
>>56554069

>it happend "fast"

I meant:
It didn't happen "fast".
>>
>>56547951
A final coalgebra is a fancy way of saying "coinductive type". An initial algebra is an inductive type.

Co- just means you flip the arrows.
>>
File: 1467822381490.jpg (77KB, 356x356px) Image search: [Google]
1467822381490.jpg
77KB, 356x356px
>kind polymorphic type classes
>>
It's 2016.
Why is there still no "good" C api generator for c++ libraries?
>>
>>56548440
lmao
rust is still vaporwave
>>
I'm trying to create and apply proper force feedback effects but I'm too stupid for this shit and Microsoft's DirectInput examples aren't helping much.

I don't want to pull half a framework in from GitHub either.
>>
>>56554080
how retarded are you
>be /v/tard or /b/tard
>find "cool" indie game
>i want to be game dev!!!!! let me ask /g/ how to do!!!
>>
>>56554137
I was asking about coalgebras in general

but I wish haskell had copatterns
>>
>>56554102

Well, it's still Java.. ¯\_(ツ)_/¯
>>
>>56554172
Algebra:
(Functor f) => f a -> a

Coalgebra:
(Functor f) => a -> f a


Technically, they're F-algebra and F-coalgebra, but people just say algebra and coalgebra.
>>
File: 1473533347227.png (155KB, 500x500px) Image search: [Google]
1473533347227.png
155KB, 500x500px
>>56554170
...why are you guys so negative?
>>
>>56554267
awoove your way out of here
>>
>>56554267
im only one person
>>
>>56554172
>>56554200
Oh, and Haskell basically does have copatterns:
data Stream a = Stream
{ head :: a
, tail :: Stream a
}
>>
File: 1467066901369.png (305KB, 640x974px) Image search: [Google]
1467066901369.png
305KB, 640x974px
>>56553953
You should first read SICP. It will help you build up your foundations and knowledge on CS, the rest will come naturally.
>>
>>56554305
You can't do
x :: Stream Integer
head x = 3
cons x = x
>>
>>56554286
That is not Momiji, please educate yourself.
>>
>>56554326
True, I suppose that is the important part of copatterns.
>>
>>56554318
>buy sicp

all advice but this is good
>>
>>56548285

C# still has some mind boggling decisions made to it like non-deterministic object lifetimes and by extension, the garbage collection is non-deterministic too.

Yes, you can work around it with unsafe features and IDDisposable but seriously, stuff like that was just a bit extreme. Forced OOP everywhere is just crappy too like Java, but yeah, it's better than Java mostly.
>>
>>56554326
*tail x

>>56554341
should propose a ghci extension called gcadts

codata Stream (a :: Type) :: Type where
head :: Stream a -> a
tail :: Stream a -> Stream a
>>
var callback => CallbackMethod()

Just found out c# could do this. It's nice
>>
>>56554397
you're almost there
a few more steps

functional programming is in sight
>>
>>56554397
>c#
>>
>>56554386
OOP isn't really that forced. While it's more typing to do you could essentially convert a c program directly using static classes/structs and raw pointers but I don't know why you would. C#'s oop makes sense for the most part and is a fairly nice implementation
>>
>>56549199
then only call someMethod() in the superclass. Of course this is flawed because if you don't know if the superclass does so, or if ti changes, then you have to change the subclasses and vice versa. That's like the flaw of OOP.
>>
>>56554416
I've tried, but linq provides enough functional programming for me
>>
>functions in his favorite langage can only have one argument

laughing_whores.exe
>>
>>56549622
Suicide is a choice too.
>>
>>56554492
Currying.
>>
>>56554492
https://hackage.haskell.org/package/category-extras-0.53.0/docs/Control-Functor.html
>>
>>56554143
exceptions, name-mangling, namespaces, STL types, etc.
>>
help me understand memory allocation
>>
>>56554492
>functions in his language can't have other functions as arguments
>he can't make new functions on the from other existing functions on the fly in his language
laughing_whores.dat
>>
>>56554625
it's self explanatory

you have some memory
you can allocate some of it
>>
>>56554625
You take memory
and allocate it
>>
>>56554625
whats a google
>>
>>56553996
And what exactly do you need it for? What happens in ReadStructArray?
>>
Just made a little Python Script to generate m3u playlists which are divided by the creation time of the music.
It just goes through all my music and generates a file like 2016-06 with all music created in June 2016 (I like to organize my stuff in this way and f2k has no decent implementation for that, atleast I haven't found one).

It's simple, yet does the job just fine.

My first encounter with Python, but holy shit this language is stupid on some acpects, i.e. Syntax and especially unicode support.
May be already the last time I touched this abomination. Even PHP is more intuitive than this (not even joking).
>>
File: 1472043543707.jpg (48KB, 436x543px) Image search: [Google]
1472043543707.jpg
48KB, 436x543px
>>56554635
>tfw my language can do both of these and take more than 1 argument at a time
Ho do husklelfags even deal with functions that accept variable number of arguments? Just by passing lists?
>>
i`m struggling with a css file, i need a .jpg but i can´t find it, any help here, site is

http://www.continuumfashion.com/Ddress/

i cannot find the two female images, i`ve downloaded all, but this files are missing, any help greately apreciated
>>
>>56554712
reading an array of structs out of a binary file reader (or some other reader) that are in sequential order, whose data fields may be stored in little or big endian and as such, each field must be properly interpreted

I thought the example made it fairly obvious...
>>
>>56554492
>>56554635
>>56554766
Hold the fuck on! Haslel functions can only have one argument? That's absolutely useless.
>>
Haskell fags on suicide watch.
>>
>>56554828
>>56554844
>Haslel functions can only have one argument?
Uhm, yes? Have you been living in a cave the last 20 or so years?
>>
Is formal verification a meme?
>>
>>56554867
no, but you sure have for using a dead and obsolete language lmao
>>
File: Dfags BTFO.png (35KB, 735x247px) Image search: [Google]
Dfags BTFO.png
35KB, 735x247px
>>56545322
>>56545328
>>
>>56554828
That's not even the most funny about Haskell. The most funny is that it doesn't do IO directly, you have to use an IO monad which basically is a stateful container (so much for """pure""" code, right) that returns code you then run eval on in order to not have """"impure"""" code... It's so fucking useless.
>>
>>56554766
MUH MONADS
>>
>>56554880
Yes
>>
File: 1448568355127.jpg (3MB, 2560x2880px) Image search: [Google]
1448568355127.jpg
3MB, 2560x2880px
828
895
>>
>>56554892
>for using a dead and obsolete language
Ehm, but I am not a haskell user? Are you dense?

>no
Either you (know nothing about CS and/or are a retard) or you have been living under a rock for the last century if you didn't know that each function in haskell can take one argument.
>>
>>56554766
>>56554828
You can pass tuples, which is isomorphic to returning another function.
Haskell functions take one argument, and return another. The returned value could itself be a function (to which you could pass a value)

This is very good language wise.

For instance

f 3 4 == (f 3) 4 == let g = f 3 in g 4
>>
>>56554766
Monads
>>
http://www.strawpoll.me/10985214
>>
>>56554782
>http://www.continuumfashion.com/Ddress/
These are canvas, basically images drawn through JavaScript.
You may look out for that JavaScript or just make a screenshot of them, cut out and save as jpg.
>>
>>56554895
>>56554907
Forcing the use of monads is one of the greatest innovations Haskell has made. It makes the code a great deal more consistent, rational, sensible and allows the user to control effects themselves. Control flow constructs become regular library functions that could be implemented by the user themself.
>>
>>56554932
Haskell is the best language ever

Anyone who dislikes Haskell is a brainlet
>>
Friendly reminder that the Haskell reference book is called "Learned you a Haskell for great good". If niggers can't even get the book title correct, how can they get the language correct?
>>
>>56554926
Why did you quote me if your post was absolutely unrelated to mine? Your post doesn't address variable amount of arguments at all.
>>
>>56554963
There's no book with that title, even less an official Haskell reference
>>
>>56554766
Why wouldn't a variable number of arguments be passed with a list? Haskell's printf uses type classes to hack around but there's no gain, really.
>>
>>56554956
>>56554929
>monads
yet nobody can explain what a monad is, lol
>>
>>56554782
>>56554936
Oh nvm.

http://www.continuumfashion.com/Ddress/bodyback.jpg

http://www.continuumfashion.com/Ddress/bodyfront.jpg
>>
>>56554956
>forcing monads is good
>not having optional monads
As a pragmatic programmer, I don't give the slightest fuck about Haskellfags' bullshit and arbitrary distinction between tainted code and tainted runtime. You have to do all sorts of mental gymnastics to believe crippling your runtime performance is a good thing.
>>
>>56554990
A monoid in the category of endofunctors.
>>
Why do you people even talk about haskell so much? It's obscure
>>
finally decided to make myself a website. no idea what im gonna even do with it, might migrate my github to it at some point maybe
>>
>>56554925
>what the fuck you didn't know the IBM 704 stored alphanumeric characters in 6 bits?
>have you been living under a rock for the last century

lmao

get out with your fucking antiques
>>
>>56555018
Did you YESOD it?
>>
File: learn-you-a-haskell.jpg (64KB, 800x600px) Image search: [Google]
learn-you-a-haskell.jpg
64KB, 800x600px
>>56554984
>There's no book with that title,
Why are you lying?

http://learnyouahaskell.com/
>>
>>56555007
>monads are about IO
>>
>>56554766
>>56554828
>lol what is currying
Once again shitting on the language without fully understanding it
>>
>>56555015
because people here are developmentally retarded autists who like trash like anime and memelangs
>>
Ideally, primitive I/O would use a linear value for the world. Any use of an I/O monad would be library-defined on top of it. Also, supercompilation would make it zero-overhead.
>>
>>56555029
This confirms it then. You know nothing about CS and/or are a retard.
>>
>>56555037
"learn" != "learned" you retard
>>
>>56555042
The only way to do IO in Haskell is through the IO monad, you fucking dipshit.
>>
>>56555047
>currying
POO
>>
>>56555049
anime isn't trash you dickbag
>>
>>56555047
Why did you quote my post if you lack the ability to comprehend something as simple as what I said?
>>
>>56554808
Define the conversion methods on the structs themselves and take the common interface as the parameter type for ReadStructArray. Along the lines of
type marshaler interface {
toEndian1() ([]byte, error)
toEndian2() ([]byte, error)
//...
}

func (myreader *myreadertype) ReadStructArray(array []marshaler, endianness myendiantype) {
// ...
}
>>
>>56554967
Yes it does.

1) Passing a tuple is isomorphic to passing multiple arguments.
There is a difference in languages like C when it comes to the implementation.
In fact passing a tuple gives you the same syntax as an imperative language.
fun(a,b,c) = ...
... = fun(a,b,c)

2) Returning a function is also isomorphic to passing another value. Because you can pass a value to the returned function (and all in one).

fun a b c = ...
fun a b = \c -> ...
fun a = \b -> \c -> ...
fun = \a b c -> ...
... = fun a b c

There's a pair of functions documenting this: uncurry and curry.

>>56555007
>optional monads
This is literally retarded. It defeats the entire purpose.
You may as well not have monads at all.

>>56555050
No.

>>56554989
Printf is a different matter entirely
And you'd want a heterogeneous list for that.
You can do it but it's not Haskell 98. (Dunno if printf is though)
>>
>>56555064
Doesn't mean monads are about IO. That's just one use of them.
>>
>>56555058
The title of the book is fucking broken english, go kill yourself
>>
>>56555050
Like Mercury?
>>
>>56555064
>function calls are about binding variables
>>
>>56555085
>No.
Why not?

>>56555094
Dunno.
>>
>>56555085
>This is literally retarded. It defeats the entire purpose.
>You may as well not have monads at all.

So it either has to be a functional as a mono-paradigm or not functional at all?

This is the reason why nobody uses Haskell. A language that enforces a single paradigm in the age of multi-paradigm programming languages is obsolete.
>>
>>56555085
What you're describing sounds pretty complicated so I'm confident it's all bullshit.
>>
>>56555120
>>
>>56555092
It's a lighthearted joke you fucking autist.

God you must be so fun at parties. Not that you've ever been invited to one.
>>
Damn, I'm pretty proud of you and how you all revitalized the thread.

Only you can care about grade F bait.
>>
>>56555085
>Yes it does.
No it doesn't, nothing of what you said was even remotely related to my post.
>>
>>56555100
Who are you quoting?
>>
>>56554956
>consistent, rational, sensible
Are we still talking about Haskell?
>>
>>56555127
>autist
That's gold, coming from the guy that sperged out over misspelling of one of the words.
>>
>>56555081
the whole point was to make it a generic...
>>
>>56555132
Yes it does, and I don't believe that you don't understand.

>>56555112
Should you be able to do unsafe code in safe code blocks in a language like rust?
>>
>>56554963
>never heard of sentence currying
>>
>>56554808
>>56553996
does this help you somehow?
https://www.jonathan-petitcolas.com/2014/09/25/parsing-binary-files-in-go.html
>>
>>56555158
>Should you be able to do unsafe code in safe code blocks in a language like rust?
I don't know rust and I don't know rust's concept of "safe code blocks", so I can't comment on that.

But guarantees for parts of the code is very different from enforcing a paradigm throughout the entire code.
>>
>>56555158
>Yes it does, and I don't believe that you don't understand.
Except that it clearly doesn't. This is not the first time that you insist that you understand a post when you have totally miscomprehended it while others have understood what it said.
>>
>>56555156
You can't.
>>
>>56554766
it doesn't really matter, its just a technicality
f a b = a + b

will still work, and it won't affect anyone
its just how the runtime interprets, which again, doesn't affect the user
you're just a cuck
>>
File: 1469492983730.jpg (29KB, 471x197px) Image search: [Google]
1469492983730.jpg
29KB, 471x197px
>>56555055
>you are a retard because you don't know the limitations of my dead and obsolete language from the 80s
>>
>>56554508
Really, the discussion should have stopped here
>>
>>56555177
>sentence currying
Is that what millennials are calling pidgin english these days?
>>
File: you're a fucking nigger.png (23KB, 1103x225px) Image search: [Google]
you're a fucking nigger.png
23KB, 1103x225px
>>56554963
>>
>>56555213
How is your reply relevant to my post at all?

>>56555215
I insist that not knowing something as simple as that marks you as a retard.
>>
>>56555197
>guarantees for parts of the code
Imagine you could let someone using your code decide exactly what can and can't be done, and let them create their own sub-blocks.

Not only this, but in Haskell effectful code is literally meaningless, and requires making incredibly specific demands on how expressions work.

You CAN write effectful, imperative code in Haskell and it's not inconvenient to do so. You do it within a monad.

>>56555203
A multi parameter function is a function taking a tuple of values
>>
>>56555206
yes, you can

encoding/binary.Read can do it with a struct passed by interface{}, so there is no reason you why you can't do the same thing, applied by a slice of blank interfaces as []interface{}
>>
>>56555238
I insist that you are in fact the retard that needs to move forward and use a language that isn't dead
>>
>>56555064
>he likes a language in which invoking a function will automatically do IO
>he doesn't like controlling when it does the IO
lmao, you're a cuck, you literally have no control of when something happens
>>
>>56555242
>A multi parameter function is a function taking a tuple of values
Not necessarily, it might as well be a list.
>>
>>56555268
What language I use or not is not your concern nor part of the topic.
It's simply a fact that if you do not know something as basic as that then you suck at computer science and are probably a retard as well.
>>
>>56555271
>It might as well be a list
A tuple is a heterogeneous list
>>
>>56555242
>You CAN write effectful, imperative code in Haskell and it's not inconvenient to do so
We've seen the examples of writing a state machine in Haskell in earlier threads, it's godawful, especially the bit-fiddling one where a 32 integer was truncated into a 28 bit integer the first bit of every byte was omitted

It took the Haskell guy 600 lines of code of to do that, while it took 5 lines of C code.
>>
>>56555154
because you complained about it
>>
>>56555269
What the fuck are you talking about? Are you seriously implying that you have more control through Haskell abstractions than doing syscalls?
>>
>>56555289
>you suck at computer science because you didn't know [x] limitation of [y] dead language

quite the accusation, friend
>>
>>56555292
A list is a function.
>>
>>56555294
Then they were very bad at doing so.
But generally if it's bit fiddling, you can do it without side effects anyway.
>>
>>56555302
You tried to deny that the book even existed ffs. How the fuck is that not autistic as hell?
>>
>>56555252
interface{} is not generics, it's dynamic typing through reflection. But if you really want to use dynamic typing, take interface{} as a parameter and use type switches or the "reflect" package to reason about the type and then transition to statically typed code.
>>
>>56555238
you're retarded if you dont know how my post is related to yours
bye, datafag
>>
>>56555316
More like

>you suck at computer science because you didn't know that the most popular pure functional language uses currying
Which is true
>>
>>56555032
nah, most of it's probably gonna be static. im thinking of using Hakyll but i wanna put in a git server and idk how to combine that with it
>>
>>56555314
yes
>>
>>56555338
>you're retarded if you dont know how my post is related to yours
Sorry, but your post is not retarded to mine at all. No matter how much you try to delude yourself.

>bye, datafag
What?
>>
>>56555353
Then you are trolling or stupid. No form of abstraction offers improved low-level control.
>>
>>56555269
You could easily do that when using a language that does not force the use of the IO monad.
>>
File: 1465868539351.jpg (151KB, 645x989px) Image search: [Google]
1465868539351.jpg
151KB, 645x989px
>>56555356
>retarded
*related
Ooops, excuse me.
>>
>>56555385
The guy you're replying to is probably a faggot but it completely changes the language to just allow IO anywhere, and literally does defeat the purpose of using monads.
>>
>>56555356
>says haskell funcs can only have one arg
>I say that technically, its true, but it doesn't matter
>I say that one can still do thing like f a b c = whatever
>says that my reply has nothing to do with his
kys
>>
>>56554994
oh sweet jesus christ, i`m a fucking retard
kek

thank you dude, i`m a total noob with javascript css and all that.
>>
>>56555427
>says haskell funcs can only have one arg
Where did I claim that in any of my posts of that reply chain?

>I say that technically, its true, but it doesn't matter
>I say that one can still do thing like f a b c = whatever
Neither of these were relevant to my post.

>says that my reply has nothing to do with his
Exactly, because my post was about functions with VARIABLE amount of arguments you ultra retard. Your post was about functions with specific amount of arguments and it was totally irrelevant to the context of my post, like you hadn't read it at all.
>>
>>56555459
You can use type classes to create polymorphic values.

I.e., you have a value that is either a result or a function procuding a result. Type inference judges which you want (i.e. whether you want a result, or you want a function to take another input)
>>
>>56555459
>caring about technicalities
I bet you think that
map f xs

isn't iteration
>>
>>56555408
I don't know exactly what >>56555007 meant when he wanted optional monads however I only can assume that he wanted to just be able to mark a function as unpure and be able to call other unpure functions without the need to bother with monads explicitly/directly at all. Some kind of syntactic sugar maybe.
>>
>>56555505
Someone already replied to that. Your post is relevant to my post from multiple replies ago, not the certain post you are replying to.

>>56555506
Congratulations, now you are just rambling to yourself. Considering your inability to understand my first post I will bet that you didn't understand this one either.
>>
>>56555509
That's an effects system. (Or mimics one.)
A lot of imperative languages have been getting specific effects purely accidentally with no knowledge of actual research into the area. (which leaves them with half baked poorly implemented ideas)

You could have an effects system, but again then you have to change all expressions to reflect the strictness that effects have to have (e.g. ordering).

Monads can help you do this though - you just write your value in do notation, and return a monadic value. (Returning a monadic value is the equivalent of having an annotated function).
>>
>>56555551
yes
f a b

doesn't have a variable amount of args, but it achieves the purpose the same purpose

just like
map f xs

achieves the same as
for i in range(0,len(xs)):
xs[i] = f(i)
>>
>>56555617
>but it achieves the purpose the same purpose
It doesn't.
>>
>>56555636
tell me how
f a b = a + b

isn't the same
as

int f(a,b) {
return a+b;
}
>>
>>56555669
It is the almost same*, but it has absolutely nothing to do with what my post was about: variable number of arguments.

*I said almost because actually
f a b = a + b
is not guaranteed to return an int, unlike the second example.
>>
>>56555711
yes it s you retard
if you make the type of f :: Int -> Int -> Int
then it does
also, its a pure function, this guarantees that it will always return something given the proper arguments
>>
>>56555711
Your post started off with "... and take more than 1 argument at a time", so it was completely easy to infer you meant something different.

You should use the phrases variadic, polyvariadic and n-ary, it's the normal phrase for this sort of thing.
>>
>>56555751
In theory, but since Haskell is interpreted it can't actually enforce this in real life so you have to write tests.
>>
>>56555751
>yes it s you retard
The function you gave is not a function that accepts functions with variable number of arguments. How dense can you be if you can't understand something that simple?

>if you make the type of f :: Int -> Int -> Int
Except that you didn't in your post.

>also, its a pure function, this guarantees that it will always return something given the proper arguments
We know that? How is that relevant at all?

>>56555777
>so it was completely easy to infer you meant something different.
I have to disagree with that. Unless you try to read things that are not said you will never have such a problem.

>You should use the phrases variadic, polyvariadic and n-ary, it's the normal phrase for this sort of thing.
It's already clear enough.
>>
>>56555809
>The function you gave is not a function that accepts functions with variable number of arguments
Meant to say >The function you gave is not a function that accepts variable number of arguments
>>
>>56555809
I have to assume you did it on purpose.

Shame your language can "accept multiple arguments at once" (presumably not using tuples, but who knows if you understand context), it means it's shitty.
>>
>>56555809
again, the technicalities don't mtter
the result matters
and in fact, the techinicality of haskell functions make it so that one can partially apply them
can you do that in sepples, java?

so in the end, it achives the same as what your lang does, and it alo brings in partial application
looks haskell wins
>>
>>56555015
it's popular in internet circles
>>
>>56555015
1.5% market share
>>
>>56555882
maybe on reddit lol
>>
>>56555847
>I have to assume you did it on purpose.
What exactly?

>Shame your language can "accept multiple arguments at once" ... it means it's shitty.
Nice assumption, especially when you hurry up and consider a language that you don't even know as shitty for a property that might under certain contexts actually makes it superior.

>but who knows if you understand context
What is this supposed to mean?

>>56555865
>again, the technicalities don't mtter
>the result matters
It feels like that you are posting buzzwords for no reason now.

>and in fact, the techinicality of haskell functions make it so that one can partially apply them
Unrelated to my post.

>can you do that in sepples, java?
I don't use either, nor they are related to my post.

>so in the end, it achives the same as what your lang does, and it alo brings in partial application
No it doesn't because f a b does not accept variable amount of arguments.

>looks haskell wins
looks what?
>>
>>56555948
>Nice assumption
Can you explain to me what the point of having a function that "accepts multiple arguments at once without tuples" is, when you could have a function that accepts a tuple?
>>
>>56556078
I would consider it if you actually bothered to reply to my post.
>>
>>56556095
Maybe you should bother in literally any of your posts, and not when you let slip that you actually believe some of it and it's not 100% bait
>>
>>56556121
Is that rambling supposed to be in English? I understood nothing of it.
>>
>>56554318
Should I do this if all I know is basic stuff in C like loops and if statements. I'm only on chapter 8 of C programming a modern approach and that's the extent of my knowledge
>>
>>56556215
Nobody stops you, but I already have used several languages and SICP seems like a meme (I read like 3 chapters), even the Edwin repl is a joke, super hard to use.
Nevertheless, I'm looking forward to learn a Lisp in the future, maybe give it another try to SICP.
>>
>>56555847
>>56555865
>the haskellniggers didn't reply because they got btfo so much
>>
>>56555555
Thread posts: 387
Thread images: 31


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.