[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 Language

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: 336
Thread images: 40

File: 1489245875402.jpg (37KB, 419x424px) Image search: [Google]
1489245875402.jpg
37KB, 419x424px
What are you working on, /g/?

Old thread: >>60254560
>>
Which C utility library to use?

Glib
>huge

tbox
>like Glib but made by chinese

qlibc
>doesn't support custom allocators
>no mention of other platform support(windows, ...)

cprops
>not sure if maintained anymore

foundation_lib
>seems like you have use it's own event loop functions

klib
>macro mess
>>
>>60259093
Again, you don't need a "utility library".
>>
File: 1491805704621.gif (143KB, 500x400px) Image search: [Google]
1491805704621.gif
143KB, 500x400px
What should I call an anime-like language?
Maybe "Calculus of cute constructions"? If so, what extension should it have?
>>
>>60259093
>Which C utility library to use?
Your own.
>>
>>60259111
fuck of with your trips already.
I'm not going to reimplement the simple wheel.
>>60259134
no
>>
File: 1437744688792_gY-8eXzneZY.png (396KB, 506x510px) Image search: [Google]
1437744688792_gY-8eXzneZY.png
396KB, 506x510px
How do I program with WinAPI in C?
>>
>>60259149
#include <windows.h>
>>
>>60259149
#include <windows.h>
Read MSDN.
>>
>>60259149
If you want to do GUI use C#, and C++ for the functions that need speed.
>>
>>60259187
>If you want to do GUI use C#
Why?
It's way easier to just use opengl/directx or any framework that utilizes those graphics API in C than it is to write OOP garbage.
>>
File: Capture.png (302KB, 866x651px) Image search: [Google]
Capture.png
302KB, 866x651px
You have 10 seconds to explain why you aren't writing HolyC right now
>>
>>60259214
I don't have HolyC compiler.
>>
>>60259199
You want to do forms or 2D/3D?
>>
what are some overall tips to OS programming in C?
>>
>>60259214
I must've been living under a rock. Apparently Davis-sama is vlogging.
>>
>>60259220
Just download TempleOS and free yourself from CIA niggers
>>
Is HolyC a subset or a superset of C?
>>
>>60259247
Neither. It's its own language.
>>
>>60259214
I'm not an autistic youtube vlogger
>>
>>60259214
I'm CIA.
>>
What's stopping me from writing C wrapper to stl with extern "C"?
>>
>>60259357
that fact that you don't understand the stl
>>
>>60259357
Try it out.
>>
>>60259111
fuck off
>>
>>60259357
>stl without templates
What would be the point?
>>
>>60259404
To avoid writing macros.
>>
>>60259413
So you would rather manually create vector_int_push_back, vector_float_push_back, etc for every type you'll use?
>>
r8 my kosher mastermind game made in C

pastebin.com/HxtpS40A
>>
>>60259082
Still contemplating learning haskell. Anybody recommend a up to date book?
>>
>>60259453
The wikibook is fine. Learn you a Haskell is a bit autistic.
>>
>>60259481
So LYAH is more idiomatic.
>>
>>60259446
eww
>>
File: 1487608084850.jpg (53KB, 312x312px) Image search: [Google]
1487608084850.jpg
53KB, 312x312px
>>60259446
>>
File: texture_transform_question.png (281KB, 772x595px) Image search: [Google]
texture_transform_question.png
281KB, 772x595px
Sup /dpt/?

How would you transform these textures? Possibly in OpenGL 1.5/2.1? Notice how the inner texture is not chopped down but correctly transformed to the final form of the cell shape. I guess its some form of geometry shader? The problem is I simply cant figure out the correct algorithm to produce this effect.

The picture is from the android game Cell Lab, its a very fun game if you want to try it.
>>
>>60259683
Since it's a circle, draw lines from the center to the radius, then scale down each line to the new radius
>>
>>60259446
#define IS(a,b) !strcmp(a,b)


Why. The compiler is smart, don't do this.
>>
What is the relationship between normies and CLI these days? Should I still be making a GUI front end?
>>
>>60260002
You should be making web front ends.
If it doesn't use at least 100mb memory while idling it's not good.
>>
>>60259862
You mean he should have written a function?
>>60260002
>GUI frontend
Not enough, has to be a service which you access through the browser. Preferably it's in the cloud but if it's a service accessible through the local network that's fine too.
Also don't make it accessible by IP and port. Give it a hostname.
>>60260018
This guy knows what he's talking about.
>>
File: 1492671367800.png (8KB, 661x476px) Image search: [Google]
1492671367800.png
8KB, 661x476px
>>60260002
hi firend i made a venn diagram for you. hope it helps
>>
File: 1417806535276.png (334KB, 900x539px) Image search: [Google]
1417806535276.png
334KB, 900x539px
>nyaa replacement is written in golang
Should I give Golang a go?
>>
>>60260198
no, you should give dlang the d
>>
>>60259082
Why was the other thread deleted?
>>
>>60260198
Damn, Nikita got BTFO
>>
Anyone knows a good way how to "implement" C++ type vector to C.
Im having problems with having multiple types for same structure, is void pointer only way to go?
>>
>>60260018
>>60260024
I'd rather use Rust than make a web app.
Guess it's a GUI then.
>>60260081
Interesting. According to your Venn diagram there is zero relationship between normies and the CLI.
>>
>>60260335
You could try meta-programming.
>>
>>60260335
>is void pointer only way to go?
Unless you're going to using macros to generate different versions of some structure, yes.
Using C99 feature (flexible array members), you can make it pretty efficient in terms of reducing allocations and increasing cache locality.
struct vec {
size_t cap;
size_t len;
unsigned char data[]; // sizeof(type) * cap
};
>>
>>60260438
I understand this, but still,
if I had an array of lets say type int,
how do I go around that.
If I want my vector to be "templated" like in c++-
>>
>>60259317
Schizophrenic actually.
>>
>>60260198
Wow what an ass that fat bitch is. I agree sepples is trash but don't attack the poor delusional dude over it.
>>
>>60260198
You could help out with Nyaa Pantsu.
>>
was considering making an OS as a hobby and learning project. What OSes should I study to gain inspiration from? I was thinking maybe seL4, Plan9, and QNX if I could find sufficiently detailed documentation about them.
>>
>>60260490
>If I want my vector to be "templated" like in c++-
You need some sort of generator macro then. I really find the void * implementation to be cleaner, though.
I used to have an example of an flexible array implementation, but I guess I deleted it, and I really can't be fucked writing it again (although it wouldn't take that long to do).
>>
>>60260335
https://github.com/nothings/stb/blob/master/stretchy_buffer.h
If you don't want to use it it has nice ideas you can borrow.
>>
File: better starfield.webm (3MB, 1280x720px) Image search: [Google]
better starfield.webm
3MB, 1280x720px
I fucking _HATE_ VPX.
>>
>>60260575
TempleOS
>>
>>60260553
So autistic
>>
>>60260575
sel4, you could look at Redox. It's inspired heavily by seL4 too
>>
>>60260751
No they're very different neuropsychiatric disorders.
Schizophrenia is a hell.
>>
>>60260775
Schizos are just autists with a different buzzword
>>
>>60260802
Any programmer should be able to sympathise with the horrific symptoms of schizophrenia. It's not joking matter. Why are you here?
>>
>>60260588
>>60260577

