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

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology

View post   

[ Toggle deleted replies ]
File: 105 KB, 473x496, prog.jpg [View same] [iqdb] [saucenao] [google] [report]
62349370 No.62349370 [Reply] [Original] [archived.moe] [rbt]

Old thread: >>2343140
What are you working on, /g/?

>> No.62349388

A Rust interpreter for Scheme

>> No.62349391

Old thread: >>62343140

>> No.62349396
File: 102 KB, 1920x1080, include.jpg [View same] [iqdb] [saucenao] [google] [report]

#include <blade.h>

>> No.62349409

Learning to make gui's with python

>> No.62349420

thanks for anime image

>> No.62349432

Why would such a thing be included?
Especially that deep?

>> No.62349476

Why didn't Richie try to solve the namespace problem? Fucking noob.

>> No.62349508


>> No.62349514

Dennis Richie when he designed C.

>> No.62349538

C doesn't care about scope, or types or anything else that might make programming easier.

>> No.62349579

Hey /g/ not a regular browser but I'd love insight from regulars here.

If I have a teenager that seems to like the idea of coding what resources are there to get him on the right track? Are there some languages that are "better" than others? In terms of ROI on learning them and so forth.

Thanks for any insight.

>> No.62349597

just get him to learn python or something, it's brainlet friendly and easy to hack together something that works

>> No.62349619

python is like basic in terms of dijkstra's criticism of the latter

>> No.62349626

>or types
So it's B?

>> No.62349661

>people want better C
Literally just C with better standard library, like define the fucking API for threading and add compiler flag for platforms that supports it. Now do
the same for utf8, directories and file paths, basic data structures.
Maybe smarter compiler like, recursive macros and maybe some kind of modules instead of headers.
Saner types without the _t ending so every faggot doesn't have to rename uint32_t to u32.
>Solutions proposed
Uglier syntax than ATS
Name mangling
nonstandard ABI
Anything but what people want from C

>> No.62349662

C has a type system, it's just shitty and weak

>> No.62349664
File: 342 KB, 714x738, 1421164417027.png [View same] [iqdb] [saucenao] [google] [report]

Employed Haskell programmer here

>> No.62349719
File: 21 KB, 516x690, perl.jpg [View same] [iqdb] [saucenao] [google] [report]

I could use some help guys.
I have some perl code that decides whether to show you the usage screen (--help) or to continue running but it throws an annoying warning:
>Use of uninitialized value $ARGV[0] in string eq
Looking at the code, is there a better way to be doing this?

