[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: 314
Thread images: 38

File: 1486072446475.jpg (217KB, 700x671px) Image search: [Google]
1486072446475.jpg
217KB, 700x671px
Old thread: >>59775004

What are you working on, /g/?
>>
first for trap love
>>
Fuck off, tranny
>>
File: nigerian.gif (69KB, 600x600px) Image search: [Google]
nigerian.gif
69KB, 600x600px
>>59778843
nigga you ghey
>>
Thank you for using an anime image.

>>59778856
Rude!

>>59778861
2D traps aren't gay.
>>
kys drink the biggest bottle of bleach degenerate
>>
Thanks for a picture of Japanese origin
>>
File: 1455950118355.jpg (44KB, 267x320px) Image search: [Google]
1455950118355.jpg
44KB, 267x320px
>>59778864
>2D traps aren't gay.
>>>/tumblr/
>>>/out/
smhtbhfamalam
>>
File: img_150.png (280KB, 544x504px) Image search: [Google]
img_150.png
280KB, 544x504px
>>59778843
How the fuck do I read PDFs on my laptop without getting distracted?
>>
>>59778900
force yourself to read and hopefully you'll shift in to auto pilot and reading becomes a breeze
>>
File: 1460298450131.jpg (22KB, 433x499px) Image search: [Google]
1460298450131.jpg
22KB, 433x499px
>be at job interview
>whiteboard rolled in
>asked to write fizzbuzz
>except you can only print if the sum of all primes up to the fibonacci iteration of that number divided by 2 also a prime number
>>
Why does the /g/ wiki have no recommendations for data structures books? They're all just books on programming languages.
>>
* FIZZBUZZ.COB
* cobc -x -g FIZZBUZZ.COB
*
IDENTIFICATION DIVISION.
PROGRAM-ID. fizzbuzz.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CNT PIC 9(03) VALUE 1.
01 REM PIC 9(03) VALUE 0.
01 QUOTIENT PIC 9(03) VALUE 0.
PROCEDURE DIVISION.
*
PERFORM UNTIL CNT > 100
DIVIDE 15 INTO CNT GIVING QUOTIENT REMAINDER REM
IF REM = 0
THEN
DISPLAY "FizzBuzz " WITH NO ADVANCING
ELSE
DIVIDE 3 INTO CNT GIVING QUOTIENT REMAINDER REM
IF REM = 0
THEN
DISPLAY "Fizz " WITH NO ADVANCING
ELSE
DIVIDE 5 INTO CNT GIVING QUOTIENT REMAINDER REM
IF REM = 0
THEN
DISPLAY "Buzz " WITH NO ADVANCING
ELSE
DISPLAY CNT " " WITH NO ADVANCING
END-IF
END-IF
END-IF
ADD 1 TO CNT
END-PERFORM
DISPLAY ""
STOP RUN.
>>
>>59778976
What the fuck is this?
>>
>>59778987
FizzBuzz, clearly
>>
>>59778930
Whom quotest thou?
>>
>>59778900
sauce pls
>>
>>59778987
You don't know the superior language yet ?
>>
On rest day from the gym and it hurts to move. What language should I fail at learning? I've tried some C, Python, Scheme. I think my learning material was more an issue than the languages. Anyone have a favorite book for beginners?
>>
File: 1460877592447.jpg (37KB, 538x589px) Image search: [Google]
1460877592447.jpg
37KB, 538x589px
What language should I use to prove the genre of any given anime using the type system?
>>
>>59779133
Python is piss easy to learn. How can you fail at learning Python?
>>
>>59779161
I guess I just stopped. Maybe I'll continue Think Python 2nd Edition.
>>
>>59778757
Alright spill the beans what are you talking about?
>>
File: 1467244967189.jpg (71KB, 437x458px) Image search: [Google]
1467244967189.jpg
71KB, 437x458px
>>59778843
I need recommendations for a C# project

I know the syntax from books and experience with higher level languages. Just not sure what there is to do. My interests are with programs and games.

thanks /dpt/
>>
>>59779245
Make a mod for your favorite game
>>
>>59779219
Creation from destruction. Hopefully they'll get what's coming to them. I personally can't wait for it.
>>
File: 1482468586905.png (199KB, 574x417px) Image search: [Google]
1482468586905.png
199KB, 574x417px
>>59779260
I've made two mods for ESO in Lua before. Got a few thousand downloads for a few days of effort.

I don't want to do it again in a different language because I don't think I would learn anything

but thank you for the suggestion anon
>>
>>59779322
Try out Unitale. Undertale game engine using Unity but use Lua to program it. Post projects in /r/unitale
>>
>>59779371
I want C# projects. Unity uses C# so that's not a bad idea
>>
>>59779133
/fit/izens on /g/? Am I not the only one?

Guess the trap images make more sense now.
>>
>>59779264
Clarify yourself.
>>
@59779245
@59779260
@59779371
@59779377
>>>/r/ibbit
>>>/v/
>>
>>59779384
I'm actually a /g/entoomen on his first week working out
>>
>>59779392
What even is there to clarify?
>>
>>59779205
I'm one of those people who can never learn a language unless I have a real project to frame my learning around. Maybe it's the same for you too.
>>
>>59779144

>using the type system
So, right here you've restricted yourself only to languages with a turing complete type system, in which case, Haskell or C++ are your best bets. Although strictly speaking, you're going to have a hell of a time encoding anime into the text of the program. I don't know about Haskell, but C++ does not allow you to go read arbitrary binary files at compile time into constexpr arrays. The only compile time I/O you've got is #include.

Honestly, you'd be better off doing this at runtime, instead of in the type system, because statistical classification in and of itself is a fucking hard problem, especially when you're operating on what, audio and video data? What features would you even use to generate a model for this? I mean, maybe if you were able to just rip the subtitles and run them through something like naive bayes...
>>
>>59779480
Hm. Thanks for the tip. That could be it.
>>
public static void Main (string[] args)
{
//hot to call myMethod to grab 'b' and
//pull it or a copy of it, up here to do math on?
int c = b + b
Console.WriteLine(c);
}

{
public static void myMethod ()
{
Console.WriteLine("type a number");
int a = Console.ReadLine();
int b = a + a
}
}


how to pull the results of a method out and into another method?
C#
>>
>>59779561
https://msdn.microsoft.com/en-us/library/1h3swy84.aspx
>>
File: 1479484770974.png (67KB, 385x367px) Image search: [Google]
1479484770974.png
67KB, 385x367px
What's the best language for writing a kernel using only the type system?
>>
Anybody upload the humble bundle python books?
>>
>>59779616
idris
>>
@59779528
>So, right here you've restricted yourself only to languages with a turing complete type system
Of course I would do that, why does this deserve a comment?
>Haskell or C++
Both of them have type systems where the equivalent of this is approved by the type checker, so every type is inhabited.
data Void
a : Void
a = ⊥

Stopped reading your mindless retardation right there.
>>
Fact: OCaml programmers are the most powerful race in the world.
>>
>>59779724
>O
>>>/r/abbit
>>
>>59779728
OCaml is as much about objects as astronomy is about telescopes.
>>
>>59779590
tyvm
also, this video helped make sense of that page
https://www.youtube.com/watch?v=QwygwfqOHsI
>>
>>59779739
It is in the set of object oriented languages. Meaning it and its users belong on plebbit.
>>
People always say that if you aren't using LINQ, you're using C# wrong... but it doesn't seem too useful outside of database stuff.

How could I integrate LINQ into my general practice? Is there any real benefit?
>>
>>59779798
>People always say that if you aren't using LINQ, you're using C# wrong
This is correct, since any usage of C# is wrong.
>>
>>59779811
why
>>
>>59779818
Because C# is shit itself.
>>
>>59779839
Explain this incorrect opinion
Why is C# shit
>>
>>59779846
Where did I state a single opinion?
>>
>>59779133
http://www.ccs.neu.edu/home/matthias/HtDP2e/
>>
>>59779528
Even with a fancy type system, he'll never be able to 'prove' the genre of something.

He's also better off using a language with full-blown dependent types, like Idris.
>>
>>59779616
Idris.
>>
>>59779974
>he'll never be able to 'prove' the genre of something.
Why not?
>full-blown dependent types
As opposed to "non-full-blown" dependent types?
>>
>>59780006
>Why not?
You can certainly take an heuristic approach, but unless you have a particular mathematical proof in mind...
>As opposed to "non-full-blown" dependent types?
He was suggesting Haskell, which does not have dependent types, though is attempting to approach them in various ways (e.g., refinement types).
>>
why is LFB access so extremely slow?
I'm only trying to do a full-screen color fade at 640x480. I didn't think that would be too demanding, but it's only displaying about one frame every three seconds.
>>
File: chatterbox functions.png (10KB, 891x95px) Image search: [Google]
chatterbox functions.png
10KB, 891x95px
is this a joke?
>>
>>59780028
>Idris
I checked it out and this appears to be valid Idris, meaning it's also inappropriate for my purposes. I don't know why people seem to think that dependent types somehow rid a language of any core problems it might have.
data Empty
a : Empty
a = believe_me 5


>>59780028
>unless you have a particular mathematical proof in mind
I'm working on it as we speak.
>though is attempting to approach them in various ways
Then they aren't dependent types, but merely ways to "simulate" them. Which is probably caused by the language being crippled in the first place.
>>
>>59779851
When you said that C# was shit
explain your reasoning and I'll believe you
>>
>>59780064
That wasn't an opinion.
>>
>>59780076
fine then, back up your theory with evidence
If a theory is good enough for gravity then it's good enough for C# being shit. Prove it.
>>
>>59780060
>Then they aren't dependent types, but merely ways to "simulate" them. Which is probably caused by the language being crippled in the first place.
Jesus Christ, this was my actual point. This is why, when Haskell was recommended, I said he needed 'full-blown' dependent types, like Idris.

Honestly, learn to fucking read.
>>
>>59780085
>he needed
Not necessarily, you can prove things even in the simply typed lambda calculus.
>'full-blown' dependent types
Something either has dependent types or it doesn't. There isn't anything "full-blown" about it.
>Idris
Actually having a type system which doesn't allow you to prove absolutely anything is a lot more important than just having a more sophisticated type system.

>Honestly, learn to fucking read.
I know what you meant, I just thought it was wrong/poorly worded.
>>
>>59780124
>'full-blown' dependent types
It's a turn of phrase; if you knew what I meant then you're deliberately sperging out, and deserve every insult you get.
>>
>>59780149
Me knowing and agreeing with what you were trying to say doesn't imply that I agree with what you actually said.
>>
>>59780160
Clearly: see 'sperging out'.
>>
>>59780165
I'm not aware of having Asperger's.
>>
>>59780172
That's why I'm informing you :)
>>
File: 1466971790805.png (15KB, 300x300px) Image search: [Google]
1466971790805.png
15KB, 300x300px
>>59780175
I don't know what you're trying to imply with this.
>>
>>59778843
Just started with some simple website stuff, never bothered with html before. Any tips?
>>
>>59780221
I didn't imply anything, only stated.
>>
>>59780236
mysqli_real_escape_string
filter_input(INPUT_GET, "thing", FILTER_SANITIZE_STRING);

