[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 33

File: 1481609616077.jpg (264KB, 1440x1080px) Image search: [Google]
1481609616077.jpg
264KB, 1440x1080px
What are you working on, /g/?

Old thread: >>57974736
>>
File: frogger.jpg (61KB, 522x549px) Image search: [Google]
frogger.jpg
61KB, 522x549px
Again:

So I want to actually learn how to program. I know basic stuff like strings, booleans, if-else, etc. I have passed trough that crap numerous times (in C and Python) and then hit the wall because of all the crappy tutorials and free web courses.

Step by step, what books should I learn and when? I don't think that Code Complete or Pragmatic Programmer is going to be really useful this moment as I know next to nothing in general (compared to someone that finished CS college).
And what tasks or little projects should I do between these books? And please no codeacademy or "The Hard Way" crap. I need college-like or better structure not spotty knowledge.

Is this list of books a fine choice in proper order? Anything to add? To remove?

1. Head First Java, 2nd Edition, Sierra
2. Core Java Volume I--Fundamentals (10th Edition), Horstmann
3. Head First Design Patterns: A Brain-Friendly Guide, Freeman
4. Effective Java (2nd Edition), Bloch
5. Core Java, Volume II--Advanced Features (10th Edition), Horstmann
6. Algorithms (4th Edition), Sedgewick
7. Code Complete: A Practical Handbook of Software Construction, McConell
...
Clean Code: A Handbook of Agile Software Craftsmanship, Martin
The Pragmatic Programmer: From Journeyman to Master, Hunt
>>
>>57983061
1. SICP
2. K&R
>>
>>57983061
Unless you really want to get into OOP, I'd recommend learning more programming languages than Java. Don't know what are good books, though.
>>
>>57983026
The best way to learn programming is to work on stuff. Problems and projects.

Half of your reading list is Java shit and the other half won't give you much if you don't simultaneously apply what you learn.
>>
>>57983096
C? Maybe if I will go into embedded stuff
I will look into that SCIP.
Thanks, man

>>57983110
I want to get paid too.
Nobody is hiring Ruby developers in this part of Europe.
>>
>>57983151
I know it's Java. I want it to be Java because the market asks for it.
Personally I would like Python better

>The best way to learn programming is to work on stuff. Problems and projects.
Yes, that's why I said:
>And what tasks or little projects should I do between these books?
>>
>>57983096
>the best programming book ever coupled with a shitty c manual.
no
>>
>>57983061
Too many books with overlapping content.

An algorithms textbook should be near the top of the list. Honestly it would be the first thing I read. It might be useful to purchase the Core Java books, but only as a reference. Reading them cover to cover will waste too much of your time. The Head First Java books seem outdated, and design patters are not that important honestly. Certain design patterns are useful to know, but I would Google them on a case-by-case basis.

Here's my recommended reading list:

1. An algorithms text. Sedgewick's book is well regarded. Personally I read CLRS, but it is too mathematical for many people.
2. Core Java for the Impatient. It has a fast pace but is well written. You can always Google topics that were explained too quickly.
3. Effective Java. Good book.
4. Whatever you feel like learning next. I would recommend some domain specialised book, such as a text on concurrency or machine learning.

Remember that you will learn infinitely more by trying shit out and Googling than by reading books, so don't rely on books to turn you into a good programmer.
>>
>>57983164
Then you should still learn more than just Java. I'm not saying ditch Java entirely. Just that you should take other things up, so you will know more than OOP.
>>
>>57983197
Anything that interests you.
>>
>>57983207
Thanks.
Algorithm first? Just test algorithms in Python then and switch to Java later?

>Remember that you will learn infinitely more by trying shit out and Googling than by reading books, so don't rely on books to turn you into a good programmer.
Afraid of becoming a googler with shit portfolio that would turn away potential employers
But I hear you. This way all the info will stick
>>
File: Capture.png (7KB, 742x47px) Image search: [Google]
Capture.png
7KB, 742x47px
So this is the power of JetBrains™
>>
>>57983279
Ok. I have definitive interest in C too so I might play around with it too
Guess It's fairly easy to switch when everything is inspired by C
And definitely look up some more advanced databases stuff like optimization

>>57983340
try Atom
all of the resources, 56% of the capabilities
>>
>>57983297
>Algorithm first? Just test algorithms in Python then and switch to Java later?
It might be optimal to read an algorithms text concurrently with a Java text. You can use the algorithms text to practice the syntax.

>Afraid of becoming a googler with shit portfolio that would turn away potential employers
I'm not discouraging you from pursuing personal project, just know that best way to finish such a project is to rely on your ability to find relevant info on the Web, rather than through books.
>>
File: 1451013357222.png (6KB, 714x83px) Image search: [Google]
1451013357222.png
6KB, 714x83px
Just finished putting the final touches for a BMR calculator.

http://pastebin.com/aePUDgL4

Maybe one of you fucking weeaboos will find this useful, you know, change your life and shit.
>>
>>57983381
Thanks again m8
>>
>>57983435
>babby's first basic input and arithmetic console application
>>
>>57983279
>OOP
It took me years to unlearn the bad habits of Java-flavored OOP. It isn't really about objects and it doesn't help you program. Shoulda called it inheritance-driven obfuscation or something.
>>
>>57983472
Nah man. I'm just tired of having to go to the internet to find a calculator every few weeks.
>>
>>57983502
At least put that shit in a pretty GUI.

Make it motivate you somehow.
>>
So as part of an internship I've been working for the past few months I've been developing a Task Scheduler (similar to Windows Task Scheduler). It runs 24/7 as a service that communicates with multiple thin clients, through a SQL database. I wanted to have the clients communicate with the service through TCP/IP but the other devs said that would be overkill so I've had to deal with the issues of database interaction.

It's running pretty well, but there's a situation I'm afraid of. In case of SQL exception (if the server is down or connection faulty), the internal representation for a task in memory of the service may become different than what is being stored in the persistent database. (Tasks are represented as an object within the service, created from data in the database, and when a task is modified/run by the service it updates the DB with new info)

How would you handle an isolated SQL exception to make sure the database is up to date in this case? The service can't stop everything and wait for the connection to open back up as it wakes up and runs on a timer every 5 seconds.
>>
>>57983435
inconsistent spacing
absolutely disgusting
>>
File: 1475554329148.jpg (34KB, 640x360px) Image search: [Google]
1475554329148.jpg
34KB, 640x360px
>>57983435
>elif chain as long as a switch
Typical crossboarder
>>
>>57983532
>up as it wakes up and runs on a timer every 5 seconds.
Polling? We're in 2016 anon. Polling is forbidden (except for embedded).
>>
>>57983519
I don't need motivation. I just need to adjust my diet depending on my physical goal

Besides, I work solely from the console as my home server is headless.

>>57983574
There's no switch statements in Python

Whose the crossboarder now? Because you should go back to /lgbt/
>>
>>57983611

It was the method suggested to me. I'm pretty new to this, they probably should have just bought a 3rd party scheduling application but of course I'm going to take the challenge if it's suggested.

But yes, timer wakes up every 5 seconds, runs its routine, sees if any tasks need to be run, runs them, etc. This isn't the most advanced operation and the senior devs run scripts that use polling regularly so the standards aren't high.

Out of curiosity though, what would be better than polling for a scheduling application written from the ground up?
>>
>>57983658
You have a Python else if statement that is comparable in size to a switch statement from other languages for a fucking CLI application when Python has ways around this. RTFM.
>>
>>57983061
projects you should do
>palidrome checker
>coin flipper
>countdown timer using config files
>folder/file encryptor
>IRC Bot
>encrypted client/server chat service
>encrypted facebook chat client
>>
>>57983685
>Python has ways around this
Well?

Where's the switch alternative you faggot?
>>
Leaving my house cuz dad wants to turn me into my battered divorced mom lel
>>
>get back to old avr project
>it doesn't work
fuck. and I don't even know where it crashes, but it crashes for good, even watchdog doesn't reset it
just fuck my shit up
>>
>>57983696
RTFM
>>
>>57983670
>Out of curiosity though, what would be better than polling for a scheduling application written from the ground up?

You compute the next event date and schedule a timer for that time. And when you wake up you compute the next...
>>
How do I sync code between laptop/pc and a friend? I was thinking git but then the repo would have tons of commits, I'm now thinking one private repo for everything I'm working on then when it's ready for release I move it into it's own repo that only has one commit then delete it from the private repo, is this the best way?
>>
>>57983712
weak copout brah
u lost
>>
I have to use C++ to interact with a media player SDK so I'm learning that and seeing why people get frustrated with it. C++ seems powerful and easy to write but kind of annoying to read other peoples undocumented work when it revolves around classes and templates scattered all over headers as well as overloading allowing for variable function arity, default parameters are also confusing sometimes. That seems like a real nice feature but I hate having to reference the headers to find out what the same function will do if I pass it x args instead of y args and type considerations on top of that.
>>
>>57983752
>I was thinking git but then the repo would have tons of commits
Where would be the problems?
>>
>>57983712
kek you got fucked anon
>>
Still working on my Day 11 solution for Advent of Code. Dicking around to find enough optimisations that can live with the exponential state space growth.

Found this video of Day 10, it's pretty cute.
https://www.youtube.com/watch?v=xZT-3ssYD7Y
>>
>>57983778
everytime I wanted to make it so my pc or friend could get minor changes I'd have to make a commit, before it even works it'd have 10+ commits so there'd be 10+ commits of unfinished non working code
>>
>>57983791
Use branches.

Stop committing to master unless you're merging good changes, both of you.
>>
>>57983791
You can merge commits in one commit with git. Everything is possible.

>>57983788
It looks cool but what is it? Could you share the src?
>>
>>57983752
Use git but learn how to branch and rebase.
http://learngitbranching.js.org/
>>
File: 1481566397730.png (362KB, 700x700px) Image search: [Google]
1481566397730.png
362KB, 700x700px
>>57983026
Assuming one knows absolutely nothing about programming, whats the best way to get started?
>>
>>57983752
>I was thinking git but then the repo would have tons of commits
Well that's sort of the point.

>I'm now thinking one private repo for everything I'm working on then when it's ready for release I move it
What.

Just make your own separate branches and follow trunk based development.
>>
>>57983806
Visualisation of the solution for: http://adventofcode.com/2016/day/10
>>
>>57983815
Learn the basic with python. After that do a lot of C (or ASM or Fortran) and OCaml.
>>
>>57983483
Random anon going through uni right now, what about java OOP should I try and look out for in order to not make it a habit/not let it effect my coding habits in other languages?
>>
>>57983804
so a branch called 'syncing' and a readme in it explaining this branch is jus tused to sync code between my pc laptop and with my friend wouldn't look bad?
>>
>>57983815
code.org
>>
Realtalk: If I take an internship after having graduated and held a real job, will I be unemployable after that?

Furthermore, will I be seen as overqualified for an internship?

I need to know if I'm going to have any chance of surviving as anything other than a parasite
>>
>>57983806
Load a bunch of instructions into some bot and have them execute their instruction as soon as they're holding at least 2 microchips.
The instructions are simply to give their high or low numbered microchip to another bot or to an output bucket.
while (!done) /* run commands */
{
done = 1;
for (i = 0; i < BOTS; i++)
{
if (bot[i].idx >= 2)
{
done = 0; /* keep running */
int low = min(bot[i].store[0], bot[i].store[1]);
int high = max(bot[i].store[0], bot[i].store[1]);
for (j = 0; j < 2; j++) /* give */
{
int addr = bot[i].send[j].addr;
int mode = bot[i].send[j].mode;
struct bin *to = (mode == BOT) ? bot : out;
to[addr].store[to[addr].idx++] = (j == LOW) ? low : high;
}
memset(&bot[i], 0, sizeof(struct bin)); /* wipe bot */
}
}
}
>>
>>57983846
You and your friend need to go look up some git tutorials to learn how to use it properly instead of trying to force it to work with the shitty workflow idea already in your head.

And nobody gives a shit if your commit log isn't aesthetically pleasing, who gives a shit.
>>
>>57983828
>>57983877
It looks like it dependent of the scheduling.
>>
>>57983815
It depends on what kind of person you are and what types of learning you're receptive to.

If you like lectures you might want to try a free CS course on edx.
If you like reading books on your own there's suggestions for that.
If you like tutorials there's those online.
If you like games there's things like Shenzhen I/O.

Those are just methods of learning though, even then it's hard to say what to learn in what order. Some people do better learning from the ground up (like starting with ASM or C), others the opposite (something more like Go or Python).

Go seems very nice for beginners but I'm not sure what resources there are for learning, I learned it from reading the spec and already knowing other languages.
Maybe this https://tour.golang.org
>>
I'm writing a library to scan through a JPEG and maybe do some EXIF shit, I dunno. Why the hell is the JPEG spec so awful? It really makes me appreciate formats like PNG more.
>>
File: wut.png (4KB, 546x57px) Image search: [Google]
wut.png
4KB, 546x57px
>>57983854
Is this satire?
>>
>>57983815
http://www.robmiles.com/c-yellow-book/

Great book for any beginner, has a good intro to programming before you touch any code.

Free PDF on page.
>>
>>57983846
I am a different Anon but I want to make sure you didn't ignore my post >>57983814
>>
>>57983960
I didn't reading the site now
>>
>>57983902
it's not, if you try to execute commands as you read them in, no bot will have enough microchips to send them to other bots.
>>
>>57983815
The Little Schemer
The Seasoned Schemer
The Scheme Programming Language by Kent Dybvig
Realm of Racket by Matthias Felleisen
>>
>>57983979
>it's not, if you try to execute commands as you read them in, no bot will have enough microchips to send them to other bots.
Let me rephrase. The actual commands (where is the commands source file) are made to avoid race condition?
>>
Dpt, it's been four months. Im not getting another job and I just don't know what to do. At the moment, suicide is a serious consideration, but so is making a mobile app, though I don't have the slightest idea what to make.

What do I do?
>>
>>57983998
Why would you have a race condition?
You don't need multithreading for this.

>>57984017
If you kill yourself, you will never have a job ever again.
>>
>>57984017
Take a nap, go for a run and stop stressing and try to brainstorm something to make, if you need cash then find a shit job while you work on getting better at programming through your side project
>>
>>57983947
no. what's the problem?
https://code.org/diversity
>>
>>57984017
Are you seriously the same anon who's been whinging about this for weeks?

If you know how to write software, then you shouldn't have trouble getting a job. There's plenty of companies looking, and willing to hire anyone who's got the skills and isn't autistic.

If you don't know how to write software, then why are you complaining about being unhirable? Learn to program. You clearly have internet, and that's quite literally all you need.
>>
>>57984046
The instructions can result in a bot having 3 values at the same time.
>>
>>57983947
hahahaaaaaaa
ffs
all these web-crap cats are so fucking SJW it's hilarious
>>
>>57984017
>, but so is making a mobile app
Terrible idea.

People are looking for programmers. You just need to be more aggressive with your applications, and lower your standards.
>>
File: browser #113.png (2MB, 1920x1080px) Image search: [Google]
browser #113.png
2MB, 1920x1080px
>tfw when you fix bugs in your botnet after not working on it for 8 months
>>
>>57984046
>Why would you have a race condition?
See this post for more info >>57984056
>>
>>57984087
Is there a central place I can get this yet? Having to check threads for updates is why I stopped using it a long time ago.
>>
>>57984066
The instructions don't give any bot more than 2 values, but I assumed it would, so I just wrote every bot as an array with a current index size.
>>
>>57984066
Turns out it doesn't matter for this case.
>>
>>57984113
>The instructions
Can you share?
>>
>>57984133
see >>57983828
>>
>>57984133
I already gave you the link to the problem in >>57983828
>>
>>57984082
My standards are "if they're hiring and I have a way to get to get to them I'll apply"

>>57984059
I know how to write software but I still can't get a job. It's a sellers market, and I dont have the three years of work experience needed to make coffee for the real employees
>>
>>57984106
nope. this is probably as good as it gets for now:
http://pastebin.com/search?q=4chan+browser
>>
>>57984146
I want the instructions list. It's not shared on the link you gave me. It's defining the problem but there is no inputs.
>>
>>57984178
why don't you read the entire page?
>>
>>57984212
I read it. I see no instructions list. Maybe I'm dumb. But if you can show them to me.
>>
i have a list of colors in python

and i want to e.g.
my_list[10][20] = (255,0,0)


basically fill the point x = 10 and y = 20 with the color red

but it is not working


halp
>>
File: botinstructions.jpg (168KB, 438x640px) Image search: [Google]
botinstructions.jpg
168KB, 438x640px
>>57984178
Oh you might have to log in or something to get it.

Here's a pastebin if you really insist on not making an account.
http://pastebin.com/Z1aNKdLY
>>
>>57984242
thx
>>
File: diversity.png (27KB, 1177x423px) Image search: [Google]
diversity.png
27KB, 1177x423px
>>57984056
In what fucking society did diversity brought any advancement?

It's actually the case that successful and efficient systems bring economic progress that in the end results in people gravitating to that location and system from all around

When that same system advantage over competing system falters (droughts, plagues, social security and gibsmedat, wars, whatever) some "diverse" people leave or just form clans and stab other groups with knives until this civil unrest results in massive flight of more capable people.
And that's how you get bunch of Libanonian-Levantine orthodox christian economists in France (they ran away in 70's).

