/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

mono-project.com/
monodevelop.com/
en.wikipedia.org/wiki/Golden_ratio_base
azure.microsoft.com/en-us/pricing/member-offers/vs-dev-essentials/
mva.microsoft.com/en-us/training-courses/microsoft-azure-fundamentals-8391
go.microsoft.com/fwlink/?LinkId=691978&clcid=0x409
visualstudio.com/vs/visual-studio-2017-rc/
chromestatus.com/feature/5453022515691520
bellard.org/jslinux/
github.com/w1c/etc/blob/master/nyaa
github.com/WebAssembly/design/blob/master/TextFormat.md#linear-bytecode
youtube.com/watch?v=LR8fQiskYII
twitter.com/NSFWRedditVideo

First for D

Fist for OOP.

alright boy
*lifts your skirt and shoves my entire arm up your anus*

What did he mean by this?

they might be in Lisp but not in C. there should be a space in between if and the conditional.

Why, will you not be able to tell that it's an if statement if people don't do this?

first post bait post

it's good style and practice.

>Visual Basic Studio
There is no such thing. This, and other things you are saying are indicating a complete inability to follow basic instruction or read what's on your screen.

I'm not the user you're responding to, but this post makes you either look extremely retarded, or shows that you are certainly trolling.

Unfortunately, Poe's Law doesn't allow any confirmation either way, and so we'll just have to call you a faggot and move on.

C# is a great language, Visual Studio is a great IDE, and Azure is a godsend for anyone who understands the value of not having to fuck with your own hardware. That being said, these are tools meant for productivity and ease-of-management in a business environment. I suppose I can understand how it can be a bit overwhelming for someone starting out.

I recommend this book posted here if you want to try again and pay attention to what you're doing: In reference to Mono:
mono-project.com/
monodevelop.com/

Making a WoW bot for the lulz

Progress is slow because Windows IPC debugging a shit

Hex > Binary > Decimal >>>>>>>>>>>>>>>> Octal

>integer bases

>Windows [...] a shit

Correct

Is there a retard-friendly way to start learning Azure without paying?

There's different kinds of bases?
Are you sure you're not just assuming these bases can't have radix points for whatever reason?

en.wikipedia.org/wiki/Golden_ratio_base

Javascript is the future

got it.

the future is bleak

Web assembly will rekt all js babbies

fp is the future

>What are you working on, Sup Forums?

Trying to decide if I should go back to school as an old fag to get my meme degree, or if I should fore go it and spend the next few months trying to be marketable enough to get a programming job.

azure.microsoft.com/en-us/pricing/member-offers/vs-dev-essentials/

$25/month credit for a year, easily enough to play around and learn.

I do believe you will need to put a credit card on file, but it is impossible for a charge to actually occur unless you specifically tell it to go over that $25/month.