if you enter into php sql

otherwise, use a designer, nobody writes their own http in 2017
>>
>>59779798
there is no real benefit, it can make code harder to read, use resharper if you want to oneline some foreach stuff where you can

sometimes parallel.foreach is wrote easier in linq, too

use object serialization and deserialization instead of database stuff, i have an entire class devoted to this that uses a timer to save to file if it needs, a final save when destroyed, and an autoload from a file based on the class's name at creation, very fast, much faster than the most popular sqlite lib on nuget that had locking problems and retried 10x on queries i expected to fail
>>
>>59780318
>>
>>59778558
What is this? Searching hyper doesn't help much.
I don't quite comprehend how you go beyond arrow notation (presumably anon did that) without it just being 1 more arrow.
>>
File: 1490851729858.jpg (26KB, 365x444px) Image search: [Google]
1490851729858.jpg
26KB, 365x444px
>quake source is terribly formatted with a seemingly random number of spaces and tabs thrown in everywhere and huge decorated comments that break the flow of reading
>>
>>59780553
just lint it nigga
>>
>>59780553
it really is, sadly
>>
>>59780553
Who said this?
>>
>>59780553
>random number of spaced and tabs everywhere
Post example?
Quake source is very easy to read in my experience.
>>
File: PNIS_logo.png (645KB, 5000x1964px) Image search: [Google]
PNIS_logo.png
645KB, 5000x1964px
>>59778843
www.sdmsolutions.ca/pnis

I made a base-803 numeral system.
>>
>>59780536
Nevermind found it.
https://en.m.wikipedia.org/wiki/Hyperoperation
That would be absolutely brutal.
>>
how I document my functions in C for professional® works
>>
>>59780659
Just do something like this

// includes the file we need to print
#include <stdio.h>
// stating the main code
int main()
{
// printf() displays the string inside quotation
printf("Hello, World!");
// returns 0
return 0;
}
// end of code
>>
>>59780704
xd
>>
>>59780704
But who is it quoting?
>>
>>59780570
>Post example?
typedef struct cmdalias_s
{
struct cmdalias_s *next;
char name[MAX_ALIAS_NAME];
char *value;
} cmdalias_t;

cmdalias_t *cmd_alias;

qboolean cmd_wait;

cvar_t cl_warncmd = {"cl_warncmd", "0"};

//=============================================================================

/*
============
Cmd_Wait_f
Causes execution of the remainder of the command buffer to be delayed until
next frame. This allows commands like:
bind g "impulse 5 ; +attack ; wait ; -attack ; impulse 2"
============
*/
void Cmd_Wait_f (void)
{
cmd_wait = true;
}

/*
=============================================================================
COMMAND BUFFER
=============================================================================
*/

sizebuf_t cmd_text;
byte cmd_text_buf[8192];
>>
>>59779798
It's useful literally any time you're working with collections of things.