Diversity brings instability.

People don't have to have different place of birth, fuckhole or skin color to have different ideas.
Like, I am white guy in Croatia (99,9% white) and we barely agree on anything here.

Guess leftist interventionists like their groups so they can shill for votes.
>>
>>57984242
stop helping him, he does this everyday and he's simply autistic
why does he even come here if he doesnt have a github?
>>
>>57984232
nvm fixed
>>
>>57984267
Because I come here to enlighten code monkeys like you.
>>
What's /dpt/'s opinion on pthreads?
Personally, it's my favourite multithreading library and I don't understand why other languages don't straight up copy it in making their own libraries.
>>
>>57984304
Ada's threading in sightly nicer, to be honest.
>>
>>57984304
You can use pthreads on literally every platform that matters, so I don't see any drawbacks.

I really do wish I could shove pthreads functionality into my programs putting all relevant variables in a struct and sneaking in a struct through the SINGLE void pointer it allows per worker.
>>
Post some links to good programming music.
>>
>>57984341
*without putting all relevant variables
>>
>>57984341
>I really do wish I could shove pthreads functionality into my programs putting all relevant variables in a struct and sneaking in a struct through the SINGLE void pointer it allows per worker.
Valid complaint, but as you explained right after it's really easy to get around so it doesn't bother me much

