Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

/vt/ is now archived.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 37 KB, 419x424, 1489245875402.jpg [View same] [iqdb] [saucenao] [google] [report]
60259082 No.60259082 [Reply] [Original] [archived.moe] [rbt]

What are you working on, /g/?

Old thread: >>60254560

>> No.60259093

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

>> No.60259111

>>60259093
Again, you don't need a "utility library".

>> No.60259113
File: 143 KB, 500x400, 1491805704621.gif [View same] [iqdb] [saucenao] [google] [report]
60259113

What should I call an anime-like language?
Maybe "Calculus of cute constructions"? If so, what extension should it have?

>> No.60259134

>>60259093
>Which C utility library to use?
Your own.

>> No.60259137

>>60259111
fuck of with your trips already.
I'm not going to reimplement the simple wheel.
>>60259134
no

>> No.60259149
File: 396 KB, 506x510, 1437744688792_gY-8eXzneZY.png [View same] [iqdb] [saucenao] [google] [report]
60259149

How do I program with WinAPI in C?

>> No.60259161

>>60259149
#include <windows.h>

>> No.60259162

>>60259149
#include <windows.h>
Read MSDN.

>> No.60259187

>>60259149
If you want to do GUI use C#, and C++ for the functions that need speed.

>> No.60259199

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

>> No.60259214
File: 302 KB, 866x651, Capture.png [View same] [iqdb] [saucenao] [google] [report]
60259214

You have 10 seconds to explain why you aren't writing HolyC right now

>> No.60259220

>>60259214
I don't have HolyC compiler.

>> No.60259221

>>60259199
You want to do forms or 2D/3D?

>> No.60259223

what are some overall tips to OS programming in C?

>> No.60259224

>>60259214
I must've been living under a rock. Apparently Davis-sama is vlogging.

>> No.60259225

>>60259220
Just download TempleOS and free yourself from CIA niggers

>> No.60259247

Is HolyC a subset or a superset of C?

>> No.60259259

>>60259247
Neither. It's its own language.

>> No.60259317

>>60259214
I'm not an autistic youtube vlogger

>> No.60259337

>>60259214
I'm CIA.

>> No.60259357

What's stopping me from writing C wrapper to stl with extern "C"?

>> No.60259387

>>60259357
that fact that you don't understand the stl

>> No.60259391

>>60259357
Try it out.

>> No.60259403

>>60259111
fuck off

>> No.60259404

>>60259357
>stl without templates
What would be the point?

>> No.60259413

>>60259404
To avoid writing macros.

>> No.60259436

>>60259413
So you would rather manually create vector_int_push_back, vector_float_push_back, etc for every type you'll use?

>> No.60259446

r8 my kosher mastermind game made in C

pastebin.com/HxtpS40A

>> No.60259453

>>60259082
Still contemplating learning haskell. Anybody recommend a up to date book?

>> No.60259481

>>60259453
The wikibook is fine. Learn you a Haskell is a bit autistic.

>> No.60259515

>>60259481
So LYAH is more idiomatic.

>> No.60259540

>>60259446
eww

>> No.60259571
File: 53 KB, 312x312, 1487608084850.jpg [View same] [iqdb] [saucenao] [google] [report]
60259571

>>60259446

>> No.60259683
File: 281 KB, 772x595, texture_transform_question.png [View same] [iqdb] [saucenao] [google] [report]
60259683

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.

>> No.60259716

>>60259683
Since it's a circle, draw lines from the center to the radius, then scale down each line to the new radius

>> No.60259862
File: 449 KB, 927x540, 30dd2426ec1e0bd7e55ca01d98e1c8e9.png [View same] [iqdb] [saucenao] [google] [report]
60259862

>>60259446
#define IS(a,b) !strcmp(a,b)

Why. The compiler is smart, don't do this.

>> No.60260002

What is the relationship between normies and CLI these days? Should I still be making a GUI front end?

>> No.60260018

>>60260002
You should be making web front ends.
If it doesn't use at least 100mb memory while idling it's not good.