Say you want to start with a root directory, and delete all PNGs in any subdirectory that are greater than 3MiB, but only if the subdirectory has "muhdick" in the name:
Directory.GetDirectories(path, "muhdick", SearchOption.AllDirectories)
.SelectMany(x => Directory.GetFiles(x, "*.png"))
.Where(x => new FileInfo(x).Length > 3145728)
.ForEach(File.Delete);


Note that
ForEach()
here isn't really a part of LINQ; it would be perfectly fine to use a traditional ForEach here after storing the query in a variable, but the point is that no heavy lifting was actually done until the call to
ForEach
. LINQ is lazily evaluated so that it isn't expensive until you actually need to use it. If I would have just put it in a variable, that variable simply holds a set of instructions on where to get the result collection, and waits to be enumerated.

Depending on what you're actually doing, I could show you some examples where you might be able to make code you've written more concise and actually easier to read.
>>
>>59780659
Doxygen
>>
File: 1491060862798.gif (2MB, 500x281px) Image search: [Google]
1491060862798.gif
2MB, 500x281px
>>59780704
Do you even comment?

// see LICENSE section for licensing information
// preprocessor statement to include standard library input/output header file so we can use printf
#include <stdio.h>
// entering main function of the c runtime that returns an int to the environment, argc/v are implied
int main()
// opening brace of main function
{
// printf() displays the string inside quotation with null termination, see man 1 printf
printf("Hello, World!"); /* a classic text string
used by many of the greats of programming
often used to confirm your programming
environment is working */
// returns 0 to shell, note this is a statement not a function so we don't use parentheses
return 0; /* i forgot to mention depending on your terminal you might
want to use sprintf instead, see the
relevant man pages
for more information
*/
// closing case of main function
}
// end of code
//
//LICENSE
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//(c) 2017 pinkypie-best-pony.github @facebook pinkypie twitter: pinkypieclop
>>
>>59780047
What do you mean? Where's the screenshot from?
>>
>>59780966
That images is cute, but I don't really like your post overall.

You do get points for the apparent effort, but your wording is a bit forced in the would-be humorous comments.

I'll give you a 6/10 for your official 4chan Post Scoreâ„¢.
>>
>>59780966
I feel like contributing to this code. Care to share your code of conduct?
>>
File: 1491371471303.jpg (229KB, 1920x1080px) Image search: [Google]
1491371471303.jpg
229KB, 1920x1080px
>>59780990
Thanks bro 6/10 is fine.

>>59780997
My CoC is basically only trannies or pseudo-trannies can contribute so if you're a cisshit white male I'm afraid your are out of luck.
>>
>>59780934
this shit + LINQPad, better than bash or powershell
>>
>>59780868
>seemingly random number of spaces
But qboolean and cmd_wait here are seperated by type. Why should they share whitespace pattern?
>huge decorated comments that break the flow of reading
But that's intentional. They're using it as paragraphs for COMMAND BUFFER here for instance. You're supposed to understand some different context here. It's true that the first decoration here doesn't serve any real purpouse usually. But for completeness sakes it's needed.

And it's clearly code someone decorated for presentation, someone applied themselves to feel they did their job when the code was GPLd. I don't think all of the comments in Quake are good for understanding the game as a whole but rather for piece-wise learning.
For example the movement code:
https://github.com/id-Software/Quake-III-Arena/blob/master/code/game/bg_pmove.c#L260
Why comment alternative solutions in your code? It makes no sense to call it a bug either. It's consciously replicated from earlier games. It's not even the same as earlier games, it's modified for gameplay reasons. So why even call it a bug and "solve it"? It's plainly clear that the author is just putting that in there to assure people that they know how to write code without air acceleration. Imagine doing that in your code. It's terrible.
>>
File: 93.jpg (27KB, 450x450px) Image search: [Google]
93.jpg
27KB, 450x450px
C#
input = input.Trim();
input = input.ToUpper();
StringBuilder sb = new StringBuilder();
var chars = input.ToCharArray();
foreach (char q in chars )
{
if
(q == 'A' 'J' 'S' '1')
//assign '1' to sb
else
if
(q == 'B' 'K' 'T' '2')
//assign '2' to sb
etc...
}

been awake all night working on a program.
now my brain is fizzled out. and i know i know this shit. but i need a boost. anyone able to help?
>>
Looking for a way of taking someones input (through a sysarg) and appending it to a spreadsheet document.

Anyone know how to do this in python/bash?
>>
>>59781016
>LINQPad
Just use the built-in C# REPL in VS.
>>
I just noticed that ln(a*1/b) = lna + ln(1/b) = lna + ln(b^-1) = lna - lnb so my whole life the arcane three rules suddenly simplified to one and a half rule to remember
>>
>>59781021
What is your actual objective here?
>>
>>59781021
switch(q)
{
case 'A':
case 'J':
case 'S':
case '1':
sb.Append("1");
break;
//etc
}
>>
File: 25ai.png (14KB, 308x97px) Image search: [Google]
25ai.png
14KB, 308x97px
>>59781053
breaking down a string,
converting each alpha-numeric character to a digit between 1-9 (based on pic),
build a new string of pure numeric digits,
>>
>>59781036
LINQPad is great for quick snippets so you don't have to wait for VS to launch all the way and go into a project.
>>
>>59781084
>wait for VS to launch
not keeping VS on SSD?
>>
File: 1482268013776.gif (3MB, 576x405px) Image search: [Google]
1482268013776.gif
3MB, 576x405px
>>59779428
oh well. Good luck on your journey of health and aesthetics.

I think I may be too stupid for programming but I'll try anyway. I'm doing C# and will try to make a game later on. Already know basic modelling and animation.

But some simple program to track my progress on the main lifts and a routine app would also be great.

/blog
>>
>>59781080
>>> f = lambda character: ((ord(character) - ord('A'))%9) + 1
>>>
>>> f('A')
1
>>> f('T')
2
>>> f('S')
1
>>> f('R')
9
>>>

>>
>>59781101
Not him, but I have VS on a SSD and it's still kind of a pain to get it open. LINQPad is excellent for snippets.
>>
>>59781115
>>59781070
thanks!
think i'll go with switch since no clue about lambdas
>>
>>59781122
you do not need a lambda

just do ((ord(character) - ord('A'))%9) + 1

character is whatever chracter you wish to look up
>>
Wow this was a really good talk.
https://www.youtube.com/watch?v=rX0ItVEVjHc
>>
>>59781130
>>59781115
take character value of character
shift it to start at 0 since it is offset by the value of A
take modulus 9 to wrap it from 0 to 8
add 1 to shift it to 1-9
>>
This thing for school, so this works pretty alright and all but I want to add one more option to repeat from the beginning allowing a new set of 5 numbers without having to quit the program. It's not necessary but hell, it'll be nice to have. Any help?

