/dpt/ Daily Programming Thread

Cash money edition

Old thread:

Attached: 1*lOEJf3tEoWCHYoWEg69A7g.jpg (1600x1832, 165K)

Other urls found in this thread:

itunes.apple.com/us/app/ohayou-beginners-japanese/id1279919582?ls=1&mt=8
github.com/ErisBlastar/cplusequality
github.com/gcc-mirror/gcc/blob/master/gcc/ree.c
www-users.cs.york.ac.uk/~mjf/simple_cpu/index.html
twitter.com/AnonBabble

>posting projections
>for a year that passed
?

how close did these match actual averages?


first for LISP

>deploy app to Android
>little processing time
>quickly on the store
>deploy app to Apple
>nope, you're not allowed to build yet cause Xcode isnt the latest version
>Nope, you cant download this version of xcode unless you get latest OS update due to compatibility
>spend an hour doing both
>now you have to sign your app again to attempt to build it
>oops, your test device isn't updated to the latest compatible version

Every fucking month with this shit. I fucking hate apple

Attached: 1522491828097.jpg (300x222, 12K)

Is it possible to be too much of a brainlet to successfully code? I can see the possibilities with everything, but it's intimidating as shit and hard for me to get the more abstract concepts.

Go be a career mcdonalds employee. I hear they dont have to use their brain at all.

dude javascript webdev lmao

Hey /dpt/ I made this neat little bash script. I want to upload it to github but I'm concerned about something. My code literally curl the entire stats from marketwatch.com since it doesn't come with any api. Is it illegal to parse and display data from a proprietary website like this one and then publish the program under a GPL license on github?

Attached: 2018-04-26-221421_1920x1200_scrot.png (1920x1200, 131K)

I finished my CLI program yesterday, but user interaction is a complete nightmare. It takes too many keystrokes to perform basic tasks. It worked out perfectly in my head, but doesn't work in practice. Great...
Luckily tomorrow is a national holiday. This gives me time to start off from scrap. This time I'll be making a TUI program. That should make it much easier to interact with. At the cost of program complexity though.
The program is a simple RSS/Atom reader. You feed it an URL and it prints the entries in the feed. You can either copy the URL of the entry to the clipboard or open the URL of the entry in the browser.

Attached: Chun-Li-Cosplay-Musular-Thighs-02.jpg (1776x2048, 241K)

Go sell in on the deepwebs. You'll make lots of bitcoin

>Copyright © 2018 MarketWatch, Inc. All rights reserved.
Yes, though I doubt they'll DMCA your ass.

I mean, it would just be a .sh script uploaded on github for learning purpose. What do I risk?

Worst case, they'll send you a request to take down the script or they do it themselves. Go for it and make it a GitHub gist.

thanks, will do :o)

post the app

itunes.apple.com/us/app/ohayou-beginners-japanese/id1279919582?ls=1&mt=8

it's on android too

What was that one site that compared a fuckton of different web frameworks

Nevermind, found it

where's the stats on how many people work the jobs?

I impregnated my gf and now need to pay child support.

Can programming afford this.

I looked online for compile-time calculated fizzbuzzes and they all seem convoluted, so I made one that is simple and not convoluted:

#include

template
static void fizzbuzz()
{
fizzbuzz();

if (n % 3 == 0 && n % 5 == 0) {
printf("FizzBuzz\n");
return;
}

if (n % 3 == 0) {
printf("Fizz\n");
return;
}
if (n % 5 == 0) {
printf("Buzz\n");
return;
}

printf("%lu\n", n);
}

template
void fizzbuzz()
{
}

int main()
{
fizzbuzz();
return 0;
}

I've spent 4 months learning Assembly, and I've had a thought "why?"

Answer me straight Jow Forums, did I waste 4 months and should I waste more time? I feel like unless I'm making a key fob for a car or fridge firmware or embedded systems it's useless. Does Assembly have any merits? I could just refine my C skills

Less competition for us is good. So yea don't learn it. Do metal working

If you find enjoyment in it, it is not any more useless than listening to music or playing games.
There is a very low chance that you will ever get to write assembly though, so from a job hunting perspective, it is a waste.

dude just use constexpr

This is what I mean. No one has time for hobbies like this. My time should be used to learn meaningful skills that will better society and also make me money.

From a job perspective it's almost useless and I think I regret wasting the time on it. Like my friend who spent a year learning Brainfuck for no reason. Or video games

I think the constexpr versions look more convoluted.

>using java

found your problem