Thank you, will check both of these.
>>
>>60260839
>Any programmer should be able to sympathise with the horrific symptoms of schizophrenia.
No. Not every programmer is autistic, shouldn't be in your mental hospital right now?
>>
>>60260891
Who should or shouldn't be in my local mental hospital anon?
>>
>>60260918
Because you said specifically that all programmers can relate to autism.
>>
>>60260931
Sorry. You bore me now. Ignored.
>>
s
>>
@60260949
Don't forget your daily autism pills too
>>
Reminder that there are no men on /dpt/, only women pretending to be men.
>>
>>60261066
Actually no one knows anyone else's gender here and no one gives a single fuck, it's irrelevant. We may be mostly girls, but we don't actually pretend to be boys, we don't pretend to be any gender at all. Sorry if your conservative mind is confused.
>>
>>60261110
It's 2015+2, gender is extremely relevant.
>>
>>60261110
>gender is irrelevant
Didn't expect anything else from this bigoted shithole
>>
>>60261120
Well no, /dpt/ has a code of conduct and it prohibits plastering your irrelevant bullshit all over the place. Sorry tranny, back to >>>/lgbt/.
>>
File: 1487423592046.png (98KB, 179x214px) Image search: [Google]
1487423592046.png
98KB, 179x214px
>>60260802
rekt
>>
>>60261120
>>60261132
/dpt/ is for people who have transcended humanity and live in a world where only computer systems and their operations matter.
>>
>>60261163
>humanity
Check your species privilege, what about all the furries here?
>>
I'm working on a java project with gradle dependencies. I want to modify one of those dependencies. Should I just modify the code? Wouldn't my code get overwritten if I refresh the dependencies? I can't extend it because I want to modify an enum among other things.
>>
File: magician.jpg (3MB, 2448x3264px) Image search: [Google]
magician.jpg
3MB, 2448x3264px
>>60259082
uni homework :^)
working on a method that finds a solution for a randomly generated maze in java
>>
File: sub.png (14KB, 528x296px) Image search: [Google]
sub.png
14KB, 528x296px
Going through the Lazyfoo SDL tutorials, having to rewrite all his class-heavy C++ code into C as I go through them. Wish there was a better/faster way of learning it but SDL2 guides are surprisingly scarce.

Also discovered the Dracula colour scheme for sublime/other editors, which is good shit.
>>
>>60261196
Clone the dependency into your project.
>>
>>60261300
>having to rewrite all his class-heavy C++ code into C
Why? It's not mandatory.
>>
>>60261300
>>60261383
I imagine he's not a big fan of C++.
>>
>>60261383
Because I'm learning C, not C++.
>>
>>60261430
SDL is not the best to learn C.
>>
>>60259093
dietlibc
>>
>>60259113
moe
>>
Should I do SICP, or something aimed more towards statically typed functional programming?
>>
>>60261430
Shouldn't you learn C first and then look at SDL?
>>
File: ocaml-logo-big.png (235KB, 6944x1905px) Image search: [Google]
ocaml-logo-big.png
235KB, 6944x1905px
>>60261503
Do you read French?
https://caml.inria.fr/pub/distrib/books/llc.pdf
>>
>>60261534
I do not read French.