main() {
//Variable Declaration
int numIn, numHigh = 0, numLow = 0, sum = 0, i, choice;
double avg = 0;
printf("Please Enter Five Numbers: \n");
//User input loop
for (i = 0; i < 5; i++) {
//Calculations of numHigh, numLow, and sum
scanf_s("%i", &numIn);
if (numIn > numHigh) numHigh = numIn;
if (i == 0) numLow = numIn;
else {
if (numIn < numLow) numLow = numIn;
} //End else
sum += numIn;
} //End for loop
//Menu Display
do {
printf("\nPlease Choose an Option:\n\t1.Display the highest number\t2. Display the lowest number\n\t3. Display the sum\t\t4. Display the average\n\t5. Quit\n"); //User instructions
printf("Enter your option: ");
scanf_s("%i", &choice);
//Switch Cases
switch (choice) {
case 1:
printf("The highest number entered is %i\n\n", numHigh);
break;
case 2:
printf("The lowest number entered is %i\n\n", numLow);
break;
case 3:
printf("The sum of the numbers entered is %i\n\n", sum);
break;
case 4:
avg = (double)sum / 5;
printf("The average of the numbers entered is %.2lf\n\n", avg);
break;
case 5:
printf("Thank you for using our program. Goodbye.\n\n");
break;
default:
printf("That is an invalid option, please try again.\n\n");
} //End switch
} while (choice != 5);
system("pause");
}//end main
>>
File: out.gif (3MB, 1278x768px) Image search: [Google]
out.gif
3MB, 1278x768px
>>59778843
>>
File: 1491397430989.png (133KB, 400x387px) Image search: [Google]
1491397430989.png
133KB, 400x387px
>>59781137
>"data oriented design"
i thought this meme died long ago
>>
File: anal beads.png (8KB, 733x143px) Image search: [Google]
anal beads.png
8KB, 733x143px
>>59781122
>>59781080
Don't be afraid of lambdas.

Here's the quick and dirty:
static string AnonAndHisCSharpHomework(string input) => string.Concat(input.ToLower().Select(x => ((x - 'a') % 9) + 1));


See image for usage and example outputs.
>>
>>59781163
I don't know about that but I finally feel like I have an approach to make my code faster now. Before I would just have thought about data-structures and algorithms and be stuck there. Now I know how to actually write fast code. Feels awesome.
>>
>>59780253
>recommending real_escape_string

Who the fuck still doesn't use parametrised queries
>>
>>59781147
int main(){
int numIn, numHigh = 0, numLow = 0, sum = 0, choice;
double avg = 0;
while(true){
printf("Please nter Five Numbers: \n");
// Declare the cicle variables inside it
for(int i = 0; i < 5; i++){
scanf("%d", &numIn); // Use portable functions (scanf_s is not standard), use d (from decimal) to read integers

// Only one instruction per line
// Always group blocks with curly braces (it avoids shit like Apple's goto fail)
if(numIn > numHigh){
numHigh = numIn;
}
if(i == 0){
numLow = numIn;
}
else{
if(numIn < numLow){
numLow = numIn;
}
}
sum += numIn;
}

do {
printf("\nPlease Choose an Option:\n\t1.Display the highest number\t2. Display the lowest number\n\t3. Display the sum\t\t4. Display the average\n\t5. Quit\n");
printf("Enter your option: ");
scanf(" %d", &choice); // Use a space at the beginnig of the string to flush the input buffer
switch (choice) {
case 1:
printf("The highest number entered is %i\n\n", numHigh);
break;
case 2:
printf("The lowest number entered is %i\n\n", numLow);
break;
case 3:
printf("The sum of the numbers entered is %i\n\n", sum);
break;
case 4:
avg = (double)sum / 5;
printf("The average of the numbers entered is %.2lf\n\n", avg);
break;
case 5:
printf("Thank you for using our program. Goodbye.\n\n");

return 0;
default:
printf("That is an invalid option, please try again.\n\n");
} //End switch
} while (choice != 5);
}
}
>>
>>59781238
Holy shit, fucked that one up. Rewriting due to retardation.
>>
>>59781267
Looked ok apart from the absolute value of 0.
>>
>>59781052
Well, hey you're learning.
>>
>>59781137
>x oriented y
Instant trash.
>>
>>59781163
>2014
it did
>>
>>59781499
Is citing a date enough to confirm that something is dead?
>>
File: stalin.png (264KB, 498x615px) Image search: [Google]
stalin.png
264KB, 498x615px
>>59778864
>traps
>aren't gay
>>
@59781513
>st*lin
>>>/r/ibbit
>>
>>59781512
>14:45:04
F
>>
>>59781499
Anon this is how they do software at a major company. Do you really think they would have stopped after a mere two years when they dismissed most other approaches in this talk?
>>
>>59781513
Very creepy image anon.
>>
File: 124124.jpg (28KB, 460x276px) Image search: [Google]
124124.jpg
28KB, 460x276px
>>59781579
>this is how they do software at a major company
really saving those details right there
>>
>>59781163
It's currently the best approach to fixing the main memory bottleneck.
>>
>>59781595
What?
I don't know about Insomniac Games in detail. What do you expect?
>>
>>59781608
I can tell you that at a major company where the software is done that the code paradigm by which the code is written for the software in order to create the program about which i am talking does NOT do it this way
>>
>>59781491
Are you saying that any generalisation is inherently useless? I don't see how you could live in a modern day society where you're allowed to live largely as you choose using an image board that's based on the very general www.
>>
>>59781622
He's simply pointing out that these are merely fads that often don't really constitute anything significant and attempts to force them generally do more harm than good
>>
>>59781619
You're calling him a liar? Extremely poorly written post anon. Elaborate how you would know that though.
>>
>>59781636
No, I am talking about the different major company that makes the different software with the different paradigm

You know the one
>>
>>59781619
Holy shit, I have read this post 7 times and I can't figure out what the fuck you're saying.

80% of this run-on sentence is prepositional phrases.
>>
>>59781622
How the fuck did you get that from my post? You have some serious issues.
>>
>>59781647
No I don't anon. You're not allowed to reply to my posts anymore. Too much vague nonsense.
>>
Random question:
What is called a property of XOR bitwise operation, that if
A xor B = C
then
C xor B = A
and
C xor A = B
?
Is there even a name for it?
I can't find it here: https://en.wikipedia.org/wiki/Exclusive_or#Properties
>>
>>59781659
The posts to which the replies are being made are indeed worthy of the replies to the posts which I am myself making
>>
>>59781668
Logical thinking has a direct correlation with IQ.
>>
>>59781665
A xor B = C
A xor B xor B = C xor B
A xor 0 = C xor B
A = C xor B

You can do the same thing for A. The properties of interest are:
A xor A = 0
A xor 0 = A
0 is the identity of xor.
>>
>>59781684
unlike you
>>
>>59781654
You made a very general post. Oriented in this context means intellectually, emotionally, or functionally directed. You're most likely thinking about the intellectual aspects here. So "x oriented y" describes intellectual generalisation in general since you gave us two unknowns.

