/dpt/ - Daily Programming Thread

Old thread: What are you working on, Jow Forums?

Attached: 1556833567040.png (700x722, 542K)

Other urls found in this thread:

eta-lang.org/
twitter.com/NSFWRedditVideo

First for braces.

nth for Nim!

>qt is actually pronouced 'cute'
the heck

third for hopes

Attached: mameshiba.jpg (184x184, 5K)

It's funny because Qt is the opposite of cute.

>The alternative with whitespace delimitation would be fucking ugly as shit.
>this
(h1){Welcome to my dumb website}

>is better than
h1 Welcome to my dumb website

?????????

Nobody wants to hire me I am a worthless programmer.

Yes. A LOT better.
Not to mention your version is ambiguous, grammar wise.

what about it? the bottom is unreadable garbage

h1 "Welcome to my dumb website"

trolling outside of /b/ is against the rules, please stop.

...

Fuck off.

That's trash and doesn't allow nested elements.

could it conceivably? Like h1 blah h2(4) blah blah
4 is the number of chars after the following space

webshit get out

Attached: 1520193246060.jpg (200x200, 11K)

h1 $ em "Welcome to my dumb website"

eta-lang.org/

Thanks user I will keep trying but maybe I need to try different locations.

Even worse.
It's amazing the hoops you "people" will jump through just to avoid braces.

>the only way to signify blocks is C style brackets or Python style whitespace

Attached: 0cbpdjii3pa11.png (645x729, 105K)

One day, user. One day!

What would you do?
end blocks are pretty gross.

Begin and End is even uglier.

ML-style

>end keyword
absolutely gross

just type the first keyword backwards.

fun equals(x, y)
x == y
nuf

Attached: 61LDiyioCFL._UL1000_.jpg (1000x1000, 84K)

shell scripting is like that

nice picture of yourself

Nah, i used to be a curly loser, now I think whitespace is superior.
Although elixir has made me not hate end-blocks as much as i used to.

Brackets are fine. Whitespace is better because it forces proper indentation.

myFunction : a -> b -> a
myFunction
const
noitcnuFym

if you mean using tabluation for scope that sucks too because it forces you to create a new line for every statement which looks like shit when you have lots of small lines
brackets look better on a single line and 'end' looks better on a multiple line

Beautiful. The perfect syntax.

>it forces you to create a new line for every statement
depends what you're doing and the language, but i've found it the best out of the three main styles.

>His language has block syntax
What a joke. All you need is
if (a < b) do_thing();
if (a < b) do_other_thing();
if (a < b) return;

Attached: 1473068569478.jpg (164x160, 10K)

>statements
gross user it's not the 70s any more

>that feel when instructor just sent email extending the final project until tomorrow night

Attached: 1478326406087.jpg (490x308, 43K)

broke: ;
woke: >>=

Why are you using a sequence function as a delimiter?

; is merely a less useful, more limited >>=

who =>= win?

where can i get a formal reference/documentation of powershell syntax?
there are only references for cmdlets, but thats not enough for scripts more than 5 lines
stuff like if-else, for only exist in the form of examples
>inb4 powershell use C# syntax
i dont know C# so thats useless to me

man powershell

Shut the fuck up, faggot.

How do I read part of a text file to a string variable in C++? Not the whole line.

What exactly are you looking for in the text file?

Working on my non-programming hobby. Don't let your job be your hobby. Be prepared for that. You CAN dev 80 hours a week, but it'll drive you crazy. All the context switching. Imagining what you could have done if all those hours were dedicated to one thing rather than three or four. Nurture more passions, if you can. One for your pocket book and one just for you.

One of the values in it. For example, I'm using a for loop to step through the file to assign different values in the line to different variables of different types. Line 1 of the file would be
12 Table 30 452
assigned to "Quantity", "Product", "Price", and "SKU" by the order that they are read in. I tried using char arrays, but that was one big headache for this brainlet.

String has methods defined to do exactly that. There are also standard sorting, searching, and regex algorithms defined. You could do the entire thing and barely write any code of your own.

52nd for remi's fat ass!

Remi does NOT have a fat ass!

Remember not to forget about C++26.

Attached: 1527436177006.jpg (1040x576, 149K)

Uncle Joe is training your replacements, white bois

Attached: 1539692153839.png (602x687, 285K)