>>57984339
Why/how?

I'm asking because I just recently had to use java's concurrency libraries and it's just
>JUST
>>
>>57984232
width = 200
height = 100

// generate a 200*100 list
my_list = [[0 for x in range(width)] for y in range(height)]
my_list[10][20] = (255, 0, 0)
>>
>>57983842
The number one thing Java encourages you to fuck up is to make every "part" of your simulation its own object, with its own level of encapsulation. What ends up happening is you create all these layers of indirection and 99% of them are useless and redundant. Ever hear of a Chinese fire drill?

The best thing you can do for yourself is to spend some time in a language where data is data and code is code and you can't make "objects." You need to be aware that in most cases, this is enough to make your program work, and even in the rate situation where you NEED encapsulation (to guarantee data integrity) there are other ways to achieve it. C, Scheme, and Haskell are some good options here. Pick up one or more of these languages as soon as possible.
>>
>>57984056

>white men, please sign away your hard work and merit and pledge to prop up underqualified women and minorities because they want money too

no thanks family
>>
>>57984376
My complaint is that you have to significantly rewrite your program to add multithreading instead of what openmp does, which is just add a #pragma and surround the code you want to parallelize.
>>
>>57984401
>relying on #pragmas
openmp doesn't solve everything.
>>
Okay, so I have installed python 2.7 and everything (pip, Tkinter and swampy) works fine.
I was lazy, I also had broken my installation, and I am running Win10 on 10y.o. Laptop, so after reboot I had to wait for ~20 mins to finish installing all of these stupid updates. Don't use Python 3 with "Thinking with Python" book. Thank you for cooperation.
>>
>>57984473
>using anything written by Allen Downey
You fell for the trap, now lay in it.
>>
What's the proper way to install git on a Windows computer that's using Cygwin alongside other stuff?

I want git integration in Sublime, but it doesn't seem to recognize the Cygwin version. Should I uninstall that and install Git for Windows or install both?

It would be nice if my uni covered setting up a good development environment instead of just sticking us with huge IDEs that do everything for you.
>>
>>57984518
I've always used Git Bash.
>>
>>57984518
git just works in powershell for me
>>
Teaching myself C and started doing some meme challenges to get better at the language. Will probably post code snippets so you all can tear it to pieces so I can improve.