I'm assuming you're using the common method of green texting your reading of the situation as a negative implications.
>>
>>59781685
Yes but is there a specific name for this property?
>>
>>59781720
I've never heard of a particular name for the property (A xor A = 0). The Wikipedia page just lists it as non-idempotency. If xor was idempotent then A xor A would be A.
>>
File: 1475587564048.png (333KB, 931x554px) Image search: [Google]
1475587564048.png
333KB, 931x554px
>>59779133
how can you fail at learning Python

I'm going through this playlist at the moment: https://www.youtube.com/playlist?list=PLGLfVvz_LVvTn3cK5e6LjhgGiSeVlIRwt

and it seems pretty easy so far, I'm on video 7
>>
>>59781732
I don't mean A xor A = 0
I'm asking about
A xor B = C -> C xor B = A
>>
>>59781765
It's derived from those two more basic properties.
>>
>>59781770
So there's no name for it then, ok thanks a lot.
>>
>>59781697
>You made a very general post.
Which in and of itself implies I don't believe "generalization is bad" as you seem to think for some retarded reason.
>Oriented in this context means intellectually, emotionally, or functionally directed.
What is the purpose of this statement?
>You're most likely thinking about the intellectual aspects here.
What makes you say that? I'm really interested in what is causing you to behave this way.

>So "x oriented y" describes intellectual generalisation [sic]
Only if we assume your previous statement is true, which it isn't.
>since you gave us two unknowns
They aren't really unknowns, it's pretty clear to anyone who has even the most basic social skills that in a "numerical" context the variable 'n' represents some kind of a number. So you can't really call it an "unknown". If you apply the same intuition here it's pretty clear that you can indeed substitute x and y for something which has particular properties.

>you're using the common method of green texting your reading of the situation as a negative implications.
No. I'm not some sort of retard. I just substituted certain words for meta-variables, so to speak.
>>
>>59781783
I could have just said no but then you wouldn't know the "distilled" properties.
>>
>>59781792
Why are you replying to it?
>>
>>59781798
State your purpose.
>>
>>59781824
Why are you replying to that idiot?
>>
>>59781841
I don't have a personal rule which states that I can't respond to idiots.
>>
>>59781855
Stop encouraging him
>>
>>59781869
Why? I'm interested in what people similar to him have to say. You could say I study them.
>>
>>59781793
After litttle more searching I found wikipedia saying:
"Each element is its own inverse: for each A, A xor A = 0"
But I guess there's no "real" name for it.
>>
>>59781792
This has to be bait. Making general statements doesn't imply you oppose generalisation. You can easily be a hypocrite which was exactly what I said in my post.
>>
>>59782003
>Making general statements doesn't imply you oppose generalisation
My first sentence outright states that I disagree with the statement "generalization is bad".
>You can easily be a hypocrite which was exactly what I said in my post.
You clearly have some mental issues. Nowhere in your post did you say or even imply that.
>>
>>59782040
>thinks generalisation is bad
>the world is filled with generalisation to his advantage
Clearly anon here can't be from this world.
>random insults
If you don't want to talk just say so.
>>
>>59782067
>thinks generalisation is bad
Who thinks generalization is bad? Can you point to the particular person you are talking about?
And why are you quoting in this retarded manner?

>If you don't want to talk just say so.
Assuming I'm not being forced to do it (which I'm not), then I clearly want to talk.
>>
>>59782121
So you can't even follow the posts so far? You're clearly not actually interested in talking. You just want to write posts.
>>
File: 1466738715701.png (152KB, 500x500px) Image search: [Google]
1466738715701.png
152KB, 500x500px
>>59782158
>So you can't even follow the posts so far?
I don't know, you tell me.
>You're clearly not actually interested in talking.
Good counter point.
>You just want to write posts.
How do you get that from what I said?
>>
rate

//find repeated number
var nums = [5, 3, 7, 4, 7, 9];

for (var x = 0; x < nums.length; x++)
{
var herp = nums[x];
console.log("the first number is " + herp + "---");
for (var i = x+1; i < nums.length; i++)
{
var derp = nums[i];
console.log("the second number is " + derp);
if (nums[x] == nums[i])
{
var ayy = nums[x];
console.log("the repeated number is " + ayy + "!!!");
}
}
}
>>
>>59782240
Use lambdas, faggot.
>>
>>59782240
rewrite this in typescript or elm then we'll talk
>>
>>59782269
Javascript has lambdas?
>>
>>59782289
Doesn't it?
>>
>>59782297
Nobody knows because no sane person would use it and hipsters don't even know what lambda is.
>>
>>59782240
>doesnt use
indexOf

ayy lmao
>>
>>59782289
Yes.
>>
Generalized do notation means "let" can just be a function.
let : A -> (A -> B) -> B
let a k = k a

{
x <- let a;
f x
}
// is equivalent to
let a (\x -> f x)


In the language only "if" is primitive, but you can implement dependent pattern matching on top of it with do notation.
// propositions used as types are unit refined by the proposition
// functions from unit (including refinements) can be automatically made and applied to get call-by-name semantics
match : (p : Prop) -> (p -> A) -> (!p -> A) -> A
match p t e = if p then t else e

sign : Int -> Int
sign i = {
match (i < 0) -1;
match (i > 0) 1;
0
}
>>
>>59782289
>>59782297
>>59782314
>>59782320
Oh I get it. Not all current browsers support all of the new* stuff.

>javascript classes

Oh no...
>>
File: anal beads.png (8KB, 727x157px) Image search: [Google]
anal beads.png
8KB, 727x157px
>>59782240
var muhNumbers = new List<int> { 5, 3, 7, 4, 7, 9, 3, 1, 2, 12, 15, 12 };

var muhDupes = muhNumbers.GroupBy(x => x)
.SelectMany(x => x.Skip(1))
.Distinct()
.Select(x => x.ToString())
.Aggregate((x, a) => a + ", " + x);

WriteLine(muhDupes);
>>
>>59782421

is this actually a better/faster way to find repeated numbers? goodness
>>
>>59782341
Oh, and of course you get back monadic do notation easily.
return : A -> State S A
bind : State S A -> (A -> State S B) -> State S B
get : State S S
set : S -> State S ()

swap : S -> State S S
swap new = {
old <- get;
set new;
return old
}
>>
>>59782450
Wait, that's not right. I forgot about binding.
swap new = {
old <- bind get;
bind (set new);
return old
}
>>
>>59782341
The usage of "let" in programming triggers me so fucking hard for some reason. I can't read it without immediately thinking I'm reading a math proof.
>>
>>59782479
Programs <=> proofs
>>
>>59782442
You can do it either way, fagtron.

muhNumbers.GroupBy(x => x).SelectMany(x => x.Skip(1)).Distinct()

is shorter than
muhNumbers.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key)

