/dpt/ - Daily Programming Thread

Previous thread: What are you working on Jow Forums?

Attached: 1500600461626.jpg (473x496, 105K)

Other urls found in this thread:

kiwiirc.com/client/irc.rizon.net?channels=#Jow
twitter.com/NSFWRedditVideo

If I have 2 strings contain only natural number less than 1 million in decimal and I need to compare which one have higher value, then should I just pass both strings to strcmp, or convert both of the strings to an integer via atoi, and then compare it with normal integer comparison?

Mostly Functional programming is the best programming I think.

Contributing to Rocket.Chat

Doing some scripting in python to do some number voodoo in excel files

Programming is a subset of anime.

Might as well compare it to deal with zero-padding

>08
vs
>4

strcmp would say 4 is greater

Oh yea, forgot to mention. All of the strings are zero-padded by specification, so I don't need to care about zero-padding at all

I'm about to apply for my first job. Should I go for embedded programming using C or full-stack Java? Which one would be better in terms of salary/long term job security?

Attached: 1526669176365.jpg (960x720, 125K)

I'm making a media server to mirror twitch streams since my "smart" tv's a piece of shit. I'm rather surprised at how barren the landscape is for upnp libraries that haven't been abandoned

>full-stack Java
absolutely sure-fire way to kill your soul.

Playing with the Linux framebuffer. It's sorta sleek that I can change the color values of individual pixels by simply writing to a file at a certain offset. Here's a program that makes the entire screen white for 2 seconds.
#include
#include
#include
#include
#include

int main(void)
{
FILE * fb = fopen("/dev/fb0", "w");
assert(fb != NULL);
printf("\x1B[?25l"); // hide cursor
fflush(stdout);
while(fputc('\xff', fb) != EOF);
usleep(2000 * 1000);
printf("\x1B[?25h"); // show cursor
fflush(stdout);
}

don't listen to embedded neets, Java will make you rich and give you a career

>embedded neets
Isn't that an oxymoron?

Don't bully the pajeet

Do you have 'experience' using the both stacks?

Embedded at a small company can be a one man show which gives you extreme job security.

Daily reminder that we have an IRC chat.

kiwiirc.com/client/irc.rizon.net?channels=#Jow Forumsdpt

I don't know how to use my IRC client.

might as well use strcmp, don't see why not

Dude just mmap it. Then you can do fb[x][y] = ...

C was a mistake
ML was robbed
it didn't have to be like this

/wdg/ here
90k starting, any job I want :^)

I am 24 years old and have just started learning Python. I'm going to take some community college courses in August to learn more but I was wondering: what are the areas I should become proficient in?

btw I've never used anything but Windows XP and 7.

Attached: me no understand.jpg (369x295, 19K)

become an electrician instead, you are too old and tech illiterate to get a job as a programmer

I haven't touched java outside of uni and only made small project using microcontrollers at home.

I am learning to become literate now, dickhead. And besides I would kill myself if I had to get a career in something I don't care about

Attached: 1462685793638.png (343x315, 160K)

I think functional first languages are the best because you can still do imperative stuff when you need to but your code will mostly be functional and thus easier to read.

I think java is just fine, you retards just don't get it
keep masturbating about >muh FPL muh static types muh gonads
I learned java in school, I will get a java job, you think they would teach it and INDUSTRY would use it if it was "total poo" like you say?

go fly a kite

Both are good areas I think, might be harder to get into embedded development as a junior, probably. I rather try to get a C# job instead of Java. It's just a better language overall.
Don't listen to him, if you care, study, and practice enough you can make it.

Which is better web development or programming?

whats the benefits to functional programming vs object oriented and vice versa?

I actually like c# much better than Java but there aren't as much job opening my area.

functional and OOPs are not orthogonal

Does anybody here have experience in freelance consulting? How do I break into the market? Looking to specialize in scientific computing and numerical optimization, specifically.

Attached: 1492916258337.jpg (749x530, 157K)

