[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 36
File: 1463845570385.jpg (408 KB, 1600x2133) Image search: [Google]
1463845570385.jpg
408 KB, 1600x2133
Old >>54704918

What project are you working on, and why isn't it a booru?
>>
>>54708536
Nice pic.
>>
N O G F
O
G
F
>>
>>54708536
not working on anything, dont really want to, not enough time tbqh
>>
Dubs decides what trivial thing I write
>>
>>54708563
CHIP-8 emulator
>>
>>54708563
lmc assembler
>>
>>54708563
A calculus of construction typer and interpreter.
>>
>>54708563
Rewrite the linux kernel in Haskell
>>
>>54708536
I sit in the same IKEA office chair right now.
>>
File: semen demon afterparty.jpg (168 KB, 1280x720) Image search: [Google]
semen demon afterparty.jpg
168 KB, 1280x720
I'm trying to learn javascript coming from C, but I don't know anything about functional programming.

It's like I'm back at square one.
>>
>>54708563
brainfuck to asm compiler with no intermediate language
>>
File: just-committin.png (50 KB, 1058x660) Image search: [Google]
just-committin.png
50 KB, 1058x660
about to commit all my python codes
>>
>>54708563
a
girlfriend
>>
File: 1454885924704.jpg (18 KB, 478x378) Image search: [Google]
1454885924704.jpg
18 KB, 478x378
>>54708593
>mfw trying to get through eloquentjavascript.net after C
My brain isn't ready for this
>>
>>54708563
json parser written in javascript
>>
>>54708598
>shitty github git client
Literally gitkraken is faster, sexier, more feature-full and all around better. Plus it's on all 3 OS'
>>
>>54708593
http://bdcampbell.net/javascript/book/javascript_the_good_parts.pdf
>>
>>54708563
Raymarcher in GLSL at shadertoy.
>>
>>54708563
neural network for memes
>>
>>54708602
plz make virtual gf
>>
>>54708593
>javascript
>functional programming
No

Trying to use Javascript for FP is an exercise in frustration, futility and misery.
>>
>javascript
>bad parts
"use strict"

There, i fixed it for you
>>
>>54708656
That's all it's good for though. The only OO framework is Angular, and who in their right mind would write SPAs as a hobby in 2016?
>>
>>54708656
>Trying to use Javascript for FP is an exercise in frustration, futility and misery.
You are dum-dum. JS is excellent for functional programming, it's a scheme with Java syntax.
>>
>>54708668
>That's all it's good for though

dunno, I write physics simulator and evolutionary algorithms in JS
>>
>>54708593
I can't be bothered with it. Feels crappy because it'd be useful.
>>
>using js for backend shit
get with the times fags
>>
>>54708563
the sky is blue
>>
>>54708691
Has the node meme finally ended? Thank fuck for that.
>>
>>54708691
We've only mentioned front-end js, nobody's brought up node
>>
>>54708637
>all 3
>not including Solaris
>>
>>54708563
Give a printer emotions
>>
>>54708563
Database of your faps, with stats like duration, number of ejaculations, number of orgasms, and what you thought about during it.
>>
File: 1451754656609.png (14 KB, 418x359) Image search: [Google]
1451754656609.png
14 KB, 418x359
>>54708711
>solaris
>16 years after y2k
>>
>>54708563
Write a raytracer in GLSL on shadertoy
>>
>>54708709
>>>/g/wdg
>>
File: 1457647267615.png (479 KB, 528x647) Image search: [Google]
1457647267615.png
479 KB, 528x647
>>54708598
>Guis
>>
>>54708703
unfortunately no, since it's only good for automation tasks. Everything else is hell working with it
>promises
Can't believe this shit passed QA

>>54708735
nice meme
>>
>>54708563
A program that calculates how much 4chan sucks at times.
>>
File: safari-crash.png (6 KB, 575x133) Image search: [Google]
safari-crash.png
6 KB, 575x133
>>54708709
>>54708691

>Not using node to write simple and short webservers

Using C is like CuCking yourself, seriously, don't you value your time?
>>
>>54708764
even fucking python is better than js kill yourself
>>
>>54708764
>implying even /dpt/ would stoop so low as to use C when frameworks exist
>node in the year 2016
Python/Django masterrace
>>
>>54708536
Fucking hell. Again? Saw the same pic yesterday.
>>
File: 1462820954130.jpg (189 KB, 720x720) Image search: [Google]
1462820954130.jpg
189 KB, 720x720
Who C+Python masterrace?
>>
>>54708791
both of those languages are shit, idiot fag
>>
File: Screenshot_2016-05-23-17-15-02-1.png (169 KB, 1440x1178) Image search: [Google]
Screenshot_2016-05-23-17-15-02-1.png
169 KB, 1440x1178
>>54708724
>le Solaris dead meme
>>
>>54708801
>idiot fag
t. Pajeet
>>
>>54708775
Python is badly designed language without standard and with super slow default implementation.

Node is a great software platform. It is based on standard, high performance, dynamic language. There are libraries for everything. It just werks.
>>
File: 1451754656607.png (14 KB, 418x359) Image search: [Google]
1451754656607.png
14 KB, 418x359
>>54708812
>Solaris
>not dead
>>
NetDevOps here.
Writing DNS monitoring scripts for ExaBGP.
It monitors the anycast DNS servers on our main sites, and withdraws the anycast routes when something goes wrong.
I still have to do the alerting part, so we get e-mail when DNS is malfunctioning.
>>
I'm making progress with my rpn calculator. Next step is to add support for ints and rationals.

rpc v0.4.0
> 3 2 %
1: 1.
> << << dup 2 % 0 == >> << 2 / >> << 3 * 1 + >> if >> 'next sto
1: 1.
> clear
> 10
1: 10.
> next
1: 5.
> next
1: 16.
> next
1: 8.
> next
1: 4.
> next
1: 2.
> next
1: 1.
> next
1: 4.
> next
1: 2.
> next
1: 1.
>>
>>54708747
>I dont understand branching structures and asynchronous programming
Look at this faggot
>>
>>54708563
 "Hello World" 

In x86 assembly
>>
>>54708847
>still defending node's implementation
nice meme
>>
>>54708791
>photoshopping books into the hands of pretty girls and doing artifacts to cover how bad you are
>>
>>54708536
>his back-end stack isn't Python/Django
>>
>>54708673
JavaScript is barely similar to Scheme and anyways, Scheme isn't made for FP
JavaScript has mutability by default, first-class assignment syntax, loops in the language (for/while), no continuations, statements for 90% of the syntax, etc. it's clearly not very similar to Scheme or any FP language out there
>>
>>54708919
stop posting traps FAG
>>
>>54708919
It doesn't look like her nose changed.. What is this?
She looks way better though.
>>
>>54708874
>girl
>>
>>54708919
No way that's a girl, house is a fucking tip
>>
>>54708945
All of those are the meme parts of functional programming

JS has the necessary parts
>>
>>54708968
which are?
>>
>>54708964
>implying I care
>>
>>54708973
higher-order functions and closures
>>
File: wrong adress_2.png (72 KB, 1007x617) Image search: [Google]
wrong adress_2.png
72 KB, 1007x617
Im debugging TranslateAcceleretaor but the adress of the import function is wrong :(

why the debugger is taking the breakpoint in user32.dll when it should be in the moudel iefrmae ?

and when I look at the address in ieframe pointed from the table theres is no call to the function Im debugging

>>54708536
3DPD
>>
>>54708563
Keyboard interrupt handler in assembly for LC3 architecture
>>
>>54708995
>windows xp
kys
>>
>>54708984
every language can have these. C#, C++, Java now, VB.NET
>>
>>54708995
>3DPD
kys
>>
>>54709016
I wasn't debating against that
>>
I'm so confused right now. I have a private ArrayList<ArrayList<Integer>> variable, which in one method of the class has ArrayList<Integer>s assigned to it. I've watched this in debug. Then when I move onto the next method, everything in it becomes null, same capacity.

w0t?
>>
>>54709000
WINRAR
>>
>>54708995
>emoticon
kys
>>
>>54709016
FP is a paradigm so yeah what's your point?
>>
>>54708995
So, what exactly is the problem? Describe in more detail.

Also, kys.
>>
>>54709045
>>54709025
Javascript having them does not make Javascript a functional language. if you accept that Javascript is functional/influenced by Scheme (when the only thing you can cite as Scheme influence is closures and dynamic typing) you might as well accept every language ever made as a functional language
>>
>>54709071
No one said it was a functional language. All that has been mentioned is functional programming concepts

kys
>>
>>54709082
see: >>54708673 >>54708668
also, can you imperative fags decide what you want to call closures already? first they were an imperative concept to make it sound like there's no FP influence in imperative languages, now you're saying they come from FP but they're the only good part
>>
>>54709122
>see
First quote mentioned using it for functional programming
Second quote was a reply to someone mentioning functional programming

kys
>>
>>54709064

the problem is that i want to put a BP in TranslateAccelerator in the ieframe module, but the debugger got it all wrong and send me to the wrong adress call

also kys you all ;^)
>>
>>54709163
>winking carat face
kys
>>
This might not be the best place to ask but it is related to a programming project so I will give it a shot.

What do I do to solve this equation in pic related? Specifically the part in parentheses. It looks like a matrix but how could I solve for a single number in that case? Mainly I just need to know what kind of math this is so that I can find the solution, thanks.
>>
>>54709210
wtf is that notation with the 2½
>>
>>54709210
>>54709226
ah maybe they're separate like (cot(b)/2, 1/2)
>>
>>54709210
did you try FOILing it?
>>
File: occhioni.jpg (67 KB, 640x640) Image search: [Google]
occhioni.jpg
67 KB, 640x640
What's the best way to parse a 4chan page in C?
>>
>>54709210
>>54709226
its a vector
>>
>>54709175
>misspelling caret as carat

kys
>>
>>54709261
by using python's requests library
>>
>>54709210
>What do I do to solve this equation in pic related?
first, format it legibly
what the fuck is that quotient
is that a quantity divided by a permutation?
>>
>>54709261
jansson
>>
>>54709261
curl and strstr
>>
>kys
kys
>>
>>54709271
>what is a meme
kys
>>
>>54709163
But the TranslateAccelerator function is in the User32 module, not ieframe.

And if that's you highlighting the "A8182940", that's the same as 402918A8, the bytes are stored backwards because little-endian.
>>
>>54709271
>tripfagging
kys
>>
Okay /g/, time to unveil my plan.

I plan on making a animation app (something on par with your standard gif maker). What are some features I should have?
>>
>>54709325
ability to kys
>>
>>54708823
t. pajeet
>>
>>54709336
sorry i'm not familiar with Java
>>
>>54709325
layers
>>
File: laughing anime girls.gif (3 MB, 355x201) Image search: [Google]
laughing anime girls.gif
3 MB, 355x201
>>54709226
>>54709278
>computer science is a math major guise!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>>
File: 34632984732987.png (12 KB, 410x299) Image search: [Google]
34632984732987.png
12 KB, 410x299
>>54709316
>haha I was just meming!

kys
>>
File: gamer modern male.png (248 KB, 730x350) Image search: [Google]
gamer modern male.png
248 KB, 730x350
>>54709379
>using meme in a verb
KYS KYS KYS
>>
>>54709242
>>54709226
No idea.
>>54709250
No I haven't but I will try that and see what it looks like.
>>54709266
I think you are right from what I was reading but there was some ambiguity and since I don't have anything past pre-calc under my belt I wasn't sure.
>>54709278
>format it legibly
>wtf is that
http://entertain.univie.ac.at/~hlavacs/publications/car_model06.pdf
It isn't mine. I am just trying to build as complex a simulation as my meager math skills will allow me which is just slightly below the skill required to implement this model.

Thanks all, I think going with a vector I can find a way to translate this.
>>
>>54709204
...holy shit, what is the difference in practice between a named tuple and a dictionary? Have I really been wasting my time using dictionaries for everything?
>>
>>54709375
>not rendering equations legibly
kys
>>
>>54709410
>epic sarcasm dude lol!!!
kys
>>
>>54709322
>posting anonymously
kys
>>
>>54709400
you've been wasting your time with python
>>
>>54709431
I know. I'm just going to finish this one last project and move on.
>>
>>54709351
yeah.

Really, this animation app is kinda gonna be like a phone port of Flipnote Hatena(almost certainly spelled that wrong).
>>
>>54709441
I don't believe you. You're addicted. You can't stop.
>>
>>54709450
I can stop any timeI just don't want to right now!
>>
So, do none of you faggots even know Erlang?
>>
>>54708536
Php Framework for dependency injection + testing (obviously Mocks are accepted). No one did the way I did so when I publish it will be nice. Seems windsor but in PHP
>>
>>54709466
do you know B?
>>
>>54709480
Do you mean BCPL?
>>
>>54709613
It's based on it, but not exactly
>>
>>54708536
is it wrong for my dick to get hard from what appears to be a highschool slut?
>>
>>54710084
No, but keep it out /dpt/. Here we talk only about code.
>>
File: youthful female yoga pants ass.jpg (1 MB, 2448x3264) Image search: [Google]
youthful female yoga pants ass.jpg
1 MB, 2448x3264
>>54710084
yes
>>
>>54709480
No.
>>
can someone explain the "webdevs can't program" meme to me? whats the difference between a webdev and a "true programmer"?
>>
>>54710153
Why do girls nowadays wear this type of shit. It's like they don't want me to concentrate.
>>
>>54710470
webdevs script out what they want the computer to do
programmers program those functions webdevs use
>>
>>54710487
how is webdev different from imperative programming?
>>
>>54710487
as a programmer and a webdev (since it pays more in my area) I disagree
>>
>>54710470
Webdevs are only capable of gluing shit that other people have done together.
A "real programmer" is capable of doing it on their own.

Just look at http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/
>>
File: uD3wEws.jpg (97 KB, 1023x948) Image search: [Google]
uD3wEws.jpg
97 KB, 1023x948
>>54710144
>>
>>54710487
this is literally nonsensical
>>
>>54710470
webdevs defend MIME types.
>>
File: comfy.jpg (372 KB, 1803x1351) Image search: [Google]
comfy.jpg
372 KB, 1803x1351
>>54709000

> hardware interrupts
>>
>>54710487
If this isn't well thought out bait, I hope you realize how vacuous and wrong this statement is.
>>
>>54710470
Propogated by insecure spergs on this board who want to feel better about their only achievement in the field of computer science, their fizzbuzz collection.
>>
>>54708563
Haskell kernel written in linux
>>
>>54710470
webdev, even the backend stuff is a lot simpler and shallower than the typical program. there is a horrible culture with a complete disregard for performance, quality and even correctness. webdevs are for the most part highly incompetent and don't know math or anything that takes half a brain

just look at this shit:
http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/
>>
I wanna start building a portfolio so i can get a code monkey job
never posted anything online, what would be good to put in the portfolio
>>
>>54710608
Why not BSD kernel written in lisp?
>>
>>54710626
You seem like you have a lot of pent up anger that you need to vent
>>
>>54710649
you seem like you should fuck off to >>>/g/wdg
>>
someone post the pic with the entitled retarded bitch that couldn't do fizzbuzz, i think she was a web dev
>>
>>54710629
I would put fizzbuzz on it for sure.
>>
>>54710629
3d fizz buzz
>>
File: webdevs cant fizzbuzz.png (229 KB, 537x783) Image search: [Google]
webdevs cant fizzbuzz.png
229 KB, 537x783
>>54710705
>>
>>54710629
fizz buzz definitely
>>
>>54709033
Oh yeah, lets just all ignore >>54708733
>>
File: killurself.jpg (36 KB, 600x600) Image search: [Google]
killurself.jpg
36 KB, 600x600
>>54710683
>>
webshit is mostly just storing and retrieving data in a database, and the database stuff is abstracted away by some inefficient meme frameworks, it's not hard at all compared to making an actual program with all kinds of algorithms etc
>>
>>54710475
attention
>>
>>54710722
I love this one
>>
seems like you mouthbreathers are just mad that webdevs
1. make more money than you
2. get more pussy than you
3. are more respected than you
sound about right?
>>
File: 1416962587683.gif (1 MB, 343x239) Image search: [Google]
1416962587683.gif
1 MB, 343x239
>>54708536
>>
>>54710880
where'd you find this footage of me in highschool
>>
>>54710626
>a library containing one trivial line of code
>18 million downloads
Jesus.
>>
typedef struct lnode *List;

typedef struct lnode {
int info;
List next;
} List_node;

This is how teacher showed linked lists. But what about this
typedef struct lnode {
int info;
struct lnode *next;
} List_node;

How do I create a new node with the second declaration?
>>
youre going to kill me for my faggotry...

but what if one made a a normal, readable comfy syntax wrapper for c++? C++ reads so fucking horrible and the pointer memery omg

t. millennial programmer :-)
>>
>>54710968
>hiding the pointer symbol in a typedef
Offensive and disgusting.