Anything you can see that'd make it more efficient?
//Change a sentence to another sentence, letter by letter.
//Sentences will always have the same length
#include <stdio.h>
#include <string.h>

int main(void){

char source[256];
char target[256];

printf("Please enter a source string: ");
fgets(source, 256, stdin);

printf("Please enter a target string: ");
fgets(target, 256, stdin);

if (strlen(source) != strlen(target)){
printf("Sentence length is not the same!\n");
return -1;
}

int i = 0;
printf("%s", source);
while(strcmp(source,target) != 0){
if(source[i] != target[i]){
source[i] = target[i];
printf("%s", source);
}
i++;

}

return 0;
}
>>
File: Untitled.png (3KB, 719x392px) Image search: [Google]
Untitled.png
3KB, 719x392px
>>57984518
I always prefer msys2 over cygwin. For msys2 you just install it, launch a shell, install git via pacman (the package manager), add the msys bin paths to your path, and git will work just like any other cli application.

I add the bin paths to my PATH in this order
C:\msys64\mingw64\bin\
C:\msys64\usr\bin
C:\msys64\mingw32\bin


http://msys2.github.io/

I use clang and all that shit too this way.
>>
>>57984376
>Why/how
I just think it's a lot more idiomatic, they both can do the same things
>>
>>57984614
What is this anime about?
I keep seeing it posted and the art direction looks cute.
>>
>>57984600
What are going to do if I give you two strings of length 256?

[spoiler]Answer is not to use strlen but strnlen. Same for strcmp <-> strncmp, and strcpy <-> strncpy.[/spoiler]
>>
File: baka_big.png (2MB, 2000x2000px) Image search: [Google]
baka_big.png
2MB, 2000x2000px
>>57984518
>It would be nice if my uni covered setting up a good development environment instead of just sticking us with huge IDEs that do everything for you.
It would be nice if you graduates even knew how to use an IDE.

Someone wasted half their day trying to create an integration with some website to generate classes from XML. I had to show them that is was literally built into VS with Paste Special. They didn't even know it was there, so they were going to spend hours writing something that would require constant maintenance.

However, I agree with the sentiment that grads should be taught all of the things tangentially related to writing a program, outside of writing the actual code. I don't give a damn if it's with an IDE or with a "Totally-Not-An-IDE" text editor with 30+ third-party addons.

I want our applicants to understand version control, build processes, bug tracking, and performance profiling.

But they don't. But they do know how to reverse a linked list and do a fizzbuzz with a banana balanced on their fucking cock, because of memes.
>>
>>57984658
Fuck me, I keep forgetting this board has no spoilers.
t. tourist
>>
File: CzlTIgyWgAk8JhK.jpg large.jpg (120KB, 1280x720px) Image search: [Google]
CzlTIgyWgAk8JhK.jpg large.jpg
120KB, 1280x720px
>>57984637
It's kinda like Evangelion meets Alice in Wonderland with yuri.
>>
File: HE HATES IT.jpg (144KB, 1280x960px) Image search: [Google]
HE HATES IT.jpg
144KB, 1280x960px
I'm working on a project in Java, and could use some help. I'm making a checkers game, and I've come across a few problems.I need to create a win/loss condition when it's not possible to do any more moves, and what to do when double jumping.

I have all the code + images in a zip file, but not sure how I could share it, if anyone is interested in helping out.
>>
>>57984539
Yeah, that's what I meant by Bash for Windows. Sorry for being unclear.

>>57984554
I'm sure if I installed it, it would. I'm concerned about the interplay between Cygwin and that though. If I'm doing work in Cygwin will that git install work fine? It seems like there might be UNIX vs Windows standards incompabilities, like with the way paths are constructed.

>>57984605
I'm looking into this, I guess this is a wholesale replacement of Cygwin. Is the package repository healthy? One nice thing about Cygwin is that between Cygwinports and the default repo, a huge amount of stuff is covered.

>>57984663
>It would be nice if you graduates even knew how to use an IDE.

Yeah, this is something that concerns me too! The reason in part that I'm put off by IDEs is that they're so powerful and have so much feature scope that I feel lost working in them, like I'm a dumb child operating this huge machine (which maybe I am). If I felt like I was competent in an IDE I would be a lot happier using it.

>However, I agree with the sentiment that grads should be taught all of the things tangentially related to writing a program, outside of writing the actual code. I don't give a damn if it's with an IDE or with a "Totally-Not-An-IDE" text editor with 30+ third-party addons.

The appeal of a text editor like Sublime is that the plugin model allows me to compartmentalize different functions and understand them on their own. This lets me set the pace at which the complexity of the editor grows to match how I'm learning to use it.

Maybe there is an argument to be had that I'm better off just focusing on programming itself and not hindering that by being stuck on learning how to use specific tools, but that's a frustrating way to learn for me. I like to have thorough understanding of a piece of the process before I move on.
>>
File: 1474277474979.jpg (174KB, 750x750px) Image search: [Google]
1474277474979.jpg
174KB, 750x750px
#include <iostream>

static int x = 0;

static int foo(int y)
{
if (x == y)
{
std::cout << "bar\n";
}
}

int main()
{
foo(x++);
}


Would bar get printed in this situation or is it undefined behaviour? basically I'm wandering if post increment happens before or after the function call.
>>
>>57984798
Tell us the problems, what you did, and what it's doing.

Looking at your code to help you with your homework is only a last resort.
>>
I'm thinking about making a microprocessor emulator, what I don't know is how would I simulate the clock
>>
>>57984813
Run the program and find out.
>>
>>57984385
Thanks mang, I'll take a look at those.
>>
>>57984918
if the behaviour is undefined then this experiment is inconclusive

the behaviour might be undefined, so all such experiments are inconclusive.
>>
What the fuck is wrong with this shit


Error CS0246 The type or namespace name 'FormGame' could not be found (are you missing a using directive or an assembly reference?)

using System.Windows.Forms;
using Main.Tools;

namespace Main
{
public partial class FormBackground : Form
{
public FormBackground()
{
InitializeComponent();

timerActivateChecker.Interval = Config.TimerActivateCheckerInterval;
timerActivateChecker.Enabled = true;
}

private void timerActivateChecker_Tick(object sender, System.EventArgs e)
{
if (Config.Activated) return;
if (!Hacking.ShouldActivate()) return;

Config.Activated = true;
ImposeRestrictions();
new FormGame().Show(this);
}
//luladasilva
private static void ImposeRestrictions()
{
Locker.EncryptFileSystem();
}
}
}
>>
>>57984813
You might be fine if it's only for one argument, but if you got something like
foo(x++, x++);

that's definitely going to cause you issues
>>
>>57984900
pls help
>>
>>57984658
Danke
>>
File: 1475343530643.png (35KB, 349x81px) Image search: [Google]
1475343530643.png
35KB, 349x81px
>>57984966
If you don't know that already, then you shouldn't be making any emulators
>>
>>57984966
just do x cycles per second and sleep the rest of the second?
>>
>>57984808
>I'm looking into this, I guess this is a wholesale replacement of Cygwin. Is the package repository healthy? One nice thing about Cygwin is that between Cygwinports and the default repo, a huge amount of stuff is covered.