Attached: sdfghjkl;.png (286x251, 2K)

Attached: dfghjkl.webm (864x616, 2.7M)

How to enable this button?

>What are you working on, Jow Forums?
something niggerlicious

Attached: Screenshot_20190509_234506.png (732x182, 32K)

#include
#include
#include

using std::fstream;
using std::string;
using std::vector;


struct InventoryLine {
int quantity;
string product;
int price;
string sku;
};


vector readInventoryFromFile(const char *filename) {

vector inventory;

fstream ifs;
ifs.open(filename, std::ios::in );

while( ifs.peek() != EOF ) {
InventoryLine temp;
ifs >> temp.quantity;
ifs >> temp.product;
ifs >> temp.price;
ifs >> temp.sku;
inventory.push_back(temp);
}

return inventory;
}


I didn't test it and I've been drinking, but you get the idea.

Search for the string "Enable Me" then try and find some data structure that references it. Then enable the button by modifying the value in memory, if you are going to use cheatengine

>mfw streams
fstream ifs;
ifs.open(filename, std::ios::in );

while( ifs.peek() != EOF ) {
InventoryLine temp;
ifs >> temp.quantity;
ifs >> temp.product;
ifs >> temp.price;
ifs >> temp.sku;
inventory.push_back(temp);
}

Attached: 1493090830636.png (371x360, 124K)

Comments make everything ok

it's like acknowledging there's a problem but not doing anything about it

They're magic, yo. It knows the type, and it does the right thing (assuming your file is laid out correctly).

I would rather use fscanf

Attached: 1479616908740.jpg (602x815, 51K)

>vector of structs

Please explain that picture. I really need to understand it.

imagine the (free) smell

C is the obese woman
Jimmy Johns is C++

Get shit on C++

Attached: Jimmy_Johns_Store_Front.jpg (3010x1680, 464K)

>comparing languages to sandwich delivery joints and fatties
ABSOLUTE STATE of /dpt/

Ok grandpa.
Either way, the code is practically the same.

Pig disgusting is not the same as elegant functionality.

Attached: 1496808647929.png (1288x1048, 1.45M)

please don't use pig disgusting to describe things other than 3d s

Jow Forums, I made a calculator, that is all.

Attached: scren.png (1600x900, 210K)

Post the other files in your documents.

I think I may have fucked up.
>taking online final exam for CS course
>exam is writing a program that synchronizes processes
>doing it on SSH client to university's server
>almost have it working
>make a retarded change and run it
>get a huge infinite loop that appears to be endlessly creating new processes
>can't manage to exit it so I just close the SSH shell
>now I've been trying to connect to the server for two hours and it's not working
>exam is due tomorrow
I'm not so worried about not turning it in. I could probably re-write it in time. I'm afraid that I crashed the fucking server and all the other students who are probably doing to right now can't connect either and the professor will kill me.

nice

>math.sqrt
>math.sin
>math.asin
yeah you made a calculator alright.
cool good job tho man.

Yes, it handles an unlimited length expression, I suppose an order of operations parser is a better name.

Good job fuckwad.

>crashed the fucking server

Then the school's IT department is retarded as fuck. No matter how badly you fuck up your own personal little student sandbox, it shouldn't effect anybody else's.

>I'm afraid that I crashed the fucking server
If they didn't have things running in a sandbox, that's their fault.

Also, I wonder if you were the only one that has done that.

>been trying to connect to the server for two hours and it's not working
shame on them

Why are you wrapping the functions in a lambda? Why not simply

'sqrt': (1, math.sqrt)

>import math

Attached: thonk.jpg (512x498, 44K)

>#include

Attached: 1493874432843.png (377x330, 8K)

what anime is this?

nice

Imagine being so fat you see computer and think of food

that's not an anime that's a 2who

sorry friend, but i am not educated in japanese culture

understandable, ask why ray moo is the best 2who for more information

>2who
>ray moo
what the fug? stop making it sound like wuxia shit.

Attached: 1557249308451.gif (300x300, 1.92M)

toehoe

Because that wouldn't work retard.

>no eta reduction in python
python is shit
you're just a mad gaygenie who can't pronounce nihongese as well as me

braces and semicolons are for big-brained programmers

math.sqrt evaluates to a callable object.

Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> fn = math.sqrt
>>> fn(25)
5.0

rude
qt a cute