Anyways you just do
malloc(sizeof(List_node));
>>
File: 1456771008299.png (750 KB, 854x853) Image search: [Google]
1456771008299.png
750 KB, 854x853
>>54710722
ugh math
>>
>>54711018
it's called java
>>
>>54711020
How would you do it? The reason I'm asking is because I get all confused with List_node struct lnode and all that shit.
Also, will node->info work without hiding the pointer symbol?
>>
>>54709210
multiplication of a scalar with a vector(cotB/2, 1/2)?
>>
File: 1464032953961.png (668 KB, 1680x1050) Image search: [Google]
1464032953961.png
668 KB, 1680x1050
>>54710722

THIS is why webdevs aren't real programmers
>>
>>54708536 (shameless pointer to OP)

ok, so i have a problem

there's a structure

struct struct_1{
int val1;
int val2;
struct struct_2 struct_2_i;
};

struct struct_2 {
int val3;
int val4;
int val5;
};


how should i create 2D array of struct_2 with (val1 * val2) size?
>>
>>54709375
>implying codemonkeys on /g/ are compsci majors to begin with

and

> is a math major guise

is a silly assertion lel
>>
>>54710722
this is great example of the male vs female brain. women are good at everything in the programming world (style guides, how to make your project pretty etc) except for actually making an algorithm
>>
>>54710722
lmfao is this actually real
>>
>>54711072
Reading that initial code is making me realize why Linus hates typedef. I can't believe your instructor seriously wrote
typedef struct lnode *List