Thanks user but what should I study? I feel like I'm a brainlet compared to most of Jow Forums because there's so much computer stuff I'm unfamiliar with.

You just need: a language, a framework, a relational DB, and UI/UX sense.
Specifically those are gonna depend in what you're going to develop to, for example: web-dev, desktop applications, mobile, etc.

What do you mean when you say framework? And does DB mean data base?? Sorry for my tard questions I'm just asking honestly. I want to develop for whatever will get me the most amount of money but also with decent job stability.

Attached: 1428729823285.jpg (960x945, 61K)

I finished my 1-level perceptron neural net. I need to do some back propagation. Don't really know how I'll extend it pass 1 level effectively though.

like, if you're processing pixel data to a second line of neurons you would need to weight the input of the second line or, maybe cluster. You could claster around whole pixel lines(horizontal pixel line) and even pixel heights(vertical pixel lines) I suppose. Don't know if that would help, but it might.

I know they super sample sections of pictures too. So you break the picture into quaters and mid point.

gah

Framework is a buzzword. Basically it is just tools (like an IDE) libraries (API) and a language. You could throw in a runtime environment there too and call it good. Just look up what that stuff is and you basically know what a framework is.

should I learn Go or C#

Install Nim

Java

Framework here being the meaty part of your application, for example: WPF if you wanna do desktop for winbugs, nodejs/angular/react for webdev (known as a stack, not framework), etc.

Is fullstack web development worth it?

Java or Python.

Depends on your background and what are you working on

if you can do it in a fun language.

JAVA is the choice for Pajeets and a lot of normal enterprise software people, unfortunately. C# is a much better language.
Deal with it.

python Only

the only thing better is reified generics, everything else in C# is bloat

>The same way that void in C isn't void, since it is a unique value (void) : unit.
THIS IS WRONG.
In C, void is indeed literally nothing at all.
You'll notice on some compilers, sizeof(void) is 1. This is incorrect and nonstandard. In fact, sizeof(void) should be a compilation error, because void is an incomplete type that can't be completed because no values of it can exist. The return value of a function returning void doesn't count, because there is no such return value.

Right now, I working through html, CSS, Javascript, and php. To be such a meme, js is really fucking prevalent

muh pajeet muh muh

Java is faster, has the better ecosystem and is used by more companies. Go and suck sit, microdick

Learning Rust. Is pretty comfy with traits, pattern matching and god tier error handling but the syntax can seem messy sometimes.

Attached: 1498120881888.jpg (231x311, 18K)

Any ideas on how i should teach someone to program in Python? I consider myself good at it but i have no idea how i should start teaching it. And i want to do a good job at it.

>You'll notice on some compilers, sizeof(void) is 1.
Some of those GNU extensions really are stupid.

>bloat
I don't think you undestand what that word means.
Having features which are useful and work well is not "bloat". Java lacking so many features and trying to catch up after decades is plain pathetic

It's a side effect of supporting void* arithmetic.

I know. And that is unnecessary and stupid.
It's not like it's a huge amount of effort to cast to to a char * type and then doing the arithmetic.

I can see it having its advantages when you're writing generic code while you're passing void*+size back and forth.
Arithmetic on function pointers, now that's retarded.

Right, and c++ isn't bloated either, its just features!

Full stack Java is much harder, WIth C you're pretty much restricted to C and that's it.

With Full stack Java you will have to have a good grasp on pretty much every Internet technology today, relational databases, transactions, indexes, SQL, http, JDBC, CRUD, REST, transport layer protocols, server architecture + Java core + OOP, and that's just the tip of the iceberg, and don't get me started on front end framework, it's literally hell.

void * was a mistake.
char * should've been the generic pointer type (and it kind of is anyway since every pointer type is allowed to be cast to char *)

It was, originally. void* was introduced later than K&R and char* was the original generic pointer. void* and char* remain the only two pointer types which it's valid to cast any other data pointer to, and I'm pretty sure the standard requires them to be compatible types.

