/dpt/ - Daily Programming Thread

Previous Thread -

Other urls found in this thread:

github.com/gmpl/FsControl
github.com/gmpl/FSharpPlus
google.co.uk/search?q=.NET linux application
netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0
twitter.com/NSFWRedditVideo

First for superior Java

Cog gnobblin.

this is decent for HKT-like until it gets added
github.com/gmpl/FsControl
github.com/gmpl/FSharpPlus

not good enough

what would you want to achieve exactly not doable there

Node *add(int data, Node *head)
{
Node *new_node = nalloc(data);
new_node->next = head;
return new_node;
}

int main(void){
Node *new_node = nalloc(1);
int i = 2;
for(i; i

are you storing this in a byte array?

for (;i < 11; ++i)

i;
has no effect
just do ;

Aaa thanks, I see

make your own server that communicates with the API server and your client (which is installed in people's machines)

>I feel like a pajeet right now, but how do servers actually present websites and interact with databases?
>The basic idea is just to have a program waiting for a request to arrive on port 80 and get a thread from a threadpool to handle said request. Any interactions with the database are just simple queries to the database (which is running on a normal rdbms - completely separate from the server program itself) through whatever libraries are available for that combination of programming language + rdbms.
>Is this just it? Is the word server actually used in two different ways (server - the box running your code + rdbms + whatever else) and the code that's actually "serving" the requests? Why are there popular "serverside" languages? What gains would be gained from using PHP over Ocaml, for instance? What does an apache server have that makes it so popular? And how would I get an host for my server + database? I tried looking at microsoft azure, but it's all so complicated. Where can I find answers to these questions?

Repost

Oh shit wat do
>apply for paid intership at bank
>it involves mostly of programming in C#, asp.net and mvc, along with databases
I dont know what to study so I can prepare, Ive had an ASP.NET class but not sure if that will be enough to not look dumb once I get there and get assignments.
Databases shouldnt be a problem, but I fear Im lacking some basic programming skillz

>What does an apache server have that makes it so popular?
Apache is popular because you install it, change 5 lines in the config file and are good to go.
Most people who just want to host a few html pages cannot be bothered to work out how to set things up properly, so they don't, they use the easy tools.

>Why are there popular "serverside" languages?
Because they are known to work better in server environments rather than single-user environments, without the programmer having to fiddle with thread safety and such all the goddamn time.
Also because they have more safeguards in place to make it more difficult for memory leaks etc. to happen, because a server is expected to run for long amounts of time without restarting.

If you leak memory 100MB of memory per hour in your C program that normally only runs for a few minutes at a time, it's not going to do much damage
If you leak memory 100MB of memory per hour in a server program that runs 24/7, it's going to grind things to a halt consistently until the problem is fixed.

you can learn about how HTTP Servers work from google

but choosing a language has gains on
- the advantages the language has with writing/reading code
- performance
- tooling it provides with regards to debugging and development
- ``mature" libraries for that ``ecosystem"
- features such as CSP, actor model concurrency, etc.
- (as a company) how much talent you can leverage, not everyone knows Haskell or Ocaml/F#

for example RubyOnRails has tons of shit attached to it which can make it very easy to startup something quick, but performance wouldn't be that great compared to Go (for example, Go has other disadvantages like less library support compared to RoR)

Then there are companies who already use JVM/.NET for their business for non-web related things and want to use the web. They would likely only pick JVM/.NET languages like Clojure/Scala/Java and C#/F# for their backend.

End of the day it depends on your circumstances and what fits your needs.

sounds like basic web backend work (AKA CRUD)
try to get familiar with asp.net and youll be fine

they will ask you database questions
they will ask you general c# stuff and probably some async questions

Ah okay them, doesnt sound too bad.
I havent worked with MVC so I guess Ill go study that

How do you beat analysis paralysis?

>posting the degenerate homosexual anime image

How's it homosexual exactly?

Don't use OOP.

Eclipse, IntelliJ, or Netbeans for Java?

Generic Java, or for something specific like android?

Using anything but IntelliJ for Android is painful, don't even bother.

Otherwise, just go with whatever, they all have their perks and their downsides, neither is better than the rest.

Well. I'm not really using OOP that much. I have some inheritance. But it's not really much and I don't constrain myself to OOP practices.

I just keep thinking of the end goal and the options are just too many and tough to analyse.

So the TL;DR is convenience in both cases

I tried to google a bit before asking here, but everything is full of buzzwords and acronyms and whatever the fuck else. I just want to know if my understanding of how they work is correct.

What's a good host where I can use ocaml + mysql?

i have one week (7-8 days) to make a game in openGL with shaders, textures, perlin noise, etc,


can i do it?

yeah if you stop browsing and get to it

Got data to flow around the network logically and quickly

anyone else could
you? probably not

as well as DDOSing
I'm learning a lot about graph theory from all this, it's quite fun

>I'm learning a lot about graph theory from all this, it's quite fun
no you aren't

I certainly know more about it now than I did before
It's not like I'm going to learn an entire branch of mathematics from making a game

dont bully user
/dpt/ is a Christian thread

you can use linux virtual servers which allow you setup your own shit

>F#
God, it's like Winfag .NET shills fused with functional memers.
Truly cancer.

Why do people insist in create programming languages??

create useful libraries instead

>functional programming is bad
Nice meme

nothing is fused, it's functional by default and includes optional OO features and even has ocaml syntax strict mode

> Fleable
> Leggable
I shouldn't be looking at these pictures at work, I'm giggling like a retard.

>it's functional by default
Yeah, it's exactly as I said, retard.
Winfag .NET shills fused with functional memers and made F#

But doesn't that still require me to have my own server? I don't have one.

.NET is cross platform dumbass
Functional programming has loads of great features that senile fags like you don't understand

I guess look into Azure, amazon aws, and digital ocean

.NET is a Winfag invention.
Only Winfags actually care about .NET, no one else uses it but Winfags.

What the fuck is a Winfag and why should I care?
.NET has a bunch of shit I like and it's portable and not slow as fuck.

Point me to a Linux application that uses .NET
Protip: You can't, they all still rely on Windows specific stuff.

.NET core was released this year (as an alpha), so I would be amazed if any application was ported

google.co.uk/search?q=.NET linux application

I already looked into azure, but it was all so confusing and seemed like overkill for what I wanted. I'll try looking at the others too, but I'd welcome any other suggestions. I just want something like "here's a server. do whatever the fuck you want"

Then DigitalOcean is what you want. You just create a "droplet", select the hostname & system, and you get SSH root password mailed. Don't buy into AWS and other crap, those are over-priced technologies for hipsters from California.

well I think digital ocean is easier in that regard

You sure showed me.

>it's portable

wew

nobody targeting .NET wants to make a linux application

it is faggot
>reddit.gif
nice try hilary

Exactly, it's precisely as I said, only Winfags use .NET, nobody else cares about it.

Finished an autostrafer "bot" for Quake3 based games, based on the physics rules in the engine. This is really OP, since hitting the optimal angles for strafe jumping is very hard as a human. Pic related.

Yeah dude, "only" 86% of all computer users
netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0

cool

>only windows users
>only 87% of desktop users

> Jedi Outcast
Awww shit nigga, that's cool stuff.

>only 87% of a dying market, in a world where usage of every other computer device is going through the roof

I'm sorry, what world do you live in where windows phone market share is not a joke?

Let's not even get into backend systems doing the real work.

It IS portable, user.

This is 5x sped up because I'm only sampling every 5th frame.
Now to add player position markers...

Thanks guys, I'll try them first then. I think they even have a student package and everything.

Desktops aren't dying faggot, and phones and tablets aren't gonna fucking replace them for a long time

what is this? some kind of game?

Even if they were, I deploy C# + Xamarin apps to mobile and tablets.

Xamarin is pretty damn hot, especially now that it's free (freedom and beer).

>programming in C# when you could be programming in F#

C# has more support, and is more widely used.

F# is fine. I just don't care for the functional style that much.

>F#

Could you do me a favour? Film the following:

Click on the UK
Under the image, put some static text saying "If we stay in the EU".

is a good language

>It's the EU's fault we imported so many indians and pakis from our ebin colonies.

java test today pls wish me luck

Good luck, user.

Thanks :)

wishing you luck
god bless you

muh sovereignty tho

Gimmie a sec

good luck cutie!

char* string_array[];
char char_array[y][x];
for blah blah
{
for blah blah
{
fill char_array;
}
}


After this, how would I assign char_array to string array?

I'm asking since you can't declare char char_array[][].

gl mang, is it a beginner course?

It's part of a large project. We're taking soccer match broadcasts, performing shot analysis to classify them into closeups, overview shots and crowd shots. We take the overview shots, perform some more image recognition magic and extrapolate which part of the court is in view in every 5th frame. More image recognition creates bounding boxes around the players that are in view in each frame.
I wrote a script that takes some camera parameters like spatial coordinates, zoom factor etc and visualizes the camera FOV as seen from above. The next step is to take the parameters of the bounding boxes, extrapolate player screen coordinates from that (easy), transform those into world coordinates and show them in the video as well.

Wear your lucky panties, you'll do great!

You can declare char char_array[][]. I think only the first one may have variable/unknown length though. So you could do char char_array[][size].

string_array = char_array should work, I believe.

have always been interested, how do you do that

so soon you'll have a bunch of colored boxes indicating players moving around on your field in the video?

what techniques of image recognition do you use?

I should have clarified, I don't actually know what size would be until just before the for loop.

char* string_array[] is in a struct and char char_array[y][x] is in a function. X and Y are only found out inside the function.

just post the whole code already.

typedef struct
{
SDL_Texture* texture;
SDL_Rect rect;
char* map_data[];
} TileMap;

void LoadMapData(TileMap* tile_map, const char* map_file_path)
{
FILE* map_file = fopen(map_file_path, "r");

// get the width and height of the map
int width = 0;
int height = 0;
{
char c;
while ((c = fgetc(map_file)) != '\n') width++;
fseek(map_file, 0, SEEK_SET);
while ((c = fgetc(map_file)) != EOF) if (c == '\n') height++;
fseek(map_file, 0, SEEK_SET);
}

// load the actual map data
char map_data[height][width];
for (int y = 0; y < height; y++)
{
char line_buffer[width + 2];
fgets(line_buffer, width + 2, map_file);
for (int x = 0; x < width; x++)
{
map_data[y][x] = line_buffer[x];
}
}

// the important part i want to find out
tile_map->map_data = map_data;

fclose(map_file);
}

What are some Python projects I can study as a beginner?

Wow, that's really neat

Uhh before trying with video games, try learning the fundamentals on the language you're trying to use because clearly you know nothing about C.

ok thanks you solved my problem

>negative double max value is smaller than double min value
>java

you're welcome

...

what do mean? its valid C