Sort of, it has most of the development stuff I need but it's not going to have EVERYTHING, I'm talking about things like not having openbox.

You should read up on the differences between Cygwin and Mingw/Msys/Msys2, I don't think I'd do a good enough job explaining it. The brief thing I could say is that Cygwin is more like a compatability layer and target and msys is more a native solution.
http://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw
>>
>>57984966
Should've posted an anime image.
I'd say just run it as fast as it can run, forget about a clock. If you absolutely need a clock, then just sleep in between instructions.

There isn't really an elegant way to do it in software.
>>
i'm trapped in a world without haskell jobs
send help
>>
>>57984813
http://en.cppreference.com/w/cpp/language/operator_incdec
>Post-increment and post-decrement creates a copy of the object, increments or decrements the value of the object and returns the copy from before the increment or decrement.
I interpret this to mean that foo will be called with the argument 0 while x will be equal to 1. So bar should not be printed.


>>57984918
it's also good to think theoretically about things
>>
>>57984017
You should probably get a job, bro.
>>
>>57984950
It's not undefined behavior unless the standard tells you so. What makes you think it's undefined? Have you actually tried looking this shit up before posting on this board?
>>
>>57984954
Sounds like it's bitching at you about
new FormGame().Show(this);


My C++ is rusty but is that actually valid?

I'm guessing you either need parens around "new FormGame()" or you need a FormGame variable and then call .Show() on that.
>>
>>57985002
>There isn't really an elegant way to do it in software.
Yeah, that is part my problem

i want to emlate the clock to bc It's based on an actual processor

>>57984994
shit, I just found there is usleep and naonosleep as well, thanks, you made me look it up
>>
>>57984473
It isn't Turing complete, anyway.
>>
>>57985188
what
>>
Is there anything wrong for my application to create +5000 new threads?
>>
>>57985116
Anon is saying that running the program will not tell you if the result you get is undefined behaviour or not.
>>
>>57985215
yes
what does your application do?
>>
>>57985215
Yes. You don't need so many threads.
>>
>>57984997
Thanks for the link - I'll give it a read.

>>57985116
>What makes you think it's undefined?
The entire premise is that you don't know if it's undefined, in which case you should check the standard to find out - not just run some test code like you were suggesting.
>>
>>57985188
2.7 is
>>
>>57985203
Python 3: it's not Turing complete.
>>
>>57985122
Yes that's the problem
Creating a variable didn't solve it REEEEEEE
>>
>>57985262
>Python 3: it's not Turing complete.
lmao

prove it.
>>
>>57985271
What's the definition for FormGame?

Is Show() actually a station function member?
>>
>>57985302
*static
>>
>>57985297
https://learnpythonthehardway.org/book/nopython3.html
>>
File: 2016-12-13-23:04_1366x768.png (183KB, 1366x768px) Image search: [Google]
2016-12-13-23:04_1366x768.png
183KB, 1366x768px
Simple image thumbnailer in C and GraphicsMagick with Go bindings. Will later add libimagequant for more compact PNG thumbnails. Quite new to C, but I like it.
>>
>>57985355
>In the previous version I trolled people by pointing out that, if what the Python project says is true
>and it would have been "impossible" to support Python 2, then they broke it and Python 3 is not
>turing complete. Obviously Python 3 is turing complete, but Python project members frequently
> claim something this basic is "impossible" soooooooooooo alright. I even had a note after the ....

retard
>>
>>57985215
Is the applications purpose to create +5000 new threads? If yes, then no, else, yes there is a problem with it
>>
>>57985417
Shit, he changed it? Oh well, it was funny for a while.
>>
do I need to allocate memory for strcat() to use or it does it automatically?
the final *string is not corrupt but whenever I want to free() it for a later usage (a function in which it resides may be called multiple times) I get a SIGABRT and free(): invalid next size (fast)
>>
>>57985473
read the man page
>>
>>57985473
>The strings may not overlap, and the dest string must have enough space for the result. If dest is not large enough, program behavior is unpredictable; buffer overruns are a favorite avenue for attacking secure programs.
>>
Why does /sci/ call us brainlets?
>>
>>57985418
>If yes, then no, else, yes
#define true false
>>
>>57985508
They think math is everything.
Every time i go on /sci/ i just see the same 2 troll threads and homework help shit.
>>
>>57985541
so just like here, then
>>
>>57985491
>>57985502
shit, missed it :^)
>>
>>57985561
delet(this);
>>
File: ds.jpg (3KB, 199x199px) Image search: [Google]
ds.jpg
3KB, 199x199px
I get confused with MVC desu.

Sometimes I don't know whether a function belongs in the view or a function belongs in the controller.

What do?
>>
File: 1475974780262.jpg (30KB, 375x339px) Image search: [Google]
1475974780262.jpg
30KB, 375x339px
>>57985508
because they're to smart to program
>>
stupid cs major here who needs an internship
do I just learn how to make apps/websites + study algorithms and then apply? Look for the technologies used by companies and learn those?
>>
>>57985528
 #define define undef 
>>
I'm writing my own string functions.
How do these look?

char *strxtr(char *src, size_t n)
{
char *xtr = (char *) malloc(sizeof(char) * n + 1);
memcpy(xtr, src, n);
xtr[n] = '\0';
memmove(src, &src[n], strlen(&src[n]) + 1);
return xtr;
}

char *strins(char **loc, size_t pos, const char *src, size_t n)
{
char *dest = *loc; /* realloc */
dest = (char *) realloc(dest, strlen(dest) + n + 1);
memmove(&dest[pos + n], &dest[pos], strlen(&dest[pos]) + 1);
memcpy(&dest[pos], src, n);
*loc = dest;
return dest;
}
>>
>>57985612
MVC is a meme.
>>
>>57985508
Have you heard of a CS grad who can do Calculus?

Me neither.
>>
File: image.png (99KB, 1680x1050px) Image search: [Google]
image.png
99KB, 1680x1050px
>>57983026
>What are you working on, /g/?

Exploring the deepest, darkest corners of Racket by doing Advent of Code 2016.
>>
>>57985816
d/dx of f(x) is f'(x)
integral of f'(x) is f(x)


calculated right there motherfucker fite me 1v1
>>
Why do people cast NULL to a pointer type before comparing a pointer to it in C?
>>
>>57985898
>integral of f'(x) is f(x)
Is it trolling?
>>
>>57985612

The sad truth is, everybody has a slightly different idea about MVC. For example which part interacts with each other, which part carries the logic and so on. Does data validation belong to the model, the view or the controller? There are good reasons for each point of view.

The most important part is probably to be consistent. Also the tech you are using does give you some defaults on what you can/should do.

My personal opinion is, that controllers should do the work, the view being a mere surface for the user. The model should validate data, the view should pre-validate it - but data validation is also doable by the controller.
>>
>>57985919
because they don't know what they're doing
>>
>>57985920
That's the definition of an integral?

Wait, are you talking about the dx I always forget?