Even so, I'd prefer Haskell or Idris to OCaml.
>>
daily learning and implementing new stuff in android
want to get out of javascript, webdev meme asap
hope I will find junior android dev posution that was not taken by Rajeesh
>>
>>60261543
You're so young. I don't know Idris, but Haskell is fine. Just handle the lazy is fucking hardcore. They spent decades to prove the complexity of their sort algorithm.
>>
>>60261561
>You're so young.
What did you mean by this?
>>
>>60259082
Using OpenCV with C++ to do random cool stuff, then being impressed with what I've created.
>>
>>60261503
If you don't do SICP, you'll never know how comfy it feels to program in (((Scheme)))
>>
>>60261467
>>60261518

I'll rephrase: C is the language I've BEEN learning, and I feel I'm skilled enough in it to move into SDL. I'm not trying to learn C through making SDL programs or anything.
>>
>>60261665
Did you failed to find a good tutorial here?
https://wiki.libsdl.org/Tutorials
>>
>>60261665
>C
Do you use goto?
>>
feeling like a fucking magician at the moment holy shit
>inb4 wild bug appears and shatters my dreams
>>
>>60261681
The Twinklebear ones are okay, but the rest are worse than the LazyFoo tutorials.

>>60261717
No
>>
>>60261871
>No
Then you're not ready to move into SDL.
>>
>>60261891
You're hilarious anon
>>
How to solve Hanoi tower problem iteratively?
I know how to do it recursively.
Pls use python for the sake of simplification
>>
>>60261907
>the perennial goto considered harmful misapprehension
Goto is an essential tool for writing readable and correct C code.
>>
>>60261922
Got any examples?
>>
how can i initialize these variables to work properly?
second_smallest(A):
min, ss = A[0]
for i in range(len(A)):
if A[i] <= min:
ss = min
min = A[i]
elif A[i] < ss: ss = A[i]
intro to algorithms question 9.1-1
>>
>>60261953
Error handling and resource cleanup.

int some_fn(void)
{
int r = -1;

void *res1 = NULL;
void *res2 = NULL;
void *res3 = NULL;

if (some_prep_function()) goto cleanup;

if (!(res1 = grab_some_resource())) goto cleanup;

if (!(res2 = grab_some_other_resource(res1))) goto cleanup;

if (!(res3 = do_whatever(res2))) goto cleanup;

if (do_another_thing(res2, res3)) goto cleanup;

r = 0;

cleanup:
free(res1);
free(res2);
free(res3);

return r;
}
>>
>>60262052
Could be done just as easily and in a more modern/clean way by having cleanup be a function.
>>
>>60261953
recursive resource deallocation for error handling.
{
char *res1 = malloc(512);
if (res1 == NULL)
return;

char *res2 = malloc(222);
if (res2 == NULL)
goto err_res1;

char *res3 = malloc(2);
if (res3 == NULL)
goto err_res2;

return 0;

err_res2:
free(res2);
err_res1:
free(res1);
return -1;
}
>>
>>60262065
Nope.
>>
>>60262052
>>60262073
Dear anon, are you retarded?
>>
>>60262160
I'm still a relative novice at programming and C, but am I right in saying that gotos are generally considered a bad idea at this point?
>>
>>60262182
They're considered a bad idea by people who don't know when they are appropriate to use.
>>
>>60262212
like senile, 80 year old fortran programmers who somehow found their way to 4chan
>>
>>60262160
how about you provide a better solution instead of insults?
>>
>>60262240
Were you taught C poorly by someone who misunderstood Dijkstra's famous paper?
>>
>>60262182
They cause damage when they fall in the hands of codemonkeys, so they are heavily regulated. If can prove you are a responsible programmer, you are allowed use them though.
>>
>>60262251
He knows he can't.

Proof that female programmers > male programmers.
>>
>>60262212
The only time I needed to use a goto is to break out of a nested loop
>>
>>60262256
Exactly. This is good use of goto.
>>60262284
Sometimes code is clearer with goto.
A general rule is that gotos that move you up in the code are bad.
>>
File: FUCKSQL.png (42KB, 800x676px) Image search: [Google]
FUCKSQL.png
42KB, 800x676px
What the fuck is wrong with me, this shit should be simple. I've written these shitty joins dozens of times for MS SQL. Is the problem that I'm (forced) to use MySQL or that I'm being a fucking faggot?

Obfuscated schema pic related.
>>
>>60262861
This seems simple enough, what is your problem?
>>
File: 1494125942818.png (726KB, 1280x720px) Image search: [Google]
1494125942818.png
726KB, 1280x720px
What is the purpose of including the full forward function declaration in a header file?
You don't need the variable names, just the types.
>>
>>60263073
forward decs are just documentation.
>>
>>60263073
if you write them in header and then copy paste them to c file you don't need to write the declarations twice.
>>
>>60263113
You'd have to make every single function static to compilation unit it's included in.
Also this would bloat up your program immensely with duplicate code.
>>
>>60262883
I obfuscated it so much it isn't even the same problem I'm trying to solve. Will redraw if I don't ragequit.
>>
    int a = 1;
int b = 2;
int c = a+++b;


What value is c?
>>
>>60263292
int c = (a++) + b


Postfix has highest precedence.
>>
>>60263137
No, anon is saying that if you make the declaration by copying the first line in the definition and adding a semicolon, the parameter names are there and don't do any harm, so removing them would be an unnecessary extra step.

