[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 318
Thread images: 24

File: 1468691064727.png (231KB, 340x465px) Image search: [Google]
1468691064727.png
231KB, 340x465px
Previous thread: >>55871316

What are you working on, /g/?
>>
>starting a thread with /pol/ material

I can't wait to see 310 shitposts.

>>55880459
Working on making data look pretty.
>>
>>55880459
kys, op
>>
>>55880459
Dear /dpt/,

I have this IntPtr in C# which is a pointer to a buffer
And now I want to read the data there as a struct without copying or using Marshal

I currently do this using MY_STRUCT* my_struct = (MY_STRUCT*)ptr_buffer;
However, this gives me an array when I only really want a single struct for simplicity

Is there any way I can do this in C#?
>>
>>55880566
Actually, it's a girl who identifies as a boy, and thus being dressed like a girl is cross-dressing.

Your favorite programming language is shit.

>>55880590
I'm honestly curious about your project if you're resorting to unsafe memory management in C#.

What is your reasoning for doing this?
>>
>>55880618
I use unsafe everywhere in C# because it's faster and easier for me
In this case I'm just handling raw input from gamepads though
>>
NO FUCKING C# FAGS

NO FUCKING UNITY FAGS

AND ABSOFUCKINGLUTLY NO FUCKING WINDOWS FAGS

KEEP THIS FUCKING THREAD CLEAN OF FILTH
>>
>>55880754
Why do you hate C#?
For a shit language it's not completely shit, certainly miles better than Java
>>
>>55880812
>certainly miles better than Java
epic
>>
>>55880754
t. NEET who exists only to fiddle with conf files
>>
>>55880590
How would this work with boxed objects?
>>
>>55880872
What do you mean?
There's no boxing/unboxing that way
>>
>>55880839
>I'm retarded so everyone else must be
>>
>>55880754
C# is a good language, faggot.
>>
>>55880978
t. projecting NEET
>>
>>55880957
I mean how could you memcpy into a boxed object
>>
>>55881037
Well, you can just write boxed_object = unsafe_array[0];
At least if it's a value type
>>
>write unportable js, python ...
nobody gives shit
>write unportable c
everybody's getting buttmad

If you use anything else than gcc for c then you might as well just kill yourself
>>
I am trying code web app in Java for { game }. The { game } take input two integers and give output sum of two integers... I try implementing with Builder pattern but no avail. Please tell what are design patterns very suitable for this problem ? Thank you kindly for help.
>>
>>55881456
liftM2 (+) (read <$> getLine) (read <$> getLine)
>>
File: payne shiggy.jpg (74KB, 500x375px) Image search: [Google]
payne shiggy.jpg
74KB, 500x375px
Java doesnt have pointers they said...
public class Pointer<T>{
T item;
public Pointer(T item) { this.item = item; }
public T get() { return item; }
public void set(T item) { this.item = item; }
}

public class Swap{
public static <T> void swap(Pointer<T> a, Pointer<T> b){
Pointer<T> temp = new Pointer<>(a.get());
a.set(b.get());
b.set(temp.get());
}
}


also 404 captcha
>>
>>55881500
Reminder that pointers are just array indices, and as such they form a comonad
>>
>>55881491
(+ (read) (read))

lmaoing @ ur lang
>>
>>55881500
Heard of boxing/unboxing?
>>
>>55881533
it's called purity senpai
>>
>>55880754
THIS
I want /dpt/ to stay pure at least.
>>
>>55880754
>>55881589
>linux
>pure
>>
>>55880812
This is like having to chose between wolf and dog poo to eat for dinner.

>>55880983
Tard monkey.

>>55881599
Any free as in freedom OS is considered as pure. Proprietaryfags are the cancer of humanity and of this thread.
>>
>>55881561
It's only pure because nobody will ever bother running it.
>>
>>55881618
>Proprietaryfags are the cancer of humanity and of this thread.

There's a lot of very good proprietary software, though.
>>
>>55881561
No, it's called faggotry. Lisp unlike Haskell assumes you have a pair and a brain, and instead of making you tiptoe around the most basic operations to get shit done, provides you with the power to play with the compilation and even the parsing of programs to build the layer of abstraction you yourself want to work in, not that of the language.
>>
>>55881657
No, "good" and "proprietary" very rarely can go together.
>>
>>55881659
{-# LANGUAGE TemplateHaskell #-}
>>
File: téléchargement.png (3KB, 229x220px) Image search: [Google]
téléchargement.png
3KB, 229x220px
>>55881659
>he never used Control.Lens
Anon...
>>
>>55881688
Lenses are a shitty meme
>>
>>55881659
Too bad no one actually uses it for anything worthwhile. But then again, neither do they Haskell.
>>
>can't read my own code

W-what books do I get.
>>
>>55881730
Are you sure it's your code?
>>
>>55881739

Its Java. It's become a convolution of nested if statements and method calls. Here's a snippet.

            else {
if(toCheck == "ENTER"){
textData.newLine();
if(textData.lineCursorIsIn >= 0){
textData.incrementLineCursorIsIn();
}
ourCursor.locationX = 0;
ourCursor.locationY = ourCursor.locationY + ourCursor.heightOfEveryOtherCharacter();
}
if(toCheck == "BACK_SPACE"){
if(textData.backSpace()){
textData.decrementLineCursorIsIn();
if(textData.lineCursorIsIn < 0){
ourCursor.locationY = ourCursor.locationY - ourCursor.heightOfEveryOtherCharacter();
}
ourCursor.locationX = textData.getSizeOfLineN(textData.lineCursorIsIn) * ourCursor.widthOfOneCharacter();
}
else{
textData.decrementLineCursorIsIn();
ourCursor.locationX = ourCursor.locationX - ourCursor.widthOfOneCharacter();
}
}
if(toCheck == "ESCAPE"){
textData.displayAllText();
}
if(toCheck == "SPACE"){
textData.addCharacter(" ");
ourCursor.locationX = textData.getSizeOfLineN(textData.lineCursorIsIn + 1) * ourCursor.widthOfOneCharacter();
}
}
>>
File: 1452068794953.png (8KB, 281x218px) Image search: [Google]
1452068794953.png
8KB, 281x218px
>>55881688
>>
File: Workspace 1_010.png (106KB, 1366x768px) Image search: [Google]
Workspace 1_010.png
106KB, 1366x768px
Name better IDE?

>u cant
>>
>>55881811
Emacs
>>
>>55881774
Abstract that shit out.

That entire block you just posted that's apparently sitting in an else could be put into a method called "KeyCheck" or something.

Personally, I find Allman-style brackets easier to read for things like this.
>>
>>55881674

Since you said 'very rarely', it must mean you think there is proprietary software which is good.

Give some names.
>>
>>55881811
Depends on the language you're using and if you limit yourself to any particular operating system.
>>
File: Screenshot_2016-08-02_18-09-54.png (48KB, 876x600px) Image search: [Google]
Screenshot_2016-08-02_18-09-54.png
48KB, 876x600px
Working on this:
>>
File: 1468809862992.jpg (67KB, 800x600px) Image search: [Google]
1468809862992.jpg
67KB, 800x600px
>>55881845
So it is a "me" problem, is there not a book for something like this.
>>
how to fix this asp.net error?

>The type or namespace name 'SubscriptionDetailEventArgs' could not be found (are you missing a using directive or an assembly reference?)

am i missing a .dll file?
>>
>>55881456
Try learning English first, Pudoo.
>>
>>55881852
>it must mean you think there is proprietary software which is good
It may or may not be, as I am not an artist I can't know however people have multiple times claimed the superiority of Photoshop in comparison to other free software, however the people I know who made these comments did not try krita so it might be incorrect.
>>
wrote a small python script to fix playlists exported from audacious, so that they're playable on my Fiio X1
>>
>>55881879
>am i missing a .dll file?
Yes, and probably a using statement.

You're using some sort of shopping cart library and you don't have the library available.
>>
>>55881500
Object references are kinda like pointers anyways. Why is this necessary?
>>
>>55881500
>a.set(b.get());

Disgusting.
>>
>>55881887
Kill yourself: >>55822807
>>
>>55881869
So Rufus for Linux? Noice, but did you get anything working yet or did you start with slapping a GUI together with QtDesigner?
>>
>>55881928
You go first.
>>
File: 1441797388913.gif (743KB, 500x281px) Image search: [Google]
1441797388913.gif
743KB, 500x281px
>>55881456
>design patterns
>Java
>>
>>55881887
>>55881968
It's pasta, faggots.
>>
>>55881979
>its pasta
kys
>>
>>55881940
Started it last night, the GUI is finished, now working on device discovery from /sys/block.
>>
>>55881500
Meanwhile in C++:

template <class T>
void swap(T& a, T& b)
{
T tmp{std::move(a)};
a = std::move(b);
b = std::move(tmp);
}
>>
>>55881774
Protip: Java7+ supports switching on strings.
>>
>>55881997
Meanwhile in a codebase of somebody who actually knows how to C++:

std::swap(a, b);
>>
>>55881993
Cool, cool. You should probably change the button labels in the log window though, as in, make them just "Clear", "Save" and "Close" since the "log" seems a bit verbose and redundant in the context of the log window.
>>
>>55881997
template <class T>
void swap(T&a, T&b)
{
T temp=a;
a=b;
b=temp;
}
>>
>>55882044
Doesn't take advantage of move semantics.
>>
>>55882062
so? like i give a fuck you fucking nerd
>>
>>55881891

Creative software is really where proprietary software shines. Audition, Vegas, Photoshop, etc.

All very good.
>>
x,y = y,x


Python Meisterrasse
>>
File: Screenshot_2016-08-02_18-24-48.png (55KB, 949x572px) Image search: [Google]
Screenshot_2016-08-02_18-24-48.png
55KB, 949x572px
>>55882041
Meh, its like that on the original.
>>
>>55882084
how's your riffle?
>>
OMG OPTIMIZED

void swap<int>(int&, int&):
pushl %ebp #
movl %esp, %ebp #,
subl $16, %esp #,
movl 8(%ebp), %eax # a, tmp88
movl (%eax), %eax # *a_2(D), tmp89
movl %eax, -4(%ebp) # tmp89, tmp
movl 12(%ebp), %eax # b, tmp90
movl (%eax), %edx # *b_4(D), D.5140
movl 8(%ebp), %eax # a, tmp91
movl %edx, (%eax) # D.5140, *a_2(D)
movl 12(%ebp), %eax # b, tmp92
movl -4(%ebp), %edx # tmp, tmp93
movl %edx, (%eax) # tmp93, *b_4(D)
nop
leave
ret


void swap<int>(int&, int&):
pushl %ebp #
movl %esp, %ebp #,
subl $24, %esp #,
subl $12, %esp #,
pushl 8(%ebp) # a
call std::remove_reference<int&>::type&& std::move<int&>(int&) #
addl $16, %esp #,
movl (%eax), %eax # *_4, D.5158
movl %eax, -12(%ebp) # D.5158, tmp
subl $12, %esp #,
pushl 12(%ebp) # b
call std::remove_reference<int&>::type&& std::move<int&>(int&) #
addl $16, %esp #,
movl (%eax), %edx # *_9, D.5158
movl 8(%ebp), %eax # a, tmp93
movl %edx, (%eax) # D.5158, *a_2(D)
subl $12, %esp #,
leal -12(%ebp), %eax #, tmp94
pushl %eax # tmp94
call std::remove_reference<int&>::type&& std::move<int&>(int&) #
addl $16, %esp #,
movl (%eax), %edx # *_13, D.5158
movl 12(%ebp), %eax # b, tmp95
movl %edx, (%eax) # D.5158, *b_7(D)
nop
leave
ret
>>
>>55882140

burger king
>>
>>55881811
Intellij IDEA, of course.
>>
>>55882426
this, intellij is best IDE providing useful facility for programming needs.

jetbrains really good software company soon to dominate the industry.

you have IDE's for every languag (at least , the important ones)

https://www.jetbrains.com/
>>
Okay lads

What the fuck is a bean
>>
>>55882426

IntelliJ really is exceptional.
>>
File: le real human bean.jpg (20KB, 703x393px) Image search: [Google]
le real human bean.jpg
20KB, 703x393px
>>55882569
>>
Learning perl and trying to implement bubblesort. For some reason, I'm getting an uninitialized value warning in the if statement. Any help is appreciated.
Code:
#!/usr/bin/perl -w
sub bubble {
my @array = $_[0];
for(my $i = 0; $i < scalar(@array); $i++){
if($array[$i] > $array[$i+1]){
($array[$i], $array[$i+1]) = ($array[$i+1], $array[$i]);
}
}
@array;
}

print "Enter a bunch of numbers and press CTRL-D\n";
print bubble(qw# 9 8 7 6#);
>>
>>55882715
>^D
That's pretty idiotic.
>>
>>55882585
Not helpful desu
>>
>>55882569
impliments serializable
parameterless constructor
properties are private with public get/set methods

How is this in any way confusing?
>>
>>55881531
>and as such they form a comonad
What course do I need to take to understand what the fuck you're talking about?
>>
>>55880754
>NO FUCKING UNITY FAGS
videogaem Unity or Gnome Unity?

p.s. C# is like a better Java. I'd still never use either by choice.
>>
>>55882957
Memetics, because it's a useless meme
>>
>>55882833
>properties are private with public get/set methods
For what raisin?

Java users sure do love creating boilerplate that serves no porpoise.
>>
>>55882735

Not helpful tho
>>
>>55882994
Despite the memery I was asking an honest question.

...is it Type Theory?
>>
>>55883022
I'm not obliged to be helpful nor you're entitled to getting help, I just posted an opinion, whether you like it or not.
>>
>>55883009
Reflection
>>
>>55882156
based seeples
>>
Does anybody have some resources for how to split up databases?
What I mean is if I have a login/registration system and google/facebook login integrated where do I put which stuff?
At the moment I have multiple databases (one dedicated to login, one for constants, and one for insensitive data that changes frequently).

I think I'm thinking too complicated about this whole thing.
>>
>>55883049
Okay dude. Thanks for the opinion i guess. it'l would've been easier to not share your rude opinion. I mean I obviously asked for help, not an opinion. If you are not gonna help me, atleast don't shitpost by calling stuff idiotic.
>>
File: pence shig.jpg (65KB, 600x450px) Image search: [Google]
pence shig.jpg
65KB, 600x450px
>>55883057
>imgur filename
>>>/reddit/
>>
>>55883125
Describe your schema(s) and usecases.
>>
>>55882833
But that seems fairly normal desu, I just got confused by the word and it was really hard to find a precise definition
>>
 yield self.subscribe(u"com.audioctl.main",self.onMainCtlEvent)
File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py", line 1181, in subscribe
assert(topic is None or type(topic) == six.text_type)

Help, I put the u to convert to unicode, but it still isn't working.
>>
>>55883045

Comonads are pretty simple. They're just comonoids in the category of endofunctors. Moreover, a comonad is effectively just in the inverse of a monad, which are monoids in the category of endofunctors.

I hope that clears things up.
>>
>>55883181
>it was really hard to find a precise definition
Does your mommy block Google?

The first result searching "What is a Java Bean?" gives:

>A JavaBean is just a standard

>1. All properties private (use getters/setters)
>2. A public no-argument constructor
>3. Implements Serializable.
>>
>>55883202
Disregard, I suck cocks.
>>
>>55881811
>Current year
>Using heavy IDEs
>Not just using a decent editor

How long did you have training wheels on your bike anon?
>>
>>55883125
One database per one application.

You're better off splitting things up with schemas.
>>
>>55883228
Heavy IDEs are useful for boilerplate-laden languages.

If you don't use a boilerplate-laden language, you probably don't really need one.
>>
>>55883173
I have an android app with about 1500 active users. Because the app is utter shit I am rewriting it at the moment and try to build a good application.

Atm you have to register to use the app but I would like to integrate Google and Facebook login to increase the number of users. I already wrote some stuff to prevent the use of multiple accounts but I am not quite sure where to put which data. In future one account should be used to log in to all my applications and I would store data specific to the application in seperate databases. I'm just not quite sure on how to integrate the google/fb login data with my database
>>
>>55883228
>current year
>using primitive text editors
>not using an environment that increases your productivity
>>
>>55883246

Not really an argument, since people's editors are so chock-full of plugins that they might as well be IDEs.
>>
>>55883246
Literally every time I see someone using a text editor for serious work, they've duct-taped gigabytes of addons for functionality they would have gotten out of the box in a proper IDE.

Bonus points for when they spend more time dicking around with their plugins than actually writing code.
>>
>>55883251
Keep user auth info in one users table - add columns to deal with oauth for users that use google/fb logins.
>>
Why are normies so quick to write off any effort to produce the most efficient code possible as "premature optimization"?
>>
>>55883258
I use nano out of the box? I haven't installed anything else in it other than some syntax highlighting definitions.
>>
>>55883312
Because if you didn't profile your code, optimizing it is likely premature.
>>
>>55883312
Because you don't know what you might implement in the future (unless you've actually planned all of it down to incredible detail) you faggot, and "optimizing" might leave you going back and "un-optimizing" so you can add more functionality once you realize you need more memory, or more data types.
>>
>>55883312
>any effort to produce the most efficient code possible
It's one thing to preemptively make good design decisions, such as calculating and caching a block of data (cheap) and doing the I/O (expensive) all at once.

It's another thing to waste 4 hours of the fucking project budget squeezing 10% performance out of a non-performance-critical method, while (probably) simultaneously making the code damn near impossible to read.
>>
>>55883363
i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
>>
>>55883313
>I use nano out of the box?

I can see how that wouldn't be an issue for fizzbuzz.
>>
>>55882715
Try working off of this. I've added comments.

#!/usr/bin/perl

use warnings;
use strict;


my @array;
print "Enter a series of numbers, comma or space delimited:\n";

#Chomp removes the new line you get after the user hits enter. <STDIN> is your file handle.
chomp(my $string = <STDIN>);

#Split the string you just got on each space or comma. This is a regular expression
#Then, push it onto the end of your array.
push @array, split /[\s,]/, $string;


bubble(@array);

sub bubble {
#Copy the array passed over. $_ is for scalars.
my @local_array = @_;
my $sorted = 0;
while (!$sorted) {
$sorted = 1;
}
}
>>
>>55883313
>I use nano out of the box?
So...you write nothing of consequence?
>>
>>55881500
>verbose shit to get a pointer
Yup, looks like Java to me
>>
>>55883409
I am what you faggots would refer to as a "memer" and develop a rails site.

So, yes, if that's fizzbuzz tier to you, sure.
>>
>>55883444
>full RoR website
>uses vanilla nano

You're either masochistic, autistic, or very confused.

Either way, that's some serious faggotry.
>>
https://github.com/jezen/is-thirteen
>>
>>55883444
>I am what you faggots would refer to as a "memer" and develop a rails site.

I never said anything about rails being a meme.
>>
>>55883489
Considering that most of my workflow is
1. look at thing
2. change it
3. save
4. go to browser and reload page
5. repeat

I don't really see the advantage of using an IDE other than to have GUI text editing.
>>
>>55881561
actually the biggest difference there is the types. you could use a function Read a => IO a in place of (read <$> getLine). if you had Idris's shorthands you could write
[| read + read |]
-- or even
do !read + !read
>>
File: meme bunny.gif (3MB, 560x360px) Image search: [Google]
meme bunny.gif
3MB, 560x360px
>>55883506
>>
>>55883052
Oh, that makes sense.
>>
I'm learning Rust.
Does cross dressing speed up the process, or should I use a furry butt plug?
>>
>>55883672
let you = faggot;
>>
>>55883672
do both, but learn a non-meme language instead
>>
>>55881811
the equivalent from jetbrains, pajeet
>>
>>55883672
Neither of those help, but I hear killing yourself works tremendously well.
>>
>>55883222
Okay mate no need to be a bellend about it
>>
>>55883427
Thanks!
>>
>>55881231
i use gcc extensions but js and python are shit and should not even be considered in the context of C
>>
What languages should I learn to increase my employability? I've been writing Scala professionally for 5 years, no other professional experience.
>>
>>55884185
Java
>>
>>55884185
Python
>>
I enrolled into CS for this year's semester.

How fucked am I?
>>
>>55884215
I'm not Indian, I wouldn't be able to compete.

>>55884243
Isn't it a bad meme?
>>
>>55882084
>All very good.
in what sense?
all shit made by adobe is buggy as hell.
surely PS has a shitload of features, but in terms of quality of software, it's trash.
>>
>>55884255
Different schools teach different things.

That said, there is no worst case scenario I've heard of yet because they seem to get worse every time.
>>
File: 1469459679250.jpg (56KB, 720x471px) Image search: [Google]
1469459679250.jpg
56KB, 720x471px
>>55884282
>been working professionally for 5 years
>saying stupid shit like this
>>
>>55884185
Pick one of the big 4 (C++, C#, Java, Python)

Pick both of the following: SQL and Javascript

You are now unilaterally hire-able across all major industries.
>>
>>55884282
>Isn't it a bad meme?
Big players like TensorFlow and OpenCV have Python support.
>>
>>55884346
Pls m8, I don't want to learn Python. Don't do this to me.
>>
>>55884298
>in what sense?

Easy to use (once you learn) and they do what you want them to do.

There is nothing that competes with Photoshop, not even Paint Shop Pro.
>>
>>55884363
Do C# then.

It's employable as hell and comfy to write in.
>>
>>55884185
java and C++

FUCK python hard in the ass
>>
>>55884363
Picking the language really depends on what you want to do. C is great to know, C# is best for enterprise ready(tm) software.
>>
>>55884376
GIMP is just as good as PS
>>
>>55884419

And I'm the bloody Queen.
>>
>>55884308
>>55884378
>>55884414
Ta, looks like I'm going to become OSGTP's protégé. C#, here I come.
>>
ask a professional programmer anything
>>
>>55884443
You lied the other day then. You ARE British, and you ARE a chav.
>>
>>55881852
IDA is expensive as fuck and closed source, but it's damn good at what it does
>>
>>55884463
How do I average two ints in C?
>>
any android programmers up now?
i need help with something.
first off,
i added fragments to my activity in the form of private variables.
say
Activity{
ListFrag LFrag
OtherFrag OFrag
}

if i use fragment transact (FragTran) to add them i get a problem.
order of addition + what happens
-add(LFrag) //gives the
-remove(LFrag)
add(OFrag) //this duo works and replaces LFrag
-remove(OFrag)
add(LFrag) here i get the problem

LFrag doesn't display at all.
but if i backpress back to the first scene it works fine.
but when i advance like that it doesn;t
>>
>>55884376
ah, so you mean in terms OR GUI/UX...
see, there are different ways of measuring "good" software

>>55884419
honestly, the most important parts of the UI are confusing and dumb (I'm not a heavy GIMP user, though)
but patches are welcome, I guess
>>
>>55884454
>implying I'm not 5x the C# developer OSGTshit is
>>
>>55884519
I don't know you from anon, anon.
>>
>>55884472

Nah.
>>
>>55884510

Not just in UI, but in capability. GIMP still hasn't got vector shapes. It's the $current_year. Come on.
>>
>>55884491
i'd start with
#include "gmp.h"
>>
>>55884567
Will you mentor me in C#, mummy?
>>
>>55884584

I can't. I'm too busy doing fuck all.
>>
>>55884608
But mummy, I saved up 50 GBP! Mentor me REEEEEEEEEE
>>
>>55884419
Gimp does most of the same shit. But I'll be damned if people have the audacity to claim it's as easy to use. There are entire articles on tech sites titled shit like "most common reasons gimp isn't working", and they're lists of shit like "you accidentally hit alt+shift+e+space and that turns off keyboard input, because that's a useful feature to have". Gimp is a great program but it was designed by the kind of people who like Blender over 3dsMax. It could completely replace PS if its interface was designed to be user-friendly, but for whatever reason, gnu/linux/open developers seem to hate ease-of-use and would rather create long-winded and confusing documentation than give up their own cludge-as-you-go programming method.
>>
>>55884651
To be blunt, you should be doing your image editing in emacs.
>>
>>55884644
What do you want to do?
>>
>>55884419
>GIMP is just as good as PS
Try telling that to anyone who works with that sort of software on a professional level. GIMP will suit your average hobbyist freetard fine, but there is a reason it has 0 market share in the professional world.
>>
>>55884717
I want to learn C#. I'm already familiar with core Java. I'd like to get to a level of competency where I could work professionally with C#. But not right now, I'm on my phone, and I don't have access to a computer. I guess I'm mostly angling for links to tutorials.
>>
>>55884419
absolutely not.
>>
>>55883557
with MonadComprehensions enabled you can do [ readLine + readLine] where readLine = read <$> getLine
>>
Is Python a good choice to implement a file hosting server? It would need to scale to support say 20 users downloading concurrently. Is the choice of language a major limiting factor for the performance of file transfers over a network?
>>
>>55884935
whoops
[ x + y | x <- readLine, y <- readLine ]
liftM2 should be good enough though
liftM2 (+) readLine readLine
>>
>>55884950
>Is the choice of language a major limiting factor for the performance of file transfers over a network?
No.
>>
>>55884950
Write your shit with Django and serve files from a CDN.
>>
Which Scheme is best for learning (using, among other things, SICP), and then ultimately writing programs in (that will use C libraries and display graphics and stuff)?
>>
>>55884950
Your connection bandwidth will be the limiting factor.
>>
>>55884950
Not really, no. Pick up Flask and go ahead and write it, then make nginx actually handle the downloads once the files are uploaded.
>>
>>55885111

The most practical lisp would probably be Clojure , Racket, or Common lisp.
>>
>>55885306
>Common Lisp
Doesn't that have weird scoping?

I was looking at Racket, and also at Guile and MIT/GNU Scheme. So Racket is the best of those three?

I'd prefer to avoid the JVM, so if I understand correctly that rules out Clojure.
>>
A multiplayer match three game using ES6 (Babel/JavaScript), Webpack (Module Bundler), and Three.js (WebGL). Currently open source on GitHub.
>>
I want to make a simple storage application. It should be desktop and save all things(name of product, price etc.) in database which i can backup to other places(mounted drive, network). What language should I use to make it relatively fast? Also names of helpful libraries appreciated.
>>
>>55885392
C
libsqlite3
>>
>>55885392
MySAL
>>
i am learning malloc and freeing data from memory in C and dont quite understand. here is my code;

#include <stdlib.h> /*for malloc, maybe free?*/
#include <stdio.h> /*for printf*/

int main()
{
int *ptr = malloc( sizeof(*ptr) ); /*sizeof(*ptr) will evaluate the size of whatever we would get back from dereferencing ptr; since ptr is a pointer to an int, *ptr would give us an int, so sizeof(*ptr) will return the size of an integer.*/
printf ("The size of ptr before being freed is %d\n", sizeof(*ptr));
free ( ptr ); /*frees the integer ptr from memory*/
printf ("The size of ptr after being freed is %d\n", sizeof(*ptr));
*ptr = 0; /*sets the pointer for ptr to 0 (null) to "reset it". By doing this, when you do something foolish with the pointer (it happens a lot, even with experienced programmers), you find out immediately instead of later, when you have done considerable damage. i dont fully understand but think maybe it would prevent compilation if it wasnt freed properly or something?*/
printf ("The size of ptr after its reset is %d\n", sizeof(*ptr));
}


this compiles, but when it is run, ptr still has the same size throughout the execution of the program;
The size of ptr before being freed is 4
The size of ptr after being freed is 4
The size of ptr after its reset is 4


is anything wrong? is it just saying the value of an int even if it isnt in memory is 4 bytes?
>>
>>55885392
C++ with Qt which provides both a GUI toolkit and SQLite driver.
>>
>>55885436
sizeof (*ptr)
is sizeof (int)
which is 4 on your hardware/compiler
>>
>>55885436
First of all, you're not "resetting" the pointer, if anything, you're setting the value to 0, which isn't even valid and you should have gotten a user-after-free error.
>>
>>55880459
I just got into libGDX and I'm already blown away by the convenience of it. The development is surprisingly easy for a beginner in Java. What's amazing is how I'll be able to run the same code on both Android and iOS.
>>
>>55885331
>Scheme

Meh, you get used to the scoping.

I didn't particularly care for MIT Scheme.

As for racket it's not bad. You just have to accept that it is very slow.

You might look at Steel bank common lisp as a option.

Yes Clojure does depend on the jvm.
>>
>>55885471
oh alright, second question, can *ptr be anything or is it a specific name? for example if i made a pointer called *test could i put that there?

>>55885477
the tutorial says
After freeing a pointer, it is a good idea to reset it to point to 0. When 0 is assigned to a pointer, the pointer becomes a null pointer, in other words, it points to nothing. By doing this, when you do something foolish with the pointer (it happens a lot, even with experienced programmers), you find out immediately instead of later, when you have done considerable damage. 

and doesnt give an example how do i reset a pointer?
>>
>>55885518
ptr = 0
ptr = NULL;

there you go senapi
>>
Im an average guy that likes to use linux now an again to just switch it up from windows 7.

basically is there any point to learning any sort of programming language for the semi average user?

Is there any point to using Linux, other than the fact that it's way better optimized (generally) for shitty pc's (I have a good pc)

and what language to learn?
I tried learning Python but got bored because there was nothing I could apply my knowledge to

sorry kind of a Linux question but can anyone from here answer this?
>>
File: 1447695479362.jpg (105KB, 610x475px) Image search: [Google]
1447695479362.jpg
105KB, 610x475px
Is Android app development still profitable, or did it become a meme?
>>
>>55881599
>Implying BSD doesn't exist.
>>
>>55885518
Yes, but you should be setting the pointer to 0, not where it points to.

ptr = NULL;


or
ptr = 0;


Instead of:
*ptr = 0;


Because this way you're dereferencing it and setting the value to 0.
>>
>>55885539
I believe that good and innovative apps can be profitable. There's a ridiculous amount of trash on Google Play, tho, which can make getting users difficult.
>>
>>55885487
trust me, i was once a summerfag just like you, go ahead and play with libgdx, but know that libgdx isn't really used by any serious game development company because it's shitty and you'll outgrow it fast, and once you git gud it will be no problem at all to develop for both android and iOS without using libgdx
>>
>>55885530
>>55885564
arigato, gomenesai
>>
>>55885603
I guess that makes things even better, but what are the engines and tools that skillful devs use?
>>
>>55885331
weird scoping?

it's lexical scoping with the option to use dynamically scoped variables if you wish. exactly the same as scheme.
>>
>>55885499
Thanks for the pointers, man. Think I'll start with racket, and move to something else if performance becomes a problem. I'll also check out steel bank common Lisp.
>>
useful c++ git repos or OSS libraries that i can check to see how's the c++ programming in the real world?
>>
Baby's first program:
extern crate rand;

use std::io;
use std::cmp::Ordering;
use rand::Rng;

fn main() {
println!("Guess the number!");

let secret_number = rand::thread_rng().gen_range(1, 101);

loop {
println!("Please input your guess.");

let mut guess = String::new();

io::stdin().read_line(&mut guess)
.expect("Failed to read line");

let guess: u32 = match guess.trim().parse() {
Ok(num) => num,
Err(_) => continue,
};

println!("You guessed: {}", guess);

match guess.cmp(&secret_number) {
Ordering::Less => println!("Too small!"),
Ordering::Greater => println!("Too big!"),
Ordering::Equal => {
println!("You win!");
break;
}
}
}
}
>>
>>55885533

Points towards using Linux:

Microsoft isn't spying on you.
Fully customizable.
Generally the memory and resource usage is much much lower.
Better out of the box security.
Very well suited to hardening even further.
It's a much better environment for programming and network related tasks.
Very powerful command line utilities and navigation.

Points against Linux:
Hardware vendors are bitches and bought out by Microsoft so Drivers are not always available or up to par.
Customizable means easy to break.
Open Source Software likes to break compatibility randomly.
You have to read the fucking manual often.
Commercial and common monopoly based business software requires jumping through minor hoops to deal with.
If you want games hope that wine has good support for it or setup a windows vm with gpu passthrough.
Software vendors cater only to the microsoft overlords.
Distro and program naming conventions are often nonsensical.
A lot of gui utilities are just after thoughts (CLI / Config files rule the Linux environment. If you have to point and click to do everything this is bad)
Microsoft is constantly trying to introduce shit like uefi to fuck you on new hardware.
>>
>>55885713
https://github.com/OpenMW/openmw/tree/master/apps/openmw
>>
>>55885735
+1
>>
>>55885518
>and doesnt give an example how do i reset a pointer?
That's absolutely stupid. Don't do that. It's totally useless.
>>
>>55885713
a shitload of applications use C++: browsers, browser add-ons, everything Qt, games, ... ...
>>
>>55885418
>>55885449
Thanks. I will go with C++ and Qt then.
>>
>>55885802
sometimes you want to do it if you're reusing it and you have logic that checks it for null/non-null
>>
>Google also argues that using HTTPS connections has improved the user experience on YouTube.
yeah, fucking nah, half the videos will barely even load now
>>
>>55885971
Yeah fuck YouTube.
>Play a video once
>Want to watch it again
>Press Replay button
>Stuck loading
>Need to reload the page entirely

It happens like 90% of the time I try.
>>
>>55885971
How would using HTTPS connections improve user experience?
>>
>>55886262
>Google also argues that using HTTPS connections has improved the user experience on YouTube. “You watch YouTube videos on everything from flip phones to smart TVs,” the team writes today. “We A/B tested HTTPS on every device to ensure that users would not be negatively impacted. We found that HTTPS improved quality of experience on most clients: by ensuring content integrity, we virtually eliminated many types of streaming errors.”
>>
>>55886262
It prevents caching
>>
>>55886046
not to mention having to wait for an ad to finish only for the actual video to hang so then you reload the page and have to rewatch an ad

i think they do it on purpose
>>
This might not be the right thread for this question, since it's network related, but i couldn't see anywhere else.

What are TCP ports? I can't seem to get it in my head. Do they serve any purpose besides an agreement between two nodes?
If it's so free, what purpose do they serve? If i can create an application that expects you to listen to port 80 anyway, what do ports even do? Or i can't use port 80, since html also uses it?

If they are slots to be filled, and once filled cannot have anything else, it makes a little more sense, but even then.
>>
>>55886344
use an adblocker, they block youtube ads
>>
>>55886369
You can have only one listening application by port.
>>
>>55886398
So that is a port's purpose? To limit the amount of applications a host can receive?
Why though? I can understand the security side of it, but that came later. IP makes sense, you need ip, but why do you need ports?
>>
>>55886369
If it were not for ports, you wouldn't have multiple "servers" running on a single machine, because how otherwise would the system be able to tell how to communicate with the remote endpoint unless everyone writing networked code would agree on a common protocol on the userspace level but that's obviously not an option.
>>
File: fffffffffff.png (2KB, 287x160px) Image search: [Google]
fffffffffff.png
2KB, 287x160px
>>55886332
it's wrecking my shit
>>
>>55886423
No. To allow more than one application.
>>
>>55886426
>>55886473
I see, thanks.
>>
>>55886423
Not quite. It's more like a shipping label that tells the receiver where your packet is going. If you are sending something to port 80, the receiving server is going to give that packet to whatever program is listening on port 80 (usually a web server).
>>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main()
{
float pi = 22.0 / 7.0;
cout << pi << endl;
cout << setprecision(5) << pi << endl;
cout << setprecision(4) << pi << endl;
cout << setprecision(3) << pi << endl;
cout << setprecision(2) << pi << endl;
cout << setprecision(1) << pi << endl;


return 0;
}


Learning how to program is fun!
>>
>>55886528
Don't worry, you're not learning anything.
>>
File: karlieimage_option2.jpg (395KB, 1505x977px) Image search: [Google]
karlieimage_option2.jpg
395KB, 1505x977px
>tfw no qt3.14 to read code complete to you while your head is planted in her lap sniffing that strawberry smelling crotch
>>
>>55886538
Huh? What you mean
>>
>>55886545
Do you know what the various stream operators are doing?
>>
>>55886542
What the fuck am i reading
>>
>>55886542
What the hell is your problem
>>
>>55886568
Of course. the setprecision lets your round a number to a certain amount. endl starts output on a new line
>>
File: shot4-0.png (816KB, 1279x727px) Image search: [Google]
shot4-0.png
816KB, 1279x727px
>>55886571
>>55886570
You know you'd rub your dick against a stadium full of glass shards just to "kode with klossy" for just half a minute
>>
>>55886836
Why is she wearing a hood inside?
>>
>you must restart in order to do x
>>
>>55886836
I don't have a dick, I'm immune to her charms
>>
>>55886892
It's a bdsm thing.
She's with that goddess afterall
>>
>>55886892
A bomb
>>
>>55886542
>>55886836
hnng, she should code muh dick in her wet pussy
>>
>>55882156

I can tell immediately just by looking at this that it's not compiled using optimization flags. By default, GCC will push the base pointer on every function call. When told even to just use -O2, it won't unless it needs to. This is what a swap() function should look like with -O2 optimizations:

0000000000000000 <_Z4swapRiS_>:
0: 8b 07 mov (%rdi),%eax
2: 8b 16 mov (%rsi),%edx
4: 89 17 mov %edx,(%rdi)
6: 89 06 mov %eax,(%rsi)
8: c3 retq
>>
>>55886966
#include <stdio.h>
int main ()
{
int dick = 2; /*inches*/
printf ("Sorry, I only code in 1s and 0s but ur dick is %d :D", &dick);
printf ("Game over");
}
>>
>>55880754
This.
>>55882984
I assume he meant /v/ Unity.
>>
>>55887060
but 2 is just "1" ++ "0"
>>
>>55881231
>not using Clang
Does GCC even support compiling to a non-shit language? GCC at -O3 optimization is a pile of slow laggy stupid shit, and it's only meh-tier at -O2 optimization.

>INTEGER (int32) :: CURRENTYEAR
>Writing C
>>
Help, I was writing some Haskell today and accidentally proved I am a faggot
>>
>>55887162
Link so I can help you bully her.
>>
>>55887162
Well done, you found a woman that couldn't program

Stupid frogposter
>>
How should I learn CL?
>>
File: Screenshot_2016-08-02_16-37-31.png (5KB, 606x48px) Image search: [Google]
Screenshot_2016-08-02_16-37-31.png
5KB, 606x48px
>>55887393
Looks like you just mash your keyboard and hope for the best
>>
>>55887428
Let's try. Warning: Don't run this code it might hack the gibson.
D F;KMDVGXF DV XRFZD MFRVDRFGVKDRFVGKD ZDGD GZR DGZRLDGMZD OAPWREA WOK GOWPA
>>
>>55886344
>not using ublock origin or at least host files
Fag
>>
>>55887393

Something like this?

(defparameter *number-of-cells* 30000)

(defun string-to-instructions (string)
"Coverts STRING to the brainfuck instructions' model"
(make-array (length string)
:initial-contents (loop for x across string
collect (char-code x))
:element-type '(unsigned-byte 8)))

(defun match-forward (ip instructions)
"Searches for a matching ] forward"
(do ((c 1 (case (code-char (elt instructions i))
(#\[ (1+ c))
(#\] (1- c))
(t c)))
(i (1+ ip) (1+ i)))
((zerop c) (1- i))))

(defun match-backward (ip instructions)
"Searches for a matching [ backwards"
(do* ((c 1 (case (code-char (elt instructions i))
(#\[ (1- c))
(#\] (1+ c))
(t c)))
(i (1- ip) (1- i)))
((zerop c) (1+ i))))

(defun program-loop (program)
"The main loop"
(let ((data (make-array *number-of-cells* :initial-element 0
:element-type '(unsigned-byte 8)))
(dp 0)
(instructions (string-to-instructions program))
(ip 0))
(do ((limit (length instructions)))
((= limit ip) t)
(case (code-char (elt instructions ip))
(#\> (incf dp))
(#\< (decf dp))
(#\+ (incf (elt data dp)))
(#\- (decf (elt data dp)))
(#\. (princ (code-char (elt data dp))))
(#\, (incf ip)
(setf (elt data dp)
(elt instructions ip)))
(#\[ (when (zerop (elt data dp))
(setf ip (match-forward ip instructions))))
(#\] (when (not (zerop (elt data dp)))
(setf ip (match-backward ip instructions)))))
(incf ip))))

(defun exec (program)
"Executes PROGRAM, a string representing a brainfuck program"
(program-loop program))
>>
>>55882984
Ubuntu Unity
>>
>>55887162
>things that never happened
>>
should I add gitignore in to gitignore?
>>
>>55887746
I do it. Like that I can ignore what I want.
>>
File: ibgBL12rULaZHd.gif (3MB, 320x320px) Image search: [Google]
ibgBL12rULaZHd.gif
3MB, 320x320px
>>55887756
>>
Trying to solve this

https://projecteuler.net/problem=31

First solution idea was this

main = print $ applyWhile [0]

coinsums values = filter (<=200) $ [(+1),(+2),(+5),(+10),(+20),(+50),(+100),(+200)] <*> values

applyWhile [] = 0
applyWhile values = equal200 + applyWhile under200
where equal200 = fst $ apply values
under200 = snd $ apply values

apply values = (equal,removed)
where removed = coinsums values
equal = length $ filter (==200) removed


But this rapes your memory very quickly, and then I realised it wouldn't work anyway because it counts 1p + 2p as a difference sequence as 2p + 1p, the only way I could fix this would be to get the sequence somehow, sort them all, then remove the duplicates but nub is slow slow slow so this would be even worse.

So I can't really think of a way to do this which isn't slow as shit, anyone got any ideas?
>>
>>55887782
first, there's only 1 way to make £2 with any £2 coins, so you can improve it by simply doing:

[200] : otherSolutions


second, work from the top down, start with 200 and pick coins until you've reached 200, and filter away the coins you can try (e.g. once you've got £1.50 you don't need to try solutions involving £1 coins)
>>
I have a C++ Project where I have to build a trie class from scratch. My professor made a bunch of boost tests that we need to pass.

desu I barely understand this shit at all

for example, first boost tests are
>trie<std::string> t;
>BOOST_CHECK(t.empty());
>BOOST_CHECK(t.begin() == t.end());

this is nearly into "do my homework for me" shit but can here anyone here give a decent resource so i can get this started, or some barebones class code i can work with

i've found a bunch of implementations of tries in c++ online, but while i sorta grasp the concept, translating it to suit my professors dumb boost tests is impossible
>>
>>55887782
Do it the other way around. Start at 200 and subtract highest denominations first. That way you won't have the issue of 2p+1p == 1p+2p.

So you first try 50+50, then 50+20+20+10, etc.

That's the naive approach which is certainly good enough for this. If you want the fastest possible approach, this problem scream out for dynamic programming. It's not really necessary though, but maybe you'll find it fun to try so I thought it was worth mentioning. It's also probably the more idiomatic way to solve this in a functional language, using memoization.
>>
>>55887934
in fact if you do this, there's no real need to do the
[200] : otherSolutions
because it'll be done immediately as it'll pick £2 first realise it's matched and then go for other solutions
>>
>>55887782

It's just a normal knapsack problem.

We spend a whole semester only implementing differnt solutions for it (in Java), so.. the choice is yours:

>https://en.wikipedia.org/wiki/Knapsack_problem#Solving
>>
>>55887999
Would rather not copy a solution but thanks for the link, I guess I'll see how it's done if I can't manage it with the other anon's advice
>>
>>55887060
$ cat << EOF > klossy.c
> #include <stdio.h>
> int main ()
> {
> int dick = 2; /*inches*/
> printf ("Sorry, I only code in 1s and 0s but ur dick is %d :D", &dick);
> printf ("Game over");
> }
> EOF
$ gcc -g -Wall -o klossy{,.c}
klossy.c: In function ‘main’:
klossy.c:5:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
printf ("Sorry, I only code in 1s and 0s but ur dick is %d :D", &dick);
^
$ ./klossy
Sorry, I only code in 1s and 0s but ur dick is -1968630876 :DGame over$
$ gdb ./klossy
[...]
Reading symbols from ./klossy...done.
(gdb) disassemble main
Dump of assembler code for function main:
0x0000000000400596 <+0>: push rbp
0x0000000000400597 <+1>: mov rbp,rsp
0x000000000040059a <+4>: sub rsp,0x10
0x000000000040059e <+8>: mov rax,QWORD PTR fs:0x28
0x00000000004005a7 <+17>: mov QWORD PTR [rbp-0x8],rax
0x00000000004005ab <+21>: xor eax,eax
0x00000000004005ad <+23>: mov DWORD PTR [rbp-0xc],0x2
0x00000000004005b4 <+30>: lea rax,[rbp-0xc]
0x00000000004005b8 <+34>: mov rsi,rax
0x00000000004005bb <+37>: mov edi,0x400688
0x00000000004005c0 <+42>: mov eax,0x0
0x00000000004005c5 <+47>: call 0x400470 <printf@plt>
0x00000000004005ca <+52>: mov edi,0x4006bd
[...]
End of assembler dump.
(gdb) b *0x00000000004005c5
Breakpoint 1 at 0x4005c5: file klossy.c, line 5.
(gdb) r
Starting program: /tmp/klossy

Breakpoint 1, 0x00000000004005c5 in main () at klossy.c:5
5 printf ("Sorry, I only code in 1s and 0s but ur dick is %d :D", &dick);
(gdb) set $rsi=9
(gdb) c
Continuing.
Sorry, I only code in 1s and 0s but ur dick is 9 :DGame over[Inferior 1 (process 8069) exited normally]
(gdb) q
$

FTFY
>>
So I'm starting uni this fall and I'm majoring in computer science
Did I seriously fuck up or the degree is actually useful besides employment/wage advantages?
>>
>>55888050
im getting -1866932036, not -1968630876 how the fuck does 2 = either of these numbers?
>>
who /prolog/ here?
>>
>>55888084
It really depends on the university, most of the CS majors tend to be shit but a few have some really great programmes. Which one did you chose?
>>
>>55887782
let rec generate accu amount pieces =
if amount = 0 then
succ accu
else
match pieces with
| [] -> accu
| p :: ps ->
let accu =
if amount >= p then
generate accu (amount - p) pieces
else
accu in
generate accu amount ps
;;

let main () =
let count = generate 0 200 [200; 100; 50; 20; 10; 5; 2; 1] in
print_endline (string_of_int count)
;;

let () = main ();;
>>
>>55888014

The funny thing is, Knapsack is a bitch. You can solve it in many differnt ways.. Just by trying to understand the different approaches you will already learrn a lot.

And if you don't take a very sophisticated approach it will either be sloow or "rape your memory" as you put it.

So I'd highly advise you to goole and try to understand and implement the different solutions, this will be hard enough.. :)
>>
>>55888123
literally HOW
vbox-linux% ./3how
Sorry, I only code in 1s and 0s but ur dick is -1866932036 :DGame over% vbox-linux% ./3how
Sorry, I only code in 1s and 0s but ur dick is 507586220 :DGame over% vbox-linux% ./3how
Sorry, I only code in 1s and 0s but ur dick is 2006108876 :DGame over% vbox-linux% ./3how
Sorry, I only code in 1s and 0s but ur dick is -1421824052 :DGame over% vbox-linux% ./3how
Sorry, I only code in 1s and 0s but ur dick is -2095418484 :DGame over%
>>
>>55888123
>klossy.c:5:13: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
^
>>
>>55888123
>>55888168
>&dick
>>
>>55888177
>>55888179
you ever had a time after years of alegebra where you couldnt remember addition?
[spoiler]im sorry[/spoiler]
>>
>>55888129
Just your average European university
>>
>>55888201
not really, no.

>>55888168
also, google "ASLR"
>>
>>55888269
What country?
>>
File: houses.png (3KB, 362x365px) Image search: [Google]
houses.png
3KB, 362x365px
>>55880459
In order to get familiar to Qt I implemented a simple housing structure generator, resulting in pic related.

I'm still blown away by the quality and documentation, compared to GTK which I used earlier.
Only pain point was layouting, but that seems to be annoying in all GUI libraries so far.

As I'm thinking to target it to pen and paper role players:
Can a generator like this be useful to pen and paper games?

>inb4 printable colors
The can be changed.
>>
>>55888288
>quality
Using that word when speaking about QT is ridiculious.
>>
NEET here
Is it true that programming is a job that doesnt force you to socialize, but can still make decent money?
I don't mind learning and working but i really dont want to have to talk to people, especially women.
>>
>>55888282
Romania.
>>
>>55888316
Because? Apart from minor negligence in Qt Creator everything worked performant and as documented.

For a counter example you better not bring up some bug in an embedded web browser engine, because those are always cancerous by default and every bug in them is on the browsers head.
>>
>>55888368
For the most part that is wrong.
>>
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
const double pi = 3.14159;
double degrees, radians;

cout << "Enter an angle in degrees and I will convert it\n";
cout << "to radians for you: ";
cin >> degrees;
radians = degrees * pi / 180;

cout << degrees << " = ";
cout << setprecision(4) << fixed << left << setw(5) << radians << " rad";
cout << endl;

return 0;


}
>>
>>55888368
you don't have to socialize with people, but you do have communicate.
>>
>>55888368
Why can't you talk to people??
>>
Anyone know how to copy the text in hackerrank programming enviroment to clipboard? It's got a no copy flag set on it or something and I want to pop it into my own editor
>>
>>55888900
>It's got a no copy flag set
Lol never used your browser's element inspector before?
>>
When should I use a double variable and a float variable
>>
>>55888938
I know I can do it like that in some way but I have never done that before so idk really how
>>
>>55888945
double if 64-bit CPU, float if 32-bit.
>>
var synonymMatrix = [
["bad","terrible","no-good","poor","miserable","shitty"],
["good","lovely","excellent","extraordianry","fantastic"],
["ridiculous","proposterous","crazy","retarded"]
];

var uneducatedWeights = [
[2,1,0,0,-1,1],
[2,0,0,-1,0],
[0,-1,1,0]
];


So the synonym matrix will contain interchangeable words in each row and a character's weights will be factored in when words are randomized. Any easy ways to optimize this? How about automating the code writing?
>>
>>55888945
neither

>>55888978
tard
>>
>>55888996
>Any easy ways to optimize this?
you have no code to optimize
>>
>>55888996
retarded should be like 10, same for shitty
you should also add jewish
>>
>>55888655
For the most part?
>>55888744
Thats...manageable
Especially if i can limit communication to over the computer
>>55888849
People in general, though more so women, scare me.
It's not that i necessarily hold them any ill will. I'm not like /r9k/ with their "KILL ALL NORMIES REEEE" mentality. I just want to be alone.
>>
>>55881491
>>Mixing applicative and monad notation.
Just write
(+) <$> (read <$> getLine) <*> (read <$> getLine)
like a normal autist. liftM and its cousins are supposed to be deprecated.
>>
File: 1437439991388.jpg (34KB, 368x368px) Image search: [Google]
1437439991388.jpg
34KB, 368x368px
>tfw was about to post some code asking for help but then figured it out myself

Feels good man
>>
>>55889038

Re: women, you're probably putting them on a pedestal. It helps to remember that they lie, poop, make bad decisions, feel sad, etc. just like men do. Only difference is that they often do a better job of hiding it.
>>
>>55889038
>For the most part?
You will have to talk to customers, superiors, coworkers.
You will need to empathize with your customers figuring out what the hell they want and empathize with coworkers, figuring out what the hell their shit code is supposed to do.

You don't have to be good at smalltalking bullshit, if that is what you fear. Although it is certainly helpful to keep your customers/bosses in line.

No communication would mean your software is an end in itself.
>>
im just now learning rails and our project that we're on now is to build a mockup store.

i created a Products category (i scaffolded it with name/price/quantity/description/category)
and a Category model
Category just has a name but when i try to link to categories_url it doesn't know where it is and I don't know where to go define Category.

i just need to throw in @categories = Category.all somewhere right? my products_url works
>>
Hi guys, quick question really.

I want to learn a little python by building a shitty desktop game that opens in a window. How doable is this? and is there a good program to write it in where I can preview it as I go along? I have vim but its a bit meh.
>>
NEW THREAD!!

>>55889160
>>
>>55889159
Very doable. Pygame. Any editor will do.
>>
>>55889165
>>55889165
dumbass
>>
>>55883045
Just read this:
https://wiki.haskell.org/Typeclassopedia
And possibly also learn you a Haskell if you get stuck on the early concepts. Once you understand what a monad is, comonads are just the inverse.

Also, doing some actual coding in Hasell to get a good practical experience with examples of the concepts helps.
>>
>>55889100
Woman here, can confirm that I sometimes poop. I try to do it in other people's toilets.
>>
File: 1440064377107.jpg (204KB, 500x500px) Image search: [Google]
1440064377107.jpg
204KB, 500x500px
>>55889502
Real woman here, this anon lies.
>>
File: slowloris.png (36KB, 440x291px) Image search: [Google]
slowloris.png
36KB, 440x291px
find ./ -type f -exec md5sum {} \; >> ~/test_sums2.txt; diff ~/test_sums.txt ~/test_sums2.txt
2c2
< b7269fa2508548e4032c455818f1e321 ./file1
---
> 68b329da9893e34099c7d8ad5cb9c940 ./file1
>>
>>55887636
why not compile directly to lisp code dude

[spoiler]tfw i broke the sbcl compiler by compiling a large brainfuck program to a single tagbody form[/spoiler]
>>
asp.net mvc holy shit thank god i have an ide
>>
>>55888662
hows 101?
Thread posts: 318
Thread images: 24


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.