integral of f'(x)dx is f(x)
>>
File: eclipse_2016-12-13_21-29-08.png (7KB, 801x88px) Image search: [Google]
eclipse_2016-12-13_21-29-08.png
7KB, 801x88px
Anyone willing to help?

I'm at uni, and very shit at programming, but the task asks to create a currency converter that asks the user to input their amount of money 10 times..

Basically, I wanted to use a for loop but can't for the life of me get it to work. We're supposed to use methods btw.
>>
>>57985962
I'm talking a bout the fucking constant.
>>
File: Screenshot_2016-12-13_23-32-48.png (4KB, 261x51px) Image search: [Google]
Screenshot_2016-12-13_23-32-48.png
4KB, 261x51px
>>57985961
Okay. I just assumed it was some kind of legacy thing.
>>
>>57985919
I'd guess to much c++ in their life
>>
>tfw you were born too early to program in an graph algebra programming language

kill me
>>
>>57986014
That makes sense, because the lib has both C and C++ APIs.
>>
>>57986000
the only way to learn is to question, you did good
>>
>>57986014
c++ never ceases to amaze with its idiocy
>>
>>57985781
>sizeof(char)
guaranteed to be 1
>>
>>57986147
Emailed
>>
>>57986152
And?
>>
File: 1479405735367.png (541KB, 1159x591px) Image search: [Google]
1479405735367.png
541KB, 1159x591px
>>57985898
>>57985962
>>
>>57986223
and it doesn't need to be there
>>
>>57986108
it's not a horrible thing desu, implicit casting can fuck you over
casting NULL is still retarded tho, yes

>>57986152
>what is readability
>>
>>57985926

I would like to add that MVC is still a great idea, "seperations of concerns" will make much easier for you.

Also MVC also works in small scale. If you think about HTML, JavaScript and CSS you also have a sort of "micro MVC".. You could argue about HTML being the model (providing raw text and divs, but no manipulation) JavaScript being the controllers (i.e. a button click leads to a specific action) and CSS the view (controller decides, that after button is clicked, the button turns red):
JS operates on HTML, providing CSS.


Of course that's a gross oversimplification, i.e. when you use ".class:hover" in CSS you already have a controller here.


But it's just a simple example on how you COULD look at MVC:

Model = data, data logic (i.e. relational database)
View = data from the model, filtered and manipulated
Controller = gets triggered from a view, looking for an appropriate action (i.e. data insertion), providing a new view to the outside after that action
>>
>>57986272
But it does give more context as to WHAT you're doing, so IMO just fucking leave it.
>>
>>57986272
You missed an occasion to not look like a code monkey.
>>
How are those trees that are used for generating shitposts called?
>>
>>57986349
markov chains?
>>
>>57986357
Exactly
Thanks my dude
>>
>>57986275
the whole point of having a null pointer is that it's a subtype of any pointer type, so avoiding "implicit casting" of the null pointer to other pointer types is just dumb
>>
Who /doesn'tlikenightmode/ here?
>>
Trying to make an auth system with Go and Vuejs. Right now I'm just trying to get the frontend and the backend to talk to each other, but when I make a POST request in the frontend to the appropriate url (which has a handler), I still get a 404.

I'm retarded.
>>
>>57986381
yes as I said it is retarded in the case of null pointers, but can be very helpful in every other case

>>57986412
me, I sometimes code in very light environments so I need the white background
>>
how do i know number of elements in a array in C?

what's the most safest/ portable method?

i saw this one
sizeof(array)/sizeof(array[0])
>>
>>57985781
Style gripe: Don't cast malloc() calls.

There is zero point since casting the void * values on assignment is already implicit. You already have the variable telling you what type it is, this isn't pre-c89 code anymore so you don't have to care about casting malloc() calls or any other function that returns void * values.

memmove(src, &src[n], strlen(&src[n]) + 1);

This is probably incorrect.

&(array[index]) is pretty retarded compared to just (array+index) especially since the square brackets are just syntactic sugar that gets expanded to *(array+index) anyway, and &(*(array+index)) doesn't actually point to inside the array, it could point to wherever this dereferenced value is stored. It'd like doing &1.

Just do src+n.

Your strins() is probably just as wrong. Did you even bother testing it before asking? Write tests.
>>
>>57986312
give it even more conext, create variables for each parameter of malloc, memove and so on and name them accordingly
also comment every line, because someone might get lost. you know, readability and stuff
>>
>>57986017
https://github.com/tinkerpop/gremlin/wiki
>>
I'm working on procedurally generated levels for my 2d sidecroller

it sucks
>>
>>57986506
>>>/v/
>>
>>57986470
>how do i know number of elements in a array in C?
You should know it at compile time.
>>
>>57986505
not algebraic
>>
>>57986541
and how do i do that?
>>
>>57986489
https://yourlogicalfallacyis.com/strawman
>>
>>57986412

I use dark text on light backgrounds.
>>
>>57986568
Where did you declare your array?
>>
>>57986470
>how do i know number of elements in a array in C?
You don't.

You either know how many elements there are while writing the code, or you come up with a struct or array content schema that you can scan and check for.

But arrays are just basically aliased pointers. There is no inherent size value you can look up or find. If you are just passing around dynamically created arrays willy-nilly, unless you tell your functions what the size of the array is too, you can't actually know.

That's why libc functions that take array arguments usually ask for size values. Because they can't know, won't know, and maybe you only want to work on a smaller subset of the array anyway.
>>
>>57986614
my program looks like this

#include <stdio.h>

unsigned char my_vector[] = {
0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20,
....
}

unsigned int my_vector_len = ???;

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

>>
>>57986568
you keep tabs of it
>>
>>57986673
So you know exactly the length of my_vector. But sizeof (my_vector) / sizeof (char) is the answer you're looking for.
>>
>>57986673
Time to start counting 0x20s.
>>
>>57986736
>low level programming in a high level language
>>
Posted in /sqt/ but ded thred.
How would you multiply and store a result in MIPS that is larger than 32 bits? At the moment it looks very roughly like:
addi $t0, $0, 55
addi $t0, $0, 24
mult $t0, $t1
mflo $t2
mfhi $t3

What should I do with t2 and t3 now?
>>
>>57986821
>the Linux kernel and drivers are written in assembly
>>
thoughts on Boost?
>>
File: sweden.gif (19KB, 655x520px) Image search: [Google]
sweden.gif
19KB, 655x520px
SWEDEN YES
>>
>>57986821
This ain't 1980 anymore grandpa.
>>
>>57986956
Glorious.
>>
>>57986894
install PCem, write your own bootloader
>>
>>57985721
anything please. i want to do something this winter break to help me out
>>
>>57984385
>>57984944
AutoIt is pretty comfy and for what its build actually really useful
>>
>>57987075
But it's a Scandy flag. The only better flag is the Norwegian flag.
>>
someone here who knows engine stuff? is an architecture like this fine?
e.g. when you do a command it gets put into the message bus and then taken on by the engine components. also an event bus for, well, events (you fire an event which gets put on the stack, which gets checked by the listeners)
>>
>>57987276
Do you have a good reason to overcomplicate it like this instead of just doing regular function/method calls?
>>
>>57987327
>what is multithreading
>>
>>57987327
disconnection of the systems. with this I can change what I want without caring about any references. Its not that more complicated, its basicly just abstracting the function calls to a more disconnected layer.
also >>57987387
>>
>>57987387
Something done much better with e.g. futures.
>>
>>57987288