>293.4 MB for an app

is this normal? why is it so big?

is it because of the assets?

Attached: 1523722388712.png (1726x1238, 3.76M)

>Java
>have a Thread.sleep for about 1500 milliseconds each time in a while true loop in several threads
>processor use is at 100%

What am I doing wrong?

Attached: 1488944302180.jpg (902x762, 195K)

Assets and unity overhead

you know what they say

Attached: image.png (1200x630, 105K)

Possibly the garbage collector. Post code.

Anyone here read Structure and Interpretation of Computer Programs?

Was it worth the read or is it just some bullshit hyped up by a cult of advocates?

Attached: woman_window.jpg (1024x678, 106K)

is the woman looking at the camera or is it her back?

you made this app with unity?

nice. does it show the splash screen with the unity logo before the app starts or something?

Not at all. I have the pro version.

It's a while true loop which reads data from a text file created by a C++ program which is called before the while true loop is started.
The while true loop is paused for 1500 milliseconds each time.

I found no better way to fetch data between a C++ and Java app in real time. Is there a less shitty way?

>child support
Did your gf break up with you? Because you don't pay into the child support system if you're living with your kid. And yeah, a programming job can afford the costs of raising children.

>I found no better way to fetch data between a C++ and Java app in real time. Is there a less shitty way?
Is the C++ running on-demand or is it an always-on background thread miner?

If on-demand use JNI.
If it's always-on, look up the different Inter-process communication methods. Sockets if you have to, but I think Java has a better Message Service.

Anyway, how do you "pause for 1500 milliseconds." A proper system timer would be better, but you can also use Thread.sleep

there's no way you could have made that app alone.

you on a team?

How long should it take before the basics get into my head? Primarily working with Java now. Also, what are good programming books to read?

Is C++ recommended to someone who is new to programming but wants to take it seriously as a possible career? I heard that learning an easier language like Python can give new programmers bad habits.

Yes it was made with a team. I did all the coding, however.

No, C++ is an overly complex and poorly designed language. Begin with C if you're interested in more low level stuff, otherwise anything else.

ignore this faggot c++ is fine. Its what I learned and its why I make 100K a year.

It's always on, but it seems as though writing and reading from a text file in real time is easier than having to use sockets.
It could also be becuase there are several threads which do this at the same time, even though this number can be reduced to one.

If you've never written a compiler, you're not a real programmer.

Attached: 1520239884813.jpg (1232x1040, 183K)

Can you write programs in awk?

If your programming role doesn't require a PhD and maths, you're not a real programmer.
>tfw all the algorithms jobs require a PhD of some kind as well as programming experience

Of course.
>the language is Turing-complete, and even the early Bell Labs users of AWK often wrote well-structured large AWK programs

>AWK - the (very old) original from AT&T
>NAWK - A newer, improved version from AT&T
>GAWK - The Free Software foundation's version

Terry, Linus and RMS are my idols.

>not including Bellard

>Fabrice Bellard is a computer programmer who is best known as the creator of the FFmpeg and QEMU software projects.
>He has also developed a number of other programs, including the Tiny C Compiler.

>Does Assembly have any merits?
If you're on the bleeding edge, it can be useful. Things like debugging and security are heavily reliant on assembly. For most users you'll never need it because other people put in the work and you can call higher level functions to do it. But its extremely useful to know anyways.

Its useful for those times that you need to consider the architecture of the system or how to speed things up, because the C compiler, as great as it is, can be really shitty sometimes.

Otherwise its just a great hobby to have, because understanding the underlying system execution is rad.

its still worth it to learn it though, and to understand it, because then you can apply the concepts you learned from the absence of abstraction and apply it to hll's like C/C++.

Not if you stick with it and dedicate/sacrifice your time accordingly. Look for practical solutions to practical problems instead of overwhelming yourself with theory that you will most likely never put to use.

This happens a lot more when you're jumping in too deep too fast.

Start with the basics and slowly move up. Just learn how simple things like types and loops work, learn basic structures etc. Once you understand these things, more complex things just make a lot more sense.

don't bite of more than you can chew and just slowly learn what you can. It only seems complex because you're skipping steps.

Just fucking do it. So many people are trying to decide if they can handle *insert task here* without putting forth the effort to see for themselves. There is no quick reference for what you're capable of; you need to figure that out for yourself.

I had to do this by hand for my programming language class.

It was pretty fun actually, but useless in the long run because the use case was too specific for basically anything.