Also those parameter names are bits of documentation.
>>
>>60263292
3
>>
>>60263292
a+++++b

What value is C?
>>
I'm starting to learn C# using a Udemy course

Still just barely getting started, not much to report
>>
>>60263292
4
>>
I've got a question to anons who made custom 4chan clients
How do you deal with recaptcha to post?
>>
>>60261908
#!/usr/bin/env python

def solve (n):
stack = []
stack.append ((n, 'A', 'C', 'B'))
while len (stack) > 0:
move = stack.pop ()
if move[0] == 0:
pass
elif move[0] == 1:
print (move[1], move[2])
else:
stack.append ((move[0] - 1, move[3], move[2], move[1]))
stack.append ((1, move[1], move[2], move[3]))
stack.append ((move[0] - 1, move[1], move[3], move[2]))

def main ():
solve (4)

main ()
>>
>>60259082
How can i get the selected index from the user clicking an item in a JList.

Right now im Using ListSelectionEvent, but it doesn't work since i have both LastindexOf and FirstIndexOf.

Is there some other Listener i should use for a standard JList in Swing?
>>
>>60259149
If you need GDI+ there's the flat API.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms533969(v=vs.85).aspx
>>
Anyone with experience using Phonegap Build? I'm doing a Google Maps test app, very basic just the map in full screen and nothing else, and I'm opening the apk on my phone, and I just play a bit with the zoom and THE FUCKING MEMORY USAGE GOES THROUGH THE ROOF. An insane memory leak as a result of me zooming on the map! Eventually it gets near 1gb and the app force closes.

Any idea how to deal with this?
>>
>>60263583
Why don't you just use Android Studio pre-built google maps Activity?
>>
Code monkeys, please help an idiot.

I found some nifty code, https://github.com/petrroll/PowerSwitcher