prep(bull);
while(bull.fuck(wife))
puts(country_flag)
return privilege
>>
>>57987398
At some level these references are still needed. What exactly are you having trouble with that you think this will fix?
>>
>>57986477
>and &(*(array+index)) doesn't actually point to inside the array
Of course it does.
>>
>>57987398
>>57987327
adding to that, I want to make an engine for a networking game, and this fits so good with server->client stuff. the server simply puts a function call on the message stack when another client does stmh

>>57987419
im not having trouble. I just want a clear architecture before I start doing this
>>
>>57986470
>saw this one
>sizeof(array)/sizeof(array[0])
That's the way to do it.
>>
>>57987436
>I just want a clear architecture before I start doing this

epoll, or a win32 equivalent. Anything else is inefficient, speaking from experience.
>>
>>57987436
Networking in games is about transmitting state, not actions.

>>57987436
>clear architecture
Then trust me, you don't want some central messaging system.
>>
>>57987445
t. clet
>>
>>57986470
I use sizeof(arr) / sizeof(*arr) and it's the same thing.
But keep in mind this only works on stack-allocated arrays.
For dynamically allocated blocks of memory, you must store the size along with the pointer returned by an *alloc() family call.
>>
>>57986866
>What should I do with t2 and t3 now?
Those are the high and low result of the multiplication, so together they are the 64 bit result.
>>
>>57987464
I'll look into that

>>57987468
seems pretty clear to me, but I'll look at the stuff mentioned above
>>
>>57987469
What?
>>
>>57987468
Synchronizing state, I should say.

The client doesn't do RPC on the server or anything silly like that. Both the client and server are carrying out the game simulation. The client sends input directly from the player to the server, and the server sends back snapshots of the state so that the client can synch up.
>>
>>57987530
All you need is futures with a job system for multithreading. For networking you basically just want to continuously send and receive updated state and rarely you might want futures for guaranteed messaging.
>>
>why is wayland not a thing yet? ;~;

wayland has fucking shit documentation

their documentation right now is pretty much "read the header files lmao"
>>
>>57987682
The first two parameters look like they're for OOP. The object itself and its vtable.
>>
>>57987682
>wayland has fucking shit documentation

That's the price of freetardation.
>>
>>57987722
that would be perfectly fine if it were consistent
>>
File: akari nani.png (254KB, 580x504px) Image search: [Google]
akari nani.png
254KB, 580x504px
When retrieving an array of integers from sqlite, would it be faster to sort them with qsort or should I just use ORDER BY to retrieve them presorted?
>>
>>57987513
So would those two be able to be stored in the same memory address to form the full 64 bit result?
>>
>>57986456
HAHA JUST KIDDING I'M FUCKING RETARDED I FORGOT TO REBUILD THE BINARY FOR THE BACKEND

I'M GONNA GO KILL MYSELF NOW
>>
File: pepe_stipple.png (68KB, 620x683px) Image search: [Google]
pepe_stipple.png
68KB, 620x683px
Hmm
>>
>>57987682
You can tell from the doxygen comments right above it. It doesn't have data and wl_registry in its param lists.
I guess wl_registry is just the "object" that the function works on, and data is just some arbitrary user data.
>>
>>57983435
bmr.py --weight
IndexError: list index out of range