>> No.60260024

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

>> No.60260081
File: 8 KB, 661x476, 1492671367800.png [View same] [iqdb] [saucenao] [google] [report]
60260081

>>60260002
hi firend i made a venn diagram for you. hope it helps

>> No.60260198
File: 334 KB, 900x539, 1417806535276.png [View same] [iqdb] [saucenao] [google] [report]
60260198

>nyaa replacement is written in golang
Should I give Golang a go?

>> No.60260214

>>60260198
no, you should give dlang the d

>> No.60260223

>>60259082
Why was the other thread deleted?

>> No.60260246

>>60260198
Damn, Nikita got BTFO

>> No.60260335

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?

>> No.60260389

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

>> No.60260430

>>60260335
You could try meta-programming.

>> No.60260438

>>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
};

>> No.60260490

>>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++-

>> No.60260553

>>60259317
Schizophrenic actually.

>> No.60260569

>>60260198
Wow what an ass that fat bitch is. I agree sepples is trash but don't attack the poor delusional dude over it.

>> No.60260573

>>60260198
You could help out with Nyaa Pantsu.

>> No.60260575

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.

>> No.60260577

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

>> No.60260588

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

>> No.60260643
File: 2.79 MB, 1280x720, better starfield.webm [View same] [iqdb] [saucenao] [google] [report]
60260643

I fucking _HATE_ VPX.

>> No.60260659

>>60260575
TempleOS

>> No.60260751

>>60260553
So autistic

>> No.60260762

>>60260575
sel4, you could look at Redox. It's inspired heavily by seL4 too

>> No.60260775

>>60260751
No they're very different neuropsychiatric disorders.
Schizophrenia is a hell.

>> No.60260802

>>60260775
Schizos are just autists with a different buzzword

>> No.60260839

>>60260802
Any programmer should be able to sympathise with the horrific symptoms of schizophrenia. It's not joking matter. Why are you here?

>> No.60260842

>>60260588
>>60260577

Thank you, will check both of these.

>> No.60260891

>>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?

>> No.60260918

>>60260891
Who should or shouldn't be in my local mental hospital anon?

>> No.60260931

>>60260918
Because you said specifically that all programmers can relate to autism.

>> No.60260949

>>60260931
Sorry. You bore me now. Ignored.

>> No.60260962

s

>> No.60260964

@60260949
Don't forget your daily autism pills too

>> No.60261066

Reminder that there are no men on /dpt/, only women pretending to be men.

>> No.60261110

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

>> No.60261120

>>60261110
It's 2015+2, gender is extremely relevant.

>> No.60261132

>>60261110
>gender is irrelevant
Didn't expect anything else from this bigoted shithole

>> No.60261147

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

>> No.60261156
File: 98 KB, 179x214, 1487423592046.png [View same] [iqdb] [saucenao] [google] [report]
60261156

>>60260802
rekt

>> No.60261163

>>60261120
>>60261132
/dpt/ is for people who have transcended humanity and live in a world where only computer systems and their operations matter.

>> No.60261181

>>60261163
>humanity
Check your species privilege, what about all the furries here?

>> No.60261196

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.

>> No.60261257
File: 2.93 MB, 2448x3264, magician.jpg [View same] [iqdb] [saucenao] [google] [report]
60261257

>>60259082
uni homework :^)
working on a method that finds a solution for a randomly generated maze in java

>> No.60261300
File: 14 KB, 528x296, sub.png [View same] [iqdb] [saucenao] [google] [report]
60261300

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.

>> No.60261309

>>60261196
Clone the dependency into your project.

>> No.60261383

>>60261300
>having to rewrite all his class-heavy C++ code into C
Why? It's not mandatory.

>> No.60261409

>>60261300
>>60261383
I imagine he's not a big fan of C++.

>> No.60261430

>>60261383
Because I'm learning C, not C++.

>> No.60261467

>>60261430
SDL is not the best to learn C.

>> No.60261475

>>60259093
dietlibc