but I would agree that your version is slightly more readable.
>>
File: 1491108131640.png (54KB, 287x200px) Image search: [Google]
1491108131640.png
54KB, 287x200px
>>59782481
You literally could not be any more wrong
>>
>>59782494
https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence
>>
File: muh_life.jpg (204KB, 896x892px) Image search: [Google]
muh_life.jpg
204KB, 896x892px
>Retarded city council public servant claiming our app's reverse geolocation suddenly does not work.
> WS developed by them. They 'solved' a problem with it a few days ago.
> When I go to check it, I realize they have assumed latitude goes in the x param and longitude in the y param. Because you know, if the order is lat,long, then x,y.
> Tell them so that they can fix it.
> Lazy cunt says they cant change it because its being used elsewhere (false).
> Boss says we change params to wrong order.
I lost 2 hours on this crap and was interrupted while working in a different project.
Meanwhile this fuck was probably drinking coffee on our robbed bux.

Just kill me already.
>>
>>59782492
I remove my post because I think yours is faster,
>>
>>59782494
Apply this statement to yourself.
>>
>>59782497
Try actually reading what that is.
A program CAN be a proof but is not inherently.
>>
>>59782447
Well, the part that actually does that is just
nums.GroupBy(x => x).SelectMany(x => x.Skip(1)).Distinct()
, which gives you a collection of distinct numbers that were repeated.

From there, you can do whatever you want with that information.
>>
>>59782498
Who are you quoting, retard?
>>
>>59782514
No. A program is a proof. A proof is a program. That's proven, don't argue.
>>
File: 1484985175199.jpg (120KB, 1091x815px) Image search: [Google]
1484985175199.jpg
120KB, 1091x815px
>>59782514
Do you even know what the binary operator <=> means?
>>
>>59782514
<=> is equivalence, not identity. That being said, the two notions are equivalent. Don't you know homotopy type theory?
>>
>>59782518
> not knowing greentext
Go back to plebbit
>>
>>59782554
>not knowing greentext
Who said that?
>>
>>59782554
>not knowing greentext
Nobody said this. And why are you using spaces after the quotation operator? Are you some kind of a retard?
>Go back to plebbit
Why would I be going "back" to your home site?
>>
If you had a bunch of points on a 2d plane and you wanted to make a list of the coordinates what would be the best way to sort them so you could draw a path with lines?
>>
>>59782608
hamilton
>>
>>59782570
>Nobody said this
Then why did you ask who was I quoting? First time reading a 'be me' rant? Back to plebbit then.
>And why are you using spaces after the quotation operator?
Because my windoze tablet has the > key hidden in the virtual keyboard and I had to copy-paste it.
>>
>>59782622
very informative post ty
>>
What is man supposed to use when there's no good statically typed and compiled language?
>sml
no good implementation
>ocaml
shittier sml
>lisp
static typing not standardized
>c
decent but manual memory management slows down prototyping
>sepples
convoluted cluster fuck no sane person would touch
>rust
used only by people who don't program or are mental, also tries too hard to be uglier than sepples
>any jvm/clr
requires huge vm
>d
can't choose if it wants to have gc or no
>>
File: 1466760100193865949.jpg (149KB, 900x900px) Image search: [Google]
1466760100193865949.jpg
149KB, 900x900px
>>59782678
>Not using Ada with RAII or scoped dynamic storage pools
>>
>>59782730
>ada
>end
>>
>>59782744
aw fuck, thought this was sqt
>>
>>59782670
>Then why did you ask who was I quoting?
It was meant to show your retardation. You were quoting something nonexistent, which is impossible.
>First time reading a 'be me' rant?
Don't post this type of cancer from other boards.
>Back to plebbit then.
The only one who is acting like a plebbitor here is you. You fail to respect the way things are on non-ribbit boards.
>windoze tablet
Ah... I see. That explains quite a lot.
>>
>>59782757
>thought this was sqt
You weren't far off.
>>
>>59782678
>manual memory management slows down prototyping

Just don't free your memory unless it's in some tight loop and would result in OOM.
>>
>>59782730
>>59782738
Who said this?
>>
>>59778843
Might make a script/program to download a Youtube video (such as an album) and "split" the original mp3 into several songs based on time stamps passed in as input.

I'm thinking of reading the mp3 file raw and working from there, but I'm not sure how I would split the song based on time. Suggestions?
>>
>>59782795
but muh valgrind
>>
>>59782670
Stop replying to him
>>
>>59782817
It's a prototype, not your final program. Prototypes are meant to be thrown away, not reused and normally you use higher level languages because you don't care about petty issues like this.
>>
>>59782678
My language. Examples:
>>59782341
>>59782450
>>59782460
It also has:
- a decidable fragment of dependent types for increased correctness with full type inference
- substructural types for ownership, borrowing, and effects
- no garbage collection
- safe and zero-overhead (as long as you're inside the decidable fragment) systems programming
>>
>>59782844
>My language
I don't have a compiler for it.
>>
>>59782848
Soonâ„¢
>>
>>59778930
>fibonacci iteration of that number
what is the fibonacci iteration of a number?

>that number divided by 2 also a prime number
with what rounding type?
>>
>>59782810
Why don't you use a database like the ones used by various taggers?
Also, in case you didn't know, I'm almost certain that software like that already exists. Not that it's a reason not to do that, just saying.
>>
>>59782854
You said I can use your language when it's clearly not the case.
>substructural types for ownership, borrowing, and effects
Post some examples of this.

The only thing I don't like here is the type inference garbage, it's really unnecessary, especially full type inference.
And I'm assuming the choice of using a decidable "fragment" of dependent types was made to allow for it, which is a bad choice.
>>
Rust is really nice once you get used to it.
>>
>>59782874
>with what rounding type?
would have to be truncate because rounding would always give you an even number
>>
>>59782954
that can be said for almost any language
>>
>>59782875
>Why don't you use a database like the ones used by various taggers
This exists? Didn't know that. What are the databases like?

>Why do it
Because its fun and it gives me practice for possible larger projects I'm interested in.
>>
File: 1490908200602.jpg (102KB, 329x877px) Image search: [Google]
1490908200602.jpg
102KB, 329x877px
hey how do i save a image to the computer using javascript?

i have a variable with an image url and then i want to save said image from said in the computer.
>>
File: 1463031108969.png (120KB, 299x332px) Image search: [Google]
1463031108969.png
120KB, 299x332px
>>59782494
>>
>>59782980
Not really. Rust has a learning curve that makes you write safe code. Other languages are just a clusterfuck that you will never get used to.
>>
>>59782969
ok
then please answer this too

>what is the fibonacci iteration of a number?
>>
File: 1459526627242.png (137KB, 298x293px) Image search: [Google]
1459526627242.png
137KB, 298x293px
>>59782844
>a decidable fragment of dependent types
>>
>>59782996
>Not really.
Yes really.

>that you will never get used to
Only you.
>>
>>59782996
>t. Baby Duck
>>
>>59782902
>Post some examples of this.
It's basically exactly like Rust, just better. Borrowing isn't based on regions but rather capabilities that are automatically threaded (similar to the liveness analysis stuff they talked about maybe doing in the future). With refinement types you can also express more precisely what gets borrowed. From what I can tell, this should alleviate some of the common problems people have with borrowing in Rust that require boilerplate to work around.

>The only thing I don't like here is the type inference garbage, it's really unnecessary, especially full type inference.
>And I'm assuming the choice of using a decidable "fragment" of dependent types was made to allow for it, which is a bad choice.
I flip flopped between decidable vs. full for a while and concluded that I wanted decidable right now. First of all, getting dependent and substructural types to interact practically and soundly is an area of active research. I want to save that for when I have the type theory expertise to do such things myself, or at least wait until someone else does. Full dependent types would also mean that the language needs to support writing direct proofs of propositions, which I don't want to deal with in a language that is meant for systems programming and not theorem proving (for instance, I don't have to worry about termination).