Made some more progress. Now it displays a comfy ascii chart of the year using gnuplot. Gonna hit the bed, 1 am here, good night anons and happy coding good luck!

Attached: 2018-04-27-003357_1024x600_scrot.png (1024x600, 19K)

subtle jawline implies facing away from window and towards camera.

Rad, any recommendations on where to start or any literature to start with?

go to library or google. and just start learning

Don't bother with C++ anymore. C++ is being succeeded by C+= soon so you might as well dive into that instead.
github.com/ErisBlastar/cplusequality

>ree.c
what did they mean by this???

github.com/gcc-mirror/gcc/blob/master/gcc/ree.c

>tfw asking other developers at work a lot of questions
>don't want to annoy them
Do you guys get annoyed if noobs ask you lots of questions? I'm trying not to ask questions I can just google but many are based around opinions so it can be hard to know what to do.

>a language for us feminists
ftfy

I think they'll love answering questions because it means they get to share the newest neetest knowledge they have, if they're a snarky cunt though they may act like an asshole, just try either way.

I did but I had to use toola for parsing because parsing is another beast itself.

How does a license work if you use differently licensed modules? Should I just use a more permissive license to avoid issues?

I meant tools

Alright thanks user. I just don't want to piss off my coworkers. They mostly don't seem to mind helping.

>C++
>+ is just x turned on it's side
>C xx
C++ is the language for feminists.

>they don't mind helping
then you're in good company.

I like it

Solid enough advice, thanks

Celebrating the finalization of my exams by learining how to program my TI-84 and writing a simple invaders game.

C++ is also paradigmfluid and goes into excruciating detail about its problems all the while not telling you what's really wrong.

I'm an EE and I know how to program but I don't know shit about how the internals of a processor work. How the transisistors are able to execute those shitty assembly codes?

I've been having C and now Java in college, but i don't know shit, how can i finally learn to program? Also, is there any good game to help me learn and improve?

In general:
permissive + copyleft = copyleft
permissive + proprietary = proprietary
copyleft + proprietary = not allowed

please be bait

it isnt. enlighten me user

Transistors are used to build gates, which are used to build circuits.

yeah i know. that doesn't answer my question though.

A higher level view is the fetch-decode-execute cycle, but it's just a (complex) circuit.

still working on my memory scanner/editor

Attached: varedit.gif (1366x768, 95K)

nice, that is what i was looking for.

www-users.cs.york.ac.uk/~mjf/simple_cpu/index.html

Webgl tower defence/Image glitch user here. Decided to start another project. This one is a 240 RGB led matrix. 20x12 with 2"x2" pixels. So far have 60 soldered together. These WS2812B RGB leds are really cool. My back is killing me from the soldering so far though.

Attached: IMG_20180425_193452.jpg (2592x1944, 1.57M)

>Write C# program
>tons of calculations
>Lots of object creation
>10GB of RAM used
pls help, garbage collection can only do so much once everything is done

kek

>calling System.gc() merely suggests that it does that
Java is for big brains only

Fair enough, bitching about it won't get me anywhere.
I'll try relearning some of the simpler things. For loops are honestly still hard for me to grasp, so I'll revisit that. Are there any recommendations as far as literature goes? I'll be hoping on a plane here soon and want to put the time to use, looking primarily at Java and C, but I hope to move onto C++ and Python once I know what I'm doing.

is the extra $2000 a year worth the linking times though?

>For loops are honestly still hard for me to grasp,
wew
>I hope to move onto Python once I know what I'm doing.
w e w

>Are there any recommendations as far as literature goes
i learned my shit from "jumping into C++"
although desu, the little schemer is one of the best intros to programming there is, even if it is very odd and for a (generally) unused language
also after learning a lisp you fare a decent chance of not wanting to go back to anything else

>for loops are hard for me to grasp
Oh boy are you in for(;;) a ride

For java just watch pajeet vids until you reach classes and then try to code your own snake game.
After that go to oracle website and go through all the basics and get polymorphism down.
Hiding/overriding virtual method invocation and all of that.
Once that's done you have basics down

>For loops are honestly still hard for me to grasp
for (initial_assignment; test; expression) {
whatever();
}
you can put whatever you feel like in them
for (list_node = list; list_node->next != NULL; list_node = list_node->next) {
do_something_to_node(list_node);
}
is equivalent to
list_node = list;
while (list_node->next != NULL) {
do_something_to_node(list_node);
list_node = list_node->next;
}
or
initial_assignment
while (test) {
whatever;
expression;
}