>> No.60261490

>>60259113
moe

>> No.60261503

Should I do SICP, or something aimed more towards statically typed functional programming?

>> No.60261518

>>60261430
Shouldn't you learn C first and then look at SDL?

>> No.60261534
File: 235 KB, 6944x1905, ocaml-logo-big.png [View same] [iqdb] [saucenao] [google] [report]
60261534

>>60261503
Do you read French?
https://caml.inria.fr/pub/distrib/books/llc.pdf

>> No.60261543

>>60261534
I do not read French.

Even so, I'd prefer Haskell or Idris to OCaml.

>> No.60261552

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

>> No.60261561

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

>> No.60261588

>>60261561
>You're so young.
What did you mean by this?

>> No.60261595

>>60259082
Using OpenCV with C++ to do random cool stuff, then being impressed with what I've created.

>> No.60261644

>>60261503
If you don't do SICP, you'll never know how comfy it feels to program in (((Scheme)))

>> No.60261665

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

>> No.60261681

>>60261665
Did you failed to find a good tutorial here?
https://wiki.libsdl.org/Tutorials

>> No.60261717

>>60261665
>C
Do you use goto?

>> No.60261852

feeling like a fucking magician at the moment holy shit
>inb4 wild bug appears and shatters my dreams

>> No.60261871

>>60261681
The Twinklebear ones are okay, but the rest are worse than the LazyFoo tutorials.

>>60261717
No

>> No.60261891

>>60261871
>No
Then you're not ready to move into SDL.

>> No.60261907

>>60261891
You're hilarious anon

>> No.60261908

How to solve Hanoi tower problem iteratively?
I know how to do it recursively.
Pls use python for the sake of simplification

>> No.60261922

>>60261907
>the perennial goto considered harmful misapprehension
Goto is an essential tool for writing readable and correct C code.

>> No.60261953

>>60261922
Got any examples?

>> No.60262040

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]
[code]intro to algorithms question 9.1-1[/code]

>> No.60262052

>>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;
}

>> No.60262065

>>60262052
Could be done just as easily and in a more modern/clean way by having cleanup be a function.

>> No.60262073

>>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;
}

>> No.60262074

>>60262065
Nope.

>> No.60262160

>>60262052
>>60262073
Dear anon, are you retarded?

>> No.60262182

>>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?

>> No.60262212

>>60262182
They're considered a bad idea by people who don't know when they are appropriate to use.

>> No.60262240

>>60262212
like senile, 80 year old fortran programmers who somehow found their way to 4chan

>> No.60262251

>>60262160
how about you provide a better solution instead of insults?

>> No.60262256

>>60262240
Were you taught C poorly by someone who misunderstood Dijkstra's famous paper?

>> No.60262260

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

>> No.60262268

>>60262251
He knows he can't.

Proof that female programmers > male programmers.

>> No.60262284

>>60262212
The only time I needed to use a goto is to break out of a nested loop

>> No.60262717

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

>> No.60262861
File: 42 KB, 800x676, FUCKSQL.png [View same] [iqdb] [saucenao] [google] [report]
60262861

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.

>> No.60262883

>>60262861
This seems simple enough, what is your problem?

>> No.60263073
File: 726 KB, 1280x720, 1494125942818.png [View same] [iqdb] [saucenao] [google] [report]
60263073

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.

>> No.60263099

>>60263073
forward decs are just documentation.

>> No.60263113

>>60263073
if you write them in header and then copy paste them to c file you don't need to write the declarations twice.

>> No.60263137

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

>> No.60263254

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

>> No.60263292

int a = 1;
int b = 2;
int c = a+++b;


What value is c?

>> No.60263316

>>60263292
int c = (a++) + b

Postfix has highest precedence.

>> No.60263319

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

>> No.60263333

>>60263292
3

>> No.60263335

>>60263292
a+++++b

What value is C?

>> No.60263347

I'm starting to learn C# using a Udemy course

Still just barely getting started, not much to report

>> No.60263374

>>60263292
4

>> No.60263377

I've got a question to anons who made custom 4chan clients
How do you deal with recaptcha to post?

>> No.60263399

>>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 ()

>> No.60263477

>>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?

>> No.60263543

>>60259149
If you need GDI+ there's the flat API.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms533969(v=vs.85).aspx

>> No.60263583

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?

>> No.60263662

>>60263583
Why don't you just use Android Studio pre-built google maps Activity?

>> No.60263711

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.

>> No.60263735
File: 40 KB, 512x186, 1453069689681.jpg [View same] [iqdb] [saucenao] [google] [report]
60263735

What's good modern crossplatform BASIC in 2017?

>> No.60263751

>>60263735
SBCL

>> No.60263775

>>60263711
https://www.youtube.com/watch?v=5R7jImV3et0

>> No.60263807

>>60263751
>lisp
>basic
Reading comprehension: 0/10

>> No.60263857
File: 13 KB, 324x324, wow.jpg [View same] [iqdb] [saucenao] [google] [report]
60263857

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

>> No.60263906
File: 44 KB, 480x465, 1491123337586.jpg [View same] [iqdb] [saucenao] [google] [report]
60263906

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.

>> No.60263922

>>60263906
>What does it take to become a graphics programmer?
Math.

>> No.60263949

>>60263906
The more I learn about vulkan, the more i hate it even though its much better than OGL.

>> No.60263958

>>60263399
Hmm... Is not that different
thank you

>> No.60263974

>>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?

>> No.60263985

>>60263974
>JS
Why don't you use leaflet instead?

>> No.60264009

objects or objectList/objectArray variable name?

>> No.60264011

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

>> No.60264040

>>60263985
>leaflet
Haven't heard of it before, but it looks cool. I'll check it out.

>> No.60264056

>>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?

>> No.60264158

>>60263477
Nvm, solved it, garbage Swing.

>> No.60264424

>>60259223
don't do it.
use C++ instead.

>> No.60264593

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

>> No.60264604

>>60261300
I learned SDL by just reading the docs. Tutorials tend to leave out information

>> No.60264634

>>60259683
>cell lab
What are you doing my man

>> No.60264659
File: 639 KB, 1910x2208, glenda.jpg [View same] [iqdb] [saucenao] [google] [report]
60264659

>>60259223
Plan9 C is comfy.

>> No.60264722

What'sh the besht Lishp?

>> No.60264735

>>60264722
clojure desu

>> No.60264828

>>60264659
>:=
eww

>> No.60264907

>>60263906
>I don't know much maths

Time to learn maths.

>> No.60264928

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

>> No.60265008

>>60264828
:= is objectively better. Fuck off, underage turd

>> No.60265033

>>60265008
>its older so its better
nah, := is redundant shit.

>> No.60265122

>>60265033
x = x + 1

>some people unironically write shit like this

>> No.60265159

>>60265122
+= != :=

>> No.60265162

>>60263335
(a++)++ + b
this won't compile
are you the guy that was posting this shit
j = ++j + j++;

>> No.60265170

>>60265122
>thinking programming language syntax should follow mathematics
retard

>> No.60265171

>>60265122
I do int in OCaml but I use succ function.
let x = succ x in ...

>> No.60265185

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

>> No.60265217 [DELETED] 

>>60265185
return is_it_int(num)

The function itself should have error handling, not everywhere you call it

>> No.60265222

>>60265171
>when she says that her giving you the succ was false, but succ always returns true

>> No.60265229
File: 31 KB, 886x749, Nyotepad Features.png [View same] [iqdb] [saucenao] [google] [report]
60265229

>What are you working on, /g/?
A text editor.

>> No.60265242

>>60265229
for what purpose

>> No.60265270
File: 49 KB, 331x331, pls.jpg [View same] [iqdb] [saucenao] [google] [report]
60265270

>>60259093

>> No.60265288

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

>> No.60265290

>>60265242
a text editor is a good learning project desu, not him though.

>> No.60265301

>>60265242
For education and the joy of using a tool you've written yourself.

>> No.60265302
File: 83 KB, 667x765, apple.jpg [View same] [iqdb] [saucenao] [google] [report]
60265302

>>60265229
>Blinking text cursor
How much CPU does it use in idle?

>> No.60265327

GUI programming is more tedious than it should be.

>> No.60265333

>>60265327
GUIs were a mistake

>> No.60265341

>>60265229
does it support virtual spaces?

>> No.60265342

>>60265333
No, it's OK for porn and image viewing/editing.

>> No.60265346

>>60265333
Not a mistake, but the approach to create them was misguided

>> No.60265351

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

>> No.60265358

>>60265327
Create your own TUI library.

>> No.60265372

the above poster is huge faggot

>> No.60265388

>>60265358
Actually I am looking at Rust's existing Ncurses forks.

>> No.60265415

>>60265388
Have you tried Rustty?

>> No.60265424

>>60265415
Ncurses-rs is better documented

>> No.60265503

>>60265302
Approximately 0%

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

>>60265341
Probably not. What's that?

>> No.60265518

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

>> No.60265538
File: 51 KB, 600x656, witness me.jpg [View same] [iqdb] [saucenao] [google] [report]
60265538

>>60265229
>winshit

>> No.60265539

>its a foreigner giving a talk in garbled, broken english

why do these autists volunteer themselves to waste peoples time.

>> No.60265558

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

>> No.60265559

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.

>> No.60265563

>>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?

>> No.60265568

>>60260577

>I really find the void * implementation to be cleaner, though.
Fast > Clean.

>> No.60265573

>>60265559
Install arch on a usb key. It works.

>> No.60265592

>>60265558

It's legible enough.

>> No.60265596

>>60265503
>What's that?
absolute cancer, never implement it

>> No.60265597

>>60265568
>Fast > Clean.
Fast & clean > Fast > clean

>> No.60265602

>>60265559
Linux Live USB

>> No.60265620

>>60265602
>persistent

>> No.60265660

>>60265559
you can install linux on your usb stick

>> No.60265674

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

>> No.60265675

>>60265660
>persistent

>> No.60265696

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

>> No.60265756
File: 1.34 MB, 540x304, tmp_14004-14932287541471876388220.gif [View same] [iqdb] [saucenao] [google] [report]
60265756

op(X) :- faggot(X).

Amazing language.

>> No.60265772

>>60265696
Nice, I think I'm gonna do that myself.

>> No.60265774

>>60265756
>:- .
eww

>> No.60265781

>finished python beginner course on pluralsight

now lads where do I find baby tier exercises

>> No.60265790

>>60260081
But I'm a CLI user and I have a gf.

>> No.60265796

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

>> No.60265808

>>60261644
Can I do SICP in CL?

>> No.60265809
File: 1.61 MB, 3840x2160, programming challenges4.png [View same] [iqdb] [saucenao] [google] [report]
60265809

>>60265781
pic rel

>> No.60265834

>>60265808
yes, you can do it pretty much in any dynamic language that supports closures.

>> No.60265859

>>60265834
You probably also need tail calls and call/cc but I think CL or some of its implementations have it.

>> No.60265865

>>60265809
ROLL

>> No.60265875

>>60265809
roll

>> No.60265881

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?

>> No.60265897

>>60265809
LLOR

>> No.60265908

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

>> No.60265912

>>60265881
Excuse me for asking, but is the first thing Delegate way of doing it?

>> No.60265940

>>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#?

>> No.60265945

>>60265809
Fuck off

>> No.60265951
File: 596 KB, 1450x1080, programming challenges.png [View same] [iqdb] [saucenao] [google] [report]
60265951

>>60265945
be nice, here is another one

>> No.60265961

>>60265951
>>>/b/

>> No.60265973

>>60265951
the one that has the brainfuck interpreter is okayish. this one isn't.
(roll anyway just in case)

>> No.60265977
File: 1.89 MB, 1223x4575, 1476043182344.png [View same] [iqdb] [saucenao] [google] [report]
60265977

>>60265951

>> No.60265979
File: 49 KB, 600x522, 1492793515637.jpg [View same] [iqdb] [saucenao] [google] [report]
60265979

>>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?

>> No.60265987

>>60265951
>>60265809
Take your /b/ shit to /b/

>> No.60266028

>>60265951
lez try

>> No.60266042

>>60265977
this reeks of someone who's never been to 4chan before

>> No.60266059

>>60265961
>>60265977
>>60265987
welcome to /g/ retard

>> No.60266063

>>60265809
>Bootloader
>Torrent client
Are you fucking serious? If you can't think of a clever problem, stop pretending to do so

>> No.60266086
File: 8 KB, 265x265, 1478035012650.jpg [View same] [iqdb] [saucenao] [google] [report]
60266086

>>60265987
>>60266042
>>60266059
>>60266063
>He actually took the ebic programming rolle seriously

>> No.60266160

>>60259093
c++

>> No.60266169

>>60265809
roll

>> No.60266354

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

>> No.60266375

gone through 231 pages of introduction to algorithms so far in the past couple weeks. feeling productive

>> No.60266382
File: 9 KB, 515x379, shit_ui.png [View same] [iqdb] [saucenao] [google] [report]
60266382

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.

>> No.60266390
File: 35 KB, 564x422, 1485847174360.jpg [View same] [iqdb] [saucenao] [google] [report]
60266390

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.

>> No.60266421
File: 33 KB, 545x536, 8289748dafa7b09122fc83911a2f6cde.png [View same] [iqdb] [saucenao] [google] [report]
60266421

>>60266382
here is an example of one of the tables in the little database i made

>> No.60266427

"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

>> No.60266511

>>60259093
>>>/wdg/ brainlet

>> No.60266520

>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

>> No.60266563

>>60266511
>>>/b/

>> No.60266564

>>60266427
Based Richie, shitting on his own language.

>> No.60266575

>>60266563
>>>/suicide/

no one uses non-standard libraries in C. it's obvious you're from javascript

>> No.60266597

>>60266575
>>>/b/
go shitpost elsewhere

>> No.60266606

>>60266597
>>>/suicide
go kill yourself, lazy webdev

>> No.60266607

>>60266575
So then how the hell do you make games in C?

>> No.60266618

>>60266607
by using C++

>> No.60266682

>>60263985
Wanted to thank you again anon, Leafet did the trick. A lot faster and smoother.

>> No.60266767

how many of you are working on final projects and seriously consdering slamming your head into a wall

>> No.60266800

>>60266767
Been there, done that, ended up even dumber than before. Don't do it.

>> No.60266828

>>60261475
fefe pls

>> No.60266933

>>60261300
use sfml instead

>> No.60266993
File: 20 KB, 373x332, 1492666053187.png [View same] [iqdb] [saucenao] [google] [report]
60266993

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/?

>> No.60267123

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

>> No.60267194

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.

>> No.60267206

>>60267194
what are the assignments? are they too hard or too eas y

>> No.60267233

>>60267194

>Then I get home
This is the issue for me. I work better when I'm not at home.

>> No.60267248

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

>> No.60267262

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

>> No.60267270

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

>> No.60267294

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.

>> No.60267329

>>60267294
practice

>> No.60267385

>>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?

>> No.60267392

>>60267294
read introduction to algorithms

>> No.60267395

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

>> No.60267407

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

>> No.60267438

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

>> No.60267507