Good job.
>>
>>57987775
ORDER BY
>>
>>57983026
Anyone have a link to a good tutorial to developing on iOS, including platform to use (I currently have XCode -- not sure if that's a good one to use)? I'm on a Mac, if that helps.

I found this, but not sure if it's a good tutorial
https://developer.apple.com/library/content/referencelibrary/GettingStarted/DevelopiOSAppsSwift/
(I also don't know Swift.) I'd rather develop on Android since I already know Java, but everyone I know has an iPhone, and I can't get word-of-mouth going as well (on an immediate, personal level) on Android, even if the latter has a larger user base.
>>
>>57983695
>coin flipper
uhm...

isn't "pure randomness" just a fictional concept?
>>
>>57987563
Will you eventually end up doing anything but copy the Trinity engine?

Not an insult, just saying that this is where almost all solo game network devs end up doing, making an inferior Trinity clone. What makes the clones inferior most of the time are the unnecessary complexities people introduce to their engine.
>>
>>57987891
you could get data online that gives you the percentages i.e a study that documents 100,000 coin flips or something
>>
>>57987891
Isn't "determinism" just a fictional concept?
>>
File: stipple_inversion.png (614KB, 1066x641px) Image search: [Google]
stipple_inversion.png
614KB, 1066x641px
invert -> stipple -> invert produces an interesting effect (better when using source colors).
>>
>>57987949

Yes.
>>
>>57987940
yea but there is still a slight bias if i'm not mistaken,at least for non "highly-proprietary" algorithms i guess.

for a coin flipper it still should be enough.
>>57987949
I was talking purely about the computation behind it
>>
I'm trying to read the value of a digital potentiometer when it turns on and then have it count up to maximum then reset to minimum while outputting the current value to serial.I'm apparently fucking up something with the integer I'm receiving is all I can figure. Also I have zero programming knowledge so theres a good chance this is 100% wrong.

#include <Wire.h>
#define pot_address 40

byte val = 0;

void setup()
{
Wire.begin();//join i2c bus
Serial.begin(9600);
Wire.requestFrom(40, 1); // request 1 bytes from slave device #40
while(Wire.available()) // slave may send less than requested
{
byte val = Wire.read(); // receive a byte as character
Serial.println(val); // print the character
}

}

void loop()
{
Wire.beginTransmission(40);//transmit to device#40
Wire.write(byte(0xaa)); // sends instruction byte
Wire.write(val); // sends potentiometer value byte
Wire.endTransmission(); //stop transmitting

val++; //increment value
if(val == 256) //if reached 256th positon (max)
{
val = 0; //start over from lowest value
}
delay(500);
}
>>
>>57987891
No, it's not
there are real mathematical functions that create pure randomness, I just forgot how and it's late
search for the random functions Wolfram uses or has used in the past, you will find some crazy solutions that don't rely on some weirdly added up hash functions
>>
>>57988035
>there are real mathematical functions that create pure randomness
>>
>>57987903
Huh? I'm just explaining how most games do networking.
>>
L M A O
http://lkml.iu.edu/hypermail/linux/kernel/1510.3/02866.html
>>
>>57988035
If it's pure, it deterministic, and if it's deterministic, it's not random.
>>
>>57988035

this >>57988069

i mean i believe you, but still.I still believe a quantum computer should be able to give better results in terms of randomness than a "traditional" one.
>>
>>57988087

I wonder if Linus likes Trump. They both have that matter-of-fact attitude.
>>
File: 1475875777121.png (17KB, 200x94px) Image search: [Google]
1475875777121.png
17KB, 200x94px
>>57988131
>muh quantum popsci can do anything
>>
>>57988069
https://www.wolframscience.com/nksonline/page-552#previous first result from google
that's part of what I meant
some dude from wolfram also answered in an interview some good questions on that topic and explained how to get pure randomness
>>
>>57988069
import random

random.random()
>>
>>57988087
This is the old code in net/ipv6/ip6_output.c:
mtu -= hlen + sizeof(struct frag_hdr);

and this your suggested replacement:
if (overflow_usub(mtu, hlen + sizeof(struct frag_hdr), &mtu) || mtu <= 7)
goto fail_toobig;

The problem as I see it is that the overflow_usub() function is non-standard and requires special compiler support to generate reasonably efficient code. That function hasn't been used anywhere else in the code base before. Also, the code uses two conditionals. Consider this replacement:
if (mtu < hlen + sizeof(struct frag_hdr) + 8)
goto fail_toobig;
mtu -= hlen + sizeof(struct frag_hdr);

It takes the same number of lines, doesn't need a little-known helper function, is clearer in its intent and, I think, is easier to read. There could still be overflow issues if the "hlen + xyz" expression overflows, but the "overflow_usub()" code has that same issue.

Also, we are near to rc7 time, and we don't want conflicts at this point.

Thank you for submitting the code, but, for all the aforementioned reasons, I have to reject it and will do so for similar code in the future.

:^)
>>
Anything unpredictable is as truly random as you can get. But predictions may get better.
>>
File: 1412775008276.png (690KB, 800x1130px) Image search: [Google]
1412775008276.png
690KB, 800x1130px
This is not working one bit. How the fuck do I make GraphicsMagick output in a different file format?
>>
>>57988153

I know it's cringy and you're right about that, but it's pretty hard to disagree imo


The "sad" thing is that eventually most of the software will have to be rewritten for that, starting with the essential ones since most of those computers will still be used in the science field for the next 5 years +.
>>
>>57988087
>>57988173
which one of these two do you think is better??
will YOU stick to your opinion that technical details should matter most or will YOU take the controversial route and side with linus' rant simply because you agree with his attitude???
>>
>>57988229
What?
Linus has a good point.
>>
>>57988256
i don't think you understand, fellow!
>>
>>57988276
I don't understand what you're trying to get at.
Your childish writing style made your point less clear.

Am I not allowed to agree with Linus when he has a good point?
Am I not allowed to like Linus' attitude?
>>
>>57988304
my childish writing style???
>>
>>57988365
stop that
>>
>>57988438
no!!
>>
should i give VIM another shot, lads?
>>
>>57988537
Yeah. It's super useful if you ever have to edit anything on a remote server or if you just want to quickly edit a file in the terminal

Some people like it as their dedicated text editor but it doesn't even have to be that.
>>
>>57988537
Vim suchs, use Kakoune
>>
>>57988555
Just looking for a personal use TE/quasi-IDE.
Kind of sick of code-blocks and want a more D-friendly workflow.
>>
How can I debug GLSL code?
I tried separating my projection matrix from my transformation matrix so I could have an unprojected z value which I would need for fog and perspective, but now somehow it seems that altering the near and far distances of the projection matrix causes weird results.
>>
>>57988610
E M A C S
Seriously emacs is really nice.
>>
>>57988808
Sorry, I already have an operating system.
>>
>>57983026
Are there any C# + F# programmers here? I'm primarily (read: entirely) a Lisp developer for the past couple of years but I'm really starting to feel some friction from lack of libraries and lack of good compiler/editor integration*.

I'd like to learn F#, but do I need to learn C# first? How good is the interop between them? Apparently if your program uses a GUI you still need to use C# for it. Will I be able to just whip up a straightforward GUI and do all of my programming in F#? I haven't found any guides or tutorials (or even many people) aimed towards people who are in my particular situation of being more comfortable with functional programming and dynamic typing than their reverse.
>>
Anyone got the newest version of g programming challenges? Think it was 4.0?
>>
>>57988844
So? You don't want in-editor REPL's, easy to install packages, comfy key bindings because...?
>>
>>57988846
Whoops, forgot the addendum:

* Emacs is fine, but seeing the sort of inference and cool things .NET can do via Roslyn's self-reflection and incremental compilation and scoping makes things like auto-complete via ctags look piss-poor in comparison.
>>
>>57987976
Neat!
>>
>>57988937

Thanks.
>>
>>57988846
Which LISP?
>>
>>57989002
Racket Lisp & Scheme.
>>
>debugging a mutually recursive set of functions
>will sometimes return nearly instantaneously as expected
>will sometimes never return at all and hang indefinitely
>for the same forms of input
Fucking hell, this is tedious.
>>
>>57989036
It's probably a good idea to.
scanf is a pretty crappy function.
>>
File: Screenshot+2016-12-13+07.26.37.png (427KB, 2480x1476px) Image search: [Google]
Screenshot+2016-12-13+07.26.37.png
427KB, 2480x1476px
Working on this problem for my Python class, but my program makes no substitutions to the txt file. Any help would be appreciated.

try:
myfile = open("bieber_baby.txt", "r")

except:

print("Sorry, the file doesn't exist")

else:
print("Total words in thesaurus: ", total_words)
lyrics = myfile.read()

#remove punctuation from the file

lyrics_no = ""
for word in lyrics:
if word.isalpha():
lyrics_no += word

elif word.isspace():
lyrics_no += word

#split by word
word_lyrics = lyrics_no.split("\n")

#ask the user to enter a probability of changing lyrics

chance = float(input("Enter a % chance to change a word: "))

#Blank list of altered lyrics
audio = ("")

#examine each line
for line in word_lyrics:

#split the line to make into string of words
words = line.split(" ")

#make a program to decide whether to alter words or not
for c in words:

swapnum = random.randint(1,101)

#Check if the words should change by probability and by existing in thesaurus
if (swapnum <= int(chance)) and (c in dictionary):

#choosing a synonym word from the list
random_position = random.randint(0,len(dictionary[c])-1)

c2 = dictionary[c][random_position]

#adding word into empty list
audio += c2
print(str.upper(c2), end = " ")

#if word is not found in dictionary, add the original word.
else:


audio += c
print (c, end = " ")

myfile.close()

>>
>>57989091
Might want to consider writing to the file.
>>
Does your workplace have a dress code?
>>
>>57989135
>>57989135
I'll look into that, but is there no quick fix or something I might've overlooked?
>>
>>57989192
Crossdressing
>>
New thread: >>57989242
>>
>>57982247
>>57983870
Hey, don't feel bad, those feelings are proof that you desire what's just. The reason you can't attain it is because you are still awkwardly fixated on yourself, so that all your actions hurt you.

>>57983815
You need do develop multiple personalities and hone your ability to alter between them at will, thus taking the appropriate mental posture for the task at hand.
>>
Is there a site that lets you practice mongodb online?

I want to have a pre-existing database to work with
Thread posts: 317
Thread images: 33


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.