Free Azure training (there are good C# courses here, too): mva.microsoft.com/en-us/training-courses/microsoft-azure-fundamentals-8391

The biggest reason I love Azure, is that everything has .NET SDKs to manage functionality and pull information. For example, I can use (read: abuse) the Azure Data Factory ETL services with C# code locally on my machine, which means I don't have to dick around with the GUI and I can create datasets/pipelines programmatically based on my databases.

Unfortunately, I believe anyone here would have a hard time seeing Azure's value until they're really in the industry to some degree, and have live data and users to control and work with.

Fuck you for using an anime image

here

So what is the least shitty version of VBS, if I'm literally forced to suck Microsoft cock to code in C#?

Again, I'm an idiot. I just want something that will work, on not-great hardware running (ugh) Windows 10.

Always go for the degree.

First for a .NET life of corporate dreariness

>VBS
What are you referring to here? Again, there is no such thing as "Visual Basic Studio".

>I just want something that will work, on not-great hardware running (ugh) Windows 10.
Visual Studio will be fine for this.

There isn't much resource overhead while running the application.

See

>Again, I'm an idiot.
You shouldn't be programming, then.

>>Visual Basic Studio
>There is no such thing. This, and other things you are saying are indicating a complete inability to follow basic instruction or read what's on your screen.
I'm just getting the branding for all this shit mixed up. There WAS a thing called Visual Basic. Alright, it's called Visual Studio. Got it.

What is the least shitty, free version of VS? The last time I installed this, at anons recommendation, it was 8GB. Which seems pretty fucking huge.

But I'm broke and practically 30. It's a lot harder to work up the morale when you're not 18.

Are you a cute trap?

>I'm broke
Question answered, nay?

>practically 30
>cute trap
don't get your hopes high

>There WAS a thing called Visual Basic. Alright, it's called Visual Studio.
No, Visual Basic is a programming language. There is still a thing called "Visual Basic", and it is a language that also works with .NET. You can use Visual Studio to develop in many different language, including Visual Basic (VB), C#, C++, C, F#, and others depending on plugins you want to install.

>What is the least shitty, free version of VS?
VS Community 2015:
go.microsoft.com/fwlink/?LinkId=691978&clcid=0x409

8GB includes many versions of .NET and their SDKs, as well as tools to develop other types of applications. With the new VS2017 release, they're cutting down on the filesize if you require less tools.

If you'd like to try the new VS2017 release-candidate, you can get it here:
visualstudio.com/vs/visual-studio-2017-rc/

idc gimme da puss puss

Honestly, I've grown to accept the WinAPI. It does what it's supposed to do and is well documented and feels sort of comfy. It's just that debugging it and using it without 5 layers of newer frameworks can be a real pain.

WebAssembly is enabled by default in Chrome.

Wew.

chromestatus.com/feature/5453022515691520

Beginning of the end for JavaScript?

A script to batch rename my pirated TV shows to a more human-readable format, fetching the episode names if not provided.

I'm not going to take hormones and live in your jail-bed

I could be worse than broke if I take out loans.

>I'm not going to take hormones and live in your jail-bed
Oh holy fuck I had forgotten about that picture, and now I remember that picture(s?).

クライスト
I don't want an OS in my browser

bellard.org/jslinux/

>I could be worse
But wouldn't you rather be better by taking out a job?

Why the fuck can I never find any example code for wasm
I just want to know what it looks like

>But wouldn't you rather be better by taking out a job?

I'm not sure I understand what you're asking. I'm saying there's no guarantee of work after I graduate. My people skills are a little shitty, so I might just be permanently unemployable and it's hard as fuck to get ride of student loan debt unless you have a career.

asm.js is the present. WASM is the future. JS is deprecated.

>57
Need for it to trickle down to stable now.

> tfw your language becomes unparseable with only a single token lookahead

feels shit desu

Always go for the meme degree. That stupid piece of paper is a long term investment.
I know countless of freelancher that dropped out of school and jumped into the mobile bubble. Now they're stuck doing shitty projects because no company wants them.

they aren't in lisp
> being so ignorant you don't know how while and if are implemented
> also not knowing that lisp generally has the same strictness semantics as C and therefore you can't implement while or if as functions

>Now they're stuck doing shitty projects because no company wants them.

Yeah, I kinda where I'm stuck now which is why I wanted to go back. I just have this gut feeling that the tech bubble is going to pop again about the time I get out.

I want to get the MD5sum of a chunk of flash memory going through it byte by byte but I keep getting a crash at runtime.
const unsigned char *partition_address = 0x0010000
unsigned int partition_length = 0x0100000;
unsigned char local_bin[16];

mbedtls_md5_context ctx;
mbedtls_md5_init( &ctx );
mbedtls_md5_starts( &ctx );
for (int i=0;i

hey guys help a noob out in c#

assume i created a client class, a car class and an inspections class (pretty much only has a cost inside). the client class has a car array, and the car class has an inspections array.

i want to calculate total costs of inspections by client and in total. my main question is where do i put the functions and what needs to "enter" them.

i have this function in the client class
public float CostsByClient()
{
float total = 0;
for (int i = 0; i < nCars; i++)
{
for (int j = 0; j < cars[i].totInspections; j++)
{
total += cars[i].inspections[j].cost;
}
}
return total;
}

now for calculating the total cost of all clients, i declared an array of clients on program.cs, like this:

static public float TotalCost (Client[] clients)
{
float tot = 0;
for (int i = 0; i < clients.Length; i++)
{
if (clients[i] != null)
{
tot += clients[i].CostsByClient();
}
}
return tot;
}

why do i have to make it static? should i just put that code on program.cs and not make it into a function?

The tech bubble as a whole won't pop anytime soon. There's too much going on.
I do think native app development will grind to a halt very soon. Most companies cannot/won't afford two code bases practically doing the same thing. You can already see companies moving to web based apps or using something like Xamarin. Which sucks, because that's where I'm in.

This is in c btw.

Because it doesn't change anything in the class internally.

i managed to finish all my numerical math problems with octave.
feels good!

but gotta say that the compatibility to matlab is pretty underwhelming.
still very nice to improve your math skills

/blog

Larry Wall's top 5 languages are JS, Java, Haskell, C and a scripting language (Perl, Python, Ruby).
What does this list make you to think?

He has shit taste.

alright thanks, so im guessing its fine to set it as static and it should work.

another thing, i created a ListInfo method on my clients class that lists all their shit and it is also supposed to print their total inspection cost. so if i just do

Console.WriteLine("Total inspection cost: " + CostsByClient());

inside ListInfo would it be fine? both CostsByClient and ListInfo are in the clients class.

The guy tries so hard to be diverse that he should move to Sweden.

rate my nyaa.se torrent searcher script
github.com/w1c/etc/blob/master/nyaa

I'll see if I can compile something. Not sure if there is an objdump-like tool or if it's string or what. I'll have to see for myself.

>JS, Java, Python | Ruby | Perl
Is his idea that you should learn some shit languages and some good languages?

winapi + wtl is pretty much all you need.

Which ml language implementation should I choose if I want to
compile to android
easy ffi
no GIL

That he should be gassed.

github.com/WebAssembly/design/blob/master/TextFormat.md#linear-bytecode

>top 5

It's "Top five that you should know about". Big difference.

youtube.com/watch?v=LR8fQiskYII

I think his idea is you should know how to handle all instruments, so you could be put under different conditions and being able to drive out the situtaion successfully.

My bad, sorry.

>i want to calculate total costs of inspections by client and in total
You should be using LINQ for this, and it's very very easy.

Without seeing your class definitions, I'll assume it's something like this:
var costByClient = clients.Select(client =>
new
{
Client = client.Name,
TotalCost = client.Cars.SelectMany(car => car.Inspections.Select(i => i.Cost)).Sum()
});

var totalCost = costByClient.Select(x => x.TotalCost).Sum();

costByClient
.ToList()
.ForEach(x => WriteLine($"Total for {x.Client} is {x.TotalCost}"));

WriteLine("Total cost is " + totalCost);


Here's my classes:
class Client
{
public string Name{ get; set; }
public List Cars { get; set; }
}
class Car
{
public string Color { get; set; }
public List Inspections { get; set; }
}
class Inspection
{
public double Cost { get; set; }
}

Also, let's all pretend I used decimal instead of double there, because we all know that you should always use decimal for money.

but think of the pennies we can siphon off, man

Yeah it should work just fine.

thoughts on Kotlin?

CPP

How do I get this map of functions to work in a loop, executing each one)?

std::map helpTexts;


helpTexts[CommandName::ABILITY] = &CommandHelp::Ability;
helpTexts[CommandName::BUILD] = &CommandHelp::Build


msg = (commandHelp.*this->helpTexts[arguments])();

Literally who?

>100% interoperable with Java™
saved my self the trouble.

ty
thats kinda cool, i really should get started on learning linq, thanks user.

if Scala is Java in 15 years, Kotlin is Java in 5.
desu Ceylon has a lot more interesting and 'new' ideas in it, but Kotlin is much safer to migrate to.

Java sprinkled with memes.

>theoretical product costs 30 cents, or 0.3 dollars
>price stored as 0.3
>insert 3 dimes (0.1 each)
>machine tries to pay out an infinitesimal amount of cash as change

What do you mean?

Maybe it's a library bug. Try increasing the chunk size to 4 or 8 and see if it works.

Otherwise I don't know. Maybe something wrong with your offsets?

no shit

>program machine to wire off that small amount of change into a swiss bank account
>become rich

It's like you hate money :^)

>what is an office space reference

also your scenario wouldn't exactly happen with doubles, you'll get 0.999~=1.0 (or the dual of it) more likely than trending towards infinity like some zeta function

but yes, decimals should always be used when it comes to figures that _need_ to balance correctly (i.e money or # of pictures of your waifu)

Where are you getting your episode names from? Was planning to do this myself sometime.

In my MVC project (PHP), I have a BookController. I need to be able to display the following:
1. a user specified card
2. all cards within a category (thriller, romance, etc)
3. all cards

Do I implement a different action method within BookController for every action, or do I create a single action 'View' which performs some logic and then update the model accordingly?

Java is pure.

Pure shit

or hackers, or superman III

doesnt matter as long as it is pure

>pure
java gets CRUSHED every night

>thank_you_master.jpg

I just finished Ashita no Joe 2

I cried

Trying to decide what I want my first solo project to be. Always have done projects for school but never on my own. I'm thinking a text based RPG in C++, mainly because I'm not familiar enough with the language as I was python or the web languages. Thoughts?

Be a man and do it in C!