sub task {
my $self = shift;

if($ARGV[0] eq 'fetch') {
else {


There has to be a smarter way to check if the user has typed
feed.pl fetch --resort blahblah

>> No.62349725

I'll have 2 number nine...

>> No.62349739

Vice video


Alos, how does one get in to AI field?

>> No.62349748

i made an irc like thingydoo

give it a go: ircs://2hu-ch.org/overchan

>> No.62349764

Assuming that you're using Linux, check out https://perldoc.perl.org/Getopt/Long.html

>> No.62349778
File: 733 KB, 850x1188, 655e7618dca57ad7346c86adb392724d.jpg [View same] [iqdb] [saucenao] [google] [report]

Employed Java programmer here

>> No.62349806

Take Andrew Ng's Machine Learning course on Coursera. If you want a good understanding of neural networks (which have become the center of modern machine learning), you should know how to differentiate functions of multiple variables and matrix-vector multiplication. It's not necessary to know these things before taking the course, but it helps.

>> No.62349890

>tfw employed C programmer
Living the dream tbqhwy

>> No.62349895

enjoy it while it lasts. programming will become easier and easier until you don't have a job, because a biologist, or a physicist, or whatever else, can program the same as you

>> No.62349915

Yes and yes, I have been using getopt for the options (--help and --resort) up until the point but the problem is fetch isn't an option it's a command and it takes no input, throwing it in with these optional flags seems like a step in the wrong direction:
'resort=s' => \$resort_value,
'help' => \$self->{'help'}

Or am I just very very confused? I'll go through the getopt man pages again though, thanks.

>> No.62349931

>spending their time writing code and debugging instead of directly working on their field

>> No.62349939

You think so?
I reckon there will be a place for software engineers for a while longer, plus being able to do shit yourself saves on labour costs if you want to start a business.

>> No.62349985

Mending cars is also easy, but nobody wants to do it themselves.

>> No.62350016

Python or Ruby is a good, JavaScript works too but you'd have to learn HTML and CSS

>> No.62350060
File: 31 KB, 308x442, 0abde8f4f969b118a52c66bf18cead3501f2872c9db572bef9d4f53a808b9dca.jpg [View same] [iqdb] [saucenao] [google] [report]

its been 2 years now and im still burnt out

i can no longer get my self to program, it was the only skill i had, programmed for over 10 years, but im so depressed due to it.

Sometimes i feel like doing a project, but then my body seems to shut down and i cant get myself to work on anything.

I always see the hurdles ahead , and the massive weight of having to go through thousands of lines of code, which makes me hesitant to work on anything. All I feel is pain and suffering when I think of code.

I feel regret and anguish when I think that i spent 10 years of my life on a skill that amounted to nothing. I've also can't stand the direction where IT is going. It used to be innovative and exciting, but now its all about survellience and politics. Im full of regret, i feel so much anger when i think that i might end up homeless even though i tried so hard. There isnt a place and there are no jobs for a depressed programmer like me.

so i try to not think about it, i convinced myself to get rid of this skill, i can't help but hate programming and i picked up buddhism instead. its really the only thing that brings me calmness to my mind, and I love to read buddhist texts and research its history. Im convinced programming and a lot of other activites we do is pointless in the long run. I hope this can be a lesson to someone, you sohulnd't try so hard to be something, All you have to do is keep doing whats close to you and what you are familiar with not being swayed by others. This life is really not as important as you think and should be lived pleasantly. I think I went too far trying to become a programmer,I wasn't meant to be one and I should stop trying so hard.

>> No.62350113

>>spending their time writing code and debugging instead of directly working on their field
>enter requirements into a box
>click some buttons
>code is automatically generated
>no code monkeys required

>> No.62350133

it's not though. it's time consuming and requires technical knowledge and resources. you can't honestly think that writing java apps will make you indispensable for decades to come. there may still be some programmers, but just as there's still some farmers

>> No.62350151

look man, sometimes its best not to think about the future too hard, bad for the soul.

>> No.62350154

What namespace problem?

>> No.62350172

true, we'll probably have a living stipend by then anyways

>> No.62350193

don't start this shit again

>> No.62350211

People are and have been doing multi million line codebases in C just fine.
So I ask again. What namespace problem?

>> No.62350214

How into multithread optimizing? I haven't touched it yet.

Don't compilers already automatically spread the load evenly?

>> No.62350239

Do you mean creating more execution contexts or optimizing an already existing multithreaded codebase?

>> No.62350273

Do you really think ditching programming entirely is the way to go? Instead of thinking black and white, you could try programming only during the weekends. Never overdo things.
About Buddhism, how do I start with it? I've seriously thought about picking it up. The main reason is to relieve some mental stress.

>> No.62350277

The one where if one faggot make library and prefixes his shit with stuff_ and other faggot makes library and uses same prefix as the first one and there's name collision and you need to use both libraries you are fucked.

>> No.62350284

>Don't compilers already automatically spread the load evenly?
No, the compiler has nothing to do with it. The operating system might do that at runtime.

>> No.62350296

Threads aren't necessarily system threads

>> No.62350313

This problem exists with any namespace solution that I can think of though, not just using prefixes but C++ or any other language's actual namespaces.

>> No.62350316

Literally never happens.
And how would namespaces even solve that problem?

>> No.62350334

I see, but wouldn't true optimizing mean you need to manually define which thread runs what part of the code?

>> No.62350343

>from foo import bar as baz
Python fixes this elegantly.

>> No.62350348

If something like that exists they themselves will become obsolete

>> No.62350379

So from which foo are you importing?
The problem was with two libraries named under a foo prefix/namespace.

>> No.62350394

Yes, you can set processor affinity via some system calls, like SetThreadAffinityMask() or pthread_setaffinity_np(). Many programs do this.

>> No.62350493

$ARGV[0] is the name of the program, not the first argument on the cmd line

>> No.62350511

Pls respond to my post >>62348826

>> No.62350575

Are you sure? print $ARGV[0]; outputs fetch when the user uses the fetch option.

>> No.62350724

I want to edit some rather large csv files (1000+ rows). What is the best way to do this on Linux? Don't really want to install a whole office suite for this.

>> No.62350901

i think you need to pass the @ARGV array onto the subroutine?

>> No.62350922

Write your own program. It's CSV so it cannot be that hard.

>> No.62351034

man perlvar

>Perl identifiers that begin with digits, control characters, or punctuation characters are exempt from the effects of the "package" declaration and are always
>forced to be in package "main"; they are also exempt from "strict 'vars'" errors. A few other names are also exempt in these ways:


>> No.62351204

i love this pasta

>> No.62351236

It depends, what kind of edit do you need to do?

>> No.62351237

How can anyone be autistic enough to actually enjoy coding? Fuck this shit is mindnumbingly boring.

>> No.62351241

>C system files.
>C++ system files.
>Other libraries' .h files.
>Your project's .h files.

what the actual fuck lads? why not:
>Your project's .h files.
>Other libraries' .h files.
>C++ system files.
>C system files.

>> No.62351256

it's not so much the coding itself as the results you get out of it

>> No.62351263

How do I know if free() was successful?

>> No.62351269

Use the Chromium guide

>> No.62351291

it always succeeds as long as you use it correctly

>> No.62351310

Should I keep learning rust or should I learn another programming language that isn’t rust?

>> No.62351318

have a coding challenge tomorrow in ruby on domain modeling. Probably only working with a has many through, 3 classes problem. Any tips to help me prepare? I don't want to get fucked

>> No.62351323

learn C++

>> No.62351329

I’m too brainlet sorry senpai ;;(((

>> No.62351330

This did the trick, still feels a bit off. If anyone has a better solution let me know, at least the warning is gone.

sub task {
my $self = shift;

if(length $ARGV[0]) {
if($ARGV[0] eq 'fetch') {
else {
else {


>> No.62351331

You think so? Try being a turner(used translate).

I'm certified to be one. When I did my internship I wanted to kill myself on the spot, I almost broke a fucking machine one time. Almost started it with key inside because I did same moving pattern over 200 times and my brain just melted. Programming is way more fun and challenging than some of the professions out there

>> No.62351335

underrated post

>> No.62351355

Keep learning Rust

>> No.62351363

Did you turn pages as a profession?

>> No.62351364

Ok I’ll have tons of fun meeting rainbow hair sjws :D

>> No.62351365

>I’m too brainlet
In that case you should most definitely mote to C++ from Rust

>> No.62351379

>meeting people
Get >>>/out/

>> No.62351385


>> No.62351399

But rust looks easier than c++, desu

>> No.62351415

Wait till you get to borrow checking and the traits part

>> No.62351421

do you say this without trying them both?

>> No.62351422

and I don’t have to use a bloated as fuck ide (visual studio) in order to code rust

>> No.62351424

If you have problem with C++, you can not survive Rust 1 month

>> No.62351436


>> No.62351437

n-no, what kind of a profession is that?

>> No.62351449

Why did you think that was necessary to mention?

>> No.62351452

Anyone here know a lot about SSL?

What is the main different between SSL and simply exchanging public keys, encrypting messages, sending them over TCP and decrypting with the private keys?

>> No.62351462

Enjoy formatting for 30 seconds each time

>> No.62351479 [DELETED] 

Trying to compile a .cpp program under macOS's cc:
>Undefined symbols for architecture x86_64:
>... [a bunch of referenced to std:: stuff]
>clang: error: linker command failed with exit code 1 (use -v to see invocation)
What does it mean?

>> No.62351483

haven't had any problems with the newer versions of eclipse being slow

>> No.62351484

what's wrong with traits?

>> No.62351514

>bunch of errors
anon...this doesn't help.
we can't help you sort errors if all you give us is 'it doesnt work', and what code are you trying to compile?

>> No.62351515
File: 40 KB, 500x377, C__Data_Users_DefApps_AppData_INTERNETEXPLORER_Temp_Saved Images_1497324536813.jpg [View same] [iqdb] [saucenao] [google] [report]

Got a job as a Python programmer.

Now what?

>> No.62351522

Or do you mean turner as in athlete?

>> No.62351525

Rust doesn't allow Higher Kinded Polymorphism as of now, you'd have to be pulling your hair any time you try to do anything remotely complex. On top of that there's BC and life time checker

>> No.62351529

include paths

>> No.62351537

>Internet explorer

>> No.62351577

>he doesn't have a Windows Phone as a dedicated shitposting device

>> No.62351591


>> No.62351608
File: 35 KB, 537x515, 1466901665251.png [View same] [iqdb] [saucenao] [google] [report]

>Windows Phone

>> No.62351611

My mum wants a gmail thing to auto reply when out of office, I barely edited this from a stack overflow post and it appears to work, but I'm not sure about the localization.

It appears to be using 0 for Sunday, which I assume will remain the same, but I'm not sure if the times will be in my timezone or not.

I assume google's smart enough to make it just work, but I'd like to make sure.

function autoReply() {
var interval = 5; // if the script runs every 5 minutes; change otherwise
var date = new Date();
var day = date.getDay();
var hour = date.getHours();
if ([6,0].indexOf(day) > -1 || (day == 1 && hour < 9) || (day == 5 && hour >= 17)) { // sunday == 0
var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
var threads = GmailApp.search('is:inbox after:' + timeFrom);
for (var i = 0; i < threads.length; i++) {
if (threads[i].isUnread()){
threads[i].reply("I am out of office. My working hours are 9-5, Monday-Friday. I'll get back to you as soon as possible.");

>> No.62351626

how do i make program that adds all number from start to finish with no numbers that include three?

>> No.62351630
File: 121 KB, 1200x926, erew.jpg [View same] [iqdb] [saucenao] [google] [report]

Operated these types of machine.

>> No.62351648
File: 639 KB, 649x611, C__Data_Users_DefApps_AppData_INTERNETEXPLORER_Temp_Saved Images_1500060630805.png [View same] [iqdb] [saucenao] [google] [report]

>anything else

>> No.62351665

First, write a function
bool includesThree(int n)

Then, write a function that adds a list of numbers

Then, combine these two functions

>> No.62351679

There's a bug in it. Here's the correct version:
function autoReply() {
var interval = 5; // if the script runs every 5 minutes; change otherwise
var date = new Date();
var day = date.getDay();
var hour = date.getHours();
if ([6,0].indexOf(day) > -1 || (day == 1 && hour < 9) || (day == 5 && hour >= 17)) { // sunday == 0
var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
var threads = GmailApp.search('is:inbox after:' + timeFrom);
for (var i = 0; i < threads.length; i++) {
if (threads[i].isUnread()){
threads[i].reply("Sucking dick for my baby boy so I can buy him Minecraft giftcards. Please try again later.");

>> No.62351681

Did ur mum turn the phone on for you?

>> No.62351688

haha epic dude
some people have a decent relationship with their parents and don't mind helping them out

>> No.62351695


>> No.62351730

My grandma, actually.
She's a wise woman.

>> No.62351735

What are some lucrative programming fields?

>> No.62351746

>helping your parents out
They created you therefore they should help you out, not the other way around.

>> No.62351747

Chingu, that's called steelworker.
But yeah, doing simple repetitive tasks drives you insane. That's why God invented dumb people to do the chores for us.
You're not making hydrogen bombs, are you? Just checking...

>> No.62351752

keep an array of 0-1-2-4-5-6-7-8-9 and use it to construct numbers (for example 8 * 100 + 1 * 10 + 2 * 1 = 812) and add them together

>> No.62351823

Assume the following C++ class:
class Foo
Foo Bar();
short *baz;

Shouldn't Bar() be allowed to perform the following?
Foo f();
f.baz[0] = 0;

g++ states that 'short int* Foo::baz' is private within this context.

>> No.62351829

now you can do it for fun


>> No.62351892

>Foo f();
This doesn't do what you think it does.

>> No.62351929

I was thinking the same too

>> No.62351952
File: 12 KB, 320x237, 19248024jpg.jpg [View same] [iqdb] [saucenao] [google] [report]

>Circular dependency
I'd personally kick you out of the office if I ever saw you

>> No.62352056

baz[0] = 0;

then call Bar from outside

>> No.62352066

>implying there's anything inherently wrong with circular dependencies

>> No.62352092

>implying there's anything inherently wrong with HIV

>> No.62352117

Fun fact: Go refuses to compile if it encounters a circular dependency.

>> No.62352121

I bet you get irrationally upset about recursion too

>> No.62352142

Fun fact: Go refuses to compile if it encounters an abstraction

>> No.62352154
File: 331 KB, 474x432, 1430853197680.png [View same] [iqdb] [saucenao] [google] [report]

>muh recursion

>> No.62352160

go is not programming language, though.
Rob Pike should leave and takes his results of masturbation with him.

>> No.62352200

>implying there's anything inherently wrong with circular dependencies
>unable to explain why
>muh HIV

>> No.62352214

Rob Pike is still stuck in the Bell Labs era.

>> No.62352222

shit, I replied to the wrong post. I meant that the guy with a complex about circular dependencies must also get upset about recursion, since it's basically the same thing

>> No.62352242

>circular dependencies
What's the difference?

>> No.62352292

Hi /g/entoomen,

Im trying to write a simple bruteforcing program in C.
Got the basics written out, but now i want to multithread.
Not much experience with pthreads though.
Anywho, does anyone know how to loop through an array bigger than the number of hyperthreads and distribute the bruteforcing/hashing?

pthread_t hash_threads[8]; // muh hyperthreading

for (i = 0; i < no_of_passwords; ++i) {
// distribute over limited no_of_pthreads?

>> TL;DR;
How to distribute more than 8 tasks over 8 pthreads?

>> No.62352303

>unable to explain why circular dependencies are inherently bad
>m-m-muh HIV
Guess how I know you're a code monkey who follows religiously every regurgitated piece of advice given by programming "gurus".

>> No.62352305

retard here: best resources for learning c++ for free?

>> No.62352313

You still haven't answered my question, kiddo

>> No.62352316

You can create more threads than your CPU supports...
Otherwise implement green threads, or use existing library for that.

>> No.62352318


>> No.62352322

just fuck around until you feel you know it all

>> No.62352329

Is merge sort a kind of difficult algorithm to write? Doing recursion usually fucks me up

>> No.62352362


>> No.62352378

Explain the difference between mindlessly trying to avoid circular dependencies and HIV, kiddo. Protip: you can't.

>> No.62352399

Are the passwords in an array like char *passwords[]? If so, divide the number of passwords by the number of threads you're creating to evenly distribute the workload.

You can pass whatever you want to the thread to make sure it knows what it should be working on. Just make sure to distribute the workload.

>> No.62352515

thanks for the help

>> No.62352522

Yea you are right, but if i were to create a thread per password i would have more than thousands of threads running, probably defeats the purpose of being faster.

Thank you, i will try to split up the array in batches and send it to the threads.

>> No.62352536

>want to use a library
>don't want to fuck around with linking
>just edit #include <something/library.h> to #include "library.c"
who /degenerate/ here?

>> No.62352544

I'm not the one who's not employed though

>> No.62352567

Cool. You should only have to pass each thread a pointer to its starting position in the passwords array, but the thread has to know when to stop working so you have to figure something out there.

>> No.62352571

>unable to justify his claims
>i-i bet y-you're unemployed
Typical /g/ brainletism.

>> No.62352595

I'm not here to babysit you kid

>> No.62352601

Aren't you supposed to make it event driven these days?

>> No.62352609

>t nodev

>> No.62352614

audible kek

>> No.62352626

Trying to write merge sort following the algorithms book. Never wrote much C before but have tried gdb to find the error without luck. Any help?
#include <stdio.h>

int merge(int A[], int p, int q, int r)
//determine the index we are slicing the array at
int first_slice_index = q - p + 1;
int second_slice_index = r-q;

//Make the subarrays
// Left
int L[first_slice_index+1];
for(int i = 0; i < first_slice_index + 1; i++)
L[i] = A[p+i-1];
// Right
int R[second_slice_index+1];
for(int i = 0; i < second_slice_index; i++)
R[i] = A[q+i];

//Put our sentinal values in the top of each subarray
L[first_slice_index + 1] = 100000;
R[second_slice_index + 1] = 100000;

int i = 1;
int j = 1;

for(int k = p; k <= r; k++)
if(L[i] <= R[j]){
A[k] = L[i];
A[k] = R[j];
return 0;

int merge_sort(int A[], int p, int r)
if(p < r)
int q = ((p+r)/2);
merge(A, p, q, r);
return 0;

int main(int argc, char *argv[])
int A[argc-1];
for(int i = 1; i < argc; i++)
A[i-1] = atoi(argv[i]);
printf("%d ", A[i-1]);

int len = sizeof(A)/sizeof(A[0]);
printf("%d", len);


for(int i = 0; i < len; i++)
printf("%d ", A[i]);

./merge_sort 1000 100 10 1
1000 100 10 1
40 0 0 1

from what I can see with gdb it doesn't even step into merge_sort()

>> No.62352636

Shoo, code monkey.

>> No.62352657

It shouldn't. Only leads to countless hours of frustration. I hate when people teach shit programming in schools these days

>> No.62352694

Ow? so i don't have to split the struct array? i can just send a few pointers to start from with a limit?

and just have to return when it finds a password or runs out of things to try ;)

>> No.62352719

literally no-one

>> No.62352755

Ow wait now i understand what you mean, i can just send the array pointer, a few starter indexes, and limits so the threads dont overlap.
Thats what you mean right?

>> No.62352767
File: 4 KB, 598x115, Capture.png [View same] [iqdb] [saucenao] [google] [report]

is this a typo /dpt/?

>> No.62352782

I have a question about data structures.
Say you have a list of values of a fixed size, uniformly distributed (think hashes)
If you want to store these as a list, the naive approach would take HASH_BITS/8*hashes bytes, for example 300 million 256 bit hashes would take 9gb.
But if you don't care about order, you can store them as offsets. Then you only need log((2^HASH_BITS)/(hashes))/log(2) bits per hash, for example in this case 227.84 bits for a total of 8gb.
Is there any data structure for storing these even more space efficiently if you're okay with discarding their order?

>> No.62352785

>In begin.In end

>> No.62352790

Yes, you should not have to mess with the array. You might want to pass something like this to each thread

struct Workload {
int start;
int stop;

With start being the index of the starting position, and stop is the index where the thread should terminate.

>> No.62352797

you should always use {} in while loops and all that

>> No.62352806

That's what I mean yeah

>> No.62352824

One of the book exercises says that I should make a function that takes a file as a parameter.
What's the point? Why wouldn't I just use file inside the function?

>> No.62352837

so you know what file to use??

>> No.62352847

>In begin.In end
>return begin

>> No.62352859

>Do you really think ditching programming entirely is the way to go?
I had to it was already killing me inside and i kept on trying to find ways to profit or get something out of it.

>About Buddhism, how do I start with it? I
I would suggest starting with Theravada Buddhism and the texts Suttanipata and Dhammapada, these are the closest to true buddhism that Siddartha himself taught and its easier for people in the 21st century to relate to because its all based on rational thinking.

Westerners tend to get exposed to Tibetan Buddhism a lot since they came as refugees, but Tibetan is a merging of late medieval esoteric buddhism and tibetan folklore so its far off from what the Buddha taught.

you can then move on to Mahayana buddhism which is refutation of rational buddhism, its a little closer to christianity. its your choice which sect best suits you though.

>> No.62353037

I got a job as a back-end java developer about 8 months ago. I had no programming experience before I started, so while I've learned a lot on this job I know there's a lot of things I still don't know. I've passed the java OCA exam so I've got the basics of the language down. I feel like I'm missing a lot of general programming/software design/computer science knowledge. My knowledge of internet protocols and layers is also lacking - I would have no idea where to start if trying to create a chatroom or set up an ftp server for example

Are there any books or resources anyone would recommend as 'must reads'? So far I have the Effective Java book on my list and that's it. I was maybe considering Computer Networking: A Top-Down Approach but it looks like a giant textbook and I'm not sure how useful it would be

>> No.62353082

Thank you so much, that i didn't think of this myself.

>> No.62353093

i pick this excerpt from advanced c++ primer. Is this syntactically correct

>> No.62353132

don't be a buddhist

>> No.62353171

No, it's supposed to be a comma.

>> No.62353174

ok thanks bro dont kno wot i'd do without you dude

>> No.62353186

>In begin.In end
What does it mean?

>> No.62353245


>> No.62353269

>ou should always use {} in while loops and all that

>> No.62353285

He's right. Fuck off.

>> No.62353297

he's wrong, though.

>> No.62353337
File: 3.78 MB, 422x418, 1483042407061.gif [View same] [iqdb] [saucenao] [google] [report]


>> No.62353339

I even wrap switch cases with brackets

>> No.62353354

Why are you posting that brainlet manchild?

>> No.62353364
File: 96 KB, 248x203, 1482178372365.gif [View same] [iqdb] [saucenao] [google] [report]


>> No.62353458


If the library used a prefix identical to the languages standard namespaces, or is not unique enough that it collides with an existing namespace then I wouldn't use it. Also this has happened a grand total of 0 times since computing has existed.

>> No.62353467

>making your code less readable
shiggy diggy

>> No.62353482
File: 586 KB, 4020x1449, dpt-programming-cheatsheet.jpg [View same] [iqdb] [saucenao] [google] [report]

Take the steps necessary to become a programming master today /dpt/!

>> No.62353485

t. somebody who has never programmer or used libraries

>> No.62353491

I don't get the second part

>> No.62353498

dumb frogposter

>> No.62353506

where do the green vegetables come into play?

>> No.62353512

Eating raw serrano peppers focuses the mind.

>> No.62353516

green is my pepper maybe

>> No.62353517

when is that ever a real issue? and it would happen in other languages too

>> No.62353523


t. someone who has never typed before

>> No.62353525

See >>62353512

>> No.62353527

I bet you'd write stuff like this too
if (things) {
} else {

instead of
if (sruff)

>> No.62353533
File: 55 KB, 600x389, 29u.jpg [View same] [iqdb] [saucenao] [google] [report]


>> No.62353540

>Not putting your else on a newline

>> No.62353541

t. someone who can't into build systems

>> No.62353544

>if (sruff)
woah we got a 1337 c0de master here

>> No.62353557

Yes. I actually prefer this to that edgy shit you got going on the bottom.

>> No.62353562

I bet you write shit like

because you think it's clever.

>> No.62353563

this: >>62353540

if(things) {
else {

>> No.62353591

Hackerrank or leetcode or interviewbit? Do you guys grind anything?

>> No.62353600

(if things (dostuff) (do-other-stuff))
Curlybrace cucks BTFO.

>> No.62353640

lisp is unreadable
how are you even supposed to tell what constructs do what when they all look identical

>> No.62353655

things (do-stuff) (do-other-stuff)

>> No.62353659

curlybrace is unreadable
how are you even supposed to tell what constructs do with all that visual noise

>> No.62353662

>lisp is unreadable

>> No.62353721

goto fail;

>> No.62353734

>//these are fine
//these are not

>> No.62353743

>visual clues

>> No.62353816

The top is the sane thing to do. If you're doing the bottom, don't use newlines at least.
if (cond) dostuff();
else dootherstuff();

That's okay, but with newlines you might think there's a brace and add a new statement and then get unexpected side effects instead of compiler warnings.

>> No.62353828

I love this joke

>> No.62353836 [DELETED] 

| things = doStuff
| otherwise = doOtherStuff

>> No.62353850

No, that's fucking horrible. Increment your variables before using them in the array, you're edging dangerously close to undefined behavior with the top 2.

>> No.62353876

>ask for embeddable scripting language recommendations
>get one that sounds promising
>check its github repo
>version 0.1
>last updated 5 months ago
Why can't programmers ever finish anything?

>> No.62353882

things ? doStuff() : doOtherStuff();
things && doStuff();

>> No.62353898

just use guile scheme

>> No.62353925

that's an extension language not a language designed for embedding, isn't it?

>> No.62353929

>//these are fine
You're fired

>> No.62353986

>useless noise is a visual cue

>> No.62354027
File: 62 KB, 750x819, guido.jpg [View same] [iqdb] [saucenao] [google] [report]

>using braces at all

>> No.62354052

python uses braces when calling functions and for tuples

>> No.62354098

Significant white space is a horrible horrible meme.

>> No.62354155

Being up front about significant whitespace is better than trying to hide it like Javascript or Go or something.

>> No.62354163

not really because go or js are not programming languages.

>> No.62354207

You can passively consume hundreds of articles and podcasts and learn far less than shipping one side project a year.

>> No.62354231

case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':

Is there a cleaner way to do this?

>> No.62354245
File: 9 KB, 211x246, fug.jpg [View same] [iqdb] [saucenao] [google] [report]

I need help vir/g/ins
I'm currently programming a game for school in C# that I have to send in 2 hours and I can't find a way to pass a string without reference or linkage to the string's variable.
I just want the text in my new string.

Do you guys have a solution for that ?
I can't find anything on stack overflow or I'm retarded

>> No.62354268

the fuck do you mean

>> No.62354269

tell us what language you're using when asking things like this please

>> No.62354276

C of course.

>> No.62354284
File: 204 KB, 900x973, 1494432716297.jpg [View same] [iqdb] [saucenao] [google] [report]

Shut up! I'm just writing the spec for the project in my mind before I commit to it

>> No.62354286

else if
else if
else if
else if
else if
else if
else if
else if

>> No.62354289

I mean that in my new temporary string variable I want to pass the letters of another string variable.

However I don't want to create a link between thos two variables

>> No.62354293

How do I copy an SQLite database in use? Can I just do cp database.db backup.db? Should I dump it and then put it into a new database? What's the recommended way?

>> No.62354294

see about doing it within interger ranges, and using those intergers as chars.

>> No.62354307

Not them but foo could be a shallow name e.g. a file. Bar is the component which has a conflicting name.

>> No.62354308

What are you trying to do?
'0' to '9' you can iterate over, if it helps.

>> No.62354327
File: 338 KB, 1140x813, programming socks.png [View same] [iqdb] [saucenao] [google] [report]

What color of programming socks is best for 64-bit ARM Assembly?

>> No.62354334

red for the raspberry pi ^_^

>> No.62354339

ones that match your color scheme in your text editor

>> No.62354373

Can someone help with this please the code is the same as the text book i'm learning from but it just hangs after i input a value i tried butting printf statements into the functions to see how far it gets but the weren't showing anything. the only thing which i had to change was the return in the absolutevalue function as it was supposed to be return x ;- but that was giving erros during compiling

//Fucntion to calculate the absolute value of a number
#include <stdio.h>

float absoluteValue(float x){
if (x < 0){
x = -x;
return x;

//fucntion to compute the square root

float squareRoot(float x){
const float epsilon = .00001;
float guess = 1.0;

while (absoluteValue(guess * guess - x) >= epsilon){
guess = (x / guess + guess) / 2.0;
return guess;

int main (void){
float x,sqr;
printf("Which number would the like the square root of: ");
scanf("%f ", &x);
printf("squareRoot (%f) = %f \n", x, squareRoot(x));

return 0;

>> No.62354377

Put the values in an array, memchr to find the index and use that to index an array of function pointers.

>> No.62354389


>> No.62354422

Can I do that in the case statement?
Check if a character matches [0-9\-] in C.
That's a horrible idea.

>> No.62354448

i don't think you'll need a case statement? only an if i think. i'm only learning myself, but if you take the character values on the ASCII table and see if your char matches that range, you'll have what you want?

>> No.62354472

What's the easiest way to make a simple GUI in Haskell?

>> No.62354481

did you even try?

>> No.62354550

Last time I tried, half of them didn't work with the latest GHC or had nonexistant documentation. I would like to hear opinions from people with some experience, hence asking here.

>> No.62354622

kys jetbrains shill

>> No.62354657

>That's a horrible idea.
Why do you think so?

>> No.62354665

I love it but documentation and Haskell don't go together. Not him btw

>> No.62354766

Write your own implementation just to be sure

>> No.62354769
File: 30 KB, 558x438, Capture.png [View same] [iqdb] [saucenao] [google] [report]


it's not even better than eclipse

at best it's a baby duck syndrome situation if you happen to prefer it

>> No.62354867


C# and intellij shills BTFO

>> No.62354884

If you're into FRP you can use wx widgets with reactive banana

Or you can use gtk bindings (possibly with glade). See https://github.com/Fuuzetsu/tsuntsun/blob/master/src/Main.hs for a simple example. See readme for how it looks.

>> No.62354907

Kurva anyádat ánon

>> No.62354921

C# is worse than Java because it stinks of sepples too

>> No.62354951

>subscription for desktop software that doesn't need a remote service
is there no end to this jewing?

>> No.62354988

Which utility library to use with C for general stuff:
klib, doesn't really cover enough
libmowgli, suggested by suckless, not sure how portable
something else...

>> No.62355016

None of them. This is C, not C++.

>> No.62355033

fuck off dumb sepples poster.

>> No.62355272

bool containsThree(int n)
if (n == 3) return true;

n = n < 0 ? -n : n;

while (n > 0)
if (n % 10 == 3) return true;
n = n / 10;

return false;

int addNumbersThatDontContainThree(const std::vector<int>& numbers)
int ret = 0;

for (size_t i = 0; i < numbers.size(); i++)
ret += !containsThree(numbers[i]) ? numbers[i] : 0;

return ret;

>> No.62355363

back to your webshit

>> No.62355451

On the bright side, this weeklong programming assignment only took about 5 hours.

On the dark side, this code is really, really fucking janky. It WORKS, but HELL if it's not a fucking mess.

>> No.62355479
File: 408 KB, 634x640, 1504556005069.png [View same] [iqdb] [saucenao] [google] [report]

What's bloat and what's not?

>> No.62355519

Have you felt an intense aversion to fuzzing the code inputs on the very high likelihood that your logic is actually shit and it will crash when your instructor grades it?

>> No.62355553

Can someone plox help

>> No.62355571

OOP is bloat
FP is not

>> No.62355594

source or didn't happen

>> No.62355688

I probably can't post the source until after the project is handed in on Thursday, unfortunately. If I remember then I'll post it. It DOES involve doing a binary search on a single item to check if two items are equal, though, which struck me as retarded but I was too lazy to code it any other way.

>> No.62355727

scanf("%f ", &x);

needs to be this
scanf("%f", &x);

>> No.62355838

Sugoi, thankyou senpai

>> No.62355902

What is the best way to learn to write good c code? It is hard to find the right resources as a beginner.

t. noob

>> No.62355910

I've got a decent ebook i can put it on mega if you'd like

>> No.62355914

write code then show us when you're done

>> No.62355949


switch (thing) {
case '-':

case '0'...'9':


>> No.62355955

yes please, or give name.
K&R is nice to learn all the elements of the language, but I feel like I'm not sure if my code is terrible or not, even after reading it

>> No.62356010

Programming in C 4th edition By Stephen Kochan


It's a book for complete beginners though so might not be for you

>> No.62356027

>6 GB/s garbage collectors

>> No.62356031

can someone here explain in full detail what exactly and how sql and python go tegother?

>> No.62356033


>> No.62356053

>paying for a glorified text editor
just git gud anon

>> No.62356071

yes, it collects the 6GB/s source code of OOP almost instantly

>> No.62356084

the same way any language + sql go together
you use your programming language to create the thing the user sees, the "program"
it may be a phone app, a website, a game, etc

you fetch and store all the data for the program in a database using sql

>> No.62356086

Seconding this, great book

>> No.62356110

I've been going through it and i've learnt more in 5 days than my 2 years from cs at college

>> No.62356198

don't exaggerate anon

>> No.62356210

This is uk college not university

>> No.62356212

I don't think you understand just how slow classroom education can be.
It has to move at the rate of the slowest student.

>> No.62356237

Everything is bloat

>> No.62356240

>It has to

>> No.62356245

there are several ways to do sql things from python
most basic is to just so system(psql [args)
second most basic is to use somethign that lets you send raw queries like mydatabase.query("SELECT ...")
most complex and most often used in industry is an orm that lets you do stuff like myobject.save(mydatabase)

>> No.62356257

Tuition $$$$

>> No.62356260

define "general stuff"

>> No.62356262
File: 1.57 MB, 880x624, college grade inflation.png [View same] [iqdb] [saucenao] [google] [report]

Because otherwise you would fail too many students and they'll drop out and they won't pay tutition anymore.

>> No.62356290

But everyone else paying tuition will be pissed off if the classes are uselessly slow, surely?

>> No.62356340

Yes, but everyone is used to it.
The stuff you learn in a 4-5 year program in order to earn a bachelor's degree can be boiled down to 1-2 years if you were a very motivated self-taught.
Not every course of study is easy to learn yourself (eg. medicine, chemistry), but computer science and mathematics require no special facilities and everyone has a goddamn computer now.

>> No.62356409

The following code
short Foo::operator[](const unsigned int index) const { return bar[index]; }
results in
error: no match for ‘operator[]’ (operand types are ‘const Foo’ and ‘int’)
when I try to compile a file where I use Foo f; short s = f[1];


>> No.62356429

directory handling. String encoding. Basic data structures. Threading and sockets.

>> No.62356448


>> No.62356470


>> No.62356476

without seeing the complete context for your code it is hard to say
pastebin it or something

>> No.62356522

a complete example on ideone.com would help

>> No.62356575

Nvm, I found the problem. I hadn't included Foo.h.

>> No.62356863

>tfw 2 dumb for ASM
help me lads, any online resources to using MiniIDE?

>> No.62356927

Disassemble C programs and compare the result to the original C

>> No.62356946

asm is a lot easier than a high level language
you only need to know a handful of instructions to do everything
knowing more just makes it possible to optimize or simplify the code

>> No.62356977

New thread:


>> No.62356987

problem is i dont even know where to start, and lots of link provided are dead.
lds #STACK
jsr initgb
ldd #welcome
jsr [printf, PCr]
newgm jsr playGame
bra newgm
init gb

look at this shit i dont even know the syntax (i have programmed DE112 board before)

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