Previous thread: What are you working on Jow Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
better-dpt-roll.github.io
en.wikipedia.org
twitter.com
Thank you for not using an anime image.
Learning lower unsafe features in C#
sorry, couldn't find my /dpt/ Nagato
Start importing Windows API via DllImport attribute and learn how shitty it is, coded by fucking Pajeets at Microsoft
What's the difference in behavior between public delegate int PerformCalculation(int x, int y); and public interface CalculationPerformer { int performCalculation(int x, int y); }?
It's the same shit, having separate, distinct, incompatible mechanisms for closures and objects when they're formally equivalent is nothing but mindless bloat.
You have great autism.
Are you retarded?
I have to confirm, are you baiting or is this why pajeets can't into events?
Interface is a contract and delegate literally represents a function pointer.
public IEnumerable Where(this IEnumerable source, Func predicate)
{
//use predicate to filter sequence and return new IEnumerable here
}
See? Func is a function which takes T and returns bool based on something, like x => x.StartsWith("A");
Interfaces have nothing to do with delegates
this is same as
char *FilteredArray(char ** source, (bool*)(char*) predicate)
{
//filter with this predicate and return new array
}
Repost someone help me on discord?
bool (*predicate) (char* param)
fix myself
keep forgetting function pointer syntax all the time
This is precisely how functional interfaces in Java 8 work, dummy.
public interface Predicate { bool invoke(T t); }
Iterable where(Iterable source, Predicate predicate)
{
/* ... */
}
var filtered = where(iterable, t -> t > 5);
You must be seriously retarded to not understand closure-object equivalency, or to think that first class functions that close over dynamic scope are the same as function pointers. But I see csharts have set a new low for themselves today.
that task description is so shitty i can't tell if it was written by a genius prof or lazy working student
You are seriously retarded desu.
Bretty good times to be a see plus plus programmer tbqh
are you literally stupid?
You should re consider your life choices.
Working on a simple programming challenge for /dpt/
>anime
kys
what do you not understand?
Where do you think you are, redditfag?
I'll help you here, underagefag.
Here: Write a program with a class named Coin that can simulate the tossing of a coin. When an object of the class is created, it should display the image of a coin that is faceup. The class should have a member function named toss that randomly determines whether the coin is faceup or facedown and displays the appropriate coin image. (You can create your own coin image or use the ones provided in the book's online resources, downloadable from pearsonhighered.com/gaddis.) In the program, create a Coin object. Each time the user presses the spacebar, the program should simulate the tossing of the coin.
Pretty simple now, right?
How do you draw an image?
Are all javalets such sore incompetent losers?
Google: How to display image in
csharts seething that they can't come up with an argument
imagine being even more retarded than a javajeet
Detection of dark ui practices: heuristics or detection of anomalies based on user behavior?
Has anyone already done this?
99,99% of people using my language spent their time in a terminal. No one know how to draw an image with it.
Ever stopped for a moment to read what you are posting? There just might be a chance that you
are actually retarded hence being called retarded six fucking times.
What language is that?
rust or c++
what language?
Do you prefer OOP or FP?
OOP: C++
FP: Rust
OCaml
Yes it is but that’s what I have to work with
My life is great except for this programming project
This is for my video game programming class which is an intro C++ I have to take basically. My program focuses more on the art and technology and not coding and I know this isn’t tough. I do not know how to display an image using C++ and utilizing what I was “taught” in the class
See I have done that but I found there are a lot of ways that go outside the scope of this class. I may not be smart enough to write this code easily but I know there is something they are looking for and I am having trouble. Like I mentioned I’m focused more on art and not programming in my degree so I am not well equipped to do this easily.
I can post some pics from my phone so you can see what the class teaches for images.
i prefer fp but mostly i just want to be employable when i graduate
Oh then C++ currently
post it, I love Nagato
>that shit paper quality
FFFFS
So is rust just better JavaScript?
Yes, I can't think of a more apt comparison than between Rust and JS
Rust is the cucked functional version of the procedural C
Yes, it's statically+strongly typed
why don't you think it'll replace cpp in a few years?
Rust is a better Cyclone.
No one is willing to rewrite legacy code.
If that was the case, Java and sepples would have been replaces years ago.
This seems like the worst way to learn programming
OOP is everywhere (C++, Java, C#) in business. Non-OOP langs will take a while gain ground.
+ what said
>No one is willing to pay to rewrite legacy code.
We are learning in the context of game design. And also this was required by my professor for a sophomore/freshman level intro class
What would be a good project to learn rust? I need something beefy but manageable to work on to learn something
redpill me hardcore on webassembly my family
Rewrite Linux in rust
Webserver maybe?
memory allocator
Rust compiles to Java script and is essentially the same thing
My sister is no nigress!
>wasm
Wasm to JS is like JVM to java
It is just an intermediate language highly specific to JS API to allow faster execution of botnet.
This. Does she cum on the paper or drop her grease regularly on the paper?
>no function
>no currying
>no partial application
>statement everywhere
"rust is functional, bro."
webm related
found it after a little googling
It tries.
gimme some simple/easy ideas for an intro to android dev course project.
We are just doing simple elements and stuff in Android Studio and I gotta choose the topic for myself.
A modern practical guide to pooing in loo and how beneficial it is.
What is that DownHat?
Is there a better way of writing the code in pic related?
For a lot of my assignments, I need to plot something of the form H = (1 + s/z1)(1 + s/z2) ../ (1 + s/p1) (s/p2)...
And I realized I just writing a similar function over and over, so I want to automate writing the function in matlab (because god knows Matlab syntax is ugly as hell)
A simple program with one button that is called abortion which does just that.
>Webshit in C++
My kind of masochist.
Interesting. Indentify the user from how he clicks on the desktop.
Interesting..
>DownHat
?
Chapel and D are better than rust. C++ is better than rust. Javascript is better than rust.
newfig leave the chan
std::string encode_cocks(unsigned char const* cocks_to_encode, unsigned int cock_length)
{
unsigned char char_array_1[3]; unsigned char char_array_2[4];
int i = 0; int j = 0;
while (cock_length--) {
char_array_1[i++] = *(cocks_to_encode++);
if (i == 3)
{
char_array_2[0] = (char_array_1[0] & 0xfc) >> 2;
char_array_2[1] = ((char_array_1[0] & 0x03) > 4);
char_array_2[2] = ((char_array_1[1] & 0x0f) > 6);
char_array_2[3] = char_array_1[2] & 0x3f;
for(i = 0; (i
What would be the proper way to implement that?
Like this
questionNums = 12
possibleAnswer = {0:'A', 1:'B', 2:'C'}
for a in range(0, questionNums ** len(possibleAnswer) - 1):
for b in range(0, questionNums - 1):
print(possibleAnswer[a/(3 ** b) % 3 ]),
print '\n'
or something different?
>std::string
I didn't even bother to read the rest of it.
I already know it's garbage.
What's wrong with std my fwiend?
Am i blind or is ret not declared anywhere?
using namespace std;
use std::*;
Learn C++
i-it's not declared I couldn't post that much code.
If I import a licensed (MIT for example) library to my code, does it count as copying of the code and do I therefore have to include the license notice in my source code as well?
Or does it only apply if I save the library files/source code in my own project repo?
Yes
t. koder
It's sepples: so it's automatically shit.
Not him. What's wrong with it?
>import a licensed (MIT for example) open-source library to my proprietary code
>sell for big bucks
I'm making my own MIT licensed code which uses a MIT licensed library. I am importing it in my code (it is automatically fetched on build using go package manager). Do I have to include the license file in my own repo or not?
If you live in America, just take it. Settle if ever becomes an issue.
A framework
test for internship tomorrow
need to "learn" C++ and java fast
wat do
give up
there is absolutely no way of adequately learning c++ in such a timeframe
java maybe, but never c++
Enumerable.Range(0, 100).Select(n =>
. n % 15 == 0 ? "FizzBuzz" :
. n % 3 == 0 ? "Fizz" :
. n % 5 == 0 ? "Buzz" :
. n.ToString()).ToList().ForEach(Console.WriteLine);