[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

/dpt/ - Daily Programming Thread


Thread replies: 341
Thread images: 18

File: K&R himegoto waifux2.png (1MB, 1000x1400px) Image search: [Google] [Yandex] [Bing]
K&R himegoto waifux2.png
1MB, 1000x1400px
old thread: >>51898447

What are you working on, /g/?
>>
>>51901537
you should use python imo (in my opinion)
>>
>>51901537
typedef U32, U16, I8, F32, etc.

imo
>>
>>51901578
python is garbage fact (fact)
>>
>>51901563
Please do not use an anime image next time, thanks.
>>
http://pastebin.com/hi1R4LAk
One last try, failing this I'll just dump the project and move onto something else because I can't find an answer anywhere.

Need to bind listboxes to this data class in WPF/C#.

Each ObservableCollection should bind to a listbox, and all the children should represent their parents correctly. I haven't a fucking clue how to do this, not one single idea. I've tried more or less everything and it hasn't worked, so I need someone to just spoonfeed me because I'm losing my mind.
>>
>>51901631
you didn't post much code. How are you binding this to your window? What is not working exactly?
>>
File: xh21bJD.png (2KB, 203x201px) Image search: [Google] [Yandex] [Bing]
xh21bJD.png
2KB, 203x201px
>>51901698
I'm not binding it at all, the methods I've used so far involve using
        public static Mod mod;

public ModuleConfigWindow()
{
InitializeComponent();

lstGroup.ItemsSource = mod.Groups.ToString();
this.DataContext = mod;

This, and all I get is this.

System.Collections.ObjectModel.ObservableCollection.1[SimpleFOMOD.Group]
With one character per listbox entry.

I'm not sure how I'm meant to set the binding up so it reads the observable collections values as opposed to just giving me the name of the property.
>>
best book to learn java as a programming newbie?
>>
9th for D.
>>
>>51901789
Go outside and shit on the pavement.
Holy Krishna will accept you as an honorary member of the people of India and endow with full knowledge of Oracle Java 8 and all of it's best practices.
>>
>>51901750
>>51901698
                if (txtAddGroup.Text != "")
{
e.Handled = true;
mod.Groups.Add(new Group(txtAddGroup.Text, (rboSelectAny.IsChecked ?? false) ? "SelectAny" : "SelectExactlyOne"));
lstGroup.SelectedItem = txtAddGroup.Text;
txtAddGroup.Clear();


This is how I add a new group, just in case you need to know the context in which the Groups exist.
>>
Stacks give me a major hard-on
>>
>>51901840
but im a white neet just looking to get a job maintaining some shitty business app so i can stop being such a drain on society (uk btw)
>>
File: pBeB4X2.png (10KB, 524x167px) Image search: [Google] [Yandex] [Bing]
pBeB4X2.png
10KB, 524x167px
>>51901698
>>51901750
>>51901843
And this is what I get if I do it this way.
>>
>>51901750
is mod not null there? Where is it initialised?
>>
>>51901888
I'm not really seeing enough code to be able to understand where the problem might be.
>>
>>51901900
At the top here
public static Mod mod;

I seem to be able to add values to it just fine when I set it up like this
>>51901888
I add a value to the object and it just displays "SimpleFOMOD.Group" but not the name of the property.

Here's my github - https://github.com/sirdoombox/SimpleFOMOD

https://github.com/sirdoombox/SimpleFOMOD/blob/master/SimpleFOMOD/ModuleConfigWindow.xaml.cs
and
https://github.com/sirdoombox/SimpleFOMOD/blob/master/SimpleFOMOD/Class%20Files/DataObjects.cs
are the relevant files.
>>
>>51901976
Is there a reason for Mod to be static?
>>
>>51902038
Not that I can think of... Would that make any difference?
>>
>>51902054
Do you know what static is used for?
>>
>>51902038
>>51902054
>>51902060

I tell a lie.

In MainWindow.xaml.cs I pass over inputs, I remember why I made it static now. Apologies I've been working on this specific issue for so long that I'm starting to forget my own code.
 ModuleConfigWindow.mod = new Mod(txtModName.Text, txtAuthor.Text, txtVersion.Text, txtURL.Text, cboCategory.SelectedItem.ToString(), new ObservableCollection<Group>());
>>
>writing code for assignment
>works for all test cases I can throw at it
>send to eval
>10/100 with WA on everything

the fuck am I supposed to do now
>>
>>51902054
Not sure. It should be null is you don't give it a value either way, so not sure why you're not getting errors already.
>>
>>51902070
post all the details and we'll see, otherwise manually compare the answers with what you think the answers should be

most cases I get is that I forget which collection types in python are sorted or unsorted
>>
>>51902074
>It should be null is you don't give it a value either way

If you see: >>51902069

It looks like he does give it a value.

Still shouldn't be static, though.
>>
>>51902116
I get it. how are you binding the DataObject fields to the controls? I'm probably just not seeing it. I was expecting to see it in the xaml.
>>
>>51902149

I'm not him, dawg. Just pointing out that he's got an object there.. just not a good design choice.
>>
>>51902319
oh right, getting mixed up.
>>
django lads
>>
>>51901563
What a cutie
>>
>>51901563
Do not undermasturbate language of Go. It's so simple. It's great.
>>
>>51901789
anyone?
>>
>>51902473
http://progzoo.net/
>>
>>51902522
any book recommendtions?
>>
>>51902539
What do you look for in a book?
Basically, tell us about how you learn and why a book is important to you.
>>
>>51902539
My Java course used this book, it was pretty good
http://www.amazon.com/Java-Introduction-Problem-Solving-Programming/dp/0133766268
>>
>>51902572
i like to read. i learn better from reading something than watching a video for example. i am looking for a book that will teach me java for a total beginner to programming.
>>
>>51901563
I'm getting into internet programming. Currently learning PHP and so far its been indescribably easy. I mean, its kind of a mess at its whole in my opinion, but for someone used to the complexity of C / C++ (and a specially regrettable experience with, ugh, C++ CLI), PHP is quite comfortable.

Anyone got any advices?
>>
>>51902687
Stop learning PHP, it's on the way out for new projects, unless you really really like maintaining early 2000s sites, or competing with the loads of WP developers who do it for free.

Ruby, JS, and Python are where it's at for web development.
>>
Just finished job interview question. Have fun
Your task is to write a program (Linux application in C) that takes a text
file and prints out the number of occurrences of each word.
E.g:
test.txt <<<
Hello, this is a "Hello world"
text file, it is!
>>>
$ occurrence < test.txt
Hello 2
is 2
a 1
file 1
it 1
text 1
this 1
world 1
>>
>>51902735
That's pretty easy. Haven't done C in a while, but can't you just stick a string and an int in a struct, then just keep an array of those?
>>
>>51902735
strtok on space and punctuation, dump tokens into add-or-increment hashmap.
>>
>>51902735
>strip anything that's not a-zA-Z
>strtok and count werds

What do I win?
>>
>>51902757
>>51902758
>>51902760
Efficiency/10
I wrote a trie that sorts itself alphabetically on key insertion.
>>
>>51902770
>I wrote a trie

You're fired.
>>
>>51902735
>it is

Bigfoot?
>>
>>51901563
>>51901563

What language is used for inputting commands in Windows PowerShell?
>>
>>51902770
That sounds like you're making it overly complicated just to show off.
>>
>>51902795

I wrote a Trie in C a few weeks ago (first time ever doing one, and in C to boot) and it wasn't that difficult.

Still, it wouldn't have even crossed my mind for something like this.

It's overkill.
>>
I want to make some shitty websites in python,
What do I need to download so I can mess with django locally?
>>
>>51902846
Python
Django
>>
>>51902770
>Implementing overcomplex datastructures for the task by hand
lmao 0/10 maintainability, and enjoy fixing bugs that the stdlib already covers.
>>
>>51902862
That's all I need to test my websites?
I don't know, I haven't messed with django yet.
>>
>>51902879
Also a web browser
>>
>>51902879
Django comes with a local webserver for development testing.

>>51902891
This too. I recommend Internet Explorer 6.
>>
>>51902891
god damn it
>>
>>51902904
>This too. I recommend Internet Explorer 6.
u cheeky little cunt
>>
>>51902879
If you want to do proper testing, Selenium is a useful tool to have. Again, there are python bindings.
>>
>>51902920
do you mean io.lines or file.lines?
>>
>>51902877
And which stdlib function would that be? The output is sorted by occurrence and alphabetically. I am pretty sure to test it they feed the entire Aspell dictionary into it. The trie stores common characters in each string efficiently.
>>
>>51902934
>>51902920
>>
>>51902937

desu fambly, I would just use kvec.
>>
Working on a skillpoints module for my D&D rip-off. I'm using an AND-style validation system to check if both the character has been named and all skillpoints have been used. If both conditions haven't been met, you can't finalize changes and begin the game.
http://pastebin.com/es2ytTTA

Code would've been too many characters to past here

I'm writing the game in
>VB

I'd like to write it in C++ but I feel intimidated to learn it - it feels really complex in comparison to VB and I'm worried it's going to be too hard for me to learn. Not to mention I have more experience in VB from learning it at school
>>
>not learning c#
>not having fun
>>
>>51903020
As somebody who has programmed in fucking VB until like 8 years ago. Make the change. Go to C# if the change to C++ feels too steep. But dont stay with VB.

VB teaches you bad practices, has partially stupid syntax and there is literally no advantage.

I can only recommend you to switch to C#. Thanks to Microshit monopole, knowing VB will actually make it easier.
>>
>>51903051
>learning c#
>not learning lua
>not making programming great again
>>
>>51903020
Guess insecurity is really a huge barrier to cross.
>>
>>51903065
I have to learn VB for my computing class - I can't avoid it. I want to learn C++ and it's not going bad so far (then again I just learnt how to declare variables) and what puts me off is I look at C++ code and it looks so complex and intimidating to me, so it puts me off. Whereas if I look at VB it doesn't look that intimidating. Is it just a matter of learning C++?
>>
>>51903074
>1-based arrays

ban this sick filth!
>>
>>51903118
Only some arrays are 1-indexed.
>>
File: bjarne2.jpg (25KB, 293x324px) Image search: [Google] [Yandex] [Bing]
bjarne2.jpg
25KB, 293x324px
>>51903103
>it looks so complex and intimidating to me, so it puts me off.

"I did it all for a laff"

t. Stroustrup
>>
File: gross.jpg (116KB, 640x480px) Image search: [Google] [Yandex] [Bing]
gross.jpg
116KB, 640x480px
>>51903131
>only some arrays are 1-indexed
You mean indexing conventions aren't consistent across the language? Fucking disgusting.
>>
True or false: the only reason C++ is so successful is because it has some modern features and C compatibility
>>
>>51903163
False.
The reason C++ is so successful is because it's one of the best languages ever made.
>>
>>51902735
Did you have to produce working code, did they give you a computer, or did they just want to see your thought process on a whiteboard with psuedocode?
>>
any links to recent humble books bundle? the avr/Rpi one.
>>
/g/ Which would you say is the hardest programming language to learn?
>>
>>51903190
take home and produce working code
>>
>>51903194
apl
>>
>>51903194
Not sure, but I'd vote ASM as the most challenging to work with.
>>
>>51903152
Perhaps it's like Pascal or Ada, where array indices are consistently bound to arbitrary indexing, and it is therefore standard to use something like Array'First instead of Array(0) or Array(1).
>>
>>51903194
Assembly language for a dialect/processor that isn't popular.
>>
Alright, someone find a hole in this please.

require "sequel"
require "scrypt"

module User
DB = Sequel.sqlite "users.db"

def self.create params
logindata = DB[:login_data]
username = params[:username]
scrypt_hash = SCrypt::Password.create params[:password]

logindata.insert username: username, scrypt_hash: scrypt_hash
end

def self.authenticate params
logindata = DB[:login_data]
username = params[:username]
entry = logindata.where(username: username).first

# Can't find entry
return nil unless entry

# Validate password
password = SCrypt::Password.new entry[:scrypt_hash]
return nil unless password == params[:password]

# Give User ID
entry[:id]
end
end
>>
>>51901563
Please stop this programming trap meme.
Thanks.
>>
what naming convention do you use for member variables?
Some people use an underscore before or after, some prepend m_, some use c-style names like variable_name.

this will throw a shadow warning with -Wshadow:
class Foo
{
int wat;

int setWat(int wat){
this->wat = wat;
}
};

I'm gonna go full autist and try to get literally 0 warnings.
>>
>>51903252
class _
{
int __;
int ___(int ____){
this->__=____;
}
}
>>
>>51903283
>__=
>>
>>51903252
>>51903252

class Foo
{
int _wat;

int setWat(int wat){
this->_wat = wat;
}
}
>>
>>51903310
>
>__=

same desu
>>
>microsoft brings back nsi memory leak

oh wow, I missed this shitty bug.

thanks migroshift
>>
I wanna write a substantial project, what's a good resource for getting started with SDL?
I wanna do a gui and I've never done them before.
>>
>>51903283
this is my new naming style for when I want to get fired.
>>
/g/, pleb here just a small question

if a chained hash table has an array size of x, would that also imply the maximum numbers of entries that can be placed in the table also be x? Or is there no limit?

Like really it feels like I'm asking something retarded but I'm still wrapping my head around this, sorry /g/
>>
File: ItemsTemplate example.png (105KB, 1620x994px) Image search: [Google] [Yandex] [Bing]
ItemsTemplate example.png
105KB, 1620x994px
>>51901888
If you just set ItemSource to an enumeration of objects, it tries to populate the text by unboxing the item as a string, or failing that, using .ToString(). In order to make it understand what you want to display as the item in the list box, you have to provide an ItemsTemplate...
>>
>>51903315
b-but thats similar to standard names
>>
>>51903352
So long as you can append new items onto the end of your chain for a particular hash value, there is no limit. But your performance will get increasingly shitty the more collisions you have.
>>
What are some neat things I can do with python? library wise
>>
>>51903583
https://automatetheboringstuff.com/
>>
why do people like python so much. Give me one good reason.
>>
>>51903555
Yeah that's what I thought

thanks man
>>
>>51903604
>webbrowser.open
holy fucking shit
thanks a bunch anon
>>
>>51903629
Hi! I like python! It's comfy and easy to use!
>>
>>51903629
I can open a fucking page in my fucking web browser with one fucking line
how fucking cool is that
I come from a couple years of C and some C++ so this is mind blowing
Also, regexes are incredibly easy, comprehensions, etc
Other languages have the tools like comprehensions and whatnot but python is so huge in the industry so there are loads of fucking libraries/frameworks/modules/whatever to do anything you want
>>
Anyone with experiences in linked lists here? Working with it for the first time

I'm trying to make a size() function with O(1) time

Would the best way of doing this in c++ just add a counting variable and make the function return it?

I also thought of using the tail of the linked list, but idk if that would be a good approach
>>
>>51903727
Just store the count. Really you should have two classes, one for all members with just the value and next pointer, and a head for all the methods, metadata, etc.
>>
>>51903727
>Would the best way of doing this in c++ just add a counting variable and make the function return it?
seems like the best way to me. Using tail would be O(n), unless you're doing some weird shit like pointer arithmetic or using an array implementation of a linked list.
>>
>>51903784
>using 2 classes when you can use 1 and static variables
>>
>>51903794
>>51903784
Thank you anons
>>
>>51903194
If we're not counting purposefully so, J,. Otherwise malbolge
>>
how do I get started with embedded C.
>>
>>51904175
Buy some AVRs and a good in circuit programmer.
>>
Whoever was helping me with lua a few weeks back. I have not had the chance to do much programming for a couple of weeks because work and the holidays, but an idea just popped into my head. I've read some stuff before that it's not a good idea to run lua through the graphics/render loop, which is what I was doing. The game logic would update at 60 ticks a second, and the output would vsynch, interpolating the coordinates. Could the bottlenecking have happened in this part of the code?

With programming I have been able to do, I may not have worked so much on the lua, but I did an audit on my code and optimized/re-organized large chunks of my code.
>>
Is anyone experienced in computer vision? I'm trying to develop an implementation of structure from motion but the maths is killing me. Has anyone been successful in implementing a pipeline or using someone elses?
>>
>>51904246
>an implementation of structure from motion
???
>>
/g/, I just want to confirm whether I understand this quicksort thing, idk why but this pivot thing took awhile to get in my head

I'm making the implementation, and I got the following numbers
8 45 2 77 3 88 99 1

I only did the first partition of the implementation so far and it gives me

3 1 2 8 77 88 99 45
am I on the right track? This recursion thing is killing me, I'm trying to get better though
>>
>>51904429
everything to the left of the pivot is smaller than the pivot and everything to the right is greater than it, so the first partition is right I think

it seems you're on the right direction
>>
>>51904429
The pivot is 8?
>>
>>51904429
Divide and Conquer, baby! Did you learn mergesort first? :3
>>
>>51901631
>WPF
There's a reason Mono supports the whole .NET framework except for WPF, you know
>>
>>51904481

Their official stated reason is that it's extremely large, and there isn't enough interest. Large is understandable, especially when there isn't really much of any funding to get them to expend the workload on it, but as for interest... well, given the choice between WPF and Windows Forms, who in their right mind wouldn't take WPF?
>>
Why is this "average 2 ints" thing so big deal? Isn't it simply
a/2 + b/2
?
>>
>>51904598

stop
>>
>>51904598
>anon_takes_the_bait.rtf
>>
>>51904619
(a+b)/2 = a/2 + b/2

The latter doesn't overflow. So will you stop being a retard and give an answer?
>>
>>51904620
>>51904619
>everybody who has been giving stupid solutions for several threads was just trolling
don't give me that shit
>>
>>51904598

a=3
b=3
average = ... 2?

So we have to take into account evens/odds.

And then we may have to take into account one number being positive and one being negative. It's not "hard", it's just that there's more edge cases than would appear to be on one's initial approach.
>>
>>51904306
building a reconstruction of a scene by taking pictures from multiple views and then projecting points from the image plane
>>
>>51904554
There isn't enough interest because there's no reason to use it over WinForms unless you create web sites for a living and wanna try programming
>>
>pedestrian problems like averaging 2 numbers
wew
what's next fizzbuzz to 200?
>>
>>51904702
Fuck me I didn't think of this in practice at all. I guess you could use doubles but that would require you to implement a rounding function first. Why doesn't C have fractions

thanks for answering tho
>>
Any recommendations for free online classes?
>>
>>51903194
GLSL, though it's not the language itself that is the problem
>>
I AM FREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE


FUUUCK

FOR 4 YEARS
I'VE BEEN LEARNING UNDER GRAD SHIT ON A FUCKING SHITTY COMMUNITY COLLEGE

BECAUSE I'M A FOREIGNER PIECE OF SHIT AND THEY WOULDNT TAKE MY GRADES FROM HIGH SCHOOL

NOW I CAN FINALLY
FINALLY
STOP GIVING A FUCK ABOUT GETTING As

AND FINALLY

LEARN THE FUCKING MATERIAL
WITHOUT HAVING TO JUST CRAM FOR GOD DAMN FINALS AND EXAMS I WOULD FORGET THE NETX FUKCING DAY

AND MAY I FINALLY GO TO A UNIVERSITY WORTH A DAMN

AND FINALLY START LEARNING SOMETHING

I FAIL TO FIND A PICTURE TO EXPRESS
HOW IT FEELS TO BE FREED FROM THE CHAINS WE CALL "GPA"
>>
>>51904818
congrats. Why did you move somewhere shitty?
>>
>>51904818
Shut up and finish that login page code monkey.
>>
>>51904837
life
>>
>>51904818
Felt the same when I transferred to uc berkeley desu

then you realized community college doesn't prepare you well enough for these universities and see yourself dying anyway
>>
>>51904858
Where did you move then? Depending on the country the university grades might matter a lot too, so there's that.
>>
>>51904554
>well, given the choice between WPF and Windows Forms, who in their right mind wouldn't take WPF?

Smart people. WinForms is superior and also mature.
>>
>>51904884
This

I got fucked up by the higher standard
>>
>>51903194
The languages itself aren't really what's difficult to learn
>>
>>51904920
depends on the language :^)
>>
>>51904818
>>>/poointheloo/
>>>/curry/
>>>/wearpolostothegym/
>>>/rapewomen/
>>>/smallcondomstoobig/
>>
>>51904939
Most languages are almost identical
>>
>>51904787

>Why doesn't C have fractions
There are about a billion things that could be in the C standard library, that aren't. If you want fractions, you make them yourself.

struct rational {
int numerator;
int denominator;
};
>>
>>51904787
>why doesn't a systems programming language from 1969 have useful modern features
>>
>>51905051
C    C    C
1 1 1
1 1 1


C11 11C


1 1 1
1 1 1
C C C
>>
>>51904990

It also doesn't have vectors. :^^^)
>>
>>51905122
wewwwwwww >:^^^D
>>
>>51905127

desu kvec.h is a godsend. thank u klib.
>>
>>51904754
cool - are you computing the distance from the viewer with parallax?
>>
>>51903194
Haskell
>>
>>51905122
to be fair, if you can't implement vectors yourself, you don't deserve to use them.
>>
>>51905170

Fair enough, but it's nice there are """"generic"""" vectors that people have hacked-in via macros.
>>
Has anyone had success using COOPS (chicken scheme OOP system) across compilation units?
>>
>>51902735
>>51903207

Did you get it working? I'm sort of stumped... I'm trying to loop through the document using AWK
>>
>>51902735

Hash maps are your friend :-D
>>
>tfw you want to use
{-# LANGUAGE QuasiQuotes #-}
but it feels dirty for whatever reason.
>>
whats the hardest sorting algorithm to implement
>>
>>51905285
out of the popular ones, probably quicksort
>>
>>51905285
QuickSort is rather complicated
I've implemented it in different ways but still don't get what it does exactly
>>
>>51904598
> Why is this "average 2 ints" thing so big deal?
Because of overflow, which is undefined behaviour. Basically, C's arithmetic is designed around the assumption that overflow never happens. If overflow occurs, all bets are off, and you can't easily detect overflow.
> Isn't it simply
> a/2 + b/2
That just discards the least-significant bit.
> 4/2 + 6/2 = 2+3=5
> 5/2 + 7/2 = 2+3=5 (it should be 6).
>>
>>51902735
>>51905242
 $ cat input.txt | sed 's/[^a-zA-Z0-9]//g’ | awk '{
for (i = 1; i <= NF; i++)
freq[$i]++
}

END {
for (word in freq)
printf "%s\t%d\n", word, freq[word]
}'

Hello    2
world 1
is 1
this 1
a 1
>>
>>51905346
reading comprehension senpai, output is sorted alphabetically and by occurrence.

Also I'm pretty sure you're not supposed to just use sed and awk..
>>
>>51905346
oops, copied an old version. That should be
sed 's/[^a-zA-Z0-9 ]//g’
>>
>>51905317
Quicksort is the textbook example of a divide-and-conquer algorithm.

Choose a break-point or "pivot". Partition the list into values which are less than the pivot and values which are greater than the pivot. Sort both halves, and concatenate the results. The two halves are sorted and don't overlap, so the overall result is sorted.

All of the O(n.log(n)) sorting algorithms have a similar structure based around recursive subdivision.
>>
I fucking hate this whole python2/3 thing.
I install a bunch of packages with pip and it turns out they were for python 2.

So, I try apt-get install python3-modules etc etc and aptitude gives me fucking 404 on everything.
So I go to the repo in my browser, download the .deb's, and they don't fucking install.
Fuck this shit.
>>
>>51905404
yet another reason python is garbage and shouldn't be recommended for anything but single file automation scripts
>>
>>51905393
Quicksort is really cool. However, despite knowing the concept and pseudo of it really well; I always stuff up the implementation at least a few times.
>>
>>51905374
>output is sorted alphabetically and by occurrence.
it doesnt say that anywhere.
>>
>>51905428
All I want is fucking BeautifulSoup for python 3. Just for a single file automation script you autismo.
I blame my distro more than I blame python.
>>
>>51905443
Look at the sample output. :)
>>
>>51905428
The Python 2/3 split is the major reason for the growth in popularity of Golang
>>
>>51905482
>no generics
I would but I won't
>>
>>51905346
cat test.txt |sed "s/[^a-zA-Z0-9]/ /g" |tr " " "\012" |sort |grep -v "^ *$" |uniq -c |sort -rn
>>
quick question: any good materials for practicing/learning java?
>>
File: slowpoke.png (56KB, 402x391px) Image search: [Google] [Yandex] [Bing]
slowpoke.png
56KB, 402x391px
Note the branchless implementation

#include <stdio.h>

int main(int c, char** v) {
int a = atoi(v[1]);
int y = atoi(v[2]);
int myResult = a/2.0 + y/2.0 + 0.1;
printf("Your average, friend: %d", myResult);
}
>>
>>51905393
You lost me at "concatenate the results"
>>
>>51905757
get a dictionary

https://www.youtube.com/watch?v=XE4VP_8Y0BU
>>
>>51905775
>computerphile
dropped
>>
>>51905748
int averageInts(int a, int y) { return a/2.0 + y/2.0 + 0.1; }
>>
>>51905821
why
>>
>>51905870
do you not see all of the green on black
>>
File: quicksort.png (47KB, 2273x2298px) Image search: [Google] [Yandex] [Bing]
quicksort.png
47KB, 2273x2298px
>>51905757
>>
>>51905775
That helped me understand it a bit better, thanks
It also made me realize that my implementation is bad since I'm using the (random) number in the middle of my array as a starting pivot
>>
>>51905905
They're appealing to normies while providing advanced content. Anything else would be college lecture tier
>>
>>51905952
That's a terrible explanation
Please don't try to help me again
>>
>>51905952
i appreciate that you went through the effort to do that, even having gray numbers for the steps and text and whatnot, even if anon doesn't appreciate it
>>
>>51905825

>conversion to IEEE and back
So what do you do when you want to average two 64-bit signed integers?
>>
File: yui.png (633KB, 1366x768px) Image search: [Google] [Yandex] [Bing]
yui.png
633KB, 1366x768px
anyone have the pic edit of Yui hugging the C Programming Book?
>>
post grades
>>
>>51906239
Just edit it yourself.
For your sake, get a copy of that image without the subs.
>>
>>51906244
screw grades; post code
>>
>>51906244
>college algebra
retard lol
>>
>>51906244

None because I'm not in college anymore
>>
What is some good language to make a GUI.

I want to learn visual basic family.

can I still make classes like normal languages and use them like other languages?
>>
KEK KEK KEK cuck cuck cuck
>>
File: 1305522698838.jpg (67KB, 500x334px) Image search: [Google] [Yandex] [Bing]
1305522698838.jpg
67KB, 500x334px
>>51906287
I second this sentiment.
>>
>>51906244
more like lelgebra
>>
>>51906244

>College Success

Now what is that all about? It doesn't look like you've even gotten into the hard stuff yet.
>>
>>51906310
fucking sort your filters out hiroshima
KEK KEK
>>
>>51906329
he's a first year so obviously that's some required course for some program he's in (hopefully)
>>
>>51906244
Only the final grades matter or what?
>>
>>51906244
>tfw A in assembly class but B in java classes taught by poo in loos
I hate pajeets so much.
>>
>>51906342

>College freshmen today were born in 1997
>>
>>51906363
Make no mistake, it's definitely your fault you got a B.
>>
>>51906244
Is this what Americans call "high school"? Pretty cool that you do programming stuff so early.
>>
>>51906373
They're also 18 and can browse this board; reply to your post, even.

:%)
>>
>>51906397
thanks sanjeep
>>
>>51906411
Nah, this is college, also known as university.
The high school (ages 13-17) programming classes are always shit.
>>
>>51906460
Why are there English and history classes? Don;t you specialise in one major?
>>
>>51906477
They force you to take unrelated classes so they'll make more money.
>muh well rounded education
>>
>>51906477
Students have to complete 'General Education' courses in college, which is sort of like a list of required courses in math, science, social studies, etc. Depending on how many credits a student brings in from high school, a university student may only have to take a few Gen Ed courses in college, or may have to take many.

>>51906512
this pretty much tho
(because our universities are expensive as fuck and make mad bank off of us)
>>
File: grades.png (67KB, 973x352px) Image search: [Google] [Yandex] [Bing]
grades.png
67KB, 973x352px
>>51906244
Great quarter. Managed to fuck a hottie in my Stress Management class
>>
File: 1449198183577.jpg (38KB, 400x388px) Image search: [Google] [Yandex] [Bing]
1449198183577.jpg
38KB, 400x388px
>>51906577
>Most points awarded is for a "stress management" class
>>
>>51906305
html
>>
Should I do all of my python in Python 2.7, because the support for Python 3 is such fucking shit and I'm tired of dealing with my shitty fucking distro?
>>
>>51902862
>>51902846

Flask too mate
>>
>>51906596
html don't export to exe
good job fag.
>>
>>51906592
GPA boosters
>>
In all seriousness guys, this is how you average in C:

#include <stdint.h>

int64_t average(int64_t a, int64_t b)
{
// If a and b are not the same sign, we can safely add without overflow
if ((a < 0) != (b < 0)) {
return (a + b) / 2;
}
// Otherwise, we take advantage of a particularly useful mathematical
// property: (a + b) / 2 is the same as (a/2) + (b/2). We will use a
// modulus to account for averaging two odd numbers
else {
return (a/2) + (b/2) + (((a%2) + (b%2)) / 2);
}
}


And as a macro
#define avg(a,b) ((a<0)^(b<0) ? ((a+b)/2) : ((a/2)+(b/2)+(((a%2)+(b%2))/2)))
>>
>>51906738
fuck off
>>
>>51906738
based ruby

What's /dpt/'s next challenge?
>>
>>51906769
Maybe we can move on to advanced stuff like finding the area of a circle.
>>
whats the advantage of structuring my python scripts to be run through cron scheduling instead of putting them in a while true loop and running them in a tmux session and sleeping for intervals

it's not like there's any cpu footprint while sleeping in a thread, is it solely for trying to be a jew about memory? whats the point of going through the extra layer at the OS level instead of maintaining the logic in the script?
>>
>>51906769
strrev implementation with O(1) complexity
>>
I'm downloading Visual Studio Community with C# and F# right now. I've only done linux programming for all of my programming life (over 10 years).

What am I in for?
>>
>>51906619
why does it have to be exe? any reason?
>>
>>51906838
welcome to hell
>>
>>51906791
#define PI 3.141592653589793
double circle_area(double r) { return PI * r * r; }


>>51906807
What python scripts? I just learned python over the past couple days and I'm bored, wondering what scripts to write for myself. I could make graphs in excel, but of what, etc.

>>51906853
Because he said in the Visual Basic family, obviously. A really large family, that.
>>
>>51906853
[spoiler]It's for a game[/spoiler]
>>
>>51906867
Can you be more specific?
>>
>>51906880
...and? Games aren't required to be distributed solely as a .exe.
>>
>>51906894
for starters you need to install a program and it's dependencies that take up more room than the windows operating system
and unless you're writing standards compliant C89, your C code will not compile on MSVC
>>
>>51906807
Running with cron gives:
- More configurability
- Update your script without screwing up timing
- Can run script out of time, If you want
- Standard unix way.
- More overhead(Don't use cron for <30 second intervals)
>>
>>51906914
I want to learn something like visual basic anon.
>>
>>51906931
yeah, it's still installing even though I have a 9 megabyte/sec internet download and a fast SSD, this is kinda disappointing

i hope the programming will be cool though, F# looks good
>>
>>51906950
It will not be cool, or fun.
You will suffer for every moment spent with VS open.
>>
>>51906819

Not possible. Not even with linked lists, because even then, you'd need to swap all of the next and prev pointers.

>>51906305

Don't even bother with Basic, just use C#. It's still piss easy to make a GUI with it.

>>51906931

If he's only using it for C# and F#, it'll be fine. Visual Studio for .NET crap is a pleasant experience. For anything native though, run for the trees.
>>
>>51906979
The first element should hold the size of the string, a pointer to the first element and a pointer to the final element.
Every element thereafter should hold a next and previous pointer.

When you want to reverse the string, just follow the pointer that goes to the end and follow the back pointers.
>>
>>51906979
>don't bother with BASIC
I always hear this.
why?
>>
>>51907013
It's a waste of time.
>>
>>51906970
It can't be that bad.. right?
>>
>>51907025
good luck anon-kun
>>
>>51907022
yeah, but why?
>>
File: 2015-12-16_22-45-58.png (12KB, 456x641px) Image search: [Google] [Yandex] [Bing]
2015-12-16_22-45-58.png
12KB, 456x641px
>>51907037
here we go familia
>>
>>51907012

Yes, but you are iterating over the entire string to change those pointers from next <-> prev. Thus, O(n).

>>51907056

Because there isn't a single use case for it that isn't better fulfilled by other languages. For simply having a beginner friendly language, there's Python and Ruby, which pretty much read like pseudocode. For serious .NET development, there's C# and F#. For scripting .NET stuff, there's F# and PowerShell.

It's a language on life support only of use to companies that have previously invested into it, and half of them are stuck on VB6 (not VB.NET) anyways. Learning a BASIC, realistically, should only be done for the same reasons one would learn COBOL -- they're desperate for a job, and don't mind maintaining old-ass code.
>>
>sending an email to myself in <5 lines of python
I love this. I have to make some program to utilize this somehow.
>>
>go to library
>go to computing section
>they literally have nothing but "for dummies" tier shit and some books on apple ecosystem crap like swift
>literally only 1 programming book and it's an outdated stroustrup C++ book

I remembered why I stopped bothering with public libraries.
>>
>>51907109
>he goes to a liberal arts college
lol
>>
>>51907105
>Yes, but you are iterating over the entire string to change those pointers from next <-> prev. Thus, O(n).
There is no changing.
The first element points to the very end, and then you read that string by traversing every back pointer till you reach the front.
>>
>>51906979
Use a doubly linked list. Wrap it in a structure and maintain a pointer to the head and tail elements. To reverse the string, just switch the pointers.
>>
>>51907105
I guess I could try C# and winforms
but I don't know how to code there.

I feel safe doing normal shit using SDL net or SFML net, but doing shit with drag and drop just confuses me.
>>
>>51906819
As you build the string, also maintain a reversed string. When you want to reverse the string, switch the representation you expose.
>>
>>51907142
The thing is, you can't JUST switch which is head and which is tail. You'd have to have an enum saying which pointer is next.

So, in your doubly linked list, you have two pointers,

node *pointers[2];

and an int, saying which pointer is next, the other being previous

int next_index = 1;

Then, you have your head and tail pointer

node *head, *tail;

To reverse the string, just do this:

temp = head
head = tail
tail = temp
next_index = (next_index + 1) % 2

And now your string is reversed
:^%)

I think I didn't smudge that up
>>
While >>51907160 is easier I think, it has a space complexity of n, while >>51907202 has constant space complexity
(minus the string itself)
>>
>>51907160
google "declarative programming", the "drag and drop" is used on probably most platforms you know to create GUIs (QT, Java/Android, XCode, Java by itself, C#, etc)

hardcoding exact positions for elements and making the event handlers and whatever is robots work
>>
>>51907229
meant >>51907198

time to stop posting
>>
>>51906807
>been using vim and a default terminal with tabs
>"whats tmux"
>sudo apt-get install tmux
>find a quick tutorial
>make a few nested windows, open vim inside one
neat, anything else I should be using?
>>
>>51907202
>next_index = (next_index + 1) % 2
?
>next_index = 1 - next_index
>>
>>51907246
There are a number of things I could have done better in that post, yeah. Cheers though
>>
>>51907229
strings are already take up n space complexity, so nothing is lost, from an big O point of view
>>
>>51907202
Nice! I dig it. You could also decide which way to traverse the sting by looking at the head element. If head.NEXT is null, go towards head.LAST.
>>
>>51907260
hence the (minus the string itself)
Although there is the point that a doubly linked list has two nodes for each element of the string, a head, a tail, and next_index, while having the normal copy and the reversed copy is just two copies of the string, and one current_index (which string to represent), so that's actually better
>>
>>51907127

>there is no changing
We are not talking about simply doing all of the algorithms one would normally apply on a string in reverse, we are talking about mutating a string such that it is the reverse of the input string. To do on a linked list requires each and every pointer to be switched, and therefore takes θ(n) time. Similarly, on an array of characters, one must access every memory location at least once.

>>51907142

So tell me, what is first->next going to point at after this switch? Now you have to swap the next and prev pointers for first? Okay, first->next->next. That points back to first? Fuck, now you have to... and so on it goes until all prev pointers are swapped with the next pointers.

>>51907160

You don't need to do anything with drag and drop. All that's doing is generating C# code for you (or XML in the case of WPF).
>>
>>51907282
This is pretty clever too, and eliminates the need for the index, but then you have to check if head.next is null each time you want to display the string, when you could just be setting the index only when you want to reverse the string. Still, cool idea.
>>
File: leaderboard day 17.jpg (6KB, 452x27px) Image search: [Google] [Yandex] [Bing]
leaderboard day 17.jpg
6KB, 452x27px
I-I did it lads
>>
C wizards, is there a way to do;
vector<SaveData>* test = (vector<SaveData> *)data;
test->push_back(SaveData(savedata, checkpoint));

without need the variable test at all?
>>
>>51907340
((vector<SaveData> *) data)->

should work
>>
>>51907332
Nice m8
>>
File: 1443041394993.png (114KB, 512x512px) Image search: [Google] [Yandex] [Bing]
1443041394993.png
114KB, 512x512px
whats a stupid simple way of printing out every character of a string in a while loop? I could probably figure it out but it would take me a few hours. (im working on a text-heavy game with some static indexed gif images in the background (for fun)

I'm using python btw
>>
>>51907358
Yep, works fine, thanks.
>>
>>51907340
I am very skeptical about what you are doing here.
>>
>>51905212
I honestly see zero point in trying to hack generics into C.
Can somebody who is rational please explain to me why you would do this?
C++ has actual generics that are a _complete_ hack, and is 95% backwards compatible with C.
>>
>>51907313
Yeah - its a case of CPU time vs memory usage. I sort of like combining the ideas - check head.NEXT and head.LAST, then allocate a boolean that tells us which way to we traverse. We save cpu cycles repeadedly checking the same thing over and over. Plus, when we're done, we deallocate the boolean and our memory footprint drops.
>>
>>51907332
Good work champ

>>51907367
Neat, I've never actually done that myself. No problem friend
>>
>>51907282

Theoretically, with any string, you could just have an "is_reversed" element, and then you would have an O(1) "reverse". But really, would you want to be checking this value with every string operation you make?
>>
>>51907362
>>51907381
thanks lads, appreciate it
>>
>>51907364
for c in string:
print c
>>
>>51907374
I'm passing in the vector<SaveData *> through a void * function parameter of an sqlite3 callback, that's why it needs to be this way.
>>
>>51907382
I cant think of any serious reason to reverse a string on O(1) time in the first place.
>>
>>51907364
int len = strlen(string);
int i;
for (i = 0; i < len; i++)
{
printf("%c", string[i]);
}
>>
>>51907405
>using a database for game save data
Why?
>>
>>51907382
This *concept* (reversed strings is a trivial and impractical example) could be useful though: having a wrapper (iterator/generators usually accomplish this) that performs an operation like reverse in O(1) but pretends to be of the base class, is neat.
However, when you're slapping on that much heap memory and polymorphism (virtual methods :( ) you have to weigh the benefits with the big cache destruction/resource management nightmare it's going to cause.
>>
I'm doing Advent of Code challenges in Java. I've only done about 6 days so far though, so I've got quite a bit of catch up to do.
>>
>>51907376

There are reasons to use C over C++:

1. Faster compile times
2. Restrict pointers
3. Everything needing to use the C ABI
4. Platform may have a C compiler but no C++ compiler (may be the case on some esoteric/embedded platforms)

In these cases, it is helpful to have generics hacked in through, say, macros.
>>
https://www.nczonline.net/blog/2015/12/why-im-not-using-your-open-source-project/

>1. Your project doesn't have a license
>2. Your project is GPL/LGPL licensed
>3. You aren't maintaining the code
>4. You don't have documentation or tests
>5. You aren't using the project

>So when you license code as GPL, that license becomes viral whenever you distribute it, which means including the code in your own open source project. That is a showstopper for businesses wishing to incorporate code from these projects.
>>
>>51907422
I'm going to be using a the database for more than just the save data of the game, if you have an efficiency or similar complaint I'm sure you're right about it but this works fine and isn't noticed performance wise.
>>
>>51907450
>1. Faster compile times
I sort of can agree with this.

>3. Everything needing to use the C ABI
Um, you can call every C function through C++ identically how you would in C. You can even inline assembly and plenty more bullshit.

>2. Restrict pointers
>4. Platform may have a C compiler but no C++ compiler
The only times you would need these features OVER the massive features that C++ provides would be for very low-level systems programming, in which case if it's this performance sensitive, you'll probably roll your own vectors anyways.
This is what Rust was supposed to fix but it didn't.
>>
>>51907463
>2. Your project is GPL/LGPL licensed
When I license things GPL, it's because I'm contributing to free software.
If they aren't interested in releasing their derivative product under the same terms I granted them when they took my code, then they can go find some other BSD cuck's code to steal.
>>
>>51907463
>>2. Your project is GPL/LGPL licensed

In other words

>Word for free for hundreds of hours so we can use your work and not credit or reward you

Fuck this cunt.
>>
>>51907480
Also why doesn't C++ have
restrict
? What's stopping it? Weird.
>>
I'm learning C++ from learncpp.com.
>>
>>51907500
Nothing, it just isn't in the standard. GCC and Clang have "__restrict__" and MSVC has something else. Any C++ compiler worth using will have some form of it.
>>
If I wanted to put my codeeval solutions in my github, should I license them?
I doubt anyone would want to use them.
>>
It's java good for making GUI?
>>
am I the only one who thinks javascript is a piece of shit meme language? I have to use it for uni but I just can't get into how illogical and messy it is
>>
Thinking about moving to Seattle. Think I can get a tech job there with no formal experience? I'll lie about my work history if I have to, I don't mind. I've done a few months of freelancing (only made $900 kek) and have an active github.
>>
>>51907553
Keep in mind that means being in US
>>
>>51907535
Why are they on github and why would you license them?
Just because all the cool kids are licensing their shitty FOSS doesn't mean you have to. Break free from the herd mentality. Become individual. Do what you want.
>>
Writing a small python script to send a new picture of a cat to my phone from google images daily. I just started learning python a few days ago so this is a stretch for me but I think I got it. Pretty excited tbqf famb

>>51907590
>I want to do thing
>Don't do it, stop conforming, do what you want
nice
>>
>>51907480

>Um, you can call every C function through C++ identically how you would in C. You can even inline assembly and plenty more bullshit.

You misunderstand. I am not talking about calling C functions, I am talking about exporting C functions.

If you want to make a function in C++ that uses the C ABI (and thus will not have name mangling that fucks with everything), you have to declare it extern "C". When you do this, you lose the ability to use references, or any of your other C++ types. In many cases, one does have to export all of these functions with C linkage, if one is writing a library, especially if it's a native extension for another language. In this case, it is of little use to be using a crippled C++.

>The only times you would need these features OVER the massive features that C++ provides would be for very low-level systems programming

You mean the bread and butter of C and C++?

>you'll probably roll your own vectors anyways
Eh... kvec is fairly fast.
>>
>>51907542
its so-so
>>
>>51907590
>why would you license them

You can be held liable if your unlicensed software fucks something up, dimwit.

>>51907535
You should absolutely license any software you put on GH

https://help.github.com/articles/open-source-licensing/
>>
>>51907550
what dont you like about it anon? type coercion?
>>
>>51907625

>You can be held liable if your unlicensed software fucks something up, dimwit.

Software without a license is all rights reserved. If you are not the author, you don't even have a legal right to use it. If someone tries to sue you for damages because they used your software, you have every right to turn around and sue them for copyright infringement.
>>
>>51907618
>If you want to make a function in C++ that uses the C ABI (and thus will not have name mangling that fucks with everything), you have to declare it extern "C". When you do this, you lose the ability to use references, or any of your other C++ types.
Wrong.
>>
>>51907676
I'm pretty sure uploading shit to github means you expressly grants users the right to look at and fork your code.
>>
what's wrong with using java if I'm too retarded for C++?
>>
>>51907682
You cannot use C++ types in a extern "C"{ function's } ABI. The implementation, however, can do anything.
>>
>>51907550
no
>>
>>51907697
Accepting that you're retarded is wrong.
>>
>>51907697
garbage collection can be a hassle for high-performance systems
>>
>>51907676
>If you are not the author, you don't even have a legal right to use it

http://choosealicense.com/no-license/

Even in the absence of a license file, you may grant some rights in cases where you publish your source code to a site that requires accepting terms of service. For example, if you publish your source code in a public repository on GitHub, you have accepted the Terms of Service which do allow other GitHub users some rights. Specifically, you allow others to view and fork your repository.
>>
>>51907704
#include <iostream>

extern "C" {
void set_value (int& x) {
x = 3;
}
};

int main () {
int x = 0;
set_value(x);

std::cout << x << std::endl;
return 0;
}

00000000 <_set_value>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 8b 45 08 mov 0x8(%ebp),%eax
6: c7 00 03 00 00 00 movl $0x3,(%eax)
c: 5d pop %ebp
d: c3 ret
>>
Is there overhead to name mangling? Like performance-wise? Does it really matter if you' aren't writing a library?
>>
>>51907720
I'm making 2D games anon.
>>
>>51903194
Ook, look it up
>>
>>51907738
If you're writing a 2D game that's just like a shitty sidescroller or danmaku or RPG or something, then you could probably write it in Python.

If you're writing a 2D game with complicated AI, lots of agent simulation, actual number-crunching etc, then Java is no good.
>>
>>51907733
If you think name-mangling hinders performance then you don't know what name mangling is.

The problem with name-mangling is that how names get mangled is up to the compiler, and thus not very cross compatible
>>
What is essential Djikstra? He seems to have been quite prolific, and is namedropped constantly, but a lot of his quotes seem to have relevance only to a certain point in history. So which papers/books should I read?
>>
>>51907764
Yeah, I figured it didn't impact performance, but everyone always bitches about "muh name mangling!" as if it's relevant, when in 99% of use cases it seems completely fine.
>>
>>51907779
It's absolutely relevant when you're dealing with dynamic linking of any kind.
>>
>>51907779
C++ has to have name mangling and anyone who thinks they can just "do away with" name mangling is an idiot. Unspecified name mangling, however, can be a problem for library linkage shit.
>>
>>51907738
you'll be fine, friend
>>
>>51907798
new thread lads come on
>>
>>51907730
I didn't know it would do that.
Let me rephrase then:

You should not use C++ types in a extern "C"{ function's } ABI. The implementation, however, can do anything.
>>
Trap thread please
>>
>>51907837
Now it's an opinion, one without basis for that matter.
>>
>>51907763
>complicated shit
>he's making 2D games
>he said he's too retarded for C++
>>
NEW THREAD

>>51907854
>>
>>51907849
If you are using extern "C" for linking with C code it is very difficult for the C developer to write a use your C++ types. It will take much less time for you to make your C function take C arguments.
>>
>>51907892
If you're writing a C library in C++ (why the fuck would you do that?) then obviously don't use C++ types in your extern"C"{}. However, this discussion is about name mangling and ABI linkage.
>>
>>51907923
Its relatively common to write C libraries in C++ because almost every language ever can link to C. Linking with C++ is much less common.
>>
>>51907726

But not the right to

1. Modify it
2. Include it in a project
3. Execute it
>>
>>51902735
import Data.Char

getWordCount = countWords . map (filter isAlpha) . tokenize

countWords :: [[Char]] -> [([Char],Int)]
countWords xss = countAux xss $ map (\xs -> (xs,0)) $ removeDup xss

countAux [] acc = acc
countAux (x:xs) acc = countAux xs $ lookUp x acc where
lookUp _ [] = []
lookUp x (y:ys)
| x == fst y = (x, 1 + snd y) : ys
| otherwise = y : lookUp x ys

removeDup = removeAux [] where
removeAux acc [] = acc
removeAux acc (x:xs)
| x `elem` acc = removeAux acc xs
| otherwise = removeAux (x:acc) xs

Use JHC to compile to C code.
>>
>>51907996
what does the call to tokenize do?
>>
>>51905346
Did they really accept this shit?
>>
>>51905404
First off, I believe for python3 you should use "pip3" and not "pip."
Second, did you make sure you don't have some unorthodox repo in your sources?
If your sources are good then do apt-get update.
If that don't work then either the repos are down or your network settings are fucked which is unlikely because you posted here after all.
What distro?
>>
File: 1432323884812-0.png (26KB, 431x499px) Image search: [Google] [Yandex] [Bing]
1432323884812-0.png
26KB, 431x499px
>>51905748
#include <iostream>

static inline constexpr double average(double& a, double& b)
{
return a / 2.0f + b / 2.0f + 0.1f;
}

int main(int argc, char **argv)
{
if (3 != argc)
return 1;

double a = strtod(argv[1], NULL), b = strtod(argv[2], NULL);
std::cout << average(a, b) << std::endl;
}
Thread replies: 341
Thread images: 18
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK