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


>like Glib but made by chinese

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

>not sure if maintained anymore

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

>macro mess

>> No.60259111

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

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

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

>> No.60259134

>Which C utility library to use?
Your own.

>> No.60259137

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

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

How do I program with WinAPI in C?

>> No.60259161

#include <windows.h>

>> No.60259162

#include <windows.h>
Read MSDN.

>> No.60259187

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

>> No.60259199

>If you want to do GUI use C#
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]

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

>> No.60259220

I don't have HolyC compiler.

>> No.60259221

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

>> No.60259223

what are some overall tips to OS programming in C?

>> No.60259224

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

>> No.60259225

Just download TempleOS and free yourself from CIA niggers

>> No.60259247

Is HolyC a subset or a superset of C?

>> No.60259259

Neither. It's its own language.

>> No.60259317

I'm not an autistic youtube vlogger

>> No.60259337

I'm CIA.

>> No.60259357

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

>> No.60259387

that fact that you don't understand the stl

>> No.60259391

Try it out.

>> No.60259403

fuck off

>> No.60259404

>stl without templates
What would be the point?

>> No.60259413

To avoid writing macros.

>> No.60259436

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


>> No.60259453

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

>> No.60259481

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

>> No.60259515

So LYAH is more idiomatic.

>> No.60259540


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


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

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

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]

#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

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

>> No.60260024

You mean he should have written a function?
>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.
This guy knows what he's talking about.

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

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]

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

>> No.60260214

no, you should give dlang the d

>> No.60260223

Why was the other thread deleted?

>> No.60260246

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

I'd rather use Rust than make a web app.
Guess it's a GUI then.
Interesting. According to your Venn diagram there is zero relationship between normies and the CLI.

>> No.60260430

You could try meta-programming.

>> No.60260438

>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

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

Schizophrenic actually.

>> No.60260569

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

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

>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

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]

I fucking _HATE_ VPX.

>> No.60260659


>> No.60260751

So autistic

>> No.60260762

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

>> No.60260775

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

>> No.60260802

Schizos are just autists with a different buzzword

>> No.60260839

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

>> No.60260842


Thank you, will check both of these.

>> No.60260891

>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

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

>> No.60260931

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

>> No.60260949

Sorry. You bore me now. Ignored.

>> No.60260962


>> No.60260964

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

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

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

>> No.60261132

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

>> No.60261147

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]


>> No.60261163

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

>> No.60261181

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]

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]

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

Clone the dependency into your project.

>> No.60261383

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

>> No.60261409

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

>> No.60261430

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

>> No.60261467

SDL is not the best to learn C.

>> No.60261475


>> No.60261490


>> No.60261503

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

>> No.60261518

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]

Do you read French?

>> No.60261543

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

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

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

>> No.60261595

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

>> No.60261644

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

>> No.60261665


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

Did you failed to find a good tutorial here?

>> No.60261717

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

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


>> No.60261891

Then you're not ready to move into SDL.

>> No.60261907

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

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

>> No.60261953

Got any examples?

>> No.60262040

how can i initialize these variables to work properly?
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

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;


return r;

>> No.60262065

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

>> No.60262073

recursive resource deallocation for error handling.
char *res1 = malloc(512);
if (res1 == NULL)

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

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

return 0;

return -1;

>> No.60262074


>> No.60262160

Dear anon, are you retarded?

>> No.60262182

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

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

>> No.60262240

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

>> No.60262251

how about you provide a better solution instead of insults?

>> No.60262256

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

>> No.60262260

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

He knows he can't.

Proof that female programmers > male programmers.

>> No.60262284

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

>> No.60262717

Exactly. This is good use of goto.
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]

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

This seems simple enough, what is your problem?

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

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

forward decs are just documentation.

>> No.60263113

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

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

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

int c = (a++) + b

Postfix has highest precedence.

>> No.60263319

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


>> No.60263335


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


>> No.60263377

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

>> No.60263399

#!/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:
elif move[0] == 1:
print (move[1], move[2])
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

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

If you need GDI+ there's the flat API.

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

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]

What's good modern crossplatform BASIC in 2017?

>> No.60263751


>> No.60263775


>> No.60263807

Reading comprehension: 0/10

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

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

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

>What does it take to become a graphics programmer?

>> No.60263949

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

>> No.60263958

Hmm... Is not that different
thank you

>> No.60263974

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

Why don't you use leaflet instead?

>> No.60264009

objects or objectList/objectArray variable name?

>> No.60264011

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

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

>> No.60264056

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

Nvm, solved it, garbage Swing.

>> No.60264424

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

>> No.60264593

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

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

>> No.60264634

>cell lab
What are you doing my man

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

Plan9 C is comfy.

>> No.60264722

What'sh the besht Lishp?

>> No.60264735

clojure desu

>> No.60264828


>> No.60264907

>I don't know much maths

Time to learn maths.

>> No.60264928

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

:= is objectively better. Fuck off, underage turd

>> No.60265033

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

>> No.60265122

x = x + 1

>some people unironically write shit like this

>> No.60265159

+= != :=

>> No.60265162

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

>> No.60265170

>thinking programming language syntax should follow mathematics

>> No.60265171

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):
return True
except ValueError:
return False


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

>> No.60265217 [DELETED] 

return is_it_int(num)

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

>> No.60265222

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

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

>> No.60265242

for what purpose

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


>> No.60265288

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

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

>> No.60265301

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]

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

>> No.60265327

GUI programming is more tedious than it should be.

>> No.60265333

GUIs were a mistake

>> No.60265341

does it support virtual spaces?

>> No.60265342

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

>> No.60265346

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

>> No.60265351

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

Create your own TUI library.

>> No.60265372

the above poster is huge faggot

>> No.60265388

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

>> No.60265415

Have you tried Rustty?

>> No.60265424

Ncurses-rs is better documented

>> No.60265503

Approximately 0%

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

Probably not. What's that?

>> No.60265518


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


>> No.60265539

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

why do these autists volunteer themselves to waste peoples time.

>> No.60265558

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

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


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

>> No.60265573

Install arch on a usb key. It works.

>> No.60265592


It's legible enough.

>> No.60265596

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

>> No.60265597

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

>> No.60265602

Linux Live USB

>> No.60265620


>> No.60265660

you can install linux on your usb stick

>> No.60265674

>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


>> No.60265696

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]

op(X) :- faggot(X).

Amazing language.

>> No.60265772

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

>> No.60265774

>:- .

>> No.60265781

>finished python beginner course on pluralsight

now lads where do I find baby tier exercises

>> No.60265790

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

>> No.60265796

You mean
faggot(X) :- op(X).

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

It's a Frenchman's approximation of ← for the old typewriters of the time.

>> No.60265808

Can I do SICP in CL?

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

pic rel

>> No.60265834

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

>> No.60265859

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

>> No.60265865


>> No.60265875


>> No.60265881

List<Integer> foo = Arrays.asList(5, 4, 3, 2, 1);

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

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


Is there any difference between these or is it all just sugar?

>> No.60265897


>> No.60265908

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

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

>> No.60265940


Makes sense.


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

Fuck off

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

be nice, here is another one

>> No.60265961


>> No.60265973

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]


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

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

Take your /b/ shit to /b/

>> No.60266028

lez try

>> No.60266042

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

>> No.60266059

welcome to /g/ retard

>> No.60266063

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

>He actually took the ebic programming rolle seriously

>> No.60266160


>> No.60266169


>> No.60266354

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]

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]

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]

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

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

>> No.60266563


>> No.60266564

Based Richie, shitting on his own language.

>> No.60266575


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

>> No.60266597

go shitpost elsewhere

>> No.60266606

go kill yourself, lazy webdev

>> No.60266607

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

>> No.60266618

by using C++

>> No.60266682

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

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

>> No.60266828

fefe pls

>> No.60266933

use sfml instead

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

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

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

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

>> No.60267233


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

>> No.60267248

>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

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

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


>> No.60267385

>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

read introduction to algorithms

>> No.60267395

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

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

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

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

>> No.60267619

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]

Ok anon, good luck (w).

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


>> No.60267965

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

>> No.60268010

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?


>> No.60268102

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]

That's called being a codemonkey.

>> No.60268156

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


>> No.60268198


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

Buy Charles petzolds book

>> No.60268229


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

>> No.60268235

hackerrank then leetcode, for hard mode go to projecteuler.

>> No.60268256


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]


>> No.60268298

top zozzle

>> No.60268307


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


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


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

What will they have you learn?

>> No.60268449

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

>> No.60268450

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

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

its not bait friendo. I havent learned either yet.

>> No.60268476

the basics are the same

>> No.60268486

Avoid both

>> No.60268488

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

>> No.60268493

what certs do i want to go for to get hired without a degree?

>> No.60268497


>Listening to /g/ ever

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

>> No.60268519

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

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

>> No.60268528

"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

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


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

>> No.60268558

why must unis jew me so bad

>> No.60268573

>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

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

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

>> No.60268621

This is your idea of an argument?

>> No.60268645

you didnt really raise much an argument by calling me retarded

>> No.60268659

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

Your high school.

>> No.60268689


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)


int foo = 4;

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)

IntContainer bar = new IntContainer();
bar.value = 4;

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

you're right, foolish me

>> No.60268707

Ruby sphere!

>> No.60268743

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

>> No.60268828

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

>> No.60268851

New thread:


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


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

but I am writing HolyC

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.