/dpt/ - Daily Programming Thread

Previous thread: What are you working on, Cred Forums?

Other urls found in this thread:

docs.oracle.com/javase/tutorial/
mailtrack.io/en/
hastebin.com/ruvojuvuro.cpp
lazyfoo.net/tutorials/SDL/51_SDL_and_modern_opengl/index.php
learnopengl.com/
fengyuan.com/article/wmprint.html
msdn.microsoft.com/en-us/library/z50k9bft(v=vs.110).aspx
blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/
pastebin.com/63rYiScz
rbt.asia/g/?task=search&ghost=yes&search_text=zed shaw tell
hentenaar.com/dont-learn-c-the-wrong-way
zedshaw.com/2015/09/28/taking-down-tim-hentenaar/
en.wiktionary.org/wiki/invidia#Latin
youtube.com/watch?v=t4etEwG2_LY
includeos.org/
fuckwikipedia.org
twitter.com/SFWRedditGifs

What is the best tool for generating c wrapper to c++ library?

Step 1: Rewrite your library in C
Step 2: Oh happy day

Is ocaml shit?

I started taking a programming class here because all I've ever used to make anything is game maker

5 weeks in and we haven't reached if statements
I thought I was the retard

C++ is what happens when you have too many cooks.

first for C. Going through C Primer by Stephen Prata. So far, I really like. Read the first chapter last night, and I'm gonna read another 1 or 2 today.

How about bottom right user?

loool just self-learn programming

docs.oracle.com/javase/tutorial/

i don't like it, make the background more opaque if you find top right hard to read

...

How to send keystrokes to a foreground window from within a background thread in Python?

Why do frameworks always use such stupid "zany" names?

Yah thanks dudes, i learned a whole bunch of Java and python before, I just mean I never made a project using them

Our tutor makes us write shit like 'x = x - 1' for now but at least I'm being paid to go to the fucking thing

no, sml and the caml dialects are all *fine.

I dont know of any big projects that have been done with them, but I had to do some CS projects in sml and have toyed with ocaml.

not my thing, but fine

Is this really a college classroom?
Do people really believe that fucking frog is hate propaganda now?

>Decompile a .jar
>Try to export the .jar
>Get error message

What am I doing wrong?
I need to be able to edit the .jar, but it won't export properly, even before I've edited it.

Modules are sick

Fuck off you fucking derailer
Nobody wants to see your fucking frog bullshit, nobody cares about "the suhjuwuhs" or "hate speech" or whatever.
They just don't like you and the faggots who post frogs.

You are all the fucking same and everybody fucking hates you.

Nice derail.

Is utf-8 a trademark?

...

>What am I doing wrong?
Using Eclipse

fix your build path duh

Thanks for correcting the record.

For messing with .jars it's better than Android Studio.
I don't want to learn a third java ide

Which of these books are any good?

>C
D E P R E C A T E D

>rabinowitz
ironically considering reading jewish propaganda

By what?

Or kill yourself
>you can't or you would have done it already

who
>typedef long long longer;
here?

#define condom namespace std
using condom;

K&R and Unix programming environment

for (poo in loo)

third?
So you basically learned all but the best IDE, congrats.
Besides learning IDE isn't like learning vim or something, it's not that long of a process, and in IntelliJ you can easily use Eclipse or NetBeans key bindings.

fuck off shill

eclipse neon is fucking good

>LLP64
Why is microsoft so shit at software?

still better than google

google uses LP64

Yeah, it's not terrible I guess.
But it doesn't come close to IntelliJ and this is an objective fact.
Your error looks like it has something to do with project settings, that is what's included into project and what's not.

Everyone is shit at software, because computer architecture is fundamentally shit. It's a wonder that anything works at all.

Today I finished coding a script that detects when an email is opened, through the injection of a 1px transparent gif in the body of the email than executes a script in the server when its requested by the email client. Yet, unfortunately, I found out GMail is now serving cached images in their emails. I think now it's only possible to know if the email reached that gmail account, but impossible to know how many times it was opened (or if it was opened at all).

Anyway, is it immoral to track emails in such a way? Couldn't it bee way too "Orwellian"? I'm kinda in a debate. But the information will be very useful to improve the service (it's not a spammy list, only a personalized email that is send to you every 1 month, only if you're client. also you can just unsubscribe)

>through the injection of ...
>is it immoral
Yes

it's immoral and makes you look like shit when the reader finds it

This is a pretty widely used technique in email marketing, except using the normal images used in the emails layout.

I don't understand how that's suppose to work.

I've edited a .jar library, but when I try and use it, it's as if the original is being used.

What is this?

>send an email with a 1px "invisible" pic in the body
>the pic is a remote url hosted on your server
>everytime a person loads the mail you can count a view through file access log

Recently saw a service that does this. They charge you a fee and otherwise show a watermark in the footer.

They integrate it with gmail directly so you see "double ticks" to see when someone read it.

This is the link right here mailtrack.io/en/

what a bunch of scumbags

.gif makes animation real

define how you "use" it in "when I try and use it"

this is why i tell mail to not load external content
plain text is superior anyway

refresh/clean/build and check if it's using an old copy somewhere

>this is why i tell mail to not load external content
How.

>But the information will be very useful
It'll be even more useful if you sell it to the highest bidder.

Playing with Processing

kek my adblocker blocked this

I delete the original file called gdx-liquidfun.jar, and copy in the one I've edited.

I click run, and the program runs like normal.

However, the console doesn't display the System.out.println(); test messages I've left in the gdx-liquidfun.jar file.

And when I try and access new methods that I've made, I get 'cannot resolve method,' meaning that it doesn't see the new methods I've created.

I've done all of these, and nothing's changed /:

I've been stuck on this for several days now. I'm losing so much productivity

should be an easy option in whatever client you're using

bad goy

What lists are you using for adblocking?

Did you see my sdl tails, processing-san?

I use gmail in browser.

delete the meta-inf folder

...

I did not, looks cute tho. I've never worked with SDL. How big is the code?

what is this, user? can you explain more

Not very big, but I also did it ""wrong"". I've got to figure out how to use actual surfaces so I'm not pushing everything to the renderer.

Here's a special one for you.