That's why the pay is good.

C is a better option than Go if the goal is not servers. C# is a really easy PL to learn and having already worked with python, it should be even easier. On a professional level, it can introduce you to many concepts from high to low level.

How hard would it be to write a program to notify me when a Jow Forums post is made containing certain words/phrases? How would you go about it? Does it already exist somewhere? Not my area but I assume it would be fairly simple?

>use 4chen api to read the posts
>search for given word(s)
>???
>profit

ask Barneyfag lol

>you think they would teach it and INDUSTRY would use it if it was "total poo"
haha yup

void * is perfectly fine and is a usability feature, and conveys a lot more information in the type system itself. If you see char * in some code, your first thought is going to be "string".

It's just such an uncommon use case, and is definitely not making sizeof(void) == 1 for.

>Jow Forums api
>hiroshimoot decides to pull the plug on the API
>your application shits the bed

Why do we have to allocate space in our program's memory for a string to be read in or written out?
Why not just have every function for reading a string return a const pointer to the input buffer, and have every function for writing a string return a mutable pointer to the output buffer?

How effective is following a tutorial, then building the same thing on your own as a learning method?

Attached: 34306564_2070760463211504_5931417833698230272_n.png (299x265, 144K)

I went on reddit to see where can I start and the only resource I see is that Bob Taber one from the microsoft website which is 5 episodes in doing "hello world" .. How did you learn it user?

You can call a function with void. You can't with Void. void is habited, Void isn't.

>parsing content from html
>hiroshimoot changing the html structure
>your application shits the bed
Your point being?

Java is sure is working hard on adding new bloat recently

That's a complete non-argument from any perceptive.
It doesn't matter what you're actually using, but if you're relying some somebody else to provide something, they could remove or change it at any time.

>how effective is learning as a learning method
Have you ever had a job before?
Played a sport?
Been in a classroom
watched a demonstration?

>Jow Forums
>hiroshimoot decides to pull the plug on the Jow Forums
>yuor stomach hurt now

It all depends, neither is better than the other as they both have strengths and weaknesses.

Nobody bothers to change HTML, it's tedious and it's much easier to just nuke the API. My bullshit scraper I wrote back in 2012 still downloads images parsing 4chin's HTML. So logically you can say that the internal structure didn't really change for the past 6 fucking years.

I disagree, if you're using void* for generic code (e.g. qsort) you're going to need to perform arithmetic on it fairly frequently.

Thanks

See
--
Np, m8.

It does matter, raw parsing takes more time, but it's much more stable in the long run, if you want something quick and easy, go with the API.

What on earth as you basing that on?

Shit nigger, read the fucking posts.

raw parsing is just as stable as the API. Jow Forums could change its layout/name of the divs/structur eof the dom

HTML didn't change in the last 6 years.

Docs, github projects, videos talking about new features and C# in depth/a nutshell book. It is very fun to write and its simple design will help you out. e.g: you want to do some networking, you search for System.Net you get the name of the class that will help you out e.g HttpClient and then you search for its (proper) usage. The class names are not half assed unreadable shortcuts so you can sometimes guess them out like File and Directory from. obviously System.IO
I came from C background so interop and reflection were really fun to learn but it might be difficult for others. You don't have to swallow it all at once but my advice is to take a peek at language features and how they mix with .net library

Alice is a pretty name that should have been used for a better language

You seem to be misunderstanding something.
School's don't care if what they teach you is useful, only if they can get money to teach you it. As they should.

1. have connections
2. use connections to network
3. maybe someone will hire you
4. dont be a fucking sperg

>you think they would teach it and INDUSTRY would use it if it was "total poo"

Attached: 1524526956913.png (645x773, 107K)

Can you elaborate on these points, providing specific examples?

>Microsoft rewrites everything in JavaScript when c++ never been better

The fuck is happening, I'm scared my dudes

JS is really well designed but autists are too insecure to admit it because that would means programming is no longer their sekrit club.