Getting full type inference is a nice side effect of this decision.

cc: >>59783016
>>
Currently restoring around 8TB of data from backup to my new server. Old server lost two hdds from failure (drives were from 2013) so I rebuilt it from the ground up. New mobo/ram/cpu and drives. Should last for a few years now.
>>
Does C++ have an equivalent of stdint.h?
>>
>>59783077
#include <cstdint> 
>>
>>59782902
>>59783056
Oh, and I would post some code for the ownership/borrowing stuff but I haven't put much thought into the syntax yet. Borrowing itself will likely not be primitive, as I think I can make it work just with substructural (probably just affine) types and refinements.

I should mention that refinements outside of the decidable fragment can still be written, they just won't be statically checked. By default, they will be inserted as assertions, but you can switch that off for release builds. I would also like to implement a feature to extract undecidable propositions to various proof assistants.
>>
>>59783077
https://stackoverflow.com/questions/13642827/cstdint-vs-stdint-h

Here ya go
>>
>>59778900
Buy an ereader
>>
>>59782844
Any recommendations on compiler books? I've got a basic polymorphic lambda calculus which I want to compile to machine code. I haven't seen a lot of resources dealing with converting functional languages to some intermediate form suitable for further compilation.
>>
>>59783241
Rather than reading textbooks I've kind of absorbed all my knowledge of this stuff from all over the place. So no, I can't give you any names in particular.

What I can tell you is to look into lambda lifting and single static assignment.
>>
>>59783241
you could look at spj's original paper
>>
File: movss.png (65KB, 709x917px) Image search: [Google]
movss.png
65KB, 709x917px
wtf is going on here? I don't know anything about vector instructions but this seems bullshit to me.
>>
>>59783346
Looks like an unrolled loop
>>
>>59783363
but why does it keep loading xmm3 multiple times without actually using it? maybe I'm missing something here. xmm registers don't work like the x87 stack, do they?
>>
>>59783260
>textbooks
Just any good resource would be fine.
>lambda lifting and single static assignment.
Thanks, I'll look into it.

>>59783269
That looks like what I need, thanks.
>>
>>59783673
What?
>>
File: 1475624685457.jpg (58KB, 600x763px) Image search: [Google]
1475624685457.jpg
58KB, 600x763px
>>59783673
>>59783700
hump
>>
File: clrs.jpg (30KB, 361x499px) Image search: [Google]
clrs.jpg
30KB, 361x499px
oh great, I'm glad you guys are still doing these threads.

Hey, /g/ I stopped programming like 5 years ago. I knew a decent amount of Java and C#, a good amount of python, and a bit of C++.

I've forgotten basically all of that though. But now that I'm getting back into it, should I abandon OOP and go for something more functional like Haskell? I've got a math B.S. so the idea of lambda calculus stuff doesn't scare me, and I've heard that OOP is just a meme. Or have I been meme'd and in reality functional programming is the meme?
>>
>>59781137
Then you might enjoy this http://www.dataorienteddesign.com/dodmain/
>>
>>59783816
>Or have I been meme'd and in reality functional programming is the meme?
Pretty much this.

The most productive and expressive potential comes from a language that can be used imperatively, and allows for plenty of expression in both functional and OO paradigms.

C# may be a great language for you to use considering you've used it before.

What do you want to program? What are your goals with learning to program?

Better language recommendations can be provided if you provide more information about your motivations.
>>
>>59778843
filthy jew
>>
>>59780575
Dude, can you open-source this? It'd be interesting to see how it works.
>>
@59783816
@59783906
>meme meme mem'd
>>>/r/abbit
>>
>>59783936
It's actually pretty basic if you think about it.

The Pokemon allow for 803 symbols to express in "digits".

"803" becomes {803, 0}, so you represent pokemon #803 and pokemon #0, which the author has used Missingno for 0, much to my amusement.

I could probably make a proof of concept of this in an afternoon, given small symbols and a list of all pokemon.
>>
>>59784047
>{803, 0}
{1, 0} *
>>
>>59783906
I'm hesitant to discuss my idea because I don't think anyone else is doing this very (very) obvious thing that I've identified. I'd like to be first to the plate, if you know what I mean. I think that if I say what it is that I'm planning, someone much smarter than me will take the idea and turn it into something while I'm still trying to get my fizz to buzz.

C# was my first choice though, and the API's and tools that I know I'll want already have support for C# already. Functional programming is something that seems interesting to me, and I've heard people say that functional programming is more likely to ensure correctness, which is something I'll definitely need. Basically, my project, for which I'm in the planning stage, is the backbone of a larger PC/Android application, and once I get proof of concept down, I'd like to come forward and try to team up with other people who can do GUI and stuff.
>>
I feel like trying something different, should I try a logic language or a functional one?
>>
>>59784162
try haskell

don't be afraid of lambda calculus
>>
>>59783346
A switch maybe?
>>
there's a port with this program running on it
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>

#define AMOUNT_OF_STUFF 40

//Learned my lesson! No more easy flags
/*void win(){
system("/bin/cat ./flag.txt");
}*/


