[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: 35
File: 1465700695183.jpg (80 KB, 482x424) Image search: [Google]
1465700695183.jpg
80 KB, 482x424
Previous - >>55041174

What are you working on, /g/?
>>
>>55049900
Erste fuer D
>>
File: monalisa3.png (91 KB, 190x297) Image search: [Google]
monalisa3.png
91 KB, 190x297
Mona lizard. Right now I'm building one with 300 triangles and 1000 candidates for each. We'll see how that turns out.
>>
File: D.jpg (42 KB, 512x512) Image search: [Google]
D.jpg
42 KB, 512x512
>>55049915
D's shit and so is your waifu & favourite vidya
>>
>>55049936
designated shooting streets
>>
>>55049944

Trump was right. Shoo shoo Saracen scum.
>>
>>55049936
OI, tripfag. You know anything about where the desktop threads went?
>>
>>55049973

No idea.
>>
>>55049900
8th for Go
also, nice triple (5, 9 and 0) dubs
>>
File: s4159214.jpg (17 KB, 321x414) Image search: [Google]
s4159214.jpg
17 KB, 321x414
Still reading through this
>>
File: 822e8c4493.png (9 KB, 525x350) Image search: [Google]
822e8c4493.png
9 KB, 525x350
>>55049900
I'm learning WPF, seems a bit big and definitely fun.
>>
>>55049973
they were banned.
>>
>>55050019
damn.
>>
>>55049900
Overthewire Bandit games.

>>55047272
A Danbooru scraper & 4chan scraper would be very fun & useful. The key to start is finding well-written pseudocode & not just a YouTube video called "how to write le scraper".
>>
Does 4chan have an api?
>>
>>55050035
Do you enjoy dick in your mouth (hint: yes)?
>>
>>55050020
>seems a bit big

4 u
>>
>>55050048
i'm a girl, so yes..
>>
File: UUUU.png (14 KB, 816x311) Image search: [Google]
UUUU.png
14 KB, 816x311
>>55050055
>>
>>55050048
calm down, fatty
>>
>>55050058
pls b in grayslake
>>
File: Yuuji.png (163 KB, 1049x750) Image search: [Google]
Yuuji.png
163 KB, 1049x750
>>55050026
Aww. No more Yuuji stalking.
>>
File: 1465671626618.png (72 KB, 244x241) Image search: [Google]
1465671626618.png
72 KB, 244x241
>>55050055
I was expecting that response, ty bb.
>>
File: 1465782502936.png (6 KB, 816x311) Image search: [Google]
1465782502936.png
6 KB, 816x311
>>55050070
your png is now optimized
>>
>>55050086
>break someone's car while cleaning it
>>your car is now optimised
>>
>>55050055
>Baneposting

>>55050080
Cute Akari. I thought about the yurus at work today. Made cleaning up the shattered glass so much easier.

Anyone else up to baneposting a bit here?
>>
>>55050103
what the fuck are you talking about dude?

it has a smaller size
>>
How do i use the 4chan api?
>>
>>55050117
Yet part of its defining features was destroyed in the process. Today we mourn UUUU.png, that anon shamelessly killed
>>
>>55050121
https://github.com/4chan/4chan-API
>>
>>55050145
thank you
>>
>>55050079

Now I can't post my high test women in the desktop threads.
>>
>>55050281
let's dispel with this fiction that this man does not know what he's doing. He knows exactly what he's doing.
>>
>>55050288
THERE IT IS
>>
File: 38751975124.png (268 KB, 396x554) Image search: [Google]
38751975124.png
268 KB, 396x554
>>55049959
Imagine being ginger
>>
The only good about the shootings is that it makes it easier/more realistic to find a qt not-extreme-leftist bf.
>>
File: iq.jpg (40 KB, 887x508) Image search: [Google]
iq.jpg
40 KB, 887x508
>>55050416
we should seriously ban muslims or at least subdivide countries so that white people can choose to live with white people and so on, we need to stop this ultra-faggy political correctness bullcrap and face the reality that people are different and have different cultures
>>
>>55049900
a better version of havij
>>
>>55050444
>subdivide countries
Fuck off, just because they were fucking let in by Labour doesn't mean I'm giving up part of England to them
>>
>>55050474
we could use them as wage slaves if not literal slaves
>>
>>55050444
>>55050498
So basically 1800's South, but w/ Muslim slaves instead of black slaves?
>>
>>55050498
Fuck off, that ended with a 60% white America
>>
File: moner-lisa.png (135 KB, 240x374) Image search: [Google]
moner-lisa.png
135 KB, 240x374
Finally, it's done. Not bad for 300 triangles. Could be better.
>>
this is a dumb question, but does the GNU assembler on OpenBSD come with M68000 support by default?

the -m68000 switch doesn't work, do I need to recompile it?
>>
File: cfg.png (43 KB, 747x694) Image search: [Google]
cfg.png
43 KB, 747x694
A program to fiddle with context-free grammars. I just got this part to work (checks if a word has the empty word in its transitive reflexive closure).
It's a bit trickier to do for CFGs in general instead of just your run-of-the-mill LL CFG because you haven't got a "no loops" guarantee if you're working from left to right.

It's not much and most of it might have a more efficient way of doing it (what I said above has worst case exponential time and space complexity, for example), but I did it all by myself and I'm proud.
>>
I discovered something about Windows: whenever I click the window title (WindowChrome) and leave pressed while not doing any mouse drag, it causes the cursor to do a fast "blink/flash" after like 1.5 seconds. That's making my r/a/dio player to glitch the audio for like 100 ms.
It kinda sucks but I'm too lazy to fix it since seems like a Windows problem and not from my application.
>>
Does anyone know how to set a default syntax in Sublime3?
>>
>>55050130
what, was it a high test PNG?

seriously, what was the defining feature?
>>
>>55051591

Ah. In that case, I can't think of any algorithms off the top of my head for dealing with this case.

>>55051588

The defining feature was the filename.
>>
Does this python even monitor the ports I want it to?
I keep getting tons of interference, I'm starting to think it just monitors everything...
HOST = socket.gethostbyname(socket.gethostname())
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
s.recvfrom(port1)[1][0]
s.recvfrom(port2)[1][0]

What am I doing wrong? I don't know that much about networking stuff.
>>
/dpt/ please help me with this c++.

I have this code fragment

std::string bin26 = "00000000000000000000000000";

bin26.replace(16,21, "11001");

//Wanted output: from bin26:
//00000000000000001100100000
//Given output: from bin26:
//000000000000000011001


I know it's doing that because the characters past that point aren't there in the segment I'm using to replace but how do I get it to replace purely that segment I'm asking for (16-25).
>>
File: 084.png (102 KB, 300x256) Image search: [Google]
084.png
102 KB, 300x256
>**NOTE** Even if you don't plan on reading from this depth_attachment, an off screen buffer that will be rendered to should have a depth attachment
fuck's sake, can't the implementation just make a damn depth attachment if it should have one even if i don't specify it
>>
>>55051697

anybody?
>>
>>55051697

bin26.replace(16,5,"11001");


Try that. The second parameter is a count, not an index.
>>
>>55051697
integers aren't iterators, so you are invoking the position/count version of the method. You are saying to replace the next 21 elements with 11001. So give it the count (5) not the end offset.
>>
>>55051970
>>55051998

Woops. I've been working on this project so long I overlooked such a simple mistake. I should go to bed. Thanks guys.
>>
Anyone using Scala? I'm thinking of using it for data analysis and stuff.
>>
>>55050026
Seriously? Fucking finally.
>>
Are the books in the gentooman library on C outdated?

I want to learn c but im not sure where to start, i did some a few years ago but the extent of what i wrote was

//countdown using while

#include <iostream>
using namespace std;

int main ()
{
int n;
cout << "Enter the starting number: ";
cin >> n;

while (n>0) {
cout << n << ", ";
--n;
}
cout << "FIRE!\n";
return 0;
}
>>
>>55051323
>r/a/dio player
Link? Unless you are talking about the web player.
>>
>>55052564
>not sure where to start
C programming a modern approach, Understanding and using C pointers.
No, I'm not going to stop shilling those books.
>>
>>55052583
Just remember it's a WIP: https://github.com/yureru/R-a-dio
>>
>>55049900
>What are you working on, /g/?
a fap app
I'm working on an app that will help me fap DAILY more effectively
This app has promise, true rewards.
I'm testing it now with some porn.
>>
File: cee.png (12 KB, 1052x149) Image search: [Google]
cee.png
12 KB, 1052x149
>>55052587
idk, sounds pretty bad
>>
>>55052606
show me this bewildering algebra in the C book
>>
>>55050034
you're acting like its hard to write a scraper. Scrapers are probably the easiest project you can do, but really can't be done without youtube or already finished code helping you imo
>>
File: cee2.png (25 KB, 1067x237) Image search: [Google]
cee2.png
25 KB, 1067x237
>>55052609
¯\_(ツ)_/¯
>>
>>55052722
Looks like a paid shill advertising another C book
>>
>>55052722
>by a customer on february 27, 1999
>>
>>55052604
>an app like Tinder for delivering porn
>learns from left swipes what you dislike and right swipes what your preferences are
>profiles are image galleries the initial main photo is part of
>>
>>55052789
>C programming: a modern approach
>1999
>>
>>55052797
lel
if only you knew
>>
>>55052722
>exercizes
not sure if shilling or if just stupid as hell
>>
>>55052789
what about it? Amazon has been around since 94 and was originally a book shoppe.
>>
>>55052820
or both

>>55052606
if you're retarded then programming is not for you
>>
>>55052722
Can someone post the mentioned exercise?
>>
File: ZM1210-operating_edit2.jpg (1 MB, 1100x2000) Image search: [Google]
ZM1210-operating_edit2.jpg
1 MB, 1100x2000
I posted my nixie tube clock code in the previous thread with very halfassed comments. Here's the fully commented version. My programming skills aren't great. Was hoping I could get some constructive criticism. It does function correctly by the way.

http://pastebin.com/B019vqwq
>>
>>55052835
eta 12 minutes sure
>>
>>55052835
>>55052857
ok, page 30 doesnt even have an excersice number 5
>>
>>55052836
the fuck am i looking at
looks like some wierd ass version of assembly
>>
I am working on android RAT.

Anyone have any ideas how to take screen shot outside of my app on non root devices? I think its achievable in gingerbread, but anything about 2.x.x made it harder/not possible.


Also , anyone listen to asmr/rain sounds while they're programming?
>>
>>55053268
>about 2.x.x

above* 2.x.x
>>
>>55052836
i wouldnt have problems if it was in x86 but
is dat sum 68HC11 microprocessor?
>>
From wikipedia's implementation of merge sort:
TopDownMerge(A[], iBegin, iMiddle, iEnd, B[])
{
i = iBegin, j = iMiddle;

// While there are elements in the left or right runs...
for (k = iBegin; k < iEnd; k++) {
// If left run head exists and is <= existing right run head.
if (i < iMiddle && (j >= iEnd || A[i] <= A[j])) {
B[k] = A[i];
i = i + 1;
} else {
B[k] = A[j];
j = j + 1;
}
}
}


Why do they have in the if j >= end? When would it never not be?
>>
>>55053182
It is assembly. The instruction set for the Motorola 68HC11 microcontroller to be exact. It's an accumulator based microcontroller which possibly explains why it looks like a weird ass version of assembly. I'm guessing you're familiar with the other type for which I can't recall the name of at the moment.
>>
>>55053268
I listen to music
it's not like reading, you can still program and listen to stuff I think
https://www.youtube.com/playlist?list=LLD5Wsn4RKmDg1O3Qg0as2Lw
>>
>>55053279
You got it!
>>
should I learn javascript or c++ for games?
>>
>>55053307
C++
>>
>>55053290
I'm an idiot, disregard that post.
>>
How do you guys get motivated to code? I came back from a con last weekend and I've yet to get back to my project. I feel so lazy. I went to the gym, got out of the house, but I sit down at my computer and I just dont feel like coding. And I have to get this project done by the end of the month.
>>
>>55053299
Thanks for the list anon, I saw some songs I like.
>>
>>55053307
>even considering javascript
just give up
>>
>>55053268
>asmr/rain sounds
what?
>>55053043
>>
>>55053299
>that playlist

This is how you can figure out how foreign someone is. They listen to all the silliest and american songs.
>>
>>55053398
what?
>>
>>55053299
>https://www.youtube.com/playlist?list=LLD5Wsn4RKmDg1O3Qg0as2Lw
what are you, some kind of fag?
>>
>>55053268
>on non root devices
no
>>
>>55053416
lel I'm a native, calfornia specifically

I don't exactly know how I got my taste, I like rap and pop and classical music and I love musicals

Some of it's from my dad (all the country stuff), the rest is mostly music from around 2006 when I was growing up

>>55053427
yes
>>
>>55053343
How I stayed motivated to code my android rat, was I kept achieving features I wanted (remote directory, mutli client, etc..) there is so much more features I need/want to add.
>>
>>55053433
>2006
>growing up

My God Im surrounded by a bunch of kids. Where the fuck did my 30 bros go
>>
>>55053445
well they grew up, presumably

I'm 20 though so not exactly a kid
>>
>>55053445
>still on 4chan in your 30s
what the fuck gramps
how have you not tired of the shitposters and spergs by now?
>>
>>55053457
>I'm 20 though so not exactly a kid
anon...
>>
>>55053467
I fucking hate all of you and I really really hate /v/. I occasionally come here to see how shit goes when away from my deep/g/ home.
>>
>>55053457
>20

You're a kid
>>
>>55053468
well I live on my own, have a job, go to college
is that not being an adult?
>>
>>55053467
i'm only 22 and i left 4chan for like a day, only came back to trump post, i'll probably leave more often and just focus on programming instead of being in /dpt/, i'm so sick of most of you fucking retards, posting in /dpt/ was mostly just a bad a habit and because i didn't have anything else to leave as an idle page on my web browser (if i'm listening to music on youtube the videos are too distracting)
>>
>>55053490
it fills a social need
>>
>>55053497
this
this is the reason this site is a home for people
You get to socialize
>>
how do you improve at all the programming related stuff that isn't programming? (the business things)
like, i have no idea how to properly gather requirements from a customer or shit like that
>>
>>55053659
look at requests and tasks and assignments and shit from wherever and implement them
>>
>>55053659
change your business model

if you're employed as a programmer it's probably someone else's problem to gather the requirements for you

if you're running a business and developing your own product(s), you set the requirements, not the customers
>>
>>55053686
Lots of companies contract work
>>
>>55053659
There are books for that
I mean your degree should've given you a unit on introduction to software engineering that included said aspect and also writing documents
>>
>>55053659

>how do you improve at all the programming related stuff that isn't programming? (the business things)

I tell myself that that's not my fucking job and I don't do that. I plan to work for a large corporation, or the government, and not a small startup. In either of these areas, there is a person, perhaps an entire department, of people whose job it is to find out the project requirements, and to hand them off to me to implement them. The only thing I feel I should need to improve is my ability to create the product, given the specifications.
>>
>>55053818
>degree
got hired as a code monkey directly after high school

>>55053832
yeah sure but it cant hurt to be familiar with the process, especially if you're aiming for a senior position
>>
>>55053832
be my gf plz
>>
>>55053894

>especially if you're aiming for a senior position
Unless that position is senior programmer, I don't care for it. I want to be writing code when I start work, and I want to be writing code when I'm 64 and getting ready for retirement.
>>
>>55053793
it's not really a scalable business model

the customer better be paying out the ass for your service since you can't sell your product to thousands of customers it's just one customer that you're building a custom software solution for
>>
>>55053936
not true
company i used to work for made contract software but if the company we made software for wasn't an IT company of some sort, they usually let us keep the source and paid us to host it for them
then we proceeded to sell to a bunch of other companies while giving the original company a part of the profits
>>
What's the best way to program an offline booru.

I have a ton of content that I'd like to tag and have them in an offline webpage.
>>
>>55053963
With a keyboard.
>>
>>55053908

Anon, I have a very unkempt beard, a little bit of fur on my chest, and a slight bald spot on the top of my head, that granted I can only see if I use two mirrors. I also have a penis.

I cannot be your girlfriend. I cannot be a girl anything, because I am not a girl. The name Ruby is not an attempt at using a feminine name. In fact, I started using it on /vp/ several years ago while avatarfagging Ruby from the Pokemon Special manga. He is very much male, and despite his obsession with Pokemon Contests, at the very least into women. I learned the Ruby programming language afterwards, because I read _Why's Poignant Guide to Ruby, and thought the name was kind of cool. The name Ruby stuck because of my use of that language. That... and the fact that I was too lazy to take the name off when posting on other boards.

But even if we neglect that, the name Ruby is still gender neutral, and in fact, it is a common nickname for those with the boy's name Reuben (note: my real name is not Reuben, nor is it Ruby, it's just a handle).

So allow me to clarify once again: I'm a guy. Always have been, always will be. I'm not a cute grill. I really do look like I program a lot of C.
>>
>>55053999
can i be your gf then?
>>
>>55053963

I feel as though this might be a very appropriate use of an embedded relational database like SQLite...
>>
What's the website where you can dress up your waifu by solving programming challenges?
>>
>>55053999
>pretending to not be a girl
You've reached a new low rubes
>>
>>55053999
I like my girls with a bit of fur.
>>
Is it worth to learn linked lists in C?
>>
Bout to learn c, is learning to thhe c89 / 99 standard fine or is c1x (c11) vastly different?
>>
>>55054088
It goes like this:

C99 -> C11 -> C++14 -> C++17
>>
>>55054112
why? BEcause of how widely c99 is implemented?
>>
File: cpp_vs_java_diagram.png (21 KB, 800x600) Image search: [Google]
cpp_vs_java_diagram.png
21 KB, 800x600
What's the best unit testing library for Lua?

>pic not related
>>
File: average java programmer.png (371 KB, 800x600) Image search: [Google]
average java programmer.png
371 KB, 800x600
>>55054128
>pic
10/10 bait

pic not related
>>
>>55054128
now do a "memory consumed" graph
>>
>>55054149
Don't forget a VM/JIT warmup time graph
>>
>>55054015
Do you have a functioning womb?

>>55054087
A linked list is just a tree with one child, and sometimes a pointer to a parent. Everyone should know trees, so it follows that everyone should know linked lists. Beyond that, as a C programmer, you should understand indirection, which is easily taught by means of linked lists.

>>55054088
The differences between C89, C99, and C11 are not too large, but you will generally find C11 more comfortable to program in than C89, and I would highly recommend you use it if you're going to program in C. Nonetheless, if you have to work with legacy codebases, you should at least know what you can and cannot use when working in C89.
>>
I just compiled mpv.exe on the new Windows 10 Linux Subsystem.

It felt awesome.
>>
>>55054148
is the 1000 different from the 100 case because of how the JVM caches boxed ints up to +-127?
>>
>>55054238
Are the beta's stable at all yet, or still crashy shit?
>>
>>55054240
Yes
>>
>>55054240
yes and everyone knows it and it's perfectly reasonable, the pic is just a retarded strawman argument
>>
>>55054238
how does this work anyway
can you compile shit for use on your windows machine using gcc for example?
>>
>>55054264
Reference equality is never reasonable in non-linear type systems
>>
>>55054278
fucking kill yourself that's exactly the kind of post that makes me hate /dpt/. and it's value equality, it's the value of the references (aka smart pointers), retard
>>
File: 1465153894267.jpg (21 KB, 480x270) Image search: [Google]
1465153894267.jpg
21 KB, 480x270
>>55054290
>value equality of the references
>type is int not int&
>references are smart pointers
>smart pointers in java
>smart pointers with GC
>>
>>55054335
type is Integer not int, off yourself

"reference equality" is a term that belongs to retarded C#, not java

java is "embarrassingly consistent", it's better to think of everything as a value, because you're always dealing values and never references in the int& sense
>>
>>55054229
Well I mean, I already knew about structures, the (*struct).value and struct->value operators

I'm reading through C programming a modern approach (the first edition cause I found it cheap, and in perfect condition as it used to be a teachers copy) and in chapter 17 I find myself rereading more stuff than I ever have in my studying. The linked lists and pointers to pointers.
Honestly, the pointers to pointers part is so short, I don't really get it, it doesn't seem like they really gave me a reason to use them, just told me how to.
>>
>>55054251
latest build 14361 fixed a lot of things although there are some syscalls not perfectly implemented yet. I cant' compile latest gettext for example.

>>55054271
It's faster than VM and it's like having Ubuntu with everything (autoconf, gcc ,cmake, mingw...)
I just followed Ubuntu instructions and it crosscompiled mpv.exe nicely.
>>
>>55054372
So how are references value-compared?
Obviously not with value equality because that would mean taking their references and comparing them, ad infinitum
>>
>>55054419
>So how are X value-compared?
>Obviously not with value equality
idiot
>>
>>55054447
The funny thing is I can't tell if you didn't read what I said or if you just don't understand the idea of argumentum ad absurdum
>>
>>55054470
you're fucking stupid as hell and this "discussion" is meaningless
>>
>>55054447
>>55054479

So to get this to you again:
If you compare two integers under value equality (using your definition of value equality, not mine) you compare their references.

How do you compare their references?
>>
>>55054481
KILL YOURSELF i'm fucking done i'm closing this thread fuck off

you can choose to understand or maybe you're completely unable to understand because you're a fucktarded Cshart

>>55054372
>"reference equality" is a term that belongs to retarded C#, not java
>>
>>55054271
exactly, you can cross-compile win32 binaries just opening a bash terminal and using aptitude to install everything. Some X11/gnome applications work with a X11 server installed too.
>>
File: 1465681123914.gif (1001 KB, 640x480) Image search: [Google]
1465681123914.gif
1001 KB, 640x480
>>55054492
Holy shit I'm fucking laughing

You can't answer because you fucking know it's retarded

If comparing things by their references is value equality, then you can't say you're comparing their references by value equality because then you'd need to compare the references to the references
>>
>>55049973
they moved to /w/
>>
>>55054379

>Honestly, the pointers to pointers part is so short, I don't really get it, it doesn't seem like they really gave me a reason to use them, just told me how to.

You need look no further than how command line arguments are handled in a C program. Your main function, its signature looks something like this:

int main(int argc, char **argv)


char **argv, that's a pointer to a pointer to char. Why is it like that? Well, you have an array of strings. A string is a pointer to the first character of buffer containing text. An array of this is a pointer to a buffer containing these pointers, with the last element being NULL. So a double pointer can be used as a means of handling two dimension array-like structures, where the length of each element in the array (as is the case with a string), is not fixed.

It can also be used when you want to set a pointer parameter as part of a function. Say I want a function to do two things: create a pointer to an object, and return an error code. If the error code needs to tell me more than just "I couldn't create the object", then returning a pointer to an object doesn't work well. Instead I might return an int for the error code, and take a pointer to a pointer to a struct as an argument. The user declares a pointer on the stack, and passes the address of that pointer to the function, the function then sets that pointer, and the user can pass around the pointer like any other opaque struct.
>>
>>55054510
So you're left with saying that comparing two things by references to them is value equality, while comparing two references without using references to them is reference equality
>>
>>55054510
stay delusional idiot i'm out of here

if you really want to try to understand, try re-reading the posts and think of how you compare ints and pointers
>>
>>55054524
With REAL value equality?
>>
>>55054522
YOU HAVE THE REFERENCES, YOU DON'T HAVE THE ACTUAL OBJECTS, YOU HAVE THE REFERENCES AND THOSE ARE WHAT YOU ARE COMPARING BY VALUE

FUCK OFF AND DIE IDIOT

FUCKING CSHARTS
>>
>>55054536
So how do I compare integers by value rather than references to integers?
>>
>>55054500
sounds neat as shit
>>
>>55054553
LITERALLY DIE IN A FIRE FUCKING CANCEROUS LE EPIC TROLE RETARD KEEP WASTING YOUR TIME ON THIS NECKBEARD AUTIST SHITHOLE
>>
>>55054536
>>55054559
fucking aspie, go take your medicine
>>
>>55054536
>>55054559

Java mental gymnastics
This is fucking gold
>>
>>55054588
stay delusional fucking jackass

== works the same in java for ints and references as in C/C++/C# for ints and pointers

i'm leaving for real fuck off and die stupid Cshart
>>
>>55054517
Thanks, that honestly made that far more clear to me, I'll probably take a bit of a break and reread most of the linked list parts to see if I can make more sense of it once I've had some coffee and relaxed some.

Is there any chance I could get a way to contact you if I've got a question in the future? The retardation and shit posting going on around us is usually what happens when I ask questions here.
>>
File: AHAHAHA.gif (491 KB, 500x220) Image search: [Google]
AHAHAHA.gif
491 KB, 500x220
>>55054612
If you ask a straightforward enough question you'll normally get a decent answer

>>55054601
>for real
>>
>>55054612

Just post your question in /dpt/. I'll get around to it, or someone else will.
>>
File: The C Programming Language.png (107 KB, 792x1023) Image search: [Google]
The C Programming Language.png
107 KB, 792x1023
Should be teaching myself C at the moment. But instead went on 4Chan to shitpost.
>>
>>55054676
Never answered my question about using a free monad to build expression trees
>>
>>55054687

I don't think anyone here knows what the fuck a monad is.
>>
>>55054705
Monads are burritos.
>>
>>55054705
It's an applicative functor with a join operation
>>
File: 1464664961135.jpg (153 KB, 392x637) Image search: [Google]
1464664961135.jpg
153 KB, 392x637
>>55049900
Can I just write fizzbuzz in c, compile it then write the resulting machine code to the MBR and expect it to run? Or are there more caveats to consider like the operation mode or something?
>>
>>55054705
>>55054742
Alternatively it can just be defined in terms of return & bind

return :: a -> M a
bind :: (a -> M b) -> M a -> M b
>>
>>55049900
I suck huge cock at programming so I'm still working on that python script that copies images from one folder to another.
>>
I made a programming language with enum-types, rank-1 polymorphism, and user-defined classes. OO+functional, sorta.
>>
>>55054679
Any tips for learning C?
I'm using this book and also Sams 24 hours
>>
>wake up
>half of the thread has been deleted
Nicely done.
>>
>>55054965
Just means the thread will last twice as long, right?

Or are deleted posts still counted towards autosage?
>>
>>55054926
https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628
Get it. Read it. Understand it.
>>
>>55054998
>used $10
>new $50
>>
>>55055004

Go to a fucking library then, or get a job and spend the cash on the book. You'll cherish it.
>>
>>55055011
My complaint is more the sheer difference in value.
You see the same thing with all sorts of informational books, and with scholarly articles.

Are online tutorials not good enough for C?
>>
I'm reading about pointers to functions, and I'm trying to understand the uhh, function declaration that the book is giving me.It says if I wanted to make a function that takes the pointer to a function as an argument that it would look like.
double integrate(double (*f)(double), double a, double b);

and i don't quite understand why the pointer to a function has double in parenthesis after double (*f)
>>
>>55055040
It's a callback function. The callback takes a double and provides a double in return. The double in parentheses is the incoming argument, the double before the *f is the output.
>>
>>55055040
That's the input

(returnType)(*function)(parametersToFunction)
>>
>>55055032

Tutorials suck. Read about the language instead, you'll take so much more away, where a tutorial won't get you anything but how to do that specific boring thing.

I'm just guessing here, but you probably want to learn, not just copy paste.
>>
>>55055065
>>55055068
Ah okay, thank you for clearing that up.
>>
>>55054998
That's the book I said I was using

>>55055004
I was able to get it for like 15 w/ shipping
>>
>>55054753
Go away Dutch.
>>
>>55054998
>>55055004
>>55055119

I just got the fuqin green one
https://www.amazon.com/gp/product/8120305965/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1
>>
>>55054965
yeah what the fuck, there were some legit posts in there
>>
File: Hale20070111.png (18 KB, 683x306) Image search: [Google]
Hale20070111.png
18 KB, 683x306
>>55054128
So is lunit good?

>pic still not related
>>
>>55054753
We have a PR to discuss, Dutch.
>>
File: The_pragmatic_programmer.jpg (22 KB, 378x475) Image search: [Google]
The_pragmatic_programmer.jpg
22 KB, 378x475
is it good?
>>
>>55051274
Interesting stuff anon.

In my theory course we played around with CFG's in Chomsky Normal Form, but as you pointed out this is easier because of certain guarantees.

Impressive!
>>
What's the best music to program to, and why is it literally anything done by qt boys?

https://www.youtube.com/watch?v=hXTAn4ELEwM
>>
>>55055430
2hu remixes. Shibayan, Alstroemeria, some songs from other circles.
>>
Should I learn C or C++? Some people say that there's no point to learning C anymore instead of just learning C++. Is that true?
>>
>It's a /g/ doesn't realize linked list inserts are O(1) episode
>>
>>55051274
Looks neat.

What language do you use?
>>
>>55055463
Bizzare. I have never implemented a linked list, but still get it.
>>
File: rajesh.jpg (49 KB, 522x740) Image search: [Google]
rajesh.jpg
49 KB, 522x740
>>55055463
Adding in front is O(1)

In the general case of insertion you have O(n), with rather big hidden constants due to you pooing all over the cache
>>
>>55055463
Sleep sort has O(1) time complexity to sort arbitrary data
>>
>>55055461
You will also learn C while learning C++ so not learning C is not really an option.
>>
>>55055463
?
This is such shitty bait, why even throw it?

>>55055415
Good timing anon, I literally just came back to the thread for the first time since yesterday.

I'm not sure if this is easier for CFGs in CNF, actually. The difficulty in the general algorithm is accounting for the possibility of left recursion (or right, but that doesn't matter). I don't think CNF guarantees no left recursion does it? For example:
A -> BC
A -> a
B -> AC
B -> b
C -> c
S -> A