Got Visual Studio, but since I'm currently taking my first babby steps in Java and or Python, I haven't got the slightest idea how to compile that source code into somehting usable.
>>
File: 1453069689681.jpg (40KB, 512x186px) Image search: [Google]
1453069689681.jpg
40KB, 512x186px
What's good modern crossplatform BASIC in 2017?
>>
>>60263735
SBCL
>>
>>60263711
https://www.youtube.com/watch?v=5R7jImV3et0
>>
>>60263751
>lisp
>basic
Reading comprehension: 0/10
>>
File: wow.jpg (13KB, 324x324px) Image search: [Google]
wow.jpg
13KB, 324x324px
>>60263775
>it took literally 10 years for microsoft to add git integration
>you still have to have a github account for it to work at all
>>
File: 1491123337586.jpg (44KB, 480x465px) Image search: [Google]
1491123337586.jpg
44KB, 480x465px
What does it take to become a graphics programmer?
I'm thinking of learning it for practice and maybe some assistant job. I don't know much maths however, and I only know very basic programming (currently studying in an IT teacher's program) but graphics looks interesting and fun to do.
>>
>>60263906
>What does it take to become a graphics programmer?
Math.
>>
>>60263906
The more I learn about vulkan, the more i hate it even though its much better than OGL.
>>
>>60263399
Hmm... Is not that different
thank you
>>
>>60263662
Well I'm already in the middle of writing a web app which integrates the JS API. All of my designs are CSS and DOM-based. The reason I wrote a small test app in addition to said app, is to help identify the cause of the leak, but it occurs even in a basic page.

I guess I can try the android API... How much will I have to change my code to integrate from a web app to an Android app?
>>
>>60263974
>JS
Why don't you use leaflet instead?
>>
objects or objectList/objectArray variable name?
>>
>>60259082
I've pretty much learned JS/Java, and I'm learning C++ right now.
What do you guys suggest practicing/making?
I haven't had any ideas to program anything.
Are there any problem solving websites you guys recommend?
I'm going to uni next semester for CompSci, but I would like to learn as much as I can before going.
>>
>>60263985
>leaflet
Haven't heard of it before, but it looks cool. I'll check it out.
>>
>>60263922
Well shoot. The course plan only includes 4 Maths classes and I'm not sure if I'll have the time to take complementary classes or self-teach myself; how difficult would you say it is?
>>
>>60263477
Nvm, solved it, garbage Swing.
>>
>>60259223
don't do it.
use C++ instead.
>>
>>60264011
Aim to learn the math first. Pick up your books and start learning now. The early programming courses will be very easy for you. The math might not be. Either way you would like to be able to be the cool guy who helps his classmates. Knowing the math is the best way to be that guy.

Having friends at university is important. One of the primary reasons people leave college (aside from failing) is that they feel lonely.

If you already know a language you won't really be challenged on the programming front in any way for the first year pretty much.
>>
>>60261300
I learned SDL by just reading the docs. Tutorials tend to leave out information
>>
>>60259683
>cell lab
What are you doing my man
>>
File: glenda.jpg (639KB, 1910x2208px) Image search: [Google]
glenda.jpg
639KB, 1910x2208px
>>60259223
Plan9 C is comfy.
>>
What'sh the besht Lishp?
>>
>>60264722
clojure desu
>>
>>60264659
>:=
eww
>>
>>60263906
>I don't know much maths

Time to learn maths.
>>
>>60264828
WTF you talking about? The closest thing to Plan9 that has a := is Go and it's fucking garbage I wholeheartedly agree. Hail C.

Also TempleOS is pretty low-level friendly.
>>
>>60264828
:= is objectively better. Fuck off, underage turd
>>
>>60265008
>its older so its better
nah, := is redundant shit.
>>
>>60265033
x = x + 1


>some people unironically write shit like this
>>
>>60265122
+= != :=
>>
>>60263335
(a++)++ + b

this won't compile
are you the guy that was posting this shit
j = ++j + j++; 
>>
>>60265122
>thinking programming language syntax should follow mathematics
retard
>>
>>60265122
I do int in OCaml but I use succ function.
let x = succ x in ...
>>
What is a better solution between these two? Language is python

def is_it_int(num):
try:
int(num)
return True
except ValueError:
return False


or:

def is_it_int(num):
try:
int(num)
except ValueError:
return False
else:
return True
>>
>>60265171
>when she says that her giving you the succ was false, but succ always returns true
>>
File: Nyotepad Features.png (31KB, 886x749px) Image search: [Google]
Nyotepad Features.png
31KB, 886x749px
>What are you working on, /g/?
A text editor.
>>
>>60265229
for what purpose
>>
File: pls.jpg (49KB, 331x331px) Image search: [Google]
pls.jpg
49KB, 331x331px
>>60259093
>>
>>60265185
Don't put more than is strictly needed inside the try block, even though it probably doesn't change anything here.

def is_it_int(num):
try:
int(num)
except ValueError:
return False
return True

saves you a line, we are at the end anyway.

Also what are you going to do right after calling this function besides int()ing num? Just put the try block there, it's one less function to read.
>>
>>60265242
a text editor is a good learning project desu, not him though.
>>
>>60265242
For education and the joy of using a tool you've written yourself.
>>
File: apple.jpg (83KB, 667x765px) Image search: [Google]
apple.jpg
83KB, 667x765px
>>60265229
>Blinking text cursor
How much CPU does it use in idle?
>>
GUI programming is more tedious than it should be.
>>
>>60265327
GUIs were a mistake
>>
>>60265229
does it support virtual spaces?
>>
>>60265333
No, it's OK for porn and image viewing/editing.
>>
>>60265333
Not a mistake, but the approach to create them was misguided
>>
>>60265288
thanks! I'm just learning python, and was writing a small function to check whether characters from an input file are ints. There is a stream of numbers in an input file, so this was a handy function.
>>
>>60265327
Create your own TUI library.
>>
the above poster is huge faggot
>>
>>60265358
Actually I am looking at Rust's existing Ncurses forks.
>>
>>60265388
Have you tried Rustty?
>>
>>60265415
Ncurses-rs is better documented
>>
>>60265302
Approximately 0%

But yeah, it keeps blinking and rerendering even when the window is not visible.

>>60265341
Probably not. What's that?
>>
>>60259093

>macro mess
C can't have generic data structures without using macros. Take it or leave it. Or use C++ and discover the wonders of the STL.
>>
File: witness me.jpg (51KB, 600x656px) Image search: [Google]
witness me.jpg
51KB, 600x656px
>>60265229
>winshit
>>
>its a foreigner giving a talk in garbled, broken english

why do these autists volunteer themselves to waste peoples time.
>>
>>60265518
Off course you will need macros but have you tried to read the klib source code? It's pretty unreadable macro mess compared to other candidates.
>>
Not directly programming related but how can I create a persistent flash drive so that I can boot from it in any machine? My uni computers run windows but I am not comfortable with it.
>>
>>60265539
What else do you do at an incredibly niche programmer conference?

Is there anything more lame and boring than going to a trade show for a specific programming language?
>>
>>60260577

>I really find the void * implementation to be cleaner, though.
Fast > Clean.
>>
>>60265559
Install arch on a usb key. It works.
>>
>>60265558

It's legible enough.
>>
>>60265503
>What's that?
absolute cancer, never implement it
>>
>>60265568
>Fast > Clean.
Fast & clean > Fast > clean
>>
>>60265559
Linux Live USB
>>
>>60265602
>persistent
>>
>>60265559
you can install linux on your usb stick
>>
>>60265503
>What's that?
where you can move the cursor around and start typing anywhere, as if the screen were filled with 'virtual' space characters. also makes block-select work as expected.
>>
>>60265660
>persistent
>>
>>60265675
It's persistent. Currently running ubuntu from work machine with usb stick becuase I was not allowed to install linux on it.
I don't mean live usb, I mean install the usb on the stick and boot from it.
>>
op(X) :- faggot(X).

Amazing language.
>>
>>60265696
Nice, I think I'm gonna do that myself.
>>
>>60265756
>:- .
eww
>>
>finished python beginner course on pluralsight

now lads where do I find baby tier exercises
>>
>>60260081
But I'm a CLI user and I have a gf.
>>
>>60265756
You mean
faggot(X) :- op(X).


It is not a requirement for faggots to have been an OP.

>>60265774
It's a Frenchman's approximation of ← for the old typewriters of the time.
>>
>>60261644
Can I do SICP in CL?
>>
File: programming challenges4.png (2MB, 3840x2160px) Image search: [Google]
programming challenges4.png
2MB, 3840x2160px
>>60265781
pic rel
>>
>>60265808
yes, you can do it pretty much in any dynamic language that supports closures.
>>
>>60265834
You probably also need tail calls and call/cc but I think CL or some of its implementations have it.
>>
>>60265809
ROLL
>>
>>60265809
roll
>>
List<Integer> foo = Arrays.asList(5, 4, 3, 2, 1);

foo.stream().forEach(new Consumer<Integer>() {
public void accept(Integer i)
{
System.out.print(i);
}
} );

foo.stream().forEach((Integer i) -> System.out.print(i));

foo.stream().forEach(System.out::print);


Is there any difference between these or is it all just sugar?
>>
>>60265809
LLOR
>>
>>60265881
Just sugar but there's some limitation on when you can use the lambda notation, the interface must only have one method or something like that.
>>
>>60265881
Excuse me for asking, but is the first thing Delegate way of doing it?
>>
>>60265908

Makes sense.

>>60265912

The first method constructs an instance of an anonymous class which implements Consumer<Integer>.
I don't know what a delegate is, isn't that C#?
>>
>>60265809
Fuck off
>>
File: programming challenges.png (596KB, 1450x1080px) Image search: [Google]
programming challenges.png
596KB, 1450x1080px
>>60265945
be nice, here is another one
>>
>>60265951
>>>/b/
>>
>>60265951
the one that has the brainfuck interpreter is okayish. this one isn't.
(roll anyway just in case)
>>
File: 1476043182344.png (2MB, 1223x4575px) Image search: [Google]
1476043182344.png
2MB, 1223x4575px
>>60265951
>>
File: 1492793515637.jpg (49KB, 600x522px) Image search: [Google]
1492793515637.jpg
49KB, 600x522px
>>60259082
Going to just push forward with some OpenGL properly soon as I'll be taking time off work and then doing a bit of webdev, probably Django to build up my portfolio nicely.

Any tips?
>>
>>60265951
>>60265809
Take your /b/ shit to /b/
>>
>>60265951
lez try
>>
>>60265977
this reeks of someone who's never been to 4chan before
>>
>>60265961
>>60265977
>>60265987
welcome to /g/ retard
>>
>>60265809
>Bootloader
>Torrent client
Are you fucking serious? If you can't think of a clever problem, stop pretending to do so
>>
File: 1478035012650.jpg (8KB, 265x265px) Image search: [Google]
1478035012650.jpg
8KB, 265x265px
>>60265987
>>60266042
>>60266059
>>60266063
>He actually took the ebic programming rolle seriously
>>
>>60259093
c++
>>
>>60265809
roll
>>
>>60260575
To add to this question if you where designing a new OS in current year would you bother with making it like POSIX? I mean, POSIX standards are full of pointers like char* void* and soforth that dont fit in with strongly typed or dependent typed languages. Buut those compilers emit code which has runtime dependencies that use POSIX standards.
>>
gone through 231 pages of introduction to algorithms so far in the past couple weeks. feeling productive
>>
File: shit_ui.png (9KB, 515x379px) Image search: [Google]
shit_ui.png
9KB, 515x379px
I'm trying to make a simple windows form program in visual studio and VB that when I click a button(CPU) it populates a list with the info from a "CPU Model" column in a listbox, then when you click a model I want it to take the corresponding info from the other columns in the row and throw it into labels.
I made the database with all the info and the UI. I made a class for each component(CPU, RAM, gpu, etc) and I'm trying to create instances of the corresponding class and populate it with the information from the DB.
Is this the best way to go about this or is my approach wrong? I'm stuck now after having made the classes.
>>
File: 1485847174360.jpg (35KB, 564x422px) Image search: [Google]
1485847174360.jpg
35KB, 564x422px
Hello, in the previous thread I was asking for help because I'm terrible at understanding programming logic, and I lack critical fundamental math skills. I went off on a depressed tangent about how much of a failure I am. Last night I went to bed sad, and had a dream in which a fictional character that I admire told me, "I don't care if you've never succeeded at anything before. You will succeed here."
It renewed my confidence in myself and now I'm going to start studying algebra basics so I can work my way up to more advanced math. I've never been good at math, but I always wanted to be a programmer, even as a young boy. Had I known how closely tied in mathematics are with programming, perhaps I would have focused more and been better.
I'm sorry for shitting up yesterdays thread, and I'm sorry for this long blog post shitting up this thread.
I just wanted to tell you all that even if I have to try 5 times as hard as other people, I'm going to do my best. So I hope you do your best too.
Have a nice day.
>>
>>60266382
here is an example of one of the tables in the little database i made
>>
"C provides the infinitely-abusable goto statement, and labels to branch to. Formally, the goto is never necessary, and in practice it is almost always easy to write code without it. We have not used goto in this book." - The C Programming Language
>>
>>60259093
>>>/wdg/ brainlet
>>
>on a deadline for uni
>work on my surface for a change
>the fucking windows 10 force restarts and installs a big system update that takes forever
WOW
JUST FUCK MY SHIT UP SENPAI
>>
>>60266511
>>>/b/
>>
>>60266427
Based Richie, shitting on his own language.
>>
>>60266563
>>>/suicide/

no one uses non-standard libraries in C. it's obvious you're from javascript
>>
>>60266575
>>>/b/
go shitpost elsewhere
>>
>>60266597
>>>/suicide
go kill yourself, lazy webdev
>>
>>60266575
So then how the hell do you make games in C?
>>
>>60266607
by using C++
>>
>>60263985
Wanted to thank you again anon, Leafet did the trick. A lot faster and smoother.
>>
how many of you are working on final projects and seriously consdering slamming your head into a wall
>>
>>60266767
Been there, done that, ended up even dumber than before. Don't do it.
>>
>>60261475
fefe pls
>>
>>60261300
use sfml instead
>>
File: 1492666053187.png (20KB, 373x332px) Image search: [Google]
1492666053187.png
20KB, 373x332px
What if I wrote a program in x86, that took assembled machine code, and turned it back into actual instructions that printed to the screen?
Would you be impressed, /dpt/?
>>
>>60266993
A disassembler? Not really impressed, no.

Although x86 instruction encoding is a mess so I'd know it took you a bit of effort.
>>
ATTN: People who are employed and happy in this field

Did you enjoy doing assignments?
I love the lectures, it engages me and I find it interesting. Then I get home, time to write something, and I lose all my motivation. I think I might be fooling myself into thinking i like programming.
>>
>>60267194
what are the assignments? are they too hard or too eas y
>>
>>60267194

>Then I get home
This is the issue for me. I work better when I'm not at home.
>>
>>60267123
>A disassembler? Not really impressed, no.
My school is having me write a dissasembler. I'm not sure what it's meant to demonstrate about my abilities/knowledge/coursework. It's just very tedious.
>>
>>60267206
They've been more on the easy side but there have been a few that have been challenging. They're generally just standard exercises but done in the language the class is on.
I'll even think about them while going through my day; "Oh wouldn't it be cool if I built it this way instead of that way" and etc but then open a project and just immediately want to do literally anything else.
>>
>>60267194
If you don't find yourself doing this shit in your spare time for fun, it might not be for you.
You can persevere if you want, but you will end up hating any programmer job you end up getting.
>>
How do I get better at programming? I can learn the syntax of a language fairly quickly but I'm not good at actual programming and algorithms, nor can I ever think of anything to program.
>>
>>60267294
practice
>>
>>60267270
>If you don't find yourself doing this shit in your spare time for fun, it might not be for you.
but I don't do anything in my spare time for fun outside of playing video games and watching anime.
What am I supposed to do for a career?
>>
>>60267294
read introduction to algorithms
>>
>>60266993
Don't do things to impress others. It is a waste of effort.
Do things because you want to do because it interest you.
>>
>>60267385
become a professional anime-inspired video game developer

just kidding, don't do that. fun jobs pay bad. get a boring job that pays good
>>
>>60261300
To be honest that's probably a better learning experience though.
Since you now can't copy-paste code, you have to understand and rewrite it using different library calls etc.
>>
>>60267407
>fun jobs pay bad. get a boring job that pays good
:( fucking end me pham
>>
>>60267294
Start with something you know and implement that.
There is not that many different algorithm archetypes, so learn the basics, implement some variation of them and solving problems gets easier and easier.

Can you find the optimal path in a graph?
Can you solve an equation?
Can you solve problems using data structures?
Can you can you solve problems using a probabilistic method?
Do you know the basics of the physics of the field you work in?

If you can't, then start with one of these.
>>
File: 1488183809920.png (383KB, 1250x1425px) Image search: [Google]
1488183809920.png
383KB, 1250x1425px
>>60266390
Ok anon, good luck (w).
>>
File: 1494196014797.png (336KB, 1250x1425px) Image search: [Google]
1494196014797.png
336KB, 1250x1425px
>>60267659
optimized
>>
>>60267407
>fun jobs pay bad
A friend of mine who interned at some game dev company was making 6k a month.
>>
>>60267965
game dev is the epitome of non-fun
do not work game dev for a large company, they will literally ruin games for you
>>
hi, guys, n00b coder here.

I could never bring myself to learn to code, I mostly found it a question of "will I need that". After I found codingbat.com, my learning jumped up a lot. It's fun to ponder questions!

My question to you is this: Is there a similar website for C or languages other than Python and Java?

Thanks.
>>
>>60266390
Good luck, buddeh.

I had a lot of trouble with maths at grammar school and now I kind of regret not focusing more on it. I'm a translator now, but I want to have a net as a programmer/sysadmin.

Not sure what you need maths for, except for Booleans and the whole larger than or equal to spiel, but hey. Tackle problems as you encounter them.
>>
File: 1492618231265.png (248KB, 1000x1200px) Image search: [Google]
1492618231265.png
248KB, 1000x1200px
>>60267294
That's called being a codemonkey.
>>
>>60261257
Hint hint turn it into a graph you plebeian
>>
i know java, nodejs, express, c++, c#, i know how to use the terminal, i know Qt and git, python

but i never actually do anything 'worthy' i learn a language, then jump to another, is this a normal phase in the learning curve?
>>
ive dont java and c# and still dont understand pass by reference and value
also dont understand ref and out keywords on c#
someone give me an easy example pls
>>
>>60268180
done*
>>
>>60267619

t-thanks anon
>>
With summer coming up, I made it a goal to learn how to program.

where should I start, /g/?
>>
>>60259149
Buy Charles petzolds book
>>
>>60268180

afaik x = b is similar to function(out x)
>>
>>60268070
hackerrank then leetcode, for hard mode go to projecteuler.
>>
>>60268180

It gets confusing in these languages because of reference types, which are completely distinct from pass-by-reference.

Java does not have pass by reference. C# does if you use the ref keyword.
>>
File: 1492926936341.png (3MB, 1140x1731px) Image search: [Google]
1492926936341.png
3MB, 1140x1731px
>>60268224
Python
>>
top zozzle
>>
>>60268224
Shitkell
>>
File: anime.png (786KB, 1000x1300px) Image search: [Google]
anime.png
786KB, 1000x1300px
>>60268224
https://en.wikibooks.org/wiki/Haskell
>>
This is the summer before I enter a top tier Uni for comp sci. I have very little experience coding.

Python seems cool, i doubt my uni would touch it with a 10 foot pole.

Same with java.

After I get my hands wet with python and java, where should I go? Its time for cram summer.
>>
>>60268429

Python and Java are the two things I've learned in my first year at Uni.

What will they have you learn?
>>
>>60268429
>>60268444
Please let this be bait.
Don't learn Java or Python, they aren't just bad, they'll ruin your mind forever.
>>
>>60268444
then i guess im entirely wrong. For some reason I was under the impression that python was a meme language, only good for starting off. And that java is convoluted and messy as shit.
>>
>>60268256
ah thats why it was easier in java i guess
so are reference types basically objects like arrays?
and can simple types be passed by reference and reference types by value?
that would make it like a 2x2 table of things that could happen
>>
>>60268449
its not bait friendo. I havent learned either yet.
>>
>>60268224
c++,java,c#
the basics are the same
>>
>>60268467
Avoid both
>>
>>60259082
at the moment, a dubs script, and after that some data mining work
>>
>>60268476
what certs do i want to go for to get hired without a degree?
>>60268486
why?
>>
>>60268450

>Listening to /g/ ever

Can't you check what the courses offered at that uni teach?
>>
>>60268493
They're absolute garbage.
Don't learn Javascript either.

Start with something that's partly decent and partly useful like C#
>>
>>60268497
"Be able to convert a given algorithm, whether psuedo-code, flowchart or natural language into MATLAB or Python code."

the fuck is matlab?
>>
>>60268519
i can tell you are either baiting or have very little experience with computer science, because no language is bad. you do the language for the job.
>>
>>60268528

The kind of meme language which is only used in universities.
>>
>>60268546
why must unis jew me so bad
>>
>>60268533
>i can tell you are either baiting or have very little experience with computer science, because no language is bad. you do the language for the job.
You're a fucking retard if you think that.
>>
>>60267294
You don't learn algorithms when you read about the language's syntax. You don't make solutions when you read about algorithms. There is no solution to be produced when there are no problems.
Every business wants to raise their profits, that can happen by cutting costs, expanding the business and saving time.
Businesses are fed by demand from the consumers, other businesses or a conglomerate of businesses. In an ideal world, the business operates through logic to save time, raise profits and cut costs (truth be said, they are just as logical as a person because the person feeds them through consumption) and technology saves their time and cut costs, raises profits sometimes.
The person wants pleasure, comfort, entertainment and reduce repetitive tasks. For the person, technology can be used to save their time by letting technology do repetitive tasks. Now I ask, what does the language has to offer for you? What would you like to not worry about anymore and which of them are achievable through programming?
All this armchair philosophy should guide you on what to do.
>>
>>60268573
i have the feeling you're the type of person to design web automation apps in c++ rofl
>>
>>60268598
This is your idea of an argument?
>>
>>60268621
you didnt really raise much an argument by calling me retarded
>>
>>60268645
You made a claim that nearly everybody but you would think is absolutely daft.
An idea that WAS daft.
>>
where can i talk about data analysis programming in R and Python?
>>
>>60268671
Your high school.
>>
>>60268459

All objects in Java (typically beginning with uppercase letters) are reference types. These all hold a reference to an
Only the basic primitives boolean, byte, char, short, int, long, float, double are value types. They hold the value itself.

Suppose we have the following code.
public plusOne(int x)
{
x++;
}

...

int foo = 4;
plusOne(foo);
System.out.println(foo);

A copy of the value of foo is given to plusOne. The copy named x is incremented, not the original foo. 4 is printed.

now, consider this code.
public class IntContainer
{
public int value;
}

public plusOne(Bar x)
{
x.value++;
}

IntContainer bar = new IntContainer();
bar.value = 4;
plusOne(foo);
System.out.println(foo);

The constructor of IntContainer is run, and a reference to the IntContainer object is returned and saved as bar.
A copy of the value of bar is passed to plusOne. plusOne obtains a reference to the same object as the one referred to by bar.
This shared object's value is incremented, and 5 is printed.


C# complicates this a lot more. You can have reference types (classes), value types (structs), regular passing and pass-by-ref (both with ref and the related out). You don't want to go questioning that until you're certain you understand how Java handles it.
>>
>>60268659
you're right, foolish me
>>
>>60265592
Ruby sphere!
>>
>>60268700
You said that there aren't any bad programming languages.
Did you forget?
>>
>>60268172
If you don't do any projects in the languages you don't know them
>>
New thread:

>>60268718
>>60268718
>>60268718
>>
How can I tell a maximum or minimum number of nodes in a b+ tree? I know how to calculate the height of the tree based on number of elements but this one is eluding me.
>>
>>60265809
roll
>>
>>60259214
but I am writing HolyC
Thread posts: 336
Thread images: 40


[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.