Anyways yes it will work. These are equivalent statements:
struct coord * foo = malloc(sizeof(struct coord));
foo->x = 5;
(*foo).x = 5;
>>
>>54711020
>Offensive and disgusting.

And common.
>>
>>54710722
in scheme i'll do an if whether it's divisble by 15, then in the alternative i'll have a cond for divisible by 3, a cond for divisible by 5, and an else of just printing the number
>>
>>54711153
That doesn't make it right.
>>
>>54711246

C in a nutshell.
>>
>>54711149
I also hate typedefs, but irrationaly since I'm learning to program, but for me they make shit confusing.
That is why I'm asking here how to do shit without typedefs. And I think I finally starting to get them.

Basically all these typedefs save keystrokes so you only do with code above
List node;
node = (List) malloc(sizeof(List_node));

But without the typedefs you have to do
struct lnode *node
node = (struct lnode *) malloc(sizeof(struct lnode));

Honestly I prefer the more explicit version, and you /g/ ?
>>
>>54711375
I do use typedefs but only because I think the struct namespace is a mistake and hate having to type struct every time.
typedef struct foo foo
is the only typedef I do.

Also
>casting malloc
Nigga void pointers are implicitly cast unless you're compiling that in C++ for some inane reason.
>>
>>54711375
typedefs can come in handy especially if you use them like a macro for example if you want to easily change between float and double for a certain part of your code