Is in CNF (I think) and would still require the more general algorithm to not fall into an infinite loop when trying to reach the empty word (because it'd be replacing B with AC with BCC with ACCC ad infinitum).

Also, why did my replies to Ruby get erased? I was completely on-topic. Dumb mods.
>>
>>55054238
shit I feel forced to upgrade to win10
>>
>>55055527
It's O(n) as you have to start up n threads
>>
>>55055576
>making implementation assumptions
>>
>>55055640
>quicksort is O(1)
>having to compare things is an implementation assumption
>>
>>55055514
The search is O(n) but the insert remains O(1)

>>55055552
? What bait?
>>
>>55055398
yes
source I have read it
>>
>>55055662
So binary search trees have O(1) inserts without even having to worry about balancing them?
>>
>>55054753
Kind of, you need a little bit more code:

http://wiki.osdev.org/Bare_Bones
>>
>>55055651
Sleepsort relies on each item being delayed proportionally to its enumerated value

That means the maximum delay is proportional to the maximum value, which is O(1)
>>
>>55055675
isn't the point of binary search trees balance?
>>
>>55055482
I used Java. I wanted to do it in Ocaml (and might still get around to it), but doing it in a purely functional style would be a bit too annoying at this stage (which is the only reason I'd want to use it) and converting strings to lists, to sets, and back and forth, as well as printing everything would be more laborious in ocaml than it is in java.
>>
>>55055703
>All binary search trees are balanced

t. ramanujan
>>
>>55054705
Sounds like a hardware simulcrum for an and operation. So like, one of those byzantine squares you'd find on the motherboard.
>>
>>55055711
You should try Haskell
>>
>>55055754
Why use Haskell instead of Ocaml? They're both ml + some
>>
>>55055807
Haskell isn't an ML derivative
Haskell has type classes (giving it overloading), monad comprehensions, easier conversion between types, etc
>>
>>55055853
I don't know why, but Haskell doesn't really "speak" to me.
>>
>>55055888
Probably because it's a fucking programming language and not a human being
>>
>>55055888
>>55055853
he could use F# with FsControl/F#+ (typeclass-like features)
even has unsigned ints
>>
>>55055913
FsControl and F#+ are still shit anon
>>
>>55055948
still haven't told me what exact functionality is missing
>>
>>55056013
Language support
>>
how does lexers know not to interpret 1*1 as a single identifier symbol?
im trying to write one myself but im a simple code monkey and my original idea was to use simple regex patterns for matching keywords, literals etc
>>
>>55056058
* isn't a valid identifier character
>>
File: 1464776646043.png (126 KB, 280x280) Image search: [Google]
1464776646043.png
126 KB, 280x280
>>55056066
shit
>>
>>55056058
They're not a single symbol, they're a number literal, an operator, and another number literal which are tokenized into an expression.
>>
Hey guys, I wrote a /pol/ simulator. Rate my code?

#include <stdio.h>

int main(void) {
puts("cuck");
return 0;
}
>>
>>55056426
how is that a /pol/ simulator?
>>
File: 13yo simulator.png (19 KB, 926x280) Image search: [Google]
13yo simulator.png
19 KB, 926x280
>>55056426
0/10
>>
File: 1447921043042.jpg (7 KB, 180x210) Image search: [Google]
1447921043042.jpg
7 KB, 180x210
>>55056443
nice
>>
>>55056426
puts(((const char[]){
"whiteboi",
"can't stump the trump"
"crooked hillary"
"muh emails"
"#PRAY4ORLANDO"
"dindu nofin daily thread"
"#TEAMDEPP"
"MAGA"
"How i discovered milo and fallen in love with him"
"thanks obama"
"Would you date this non aryan-girl, /pol/ ?"
"are niggers stealing our women ?"
"Cameron is a pigs-fucker"
"/pol/ said it first"
"M A G A"
})[random()%15]);
>>
>>55056443
Perfect!
>>
how do i make a batch file open a program and then have that program work on every file in the directory with a given extension?

for example, I want to use this converter program to convert .bnk files to .wem files. it's functionality is
bnkextr filename.bnk


I thought
bnkextr.exe bnkextr *.bnk
would convert everything, but it actually does nothing at all, so how do I accomplish this? it doesn't really have to be a batch file either. I just need to know to know how to make the program loop for all the files.
>>
>>55056541
not portable
>>
>>55056602
lol wincucks
>>
>>55050444
>islamophobia
enjoy your botnet.
>>
>>55056610
Because he used random() instead of rand(), forgot his commas (making random()%15 incorrect) or are you one of those obnoxious C89 fags?
>>
>>55056909
>actually defending C99 and C11
How can you have the audacity?
Have you forgotten this is a programming thread?
>>
>>55056917
I seriously think you need to kill yourself.
C99 especially makes C much nicer to write, without fundamentally changing the language.

int main(void)
{
puts("test");
int a;

return 0;
}

>This is invalid C89 code
>>
>>55056947
>not wanting your C code to resemble the various asm it compiles to
>>
>>55056967
Sorry, but if statements are too useful.
>>
>>55056947
as it should be. why would you ever need to declare a variable after you already got into the "logic" of your program? idiot

>>55056909
i'm actually just concerned with the fact that he seems to think that string literals are actually const char[] literals
>>
>>55056990
>why would you ever need to declare a variable after you already got into the "logic" of your program?
const variables that are not known at the start of the function.
Wanting to declare variables closer to where they are used.

>i'm actually just concerned with the fact that he seems to think that string literals are actually const char[] literals
String literals are of type char[], and there is absolutely nothing wrong with him declaring them const. I bet you think string literals are char * or something. Idiot.
Thread replies: 255
Thread images: 35

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.