It's just a bunch of triangle with randomly generated colours. Mouse's horizontal position determines hue, vertical variation in hue, brightness and saturation.

First person to guess what this is for gets a free puppy

void dsfsdfsdfsdf( CUserCmd * Cmd , CEntity * Local ) {

/* declare shit */
float m_flBestTarget = 35.f;
int m_iBestIndex = -1;
Vector m_vEnd;

if ( !Local ) return;

for( auto i = 1; i GetHighestEntityIndex( ); i++ ) {

CEntity * Entity = ( CEntity* )g_pEntList->GetClientEntity( i );

if ( !Entity || Entity->GetTeam( ) == Local->GetTeam( ) || Entity->GetDormant( ) || Entity->GetHealth( ) GetBonePosition( 6 );

float flFOV = g_pMath->GetFOV( Cmd->ViewAngles , Local->GetEyePosition( ) , m_vEnd );

if( flFOV < m_flBestTarget ) {
m_flBestTarget = flFOV;
m_iBestIndex = i;
}

if ( m_iBestIndex != -1 ) {

Vector vDirection = m_vEnd - Local->GetEyePosition( );

g_pMath->VectorNormalize( vDirection );

Vector vAim;

g_pMath->VectorAngles( vDirection , vAim );

vAim.z = 0.0f;

if ( IsVisible( Local->GetEyePosition( ) , m_vEnd , Local , Entity ) ) {
if ( ( GetAsyncKeyState( VK_XBUTTON2 ) & 0x8000 ) && GetActiveWindow( ) == FindWindowA( "Valve001" , NULL ) ) {
g_pEngine->SetViewAngles( vAim );
}
}

}

}

}

That doesn't change anything /:

forgot pic

Aimbot.

filtered

...

...

holy crap i didn't even notice the last line only has one book and one horse shoe

another one

>free
where's the FSF(TM) watermark

...

some sort of hit detection thing for a fps

I want to make an image board, wiki or something else, that works without internet, only on wifi, peer to peer. I found Zyre for desktop/mobile, but I can't find anything that works in a browser.

Do you know what can I use to send and listen broadcast messages on LAN from a browser?

I don;t even understand the question

lolnope

>I don;t even understand the question

I understand what its asking me but I don't understand the rules about doing so

What did you program it in? That's honestly cool.

Given a grid, represented as a 2-dimensional array of 1s and 0s (1s represent obstacles, 0s represent non-obstacles), and a rectangle placed on the grid with a given width, height, position, and orientation, is it possible for that rectangle to reach the edge of the grid passing through only non-obstacles?

processing

We're moving now
Make Epilepsy Great Again

Processing 3

>MEGA

the car can move horizontally or vertically

it can not pass through obstacles

if it can drive to the designated parking area, return true, else return false

Not that guy but the question doesn't make much sense to me either
If I start on the left (assuming that 1s are occupied spaces), do I start on the higher or lower 0? (or do I test for both?)
This data set is so small that it's hard to even derive meaning from it, especially since the car is as almost as wide as the entire parking lot.

Graph traversal algorithms time!

I think i may be retarded. I need help learning how to find information.

If i need formal specifications of a particular file system, am i really expected to pay ISO twohundred bucks, else i can fuck off an write another fizzbuzz?

you start so you're aligned with the spot obviously since you can only move forward/backwards along the long side of the car jeez

or rather: file FORMAT, not file system

Simulating a spring in my game
Im self taught, and im actually stuck in it

What is the spring doing? (joining two things together, bouncing the planet, etc)
How are you doing it?
What part has you stuck?

Still working on my terminal, have some progress.

x is a cool character.

in real life, if you want to figure out if you can put your dick into something, it's not hard to figure out

the car parking problem is similar and it's not hard to understand what they're asking

stop being retarded

Doesn't sound like that should be terribly hard. Model it using Hooks law, or let a force be proportional to to the offset from rest

I have a Java application with 100 balls (actually rectangles for the collision) that bounce of off the screen bounds, and each other

Now it has a for loop that loops 100 times (for each ball) and inside that loop another loop that loops 100 times.
So that it compares all balls to all other balls, so in total 10.000 loops.

Is there a better way to do this, so I don't have to check for collision 10.000 times?

But user, i always underestimate the girth of my dick.

Look up broad-phase collision detection, even simple shit like grids can reduce it massively.

How do I choose what fields to encapsulate in a data access object? Some configuration data is stored in a database and if I were to encapsulate every field in one configuration data access object the class would become enormous.

tl;dr how do I git gud with data access objects

you're a big guy

quadtrees

Why isn't my quadrtatic equation programming working, it compiles but displays the solutions as "(-nan)ind" for both. Should the roots declared as doubles be floats? I am writing in C btw
#include
#include

int main()
{
double disc;
double a, b, c;
double root_1, root_2;

printf("Please input a value for A: \n");
scanf("%lf", &a);

printf("Please input a value for B: \n");
scanf("%lf", &b);

printf("Please input a value for C: \n");
scanf("%lf", &c);

/*Compute two roots, root_1 and root_2 for disc > 0.0*/

disc = pow(b, 2) - 4 * a * c;
root_1 = (-b + sqrt(disc)) / (2 * a);
root_2 = (-b - sqrt(disc)) / (2 * a);

printf("The solutions for your quadratic equation are %lf and %lf", root_1, root_2);


return 0;

}

sweep and prune algorithm

try compiling it with -Wall -pedantic
any warnings ?

Thanks, I'll look into these.

You're not being retarded and inputting a = 0, are you?

seconding

though 100x100 you might be better off with just an n^2 algorithm

depends

I'm 100% sure you entered wrong numbers.

man sqrt
RETURN VALUE
Upon successful completion, these functions shall return the square
root of x.

For finite values of x < -0, a domain error shall occur, and either a
NaN (if supported), or an implementation-defined value shall be
returned.

/agdg/ was no help.
I'm trying to learn OpenGL. My code is: hastebin.com/ruvojuvuro.cpp
This compiles just fine, but it's cout'ing the error at line 113, about the vertex shader failing to compile. I'm using this tutorial: lazyfoo.net/tutorials/SDL/51_SDL_and_modern_opengl/index.php

Anyone know what I'm doing wrong?

glGetShaderiv also provides compile error messages.
Pass a char buffer and print it to stdout.

>/agdg/ was no help
What did you expect?

Ah my b guys. Thanks. Carry on.

i compiled your code.

after running, yield this

gVertexPos2DLocation error.

I'm not entirely sure what you mean, since I can only pass GLints into glGetShaderiv, but I did try using glGetError, and it gives me error 1281: invalid value at line 116, where I call glAttachShader.

Yes, you're right, that's what I meant to say. The error at line 113 is NOT being written.

I'm trying to compile glfw but i get external symbol linker errors and i believe i shouldn't have to make changes in a library to make it work...

>i believe i shouldn't have to make changes in a library to make it work...
hah

I fixed it. Turns out I had forgotten to call glCreateProgram.

No enterprise programmers around?

Well, seperate them logically into couple of classes. I don't really see what's the problem here.

I just suck at OOP and design patterns in general. But thanks anyway. I'll just give it a go and see what happens.

Now that I have it working, could someone recommend a book or tutorial for learning OpenGL? I like to make games, and I've been using SDL's renderer up until now. It's really easy, but it's pretty slow.

>This computer science degree is all I have going for me right now and I'm failing an important class. What should I do?

I'm 22 and I've dropped out school for the last five years straight. I don't want to make it six.

I'm 3 weeks into my course and I already feel hopeless. I'm fucking ridden with anxiety because I there's already a big chance I could fail this course and put me behind schedule to graduate.

What got me in this mess is that I transferred from a different school with a very different curriculum.

Basically, I went from knowing how to create classes in Java to not knowing how to implement a simple fucking for-loop in Python.

HOW?

My lab professor is unhelpful as fuck and these people in class seem hostile as shit.

I have no idea what to do but I don't want to go back to changing people's oil for 12 dollars an hour.

Please help

Just starting a Wikipedia client for Emacs, and I am about to finish my Blackbox minor mode to censor words in some Emacs documents.

learnopengl.com/
A while back I was learning OpenGL and I looked through bazillion tutorials. This one was the best I found.

basic browing

I'm sorry. How much programming do you know?

Thanks user.
I just wish OpenGL could be as simple and easy as SDL.

I want to create a program that recognises the windows tabs that you have, then allows you to overlay a .png on each window.

It needs to remember what .png to put on each window.
Eg. Chrome has a dog.png overlay, Skype has a pig.png overlay, MyComputer has a fish.png overlay.
You need to be able to click through this.

What language should I use and learn?
I only know java and js.

>"awesome face" boxes

C.

Stop browsing Cred Forums is a good start. Then you buy a good entry level book where no previous programming experience is required on whatever programming language your university is teaching you. Stackoverflow probably has a FAQ/wiki question where the community has a recommended book list. Then the most important part is you actually doing every exercise in that book and not just read it.

Practical hands on approach is required if you want to learn. Oh and don't use a laptop to takes note in class. Use pen and paper. It should trigger your brain to remember shit.

Don't give up hope user.
It's just practice. Make some simple applications in your spare time to practice the course material.

Why the fuck are you trying to do this?

That information is classified.

lmao what

but C or C++, maybe C# would work now days

anyone have a way to get Cargo working with MSVC instead of Mingw/gcc on Windows? im sure it's not that hard to do but i havent bothered trying yet cause I'm not sure I'll even be using Rust for this project yet
no, it's a very nice language. you should try it

>to censor words in some Emacs documents.
Why?

When you're a beginner, how acceptable is it to see other people's code when doing your own as a reference?

Like "oh I want to do this, but how do I go about it?" etc., but not exactly equal of course

It's probably best if you don't look at other people's implementations when starting out.

You'd benefit more from learning idioms and basic techniques that can be applied anywhere.

Once you wrote something that works, feel free to look at someone elses and see what they did differently.

Anything that can access the windows API should be able to do this. I know for sure C# can because I've made something... kinda similar.

Thanks man.

Then I can't help, despite being an expert at the Win32 api.

Looking at other people's code is a very good way to see "how the pros do it". You can actually learn a lot.
I would say at the very begining it won't give you much, but once you're comfortable with a language, this is a very good thing to do.

I'm not sure what you are trying to do but dll injections and win32api will probably do the trick. You'll need to learn C, C++ or C# (yes you should be able to use platform invoke to accomplish this) and the workings of win32 api. Preferably C++ or C. I googled something quick for you to get an idea:
>fengyuan.com/article/wmprint.html

emacs kernel and bootloader when?

I was taking a MOOC on Java programming during the summer and I was able to implement fairly simple classes that worked in unison. Before that I had taken one introductory programming class at my old university which was also in Java. I somehow got bumped up to a second year class called Data Structures & Algorithms and it seems everyone is ahead of me. Not to mention they have taken two programming classes prior and have at least one year experience in Python which is the language we're supposed to use.

I know it sounds like I'm bitching, and I am, but I'm honestly willing to do whatever it takes to make it.

Thanks man. I won't. I just needed to vent I guess.

there is a lot of negativity in Cred Forums, particularly in these threads

as says, leave Cred Forums and read a book. python.org has one... it's quite good imo

python is fun and can help you build lots of things easily. use that as a motivator, which is what you need.

First of all you should realize that there is no replacement for a missed year. University is a full time job. You should not be taking second year classes.

GTP, at what point in your life did you decide "I am going to be an expert at the Win32 API"?

I expressed myself like shit, it is a letterboxing-mode, you select a region, press the keybind and the region becomes letterboxed.

I use emacs at work and I want to hide some info to avoid snooping.

seems quite obvious, seen that someone has been asking "how to make a virus" for a while...
IMO, that's the wrong approach, though :P

depends on the code. say you are learning C. want to take a look at the standard libs? yes. some random lib? no

>Data Structures & Algorithms
It is in a lot of ways among the harder classes for newbie programmers.
To pass the course, every time you learn about a new data structure or algorithm in class, implement it yourself in python. Don't give up until you've done it, it'll feel like banging your head against a wall for a bit, "ahh what the fuck was the loop syntax again?!"... But you just have to stick it through somehow. Hopefully if you do it this way you'll be learning the algorithms and data structures in depth, and memorizing python syntax out of necessity as you code them up.

I'll definitely do that. If I may ask, do you think it's possible to pass the course? I've effectively missed two lab assignments worth 7% of my total grade because I was being an idiot. I'm wondering if I should still try the lab assignments or put all my effort into learning python from the ground up from the resources you guys recommended?

>I've already missed 7% of my grade I wonder if I should miss more
Hmm...

garbage code desu

>Data Structures & Algorithms
This class is not only designed to learn people about datastructures. It's also designed to weed out people not fit for programming and some universities put it very early into the education to save everyone money and time. I got it the second semester (4-6 months into the education). I only had a total of 10 weeks full time programming courses before I got this class.

We had two tracks. One track could choose Java as their main programming language the first 1.5 years. The other one did C. Since pointers are a natural thing in C it meant that people doing C were better prepared for this course. Some 80% from the Java track dropped out after taking this course. About 40% from the C track dropped out.

hey guys i kniw i should or could post thos question in sqt but i know ruby posts in here more often and I quite trust her and you guys more than someone that might have. encountered mu same problem.

Alright so my friend was looking for a way to make money and bought some storage containers. Said he found a lot of computer stuff but that this one, he wasn't able to fix/figure out and so he gave it to me. I was given a macbook pro, the 2013 model, and it looks fine, I can replace the cables and such, but the same apple id problem has just come up. I no has.

So having said that and
>inb4 give it back jamal
is it still unpossible for me to recover any prospects of making this a useful device in my home? Could I somehow sodder in new parts, flash the bios and run a linux machine out of it without the problem of having to do so from inside the current runtime?

>We had two tracks. One track could choose Java as their main programming language the first 1.5 years. The other one did C.
hmmmm
>Some 80% from the Java track dropped out after taking this course. About 40% from the C track dropped out.
hmmmmmmmm

Probably around the time he decided to be a massive faggot

Probably when he decided he wanted to become a hackhurr and make a keylogger to get his sister's nudes. Otherwise becoming an expert at win 32 api is not by choice.

I am practicing my coding in C# and am working on code that recursively calls itself to get the smallest number of an array.

I am wondering how do I recursively call this function while passing through ridVal with -1 array slots. Whenever I try to add somthing like

riddle(ridVal[ridVal.length -1]);
I get an argument error cannot convert from int to int[].

How do I pass a shorter version of ridVal through?

Yeah what other courses are you taking at the same time? If you quit life for a while you might make it maybe. A huge maybe. Assignments don't typically get easier.

In the end there were less than 40 people graduating of 200. It was a math heavy computer science bachelor. The dropout rate was so bad that the university eventually a decade later went full C# everywhere and made it pajeet friendly. Now I'm ashamed to display that university on my resume because it's no longer a sign of people knowing what they are doing.

I was anticipating that this class would take a lot of my time so I took no other science classes this semester. So English, History, and Econ. I'm going to brute force my way for a chance to pass but either way I'm not give up if I eventually fail. I won't accept that I'm not meant for programming

>give people a choice they are not qualified to make
>one group is severely disadvantaged
sounds like a quality university

>ridVal[ridVal.length -1]
Not sure how C# arrays work etc but here you select the last element in the array and that is certainly not an array in this case.

There's actually a test developed to determine if you're meant for programming or not.

Java was the hip shit back then everyone had to do. All universities did this except the top 10 world. My university was in the transition from going from a good one to a bad one.

Just like many universities use python now because it's hip. Not because it actually teaches you a good foundation.

>Not sure how C# arrays work etc but here you select the last element in the array and that is certainly not an array in this case.
I think you may be right and I'm retarded.

I am trying to write this psudocode out (I want to follow it in the debugger for a better understanding of the trace) and cant for the life of me understand how to
> else temp

Starting over at year 1 next year might be an option. But never stop programming or you are going to forget. Keep doing a hobby project or something.

Or could it be that, the people that picked C were actually the ones (mostly) that took this shit seriously.
And those that picked java, even if they would be forced to learn C they would drop out nevertheless, because they just came to CS cause they heard of $$$ or some shit like that.
That's my theory anyways.
Of course we're talking statistically. There are good, serious java devs as well as there are scriptkiddie-tier C devs.

I might try C#, I still have nightmares from trying to make 3D games in c++ as my first experience programming.

I went from Python in our Intro to Programming course, to C++ in our second programming course: OOP. That was a bit of a shock in terms of workload.
I'm sure if i hadn't had a little prior experience with C++, i wouldn't have made it.

show met t his test plz.

First of all. You can just set one breakpoint and then press "step through/over/into" to go to the next line etc.

Second. That's not how you'd normally do it C#. What you are doing is more of a functional programming approach. Something like this would be more normal:
int min = Int32.MaxValue;
foreach (int n : intArray) {
if (n < min) min = n;
}
return min;

(Excuse any mistakes I can't be bothered checking it.)

Third. If you insist on doing it recursively, I wouldn't try to pass in a shorter version of the array, but instead just add an index to the call to show how far into the array I am. If you do decide you want to make a shorter version of the array and pass it it, you're going to want to use Array.Copy. Something like this:
int[] shorter = new int[ridVal.Length - 1];
Array.Copy(ridVal, 1, shorter, 0, ridVal.Length - 1);

(Again, can't be bothered checking if it's correct.)

as per msdn.microsoft.com/en-us/library/z50k9bft(v=vs.110).aspx

What distinguishes a scriptkiddie-tier dev?

www.isitchristmas.com

>Do you just make a temp array, set it to 1 less the length of the one passed in the parameter and then copy the content of the array passed in sans the one on the end?
>It feels like there has to be a better way!
If you intend to make a temporary array and not use pointers/iterators the underlying mechanism (standard library) will whether you like it or not create a new array and copy the elements over.

whether the only language they know is Java. (to a lesser extent, other languages apply here). also if everything they write is copy-pasted

blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/

This is where i heard about it.

writing Go backend for a Go talk
every time I create a .go file I remember how fucking cool this language is

and don't start with the Go-Rust-meme language war, I don't fucking care about any autistic wars or judgments like "hurr durr my language is better 'cause this, that, 'cause I can wank more cocks concurrently"

Writing scriptkiddie-tier code.

danke

will post some code after i read this

wtf why are they teaching kids about pepe?
r9k has become the new Cred Forums

I'm trying to research an algorithm to find whether or not a function is periodic the periodicity. I found the "tortoise and hare" algorithm but it looks like it'll only work if they land on the same address.

cuz programmers/IT folk in general are retarded?

Doesn't this make a scriptkiddie-tier C dev an oxymoron?

I found this, did this years ago.

pastebin.com/63rYiScz

extern "C"
{
}

Thank you both for taking your time to answer my questions!
I'll look over what you posted and try to improve my code, and the way I code!

I started working on a program to encode QR codes from scratch, but then I realized how complicated it would be with polynomial arithmetic and I gave up.

Also:
I want to include a c++ library in my program but the compiler won't find the header.

Even when I include the full path and have exported the library to the same folder as the file I'm trying to compile. What's wrong?
I don't have specific code to show, but I've tried this a few times in the past.

What the fuck is wrong with people?
Surely, this would be a javascript one-liner printing NO if date isn't equal to DEC 25.

There's over 1000 lines of javascript in here not including the jquery boilerplate.

>if you're not born with the knowledge that C-style languages assign right to left, you're not gonna make it
i hate this test

pretty cool

as a recent html noob myself, i appreciate this.

Should I learn C#?

how so? I only know a handful of C programmers who know a second language

the .lib file is at the path? debugging make systems is a horror i rather let other people do

>i hate this test
You missed the point. It says half the students came up with a consistent mental model of how assignments work, even if they were wrong. So if you consistently tried to assign left to right you'd be put in the "can program" box.

>Americans are so silly they can't even learn a second programming language.

>if you're not born with the knowledge that C-style languages assign right to left, you're not gonna make it
How do you explain the correlation then?

The syntax is nice. C# programming in visual studio is very pleasant. Linq is awesome. Can easily interface with C and C++ binaries. But if you should you learn it is up to you.

no

that's now how the test works. it doesn't test your specifical knowledge but your ability to form a consistent mental model. you could answer every question wrong and still score high on the test.
that's what makes the test interesting, imo

What is the best language to get a job?

English, I suppose

Chinese, i've heard. Many international companies find Chinese speakers valuable.

Although i suppose, being the de facto lingua franca in the world, is correct.

probably because they taught C (or a similar language) in those classes. there's also the knowledge that "=" means assignment and that variables can be assigned multiple times in C. and the "int" keyword alone probably makes it even more confusing. people who thought the same way that C programmers think did well here. if they switched to a language very unlike C, they'd probably show the same groups meant the reverse. a person who scored high on this test might be an incredible APL programmer.

You didn't even read this article, did you?

Is Zed Shaw C the hard way a good book to start with? I have previous experience with C, Assembly an a little python...

I'd really appreciate if you recommend me other books to learn from example/practice. I don't want anything too complicated my final goal is embedded software development

no, start with k & r

There is only one C book and it's K&R.

>C the hard way
NO

building a consistent mental model when you can't comprehend something at all indicates very little

(this is also the reason there were people who just left questions blank)

The only book you need is the C standard.

why is creating a go file cool

"Learn C the hard way" Is absolute garbage.

dunno, like same reason for which doing package structure architecture makes you feel good

On the contrary, it indicates a lot. Perhaps even more than if you have full comprehension.

Could any of you guise explain why is it so bad? I'm halfway through I've found it helpful in some basic topics, and also very practical it feels like you set up from the bottom..

why?

not really true.

I'm not sure if there are any books about it, but setting up an environment in which to develop C is a beast unto its own.

if it makes you understand C programming, just read it and leave other people's opinion out of it.
'cause, you know, it's other people's opinion, who gives a fuck

I've not seen one (one) document that properly describes the C memory model except for the C standard. So you might as well stop wasting your time and read the C standard.

rbt.asia/g/?task=search&ghost=yes&search_text=zed shaw tell

I can't be bothered to explain this over and over.

It's "copy my poorly explained code: the book". It does a terrible job of explaining anything, and is filled with things that are factually wrong.

hentenaar.com/dont-learn-c-the-wrong-way
has details about those things which are factually wrong.

>probably because they taught C (or a similar language) in those classes.
In the article it clearly says that subjects of the test were people that have never seen any code in their lives, and that it is targeted at exactly those people.
So if you have seen how the C assignment works then you're not eligible for the test.

"The test was administered twice; once at the beginning, before any instruction at all, and again after three weeks of class. The striking thing is that there was virtually no movement at all between the groups from the first to second test. Either you had a consistent model in your mind immediately upon first exposure to assignment, the first hurdle in programming – or else you never developed one!"

I'm not saying you are wrong in suggesting C standard. but it doesnt contain all of the information you will need to actually start writing C.

>compilers
>make
>debuggers
>valgrind
etc....

ok, so what do after I learn a language's syntax and standard libary
how do I make a real program that isn't 100 LOC tier
something like st or bspwm

Aint nobody gonna read all that nerd shit.
>reading a book about why not to read another book

You have to find a niche and corner the market.

You make a 200 LOC tier program. Then you make a 300 LOC tier program... And so on. Just do. Don't think.

I find that the next step on the path to making useful programs is learning how to interact with the os and hardware.
This is almost always lacking in programming education until much too late.

Well, that just proves the point..
Non-programmers-never-seen-code-before took the test, and half (or whatever) of them failed, and even after seeing code and learing about it they still were failing. The second test was just there to check how the test results correlate to ability to learn programming. It proved it to be pretty accurate, so you can now give the test to any non=programmer-never-seen-code-before guy, and if he fails, then he most likely won't be a good programmer.

>programming
>don't think

You are absolutely right. It IS indeed because it expects you learn from the bottom up rather than recursively, where you learn a word, prohibit the entailed structure from executing and then apply on return. It assumes that the efficiency is an application itself rather than an after thought of the matter.

People will call it bad because it doesn't give them that immediate satisfaction of "i've made a constructor" ( though, they could have it regardless ) whereas programming should be learned as "I have more than just numbers and letters now".

To touch on that a little more fairly, though, the book doesn't share with you the insights from any level above or below the language, so you end up with the understanding that you've done something efficiently but don't understand why. You could troubleshoot to solve that misunderstanding but could still ultimately end up with a similar answer using flawed reasoning, as in creating sorting algorithms. You could be making a quick sort and applying your operations in the wrong order, which increases the possibilities at compilation time, which increases entropy, creates strange threaded branches and bogs down an array pushing process by having it return mid expression because you gathered your variables out of order.

That kind of thing could create a false sense of understanding and create many more python scripters. I haven't really read the K&R book, unless it's the one that switched to ANSI C in the second edition, ( though it may have been the 3rd book I had open while reading ANSI C and 21st Century C ) but I do know that language designers model around the realities we already have experience with. It's the ones that do the fixing of the language that generally make efficiency changes on an interface that they have not presented, typically due to publishers or corporations asking them to keep to their logistics for fear that the facilitating system be considered too helpful.

If you need all this, once you are done reading that book look up 21st century C.

It's literally covering everything user here mentioned except for the basic syntax of the language.

Raises an interesting point though. It is conceivable that the syntax of the questions is relevant to the ability to grasp a mental model. You could maybe change the syntax and a different subset of test takers might be favored, simply because a different visual syntax might spark different neural activity. Language influences the way we think.

Remember in algebra class when people had finally stopped panicking and figured out how to perform the steps to solve for x, and suddenly they were asked to solve for y and they were completely stumped.

I believe different thought patters favoring different languages and syntax is also why /dpt/ thinks that everyone elses programming language is shit, and why people keep confusing design paradigms with language constructs.

Is it bad to use protobuf serialization for IPC? I have something spitting out around 10 messages a second. It will eventually run on an embedded system with limited resources.

that's not what I'm saying. I'm saying these people did well in C, Java, C#, etc. classes after the test

>Putnam and others found that novices’ misconceptions about the capabilities of computers could
have a massive negative impact on their success at programming [26]. Many of their subjects tried
to use meaningful names for their variables, apparently hoping that the machine would be able to
read and understand those names and so perceive their intentions.

I did this in moving from Basic to Java. Then realized that I could still do it in Java, I just didn't know how to call the standard library. I also may have assumed a custom class that my hs basic teacher may have made for our projects.

>Pennington looked at the way that expert programmers understand problem domains and programs
[24]. He found that, despite the admonition of the computer science establishment to construct
programs top down, experts build them bottom-up.

>C++11
>create a lambda that sums two ints
>assign it to auto a and print it to the screen
>it compiles to std::basic_ostream& std::endl(std::basic_ostream&)
what happened to c++?

>I also may have assumed a custom class that my hs basic teacher may have made for our projects.
?

>Putnam and others found that novices’ misconceptions about the capabilities of computers could
>have a massive negative impact on their success at programming [26]. Many of their subjects tried
>to use meaningful names for their variables, apparently hoping that the machine would be able to
>read and understand those names and so perceive their intentions.

>naming your variables full words
>expecting the computer to be able to read what you're calling your variables
literally retarded, yet people here do it all the time when naming their variables. just name it a letter, christ

zedshaw.com/2015/09/28/taking-down-tim-hentenaar/

Man, Zed's one salty motherfucker

MPD client.

>by default java runs .jars using a version of java.exe that doesn't open a command window
fucking why?
This just makes it harder for people to use/test/anything else .jars, but it also means that idiots can be tricked into running something that will by default be completely invisible

Sounds like it tests whether people can reflect on the position/posited noun.

This is why I make sure to let people know right off that amount, value, quantity and number are all very different things when used in real math. An amount is aggregate, a value the result of a process, quantity an arbitrary value and numbers the meaningful aparatus through which we bridge the connection between our biological faculties and our logical ones.

Make sense?

templates happened

how can you build a program top-down? do you just not compile it until it's complete? or am I misunderstanding their definitions for top and bottom here (bottom = things lowest in the dependency tree)?

I've actually read this aswell, and it is very helpful at least in pointing you in the right direction.

>how can you build a program top-down? do you just not compile it until it's complete?
i did that for my derivative program. had to spend about half an hour fixing bugs but i got it working after having worked on it about 30 minutes a day for 5 days

>how can you build a program top-down?
Start by laying out the overall structure, the classes, their methods, etc... without actually implementing any of the methods until you've laid out the entire program. I do it sometimes. You still want to implement and test each piece one by one though.

Experienced programmers don't name their variables for the computer to read, you knob. They name them for themselves and other collaborators or future maintainers to read.

Finally buying an iThing. I have experience doing Android dev and I'm good at quickly learning things. Is it worth getting into freelance iOS dev? How saturated is the market?

>just name it a letter, christ
Found the non-programmer.

>expecting the computer to be able to read what you're calling your variables
Your computer never reads your variable names, all it sees are 1's and 0's. Are you retarded?

This very true. I still haven't gotten around to messing with ASM seriously because I can't find any good information on how to access hardware, out of windows, using only C. I feel like I don't have the "proper permissions". I know the hardware IDs can be grabbed using bash or checking the device manager aaaannnnndddd that I can write to any program that accepts input or outputs, albeit writing to is practically surgery, but you'd think a developers environment would leave the above-kernel interface as optional if one is expected to write code that will treat the advances in the tech as such and not as "error padding".

Like, I know this is why namespaces were created, but since C hasn't adopted any of these namespace practices why can't we have a little more hardware clarity? I can't imagine it's anything more than political bullshit like ">C89 can run on any intel/amd based processors".

lmao i hope youre trolling else gtfo

actually, all it sees are symbols which map to a memory offset table.

business idea: learn japanese and use japanese characters in scheme programming to RP as an advanced futuristic hacker

I fail to see the 'business' in this idea. Sounds fun though.

I've just learned a new word.
en.wiktionary.org/wiki/invidia#Latin

I find this somewhat amusing.

it's a meme from /brit/. you should join us! /brit/ has some of the best memes

Explain this meme to me.

>Later, Johnson-Laird put forward the theory that individuals reason by carrying out three funda-
mental steps [14]:
1. They imagine a state of affairs in which the premises are true – i.e. they construct a mental
model of them.
2. They formulate, if possible, an informative conclusion true in the model.
3. They check for an alternative model of the premises in which the putative conclusion is false.
If there is no such model, then the conclusion is a valid inference from the premises.


Did they just describe the scientific method?

I've been writing Android games in Java.
I know some niche libraries and about game related code.

I know almost nothing else.
Is this a negative to employers? I assume that with the thousands of libraries, whatever task you're employed to do requires initial learning.

I don't have the interest to read a book or learn anything that I do not currently need to know.

you say something that may or may not be a business idea, but is something you intend to do. such as, business idea: have a wank. or business idea: have a poo. you can also use it the same way it used to be used which is something like
business idea: have you and a friend each put 20 dollars in a box, sell him the box for 30 dollars, and you each walk away with 10 extra dollars

>Be 14yo 'hacker'
>Change the family computers cursor icons to a blank transparent image
>Can't see cursor anymore
>Parents and sisters are upset the computer is broken
>I save the day by navigating using just the keyboard and fixing it
>The story of how I hacked the computer virus is now a legendary story that's mentioned several times a year by my family

How much do you enjoy pressing alt+shift?

Err I meant to say I may have taken his custom class from BASIC for granted in the Java class.

And how did this become a meme?

But basic doesn't have classes.

It's building according to the structures and using only signatures. Prototyping, essentially. You may have heard it brought up while learning about something called "Test Driven Development".

Essentially you draw out a bunch of squares and fill them in with more little squares. Each square is a class/package or namespace and in them you describe the functions and classes to be used in the program. Then when you have your empty "buildings"/structures, you fill them and connect the more discrete processes together using streams and concurrency.

You're basically building the box for it all to fit in, including all the size limits in this one large box, then filling it with your things second to make sure you can even fit that many of those things in your box(es) and then you work out the operations between buffer and structure and then structure to structure.

That's top down, and it's usually done so to be bridled with other economic, political and natural factors like urgency.

I want to regex a URL to make sure that the URL being parsed is a subdomain of the primary domain. For Wikipedia, it would be
https?://([a-zA-Z]{0,}[.]?)*wikipedia.org/?([a-zA-Z]{0,})?

How can I change this so that the far right-hand side of the regex will accept literally any number of characters of any type? Currently it terminates at any non-letter character (obviously) but I can't find anything for "subset of all characters" on any regex tutorial sites.

Are you ready to statically compile a whole OS into your C++ programs Cred Forums?
youtube.com/watch?v=t4etEwG2_LY
includeos.org/

got it, I just had to make it
https?://([a-zA-Z]{0,}[.]?)*wikipedia.org/?.*

.*

What language is this user, and what is it generally used for?

the "business ideas" people proposed started gradually becoming less and less like actual business ideas

>{0,}
*
>[.]
\.

It's a regex (regular expression), it's a format for checking whether or not strings are in a particular format (for purposes such as normalization).
I don't know exactly how it works, but many languages offer a ton of really useful tools that work with regex (like replacing any instances where are regular expression is true or false), etc.
It also lets you catch a lot of errors before they happen, like folks inputting invalid file names

Well that entity model then. I recall getting an object and calling the dot operator for a lot of functions like "change direction" and "setVisible".

Your expression is pretty fucktarded. For instance:
>{0,}
Why? Why would you do this? This is literally *.
Why do you have the subdomain period in a character class? Why is it marked optional? Your expression matches fuckwikipedia.org since the period is optional.
https?://(\w+\.)*wikipedia.org(/.*)
Possibly domain names have a wider class than \w, but I don't care enough to check the spec. Presumably [-_\w] is a good start.

lol I just got two trips in three consecutive posts.

>Told that there were three groups and how they were distinguished, but not
told their relative sizes, we have found that computer scientists and other programmers have almost
all predicted that the blank group would be more successful in the course exam than the others:
“they had the sense to refuse to answer questions which they couldn’t understand” is a typical
explanation. Non-programming social scientists, mathematicians and historians, given the same
information, almost all pick the inconsistent group: “they show intelligence by picking methods to
suit the problem” is the sort of thing they say. Very few, so far, have predicted that the consistent
group would be the most successful. Remarkably, it is the consistent group, and almost exclusively
the consistent group, that is successful.

trip trips

Either i'm being stupid or you're talking about Visual Basic, not Basic. Although i didn't know VB had classes.
I'm certain Basic doesn't, though. It's too old and, well, basic.

Your story illustrates, though, why i don't like it when they try to make things easier for newbie programmers by giving them custom frameworks to work with.

Oh I know how to do this except in java

use java.awt.Robot

consider spawning it from python with a batch script or something of that sort, I did that when working with CSGO triggerbots

How do the libc headers even work? I've taken a look through a few, and 90% of it is preprocessor definitions and macros that don't seem to actually do anything

>It now seems to us, although we are
aware that at this point we do not have sufficient data, and so it must remain a speculation, that
what distinguishes the three groups in the first test is their different attitudes to meaninglessness.

There are all sorts of feature test macros and other shit trying to make the headers work on an many systems as possible.
They're a fucking mess, and you're probably better off not reading them.

>Formal logical proofs, and therefore programs – formal logical proofs that particular computations
are possible, expressed in a formal system called a programming language – are
utterly meaningless
.
To write a computer program you have to come to terms with this, to accept that whatever you
might want the program to mean, the machine will blindly follow its meaningless rules and come to
some meaningless conclusion

>. In the test the consistent group showed a pre-acceptance of this fact:
they are capable of seeing mathematical calculation problems in terms of rules, and can follow those
rules wheresoever they may lead. The inconsistent group, on the other hand, looks for meaning
where it is not. The blank group knows that it is looking at meaninglessness, and refuses to deal
with it.

what is this guy doing

yo momma bix nood

Where are the heroes in Victorian literature? Is heroism still possible in the modern world, where epic conflict seems a thing of the past, and where material comfort and quotidian concerns preoccupy the masses?

Can you please fuck off?

thanks user

How do I calculate the entropy of a random series of bits? For example, what's the entropy of 11010010111110?

The subdomain part should probably just be
([^/.]+\.)*
. The bit in brackets is "all characters except dot and slash".

Extracing lotto numbers from arbitrary text.
It's quite challenging, as some random dates in the same line can fuck you over.

2^14 possible permutations

can someone explain to me how regular expressions can be so powerful but also be so quick?

Yes, but that isn't entropy

This has nothing to do with passwords, btw

...

define entropy first then

I suspect if he knew how to define entropy hew wouldn't be asking how to calculate it.

The amount of unpredictability in the data, i.e. the theoretical minimum compressed size

Well if someone asked me to guess a number I definitely wouldn't say 11010010111110, so it's pretty unpredictable.

That's a contrived example. I need a way to estimate the upper bound of how much I can compress binary data

Java is a training wheel language for learning OOP, for people who are afraid of memory management and pointers.

looks like a bot that plays in an fps like world, or at least references a 3d simulation.

Hint: I can understand it

NOT

Formal specifications meaning the different constructors and their parameter listings or actual explicit language and code?

The former I don't think is a problem and may be an easy google with the right words, the latter might be worth 200 bucks.

>Formal specifications meaning the different constructors and their parameter listings
What good does that do? That doesn't tell me how to implement the constructors.

Okay you noob. Read this post and see if it makes sense.

Your computer is a box. Physically anyway. Now if we keep to this simple idea that it is a box the rest will make sense.

You have your box, and in this box you carry the potential to describe just about anything. To describe anything between distinct entities, you need a language. Once you have your language, you need a reasoning clause to carry your language. Java happens to be Enterprise Standards. Python happens to be the Interface.

When you learn the syntax to a language, you learn how to place "blocks" of information about the process as a way to describe limits and encapsulations, as well as operations. These blocks keep the current of information from being disrupted and allow you to keep a reliable track of it all. Shaking the machine in any physical sense won't damage the data as it is stored. And although breaking a side on the box may make the data inaccessible, the data is still not corrupted. Pointing at it, yelling at it, spitting at it, cussing at it, anything barring presenting another random electrical signal or inducing an electrical reaction using magnets or something will not mess with this data. Knowing that data will not change by any humanly physical means we have taken to pin point electrical charges to temporarily/"permanently" store any variety in the system. These varities exist and are referred to in/from data tables stored in memory as you already may have guessed.

That's about what they have in common. The difference in these boxes comes in the form of algorithms and data structures. Sometimes computers hold a lot of info and sometimes they hold none. The kind of info they hold is determined by the process, the kind of structure used for this data is also determined by the process. Now here is where it gets tricky so bare with me. Also, I may have to cont. post.

A programmer can easily build up to that if he understands the system processes?

I'm saying if you need to work out some drivers you could black box the input output cycle or just look around for some open specifications and take a guess at the proprietary one.

Anyway, I was asking which you wanted.

Considering that this is electricity and electricity is chemical, and chemicals have a weight and density, we can be sure that the data does in fact move, but we have placed some ingenious limits on the matter and can affront to move it more precisely. We do this by executing expressions that manage operations over the data. You already know that, though, so let's move on. Considering that electricity is chemical, you may be able to infer that chemicals interact with gravity and have a sort of "float"ing quality to them. Keeping this in mind, you'd think that tipping the box would move some of the data even only at the atomic level but they don't, and so our unsorted data table may be a mess to siphon through with having to return the wrong ones after pulling them out and then having to hold this one while you move that one up. Anyway, you get the picture. What we have then in place for this kind of thing is algorithms. These algorithms basically define a general direction for the flow of the data. Lemme start a new paragraph.

Okay, so you have an array that has electrical values that after compilation will be tantamount to [ 1, 3, 5, 7 ].

Tip the box to the right and the the values will stack up in descending order and will be most readily accessible from smallest to largest. If we tip it over to the other side, the laws of physics won't safely apply themselves here and we will keep our order, it will just appear reversed because we switched the Current top and bottom.

Well, what if we want to access data in an opposite way? Well, we have to set the traversal of the array and the access and mutation operations in an order that most cleanly follows the principles of the chosen algorithm. This means that the quick sort where I move all the big pieces to the end of the array involves picking up my current value with intent to move it further down the array if it just so happens to be a greater value than the subsequent element.

Specifically i want the full specification for the MP3 format so i can implement a playback decoder.

This then means that if my array works with direction, it should only work in one direction at a time and that direction should generally speaking be the direction of the process. Sometimes direction isn't always up down left right. Sometimes its a class act.

And yes the other students are always hostile towards normies. Just try to be meek, leave the schaudenfreude at home, and ask a lot of questions. Trust me, they already did the reading, will do it again this time. Just get all the info you can. Or come on here and ask more questions. So yeah, make it follow the general direction. Merge sorts literally work like binary tree traversals. Root, left branch, left branch position + 1, left branch position + 2, right branch.

It's just about seeing the process as a general tendency. Pick up heavy thing with legs, once heavy thing is hoisted continue piling on back. The general tendency here is that heavy things require an extra base and if things need piling do it after the basic foundation is set.

A lateral explanation for this would be get your heaviest elements to the end and then start piling on the smaller ones.

I don't want to supply you with something you can be a pedant about so I'll keep it this general for now.

But most basically, look at the general principle for the algo and then look for a way to grok the process in parts and try to assign the duty/role of those parts to the limited number of operations used in creating algorithms.

In the first quick sort the base foundation is moving the highest value(s) to the end and then the piling happens after that.

I mostly brought up the electricity and chemical nature of the data so you could try to imagine "doing" something to the box like leaning it over, kicking it, flattening it, cutting it, etc. and then try to imagine the data inside bouncing around if you can't yet simply supply an underlying action yourself.

Have you tried using meld on two mp3s? You could take the similar lines and try them out as a wrapper.

I don't even know what you're talking about, but you seem to be suggesting i perform science on files to reverse engineer and deduce the coding.

I have neither the patience nor skill to do that. The exacts specifications exist, and the patents have (mostly) run out.

Thanks user, but I would prefer to avoid Java entirely.

My current approach is through Wscript (since it's a Python program designed for Windows only), with this function called in a thread: def Keys():
time.sleep(15)
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate("AnyConnect Downloader")
shell.SendKeys("{TAB}")
shell.SendKeys("{ENTER}")

But for some reason it doesn't work.