typedefing a struct is fine (and it happens automatically in C++) but don't include the pointer, i think you should be explicit about the dereferencing and such to avoid confusion
>>
>>54708563
A hello world program in Whitespace (a programming language) and submit it here without using the \[code\] tags.
>>
>>54708536
https://www.youtube.com/watch?v=O9xn9h_874U

how is Jonathan Blow so good?
>>
>>54711375
typedefs are usefull when working with function pointers accepting function pointers returning function points returning ....

also, never cast a fucking malloc.
>>
>>54710743
It's not even hard. I gave it to him because it's fun.
>>54708642
This is more fun though. It's the most casual thing but it's fun.
>>54709000
Doesn't fit the "trivial". Criteria.

Either of mine are like 100 lines of code at absolute worst and a large part of that is just defining geometry.
>>
>>54710722
H-how.
I try to not be prejudice against webdevs but it keeps happening.
>>
>>54711555
make a program in java that you can enter the name of a hentai manga along with a link to it and add tags to the entry to what's in it like incest, netorare, vanilla, titfuck etc, and a rating. and then you can search your library by tags and it'll pop up a list of them with the links and what you rated them

if you don't make this i'm going to
>>
>>54711578
>>
>>54710889
Kek
>>
>>54711587
>in java
why senpai
>>
I've been vexed with this all day