void vuln(){
char * stuff = (char *)mmap(NULL, AMOUNT_OF_STUFF, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
if(stuff == MAP_FAILED){
printf("Failed to get space. Please talk to admin\n");
exit(0);
}
printf("Give me %d bytes:\n", AMOUNT_OF_STUFF);
fflush(stdout);
int len = read(STDIN_FILENO, stuff, AMOUNT_OF_STUFF);
if(len == 0){
printf("You didn't give me anything :(");
exit(0);
}
void (*func)() = (void (*)())stuff;
func();
}

int main(int argc, char*argv[]){
printf("My mother told me to never accept things from strangers\n");
printf("How bad could running a couple bytes be though?\n");
fflush(stdout);
vuln();
return 0;
}


passing it
system("/bin/cat ./flag.txt");

doesn't work nor does
void win(){system("/bin/cat ./flag.txt");}


does it want machine instructions passed to it? ie the compiled form of that segment of the C program? i tried making a program whose main was just what that function does, compiling it, and catting the output to the port but it didn't work. am i on the right track with that, or do i need to do something else? do i need to learn assembly?
>>
>>59782844
Actually, after a bit of thought, I think I might make the language fully dependently typed. Mostly what I wanted to avoid was the need to complicated proofs in the program code itself. I think I've found a good compromise. As far as soundness goes, I'll work out any kinks as they arise.

Basically, you'll be able to write down and use theorems without proving them, like postulates in Agda or axioms in Coq. You will be able to type check source code into an intermediate format that contains holes where these theorems are postulated. You can then use a tool to interactively prove these theorems without modifying the source like Idris does. This tool will output proof files that are "linked" with the type checked intermediate files during compilation. If there are any holes still left after this process, the compiler will insert assertions.

There will also be a tool like QuickCheck to empirically test your theorems, which could be useful if you want to switch off assertions for release builds but still have some confidence that you're not going wrong.
>>
>>59783816
be aware that math people tend to get hardons for haskell and fp in general. They end up spending their time bitching about C++ and not writing anything useful

C# is a bretty neat language but see for yourself
>>
In Batch how do I make the .bat script wait for an operation to end before running the next one? I remember there is something like "wait" or similar, not to create a timer though, I used to queue many x264.exe encodes in a single bat once using this, but I forgot the syntax and I don't have any of those .bat files anymore. Any ideas?
>>
Need to replace my keyboard. What's a good keyboard?
>>
>>59784554
Unless you are saying call command, you will always be waiting for one command to finish before you start the next one.
>>
>accept position as OSS dev in large corp
>turns out half the dev department are pajeet consultants hired through TCS
>everything is java
Atleast the pay is good.
>>
>>59784599
nvm this is what I was looking for: https://stackoverflow.com/questions/13257571/call-command-vs-start-with-wait-option
>>
>>59784566
It doesn't fucking matter, just buy a 10$ keyboard from the closest store.
>>
>>59784566
I got a Das Keyboard 4 ultimate from my rich ex a while ago. Feel myself like a dank hacker everyday and it's pretty good

It doesn't really matter tho, get the cheapest one and proceed with coding
>>
>>59784636
>he doesn't just work for the government or a contractor
>>
>>59784636
>>59784755
Who are you quoting?
>>
>>59784755
>working for Israel
>>
>>59782678
>>lisp
>static typing not standardized
(declare) flags are standarized.
>>
>>59782447
Just sort the array, you'll be able to find all repeated numbers at once without juggling variables.
>>
>>59783818
When was this written? It seems like it was written in a period where oop held the programming community with an iron fist. I'm just a few paragraphs in but it's constantly going on and on about OOP as if that's all people have any relation to. And it seems very sold on oop too.
>>
>>59785008
>It seems like it was written in a period where oop held the programming community with an iron fist.
I.e. right now.
>>
>>59782678
>copy paste
Still haven't found a better excuse for not using C I see. I told you that there's many options for memory management in C if you just look.
>>
>>59784905
compiler may ignore them. READ THE FUCKIGN STANDARD
>>
>>59783401

I don't know much about the x87 instructions, but XMM registers are large enough to store two double precision floating point numbers or four single precision floating point numbers, and can add or multiply them in parallel.
>>
>>59785020
No. Not really. It was way stronger in the 90s.
>>
>>59785045
Do you know the difference between absolute and relative?
>>
K&R or Learn C the hard way? Ideally I'd like to be able to make simple web apps with fastcgi/redis/sqlite. Also is it worth switching to a bsd for c development?
>>
>>59785087
K&R
>>
>>59785050
Yes but you might have noticed that I don't think it's such a big deal now regardless. I'm just presenting a period where I wouldn't say you'd be wrong to think that.
>>
>>59785087
Why are you learning C?
>>
>>59785087
the hard way books are all shit
>>
>>59782678

>convoluted cluster fuck no sane person would touch
Some of us have embraced that convoluted cluster fuck.
>>
>>59785087
I don't think k&r teaches you C programming. It teaches you the syntax and some standard library use in C. But I don't know of any good C programming books. I've never really felt a need for it though. It comes quite naturally.
>>
>>59785087
K&R.

>Also is it worth switching to a bsd for c development?
As long as it's POSIX-compatible, it's OK.
>>
>>59785123
Because I don't know it. I want to learn it so I can better understand the relationship between my code and my computer. Eventually I'd like to move on to assembly. Some people like to play vidya, I like to program computers.
>>
>>59782810
To begin with, Youtube videos usually aren't even MP3 in the original. They tend to be either AAC, Vorbis or Opus. Not sure how Youtube chooses, and/or if it has several or all formats available, but I've never seen MP3.
>>
>>59782678
>>d
>can't choose if it wants to have gc or no
I'm getting into D and it looks pretty cool so far. There are ways to minimize shit hitting the fan with the GC. It looks certainly better than all that VM bullshit.
>>
>>59785023
Nah currently using c for low level and doing other stuff in scheme but thinking of swithing to ocaml. Seems like the best out of the list anyways. Tried chapel though, seemed nice had nice features and easy c interface but no macros.
>>
>>59782987
There is a html tag i think that does it super easy
>>
>>59784360
Don't think you can call a function like that.
>>
>>59785026
They may get ignored but they are standarized, there is no:
(sb-ext:declare ...)
and
(lw:decalre ...)
, just
(declare ...)
.
Inline functions ARE standarized in C, but compilers may ignore them too. Following your thought, I can say inline functions in C are not standarized.
>>
File: Untitled.png (21KB, 1273x330px) Image search: [Google]
Untitled.png
21KB, 1273x330px
>>
>>59778843
Is the programmer socks to prevent deep veins thrombosis? Or is it just for the sake of wearing thigh high socks.
>>
>>59783936
>Dude, can you open-source this?
Already is.
https://github.com/SDMichaud/PNIS
>>
>>59785794
>Decimal Number
Not handling muh 3.6 pokemonstah
>>
>>59783936
The main code is here, This algorithm can convert from decimal to any base, just change the $base variable.

function gen_PNIS_number_arr($dec_number)
{
$base = 803;
$PNIS_number_arr = [];
// Trivial case, just return one pokemon with the same number that was provided
if($dec_number <= $base-1)
{
$PNIS_number_arr[] = $dec_number;
return $PNIS_number_arr;
}
else
{
// Divide the input by the base (803) and store remainder
// The quotient becomes the new input number
// Repeat until the quotient is zero
// The remainders in reverse order makeup the new number
$quotient = $dec_number;
do
{
$remainder = bcmod($quotient, $base);
$quotient = bcdiv($quotient, $base);
$PNIS_number_arr[] = $remainder;
}
while($quotient != 0);
}
return array_reverse($PNIS_number_arr);
}
>>
>>59785794
>emoji in git commit messages
cease your existence immediately
>>
>>59785846
This is the default commit message created automatically by github when initializing a new repo
>>
What do I need to learn in or order to learn graphics programming? I already have some knowledge in programming. I hear the best languages are either C or C++ for this deal, and that I have to learn linear algebra. What else?
>>
>>59785883
Read a tiger book.
>>
>>59785359
i'm not the one who came up with it, it's a capture the flag. it says its about shell code
>>
New thread:

>>59785901
>>59785901
>>59785901
>>
>>59782987
>hey how do i save a image to the computer using javascript?
From within the browser, or using something like node.js?
>>
>>59783401
>why does it keep loading xmm3 multiple times without actually using it?
Yes, that does look like bullshit to me too. Do you know where the code is coming from?
Thread posts: 314
Thread images: 38


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