>>60267407
>fun jobs pay bad. get a boring job that pays good
:( fucking end me pham

>> No.60267619

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

>> No.60267659
File: 383 KB, 1250x1425, 1488183809920.png [View same] [iqdb] [saucenao] [google] [report]
60267659

>>60266390
Ok anon, good luck (w).

>> No.60267708
File: 336 KB, 1250x1425, 1494196014797.png [View same] [iqdb] [saucenao] [google] [report]
60267708

>>60267659
optimized

>> No.60267965

>>60267407
>fun jobs pay bad
A friend of mine who interned at some game dev company was making 6k a month.

>> No.60268010

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

>> No.60268070

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.

>> No.60268102

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

>> No.60268122
File: 248 KB, 1000x1200, 1492618231265.png [View same] [iqdb] [saucenao] [google] [report]
60268122

>>60267294
That's called being a codemonkey.

>> No.60268156

>>60261257
Hint hint turn it into a graph you plebeian

>> No.60268172

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?

>> No.60268180

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

>> No.60268197

>>60268180
done*

>> No.60268198

>>60267619

t-thanks anon

>> No.60268224

With summer coming up, I made it a goal to learn how to program.

where should I start, /g/?

>> No.60268226

>>60259149
Buy Charles petzolds book

>> No.60268229

>>60268180

afaik x = b is similar to function(out x)

>> No.60268235

>>60268070
hackerrank then leetcode, for hard mode go to projecteuler.

>> No.60268256

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

>> No.60268283
File: 3.27 MB, 1140x1731, 1492926936341.png [View same] [iqdb] [saucenao] [google] [report]
60268283

>>60268224
Python

>> No.60268298

top zozzle

>> No.60268307

>>60268224
Shitkell

>> No.60268329
File: 786 KB, 1000x1300, anime.png [View same] [iqdb] [saucenao] [google] [report]
60268329

>>60268224
https://en.wikibooks.org/wiki/Haskell

>> No.60268429

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.

>> No.60268444

>>60268429

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

What will they have you learn?

>> No.60268449

>>60268429
>>60268444
Please let this be bait.
Don't learn Java or Python, they aren't just bad, they'll ruin your mind forever.

>> No.60268450

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

>> No.60268459

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

>> No.60268467

>>60268449
its not bait friendo. I havent learned either yet.

>> No.60268476

>>60268224
c++,java,c#
the basics are the same

>> No.60268486

>>60268467
Avoid both

>> No.60268488

>>60259082
at the moment, a dubs script, and after that some data mining work

>> No.60268493

>>60268476
what certs do i want to go for to get hired without a degree?
>>60268486
why?

>> No.60268497

>>60268450

>Listening to /g/ ever

Can't you check what the courses offered at that uni teach?

>> No.60268519

>>60268493
They're absolute garbage.
Don't learn Javascript either.

Start with something that's partly decent and partly useful like C#

>> No.60268528

>>60268497
"Be able to convert a given algorithm, whether psuedo-code, flowchart or natural language into MATLAB or Python code."

the fuck is matlab?

>> No.60268533

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

>> No.60268546

>>60268528

The kind of meme language which is only used in universities.

>> No.60268558

>>60268546
why must unis jew me so bad

>> No.60268573

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

>> No.60268576

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

>> No.60268598

>>60268573
i have the feeling you're the type of person to design web automation apps in c++ rofl

>> No.60268621

>>60268598
This is your idea of an argument?

>> No.60268645

>>60268621
you didnt really raise much an argument by calling me retarded

>> No.60268659

>>60268645
You made a claim that nearly everybody but you would think is absolutely daft.
An idea that WAS daft.

>> No.60268671

where can i talk about data analysis programming in R and Python?

>> No.60268680

>>60268671
Your high school.

>> No.60268689

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

>> No.60268700

>>60268659
you're right, foolish me

>> No.60268707

>>60265592
Ruby sphere!

>> No.60268743

>>60268700
You said that there aren't any bad programming languages.
Did you forget?

>> No.60268828

>>60268172
If you don't do any projects in the languages you don't know them

>> No.60268851

New thread:

>>60268718
>>60268718
>>60268718

>> No.60269637

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.

>> No.60270516

>>60265809
roll

>> No.60270529
File: 47 KB, 640x480, VirtualBox_TempleOS_07_05_2017_19_39_54.png [View same] [iqdb] [saucenao] [google] [report]
60270529

>>60259214
but I am writing HolyC

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action