what would be the best way to draw a grid across a varying screen, logging each coordinate, without using arrays (unless it's possible for arrays to vary across screens)?
>>
>>54711513
He cares about programming enough to talk about it.
There's tons of people that are good at programming who are oppressed by corporate structure.
His first talk on "a programming language for games" is something people should watch with this in mind. He mentions a lot of problems his friends face indirectly.

Tbh I find that gameengine devs are some of the most top tier people. Every other field (i know of) has bad opinions about programming even on that level. They're competing so directly, that's probably why.
>>54711587
Well that's ea-
>make a program in java
You better do it.
Fuck java.
>>
>>54711636
that's what i was planning on using bc it seems like OOP would be pretty useful for it
>>
>>54711437
>>54711447
>>54711544
Okay so I got this linked list node
struct lnode {
int info;
struct lnode *next;
};

And I start a node with
struct lnode *node;
node = malloc(sizeof (struct lnode));

So can I just use typedef to not write struct lnode everytime? like this?
typedef struct lnode {
int info;
struct lnode *next;
}Kek;

and thus start a node with
Kek *node;
node = malloc(sizeof (Kek));
>>
post gits I'm bored and want to help with some small-time shitter's project
>>
>>54711640
>what would be the best way to draw a grid across a varying screen
Well, say you want 16 squares wide and 9 squares high. The distance between each square width wise will be screenResolution/16
The distance between each square height wise will be screenResolution/9.

So if you want to draw the first square you'd draw from [0,0] to [screenResolution/16,screenResolution/9]
So as you can clearly see if you let i go from 0 to 16 and j go from 0 to 9 (nested for loop)
[screenResolution*i/16,screenResolution*j/9] to
[screenResolution*(i+1)/16,screenResolution*(j+1)/9]
You get your squares, no arrays.
>logging each coordinate
What do you mean?
>(unless it's possible for arrays to vary across screens)?
You mean without reallocating?
>>
>>54711687
>https://github.com/angel2d/angel2d
Please add the ability to make particles use sprite animations individually (i'd appreciate it).
>>
1) fizzbuzz calls fbLoop 1, which loops until the parameter is 100
2) fbLoop:
begin
if the number is divisible by 15..
consequent: print fizzbuzz.
alternate: enter a block of conditions.
cond 1: number is divisible by 3. Print fizz.
cond 2: divisible by 5. print buzz.
cond 3: else, print the number
if the number is less than 101, call fbLoop (number+1)


find a flaw in my fizzbuzz project outline i've spend the past 3 weeks developing, i dare you
>>
>>54711676
Yeah that works. You don't have to use a separate name for the typedef. You could do just
typedef struct lnode { int info; struct lnode * next; } lnode;
. But that's your choice man.
>>
File: 80kek.gif (1 MB, 288x198) Image search: [Google]
80kek.gif
1 MB, 288x198
>>54711605
>zapping in and out of RAM
Don't call us, we'll call you!
>>
>>54711698
>0 to 9
>0 to 16
I was thinking for (int i=0; i<16;i++)
So I meant 0 to 15 and 0 to 8.
>>
>>54710850
yes
>>
>>54711720
>calls his function fbLoop
>it's recursive and doesn't contain a loop

you work for Apache, don't you?
>>
>>54711736
i mean it's essentially a loop my man
>>
>>54708637
>>54708711

Jesus christ there are not 3 OS'. I just want to make the constructive point here for a base reference going forward. There are kernels and separate OS'es. Linux Redhat != Mint. Same kernel separate OS.

To really define the argument itself, the code written for Mint and Redhat in the example is likely totally different when compiled. For example printer GUI/engine in redhat vs mint likely has different compiler or base language (I haven't investigated but argument is there). The byte count and execution time is largely different even though the end user functionality is similar.


Just like OSX is unix based but is more of a branch and separate product than the generic unix system. Not to mention the OS varies in functionality based on the arch. it was compiled for (x86 v x86_64, ARM)

lastly
>"all"
TempleOS?iOS? Android? Older windows that don't necessarily use the same system as winXP+? ETC.
You lose many of the active market user base by limiting yourself.

>>54708536
>what are you working on today
writing a site in PHP. First time I have really done anything in PHP. Thinking about implementing a login that uses part of the algorithm used in python haystack's indexing to check verfiication. Messy. We'll see.
>>
>>54711077
This is what it wound up being - Fcp,f was defined previously in the paper
>>
>>54711721
Nice.
In my classes I was pissed as fuck because in the end we had 3 "variables" (List, lnode and List_node) while we could only use one and I didn't get shit
>>
>>54709000
>Little Computer 3, or LC-3, is a type of computer educational programming language
How utterly uninteresting.
>>
>>54708536
I'd write my data to her stdout if ya catch my drift
>>
>>54711698
Thank you so much for this solution.

Here i am sitting here pondering all day on how to properly array this, and never once did it cross my mind to divide the fuckers into a set-sized grid, and stretch that across the screen.

also the logging stuff just meant to make each square a object or something.
>>
File: 1461005231404.jpg (687 KB, 826x1167) Image search: [Google]
1461005231404.jpg
687 KB, 826x1167
I'm falling for the FP meme
>>
I know the correct way for pointer declaration (star's placement) is
int *address;

But what about a function that returns a point?
pointer* function()
pointer * function()
pointer *function()
>>
>>54711789
Dude if you've actually spent a full day on this then maybe you need some help learning.
I'm heading to bed but pass me an email:[email protected]
I like helping. And if you couldn't figure this out in the maybe 1 minute it took me to write that post you might need some guidance in how to think about tasks.
>>
>>54708595
Here you go:
#!/usr/bin/python3

import sys

sys.stdout.write("\t.lcomm d, 65536\n\t.text\n\t.globl _start\n"
"\t.type _start, @function\n_start:\n\tmov $d, %rbx\n")
s, n = [], 0
while True:
c = sys.stdin.read(1)
if c == "":
break
elif c == '>':
sys.stdout.write("\tadd $1, %rbx\n")
elif c == '<':
sys.stdout.write("\tsub $1, %rbx\n")
elif c == '+':
sys.stdout.write("\taddb $1, (%rbx)\n")
elif c == '-':
sys.stdout.write("\tsubb $1, (%rbx)\n")
elif c == '.':
sys.stdout.write("\tmov $1, %rax\n\tmov $1, %rdi\n"
"\tmov %rbx, %rsi\n\tmov $1, %rdx\n\tsyscall\n")
elif c == ',':
sys.stdout.write("\tmov $0, %rax\n\tmov $0, %rdi\n"
"\tmov %rbx, %rsi\n\tmov $1, %rdx\n\tsyscall\n")
elif c == '[':
sys.stdout.write("\tcmpb $0, (%%rbx)\n\tje c%i\no%i:\n" % (n, n))
s.append(n)
n += 1
elif c == ']':
r = s.pop()
sys.stdout.write("\tcmpb $0, (%%rbx)\n\tjne o%i\nc%i:\n" % (r, r))
sys.stdout.write("\tmov $60, %rax\n\tmov $0, %rdi\n\tsyscall\n")
>>
>>54711803
Whitespace doesn't matter at all.
There's not even coding style conventions.
I tend to group them with the type though. So pointer*
If I want to dereference the return I'd do
int i= *foo();
>>
>>54711806
i may have used a little hyperbole.That didn't actually take me a whole day, just a couple frustrating hours at most.

I might take up your offer though, as I could always learn more.
>>
>>54711803
They're all equivalent.
int *addr;
int* addr;
int * addr;

are all the same too. I personally fucking hate the first one.
>>
>>54711803
I usually do the last
>>
>>54711841
I like the first one because if you do something like this
int* a,b,c;

Only a is a pointer, the other two are ints
While with
int *a,*b, c

You know what is what
>>
>>54711860
That is true but that is why I avoid doing that.
>>
>>54711860
Well. It'd be dumb to declare different types on the same line like that. Don't do that in the first place imo.
>>
>>54711645
Almost every modern language has OOP. The idea that Java is magical because it has objects is somehow crammed into every intro to CS class, even though its total bullshit.
>>
>>54711906
Yeah OOP+GC as your first language is a no starter. You're set up to write bad software for the rest of your life like that.
>>
>>54709210
Solve it for what? β?
>>
>>54711800
im already using partial application everywhere
>>
>>54708563
Write a greasemonkey script that flips all images upside down on all pages
>>
>>54711929
I was mainly commenting on the fact that the other person went: I *need* OOP to I *must* therefore need Java, but yeah, this. Unfortunately I fell for the OOP meme at first, but luckily learned how to do manual memory management. Learning x86 assembly fixed that problem pretty quickly though.
>>
>>54711800
FP is the true redpill
>>
>>54711929
>java is bad
>>
>>54711873
>different types
It's also clearer in the case
int *a, *b, *c;
>>
>>54711800
>mfw FP is incredible but I'll never get a job using it
>feelsbadman.jpg
>>
>>54711800
you need Haskell to reach Satori
>>
>>54711965
Honestly, Java is a language that's objectively pretty low quality. Just because its ubiquitous is modern development doesn't mean that it's good.
>>
Are there any decent books or anything online that I can waste time to and learn?
I've taken a few college and high school programming courses, but I haven't done anything else besides that.
>>
>>54711970
it's taking over slowly
Next 2 versions of C# will have Higher Kinded Polymorphism, pattern matching, etc.
>>
>>54711981
>Java is a language that's objectively pretty low quality.

What's your favorite language?
>>
File: 394.jpg (36 KB, 350x197) Image search: [Google]
394.jpg
36 KB, 350x197
>>54711981
This desu.
>>
So I got an entry level job at this home design software place, and the code is absolutely awful. So much copy-paste, so much ugly code. All written in C++. It's hardly object-oriented, more like instead of inheriting, they copied and pasted the class and made minor changes. Anyway, today (6th day) they changed their product license code and gave me a piece of code to basically do a search and replace across the entire solution. They didn't use a single function when they checked for a license. They used basically a unique code about 80 times throughout the entire program, spread out across DLLs, random classes and they had me basically implement the code they had. I didn't create a function either, I just .

Anyway, I'm not sure if I made much sense, but basically, it's a huge hunk of shitty code and they basically had me do shitty solutions to their avoidable problem. Is this standard for the industry?
>>
>>54711997
Not the one you're replying to, but I agree that Java is pretty low quality. C and Lisp are pretty high up there.
>>
>>54711997
I wouldn't say that I have a favorite language. Different languages are suited to different things. C++ and Python tend to be very good, and something like Haskell is a lot of fun, if not all that practically useful.
>>
>>54711995
>Next 2 versions of C# will have Higher Kinded Polymorphism, pattern matching, etc.
Is C# bent on overtaking D as the checklist champion?
>>
>>54712012
>C [...] pretty high up there

This level of delusion and historical revisionism is incredible.
>>
>>54711995
While that's true, I feel like using non-FP languages that gradually gained FP features is still a very different experience from languages that were meant to be FP from the beginning.
>>
>>54712029
C is simple and elegant for what it can do. There's also virtually no other language that can do without runtime dependencies to the extent C can.
>>
File: wat.gif (2 MB, 235x180) Image search: [Google]
wat.gif
2 MB, 235x180
>>54712019
>C++
>good

>Python
>good
>>
Why do I need to create a header file and a .c file for 1 function? Can't I just create the whole function in a .h?
>>
>>54712040
>simple
>elegant

OH MY GOD! HE CAN'T KEEP GETTING AWAY WITH IT!
>>
>>54712042
What languages do you prefer, anon?
>>
>>54712029
>>54712054
The race mixer, demonstrating his retardation, yet again.
>>
>>54712045
>Can't I just create the whole function in a .h?
If you include that file in several C files, you will then have multiple definitions of the function, which won't link unless the function is static. If the function is static, then it is redundantly declared which is arguably wasteful.
>>
>>54712054
There's a reason the linux kernel is written in C. It may not be a perfect general purpose language, but damn if it isn't good at what it does.
>>
>>54712029
You're an idiot. I hope you don't shill C# for free.
>>
>>54712058
If i care about performance, i use assembly. otherwise, i use a custom lisp dialect to suit the project at hand
>>
>>54712054
What? It's true, quite simply. It requires quite few language features to do quite a lot. That's pretty much the definition of "elegant and simple".
>>
>>54712045
As >>54712067 says, but if your function is tiny, you can just declare it inline and put it in the header.
That won't be very wasteful.
>>
>>54712045
You don't need header files. Header files essentially just copy and paste a bunch of extern declarations at the top of your code.
>>
>>54708536
Does anyone have any experience with Rust? Is it worth trying to learn? It seems kind of neat but the syntax also looks kind of hairy.
>>
>>54712091
>If i care about performance, i use assembly.
I sure hope you know Agner Fog's timing documentation by heart to say that. Otherwise, you really should be trusting GCC to do your instruction scheduling for you.
>>
>>54712091
I thought they made it illegal to lie on the internet...
>>
>>54712098
It's a pretty interesting language, but trying to wrangle the ownership system is kind of a pain in the ass, especially at first.
Thread replies: 255
Thread images: 36

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.