[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: 328
Thread images: 41

File: 1478528364000.jpg (81KB, 600x688px) Image search: [Google]
1478528364000.jpg
81KB, 600x688px
Old thread: >>57818692

Comfy arm warmers edition!
What are you working on, /g/?
>>
>2016
>using javaids

kill yourself
>>
File: 1470657968824.png (611KB, 780x720px) Image search: [Google]
1470657968824.png
611KB, 780x720px
>2016
>he uses Java
>>
first for C++
>>
>>57826513
but op pic has nothing to do with programming
>>
>>57826513

I'm doing reverse CNN.

Instead of taking an image and picking a category, I input a string and output an image, but the 1040 inputs seem to be an issue, Might try with just like 50 categories or something
>>
>scalaids """dependent types"""
loooool
>>
File: 1480787494288.jpg (105KB, 600x862px) Image search: [Google]
1480787494288.jpg
105KB, 600x862px
sometimes I wonder if my programming skills are lacking since I dont wear long stripey socks. one day i hope to wear them and see how much more efficiently I can code.
>>
>>57826656
I hope you're at least wearing your skirt.
>>
File: IMG_2478.jpg (1MB, 2500x1667px) Image search: [Google]
IMG_2478.jpg
1MB, 2500x1667px
Still not working correctly, but I guess I am getting closer.
Not sure where the problem is though, gotta wire up some leds to help debugging shit
>>
Reposting because i'm a retard who posted in a dead thread.

Alright, I did a shitpost detector that attributes a grade to each post in Python. I want to do a web extension for this, which would basically put a little icon next to the name of the poster depending on how shitposty the post is.
How would I go on to do that ?
Also you got bad grades anon. I'm gonna have a little talk with your parents on how you discuss with people on this South Vietnamese rice farming forum.
>>
File: fail.png (19KB, 769x605px) Image search: [Google]
fail.png
19KB, 769x605px
In Java,
How would I correct the error in the image?
Also, how would I fill the hashset with the amount of objects using a loop?
And how would I also set each element of an arraylist to be assigned with another object?

Thanks.
>>
Why is this line throwing a syntax error in Python?

y= y-(0.2*(y-(x**2)*(y**4)*y)/(x+(x**2)*(y**4)*x))
>>
>>57826759
it sounds really doable, if you find the right online tutorial - seems a matter of minor reading on the topic

what's your algorithm for determning if a post is a shitpost - i'm guessing dubs, meme content, off topic etc?
>>
>>57826771
Penny penny = (Penny) itr.next();

Gotta love Java verbosity :)
>>
File: MVI_2479.webm (769KB, 1280x720px) Image search: [Google]
MVI_2479.webm
769KB, 1280x720px
well, at least it does stuff.
>>
>>57826789
it doesn't you retard
>>
>>57826845

What is le goal anon
>>
>>57826793
It probably is, but I don't know tits about web dev. I'll take a look into it, just need some ideas on where to start.

The algorithm is pretty simple, it checks for length, amount of curse word, number of replies and if the replies says thanks. Then it add the grade of each of those attributes into one. I'll refine it once i'm done with the web implementation. I'll also set up a repo so you guys can check out my abhorrent coding skills.
>>
File: Untitled.png (77KB, 542x747px) Image search: [Google]
Untitled.png
77KB, 542x747px
>>57826850

Did it really work for you? I've tried in lots of ways in interactive mode and also from a file, it just doesn't work.
>>
>>57826845
nice clock ahmed
>>
>>57826882
Probably an indentation error and python is being passive aggressive. It works perfectly in my repl, python 2.7 or 3.5
>>
>>57826845
>not using arduino
>>
>>57826771

Oh it's you again
>>
>>57826870
le goal is to get an hd44780 display workin with an attiny13, a 595 shift register and only 3 pins
>>
File: 1479578692081.jpg (65KB, 480x411px) Image search: [Google]
1479578692081.jpg
65KB, 480x411px
>tfw havent written any real code in months because im studying for google and fb interviews
>>
>>57826986
how do you study for an interview?
>>
>>57826986
What would you study for those? kek
Just be you'reself m9
>>
>>57827026
well google expects you to solve the millennium problem of inverting a binary tree so...
>>
i am learning how to do computer programming in lua (love2d)

it will become a space-invaders game soon

pls inform me now if my computer code looks like pocket spaghetti to trained eyes
>>
>>57827043
really?
Inverting a binary tree is the easiest fuckin shit on the whole fuckin planet. If you can't do that, then you should just kys
>>
>>57827065
Your code looks really good anon
>>
File: test2.jpg (5KB, 72x144px) Image search: [Google]
test2.jpg
5KB, 72x144px
Man, this is some cool ass shit, those are the first 2 images I've taught it to return for now
>>
File: 1*tsHwsy-_jG4acGFOSYJRVA.jpg (55KB, 781x403px) Image search: [Google]
1*tsHwsy-_jG4acGFOSYJRVA.jpg
55KB, 781x403px
>>57827076
>>
>>57827092
>implying they said exactly that
>>
>>57827089

Those are the logos of apple and google btw
>>
>>57827082
thx anon-san
>>
>>57827065

Are you removing bullets once they leave the screen and become irrelevant to game logic?
>>
>>57827065

What IDE/Editor is that?
>>
File: 1480763101654.png (207KB, 450x416px) Image search: [Google]
1480763101654.png
207KB, 450x416px
>company does some diversity hires
>woman joins our small dev department of 10 people
>it's a tranny
It's been a week and I haven't seen him do any real work, he won't talk to us, he disappears for most of the day after lunch and I don't think he even knows how to program.
>>
>>57827132
that is the gnome text editor Gedit. It got a facelift in gnome version 3.18. It is very powerful and lightweight.

>>57827124
if v.y < -10 then
table.remove(player.bullets, i)
end
>>
>>57827174
although i cannot get the external tools plugin to work correctly for some reason so i have a terminal in the bottom instead
>>
>>57827173
>Its a matter of time before you get fired in favor of more trannies and diversities for those sweet government subsidies
>>
>>57827173
is he cute?
>>
>>57827173
computer programmers dont do any real work anyway anon
>>
File: 2016-12-04 01_46_07.png (8KB, 1291x21px) Image search: [Google]
2016-12-04 01_46_07.png
8KB, 1291x21px
There has to be a less shitty way.
>>
>>57827224
> tranny
>cute
>>
>>57827244

Alright, how mind blowingly hot is she then?
>>
Working on my terminal emulator, started working on the Wayland port, this is going to be awful, Wayland a shit.

But alas, at least I'd get the meme Wayland users :^)
>>
>>57827173
How long until you suck her big feminine cock, anon?
>>
>>57827323

Yesterday.
>>
how do I implement inheritance in C?

I need to interact with a bunch of different types of structs but doing so through only one interface
>>
>>57827284
>mind blowingly hot
>>
>>57827173
>woman
>>
>>57827284
>she
He said it's a dude, nigger.
>>
>>57827384
>>57827405

Why you gotta judge?
>>
>>57827173
>I don't think he even knows how to program.
Anon the reason you don't see him do any work is because he's really really fast.
Boys in women's clothing are like that.
>>
>>57827429
She said it's a dude, dude
>>
>>57826771
That logic is awful
>>
>>57827367
That's not inheritance.
>>
File: output.webm (785KB, 1280x720px) Image search: [Google]
output.webm
785KB, 1280x720px
It should've printed some numbers, but I am ok with this, too :-)
>>
If I put this line of code into my android app, how difficult it might be for someone to extract it?
String encoding = Base64Encoder.encode ("username:password");

If easy, how to get it done right?
>>
>>57827437
One of us has to be sane.
>>
>>57827477
Who's information is this? If it's the users own identification you're pretty safe from malware on the device (in the sense that it's not trivial to take it) since you're saving it in memory and you're not important enough.

If it's something you don't want the users to have then. That's bad.
>>
File: 86694824.jpg (9KB, 224x225px) Image search: [Google]
86694824.jpg
9KB, 224x225px
>>57827477
Easy as shit, don't do that
>>
Any recommendation for a C library which implements associative arrays/dictionaries/hashmaps?
>>
File: RPiparser.webm (3MB, 960x540px) Image search: [Google]
RPiparser.webm
3MB, 960x540px
>>57827459
Character LCDs are fun.
>>
>>57827522
(basically need me to associate some char arrays with some numbers, nothing fancy)
>>
>>57827511

You are just insecure that she is living without repressing herself <3333
>>
>>57827522
>>57827539
1. Write that on yourself
2. Use C++
>>
>>57827522
I don't know because I don't waste time looking and just quickly write it myself.
A hashmap is like 10-20 lines of code maybe.
>>
File: fucking-font.webm (320KB, 1138x640px) Image search: [Google]
fucking-font.webm
320KB, 1138x640px
>>57827533

I liked this one more, but I fucked it up with connecting it to 5V instead of 3.3
>>
>>57827660
How much was it?
>>
File: ip-req.webm (1MB, 1280x720px) Image search: [Google]
ip-req.webm
1MB, 1280x720px
>>57827677
Nothing.
It was an old siemens c60 display.
>>
>>57826513
Okay anyone how the fuck do you not lose references to data in OOP. I just can't understand its like everything is referenced within a class and I can't access it outside of the class.
>>
>>57827684
That's pretty cool.
I need to find broken shit to salvage parts from.
>>
>>57827578
>>57827574
You can tell the programmer who has never worked on a real project by his insistence on reinventing the wheel.
>>
>>57827725
Bad thing is, I am hired, and actually sometimes reinvent wheels.
>>
>>57827725
>insistance
Well if you have it you have it. If you don't you don't.

You wouldn't inflict STD's on your code i hope.
I consider that abuse.
>>
>>57827756
I would inflict say GLib which has pretty good implementations of many useful data structures including hash maps.

>>57827578
How do you handle hash collision in ten lines of code?
>>
> project is starting to work
> a year ago I never would have thought I could have done it

I'm gonna make it bros
>>
>>57827477
>how to get it done right?
I could write a whole book about this. Well not me, but someone else as I suck at security and rely on other libraries

The basic concept is
> generate a long unique string (20 characters is definitely enough)
> add it to the front of the password
> use sha512 or some other modern hashing function like sha3 on the string you just created
> store the output and the string you created
> repeat the process each time the user logs in

That being said, Google has plenty of libraries that let you use their authentication system. But if you still want to do it, make sure all of this is in the server side, but client side
>>
Can somebody post the source code for that Rust terminal? I want to try it out, and I only hear about it on these threads.
>>
>>57827855
Are you talking about cancer? You could probably find it by googling cancer terminal rust
>>
>>57827855
notty?
>>
File: ftbuild.png (4KB, 187x169px) Image search: [Google]
ftbuild.png
4KB, 187x169px
For freetype, but I suppose it applies to libraries in general. Are you supposed to link debug builds of libraries in your own debug builds and link release builds of the lib in your own release builds, or just have one release build of the lib and link that wherever?
>>
>>57827800
>How do you handle hash collision in ten lines of code?
Depends on how you want to deal with it.
>GLib
Well as far as libraries go it seems ok. It's not using std::pair as the C++ std library does. How a standard library can be that sloppy is beyond me. So I approve of this library.

But a major problem with practically any library is how you introduce all these new types to deal with. It clutters your brain space. When you write things yourself you get exactly what you want and it's very easy to extend if you need to.
You're not gonna do something very fancy wish a hashmap usually but in the general case you may want to have a smaller piece of code to work with.

If you don't it's not rare to end up in a situation where you don't exactly feel the exact implementation is all that appropriate and you work around it, rather than changing the library you've been using. Simply because you can't be 100% sure of how it works before you start reading everything. Just looking at Glibs hashmap there's a fairly large amount of functions I'd probably straight up delete if I decided I need to change something.
>>
>>57827826
what is the project?
>>
>>57828058
Hello World! in brainfuck
>>
>>57828058

8080 emulator

also my 4th try on my 3rd language of OpenGL is working
>>
>>57827384
you know, according to this thread he probably is a much better programmer than you.
>>
>>57826875
can you put up the repo now I don't care what it looks like I just want to see how you're reading from 4chan. I'd rather try to reserve engineer than look it up.
>>
>>57827996
C "programmers" everyone.
>>
>>57827173
>women joins our small dev department of 10 people
>it's a tranny
>he even knows how to program
your already being judgmental of the person. maybe you should be reprimanded and made to attend a worker correction program to learn about diversity in teh workplace, trans inclusion, the transgression of sexual discrimination inteh work place.

anon you need ot acceptthis person.
>>
>>57828130
4chan "arguments" everyone.
>>
>>57828099
> implying he won't just kill himself
>>
File: 1480314185867.jpg (265KB, 1219x1307px) Image search: [Google]
1480314185867.jpg
265KB, 1219x1307px
>>57828131
so tolerant senpai making the internet proud
>>
File: c64gpaint.gif (10KB, 640x400px) Image search: [Google]
c64gpaint.gif
10KB, 640x400px
Can you handle GUI without OOP?
If so, how?
>>
what's better for shell oneliners? write as a script or as a function?
>>
>>57828318
IMGUI
>>
>>57828318
https://github.com/ocornut/imgui
Just as an example.
But there's tons and tons of ways.
>>
>>57828302
>put blue bucket on your head
>you are now a woman
2016
>>
>>57828318
>>57828329
>>57828337
Just to clarify, IMGUI is a general concept and not only that library.
>>
>>57828324
Depends on whether or not you can tolerate scripting in bash. If so, function. Otherwise you'd have a global script and extra dependencies that can be run anywhere, which can sometimes open up vulnerabilities depending on the type of script
>>
>>57828329
>>57828337
that's really nice. I was using sfml to make my guis but maybe I'll give that one a try.
>>
Why is Python so shit? Who the fuck thought this language was a good idea?
>>
>>57828532
https://www.youtube.com/watch?v=Z1qyvQsjK5Y
>>
Can someone redpill me on typescript

just tried it out, and it seemed saner than straight-up javascript in pretty much every way. Well-defined way to do classes, modules etc, stricter typing (although still not nearly as strict as I'd like it to be), seems to compile to very clean javascript code (basically just your original code with types stripped out) etc

why is it not more popular? only drawback I could find so far is that the compiler seems to be rather slow, but I think that's not the worst thing ever.
>>
>>57828532
It has some upsides and some downsides. Doing layouts like you normally see UI do (where it scales to different sizes and keep certain offset) is more of a chore.
To get something up on the screen and properly showing what you want to show is way easier.
>>
>>57827173
Excellent bait anon. You got like 10 (You)s. But for real though, where's your code. Cause it seems like you're calling people out with no proof of your own abilities.
>>
File: 1458726044956.jpg (66KB, 540x473px) Image search: [Google]
1458726044956.jpg
66KB, 540x473px
>>57828337
>>57828370
>mfw OO-paradigm is considered wasteful and resource heavy
>mfw IMGUI requires GPU to handle GUI effectively
Probably there's something I don't understand. How can OO-less system be more resource-heavy than OO-ful system?
>>
>>57828683
>requires GPU
Well any decent GUI library does.
Software rendering isn't the cool thing to do anymore anon.

Either way it's a very small part of the system and has incredibly little to do with the actual systems at play.
>>
I got a C++ class with template, let's say something like the following:

template <class T>
class Foo
{
public:
virtual T* doSomething() = 0;
};


I inherit this class like this:

class Bar: public Foo<Bar>
{
public:
virtual Bar* doSomething() = 0;
};


Now, if I want to have some function that accepts any child of Foo as an argument, how would I go about it? I can't for the life of me get something working.
>>
>>57828683
>>57828719
Oh and to be clear it's just this implementation.
Imgui is broader. You can do software rendering if you so choose.
>>
>>57828580
>Doing layouts like you normally see UI do (where it scales to different sizes and keep certain offset) is more of a chore.
People always say stuff like this but there are usually easy solutions.

>>57828683
Ah, well, IMGUI doesn't work all that well unless you have a main loop and are getting input and repainting constantly, particularly in the context of a game. It's pull-based rather than push-based.

There's also FRP but I doubt you're interested in that.
>>
>>57828683
Not doing OO makes state a little more explicit, which can help you to boil down the state of your GUI more concisely into the absolute minimal set of state you need.

Excessive class hierachies can also impact performance, e.g. through virtual functions which have some overhead.

The difference is not really that relevant for GUI systems, and whether something is heavy or not is hardly influenced by whether it's OO or not, or immediate-mode or not. All the big serious GUI frameworks are "retained-state", the "simple" UI toolkits for games and such are sometimes immediate-mode, but it's really more of a stylistic choice.

immediate-mode is sorta easy to get started with if you just quickly want to barf a few buttons on the screen, but it becomes a completely unusable mess for anything more complex than that.
>>
>>57828725
I sort of did this for work.
Do you want to add it to the abstract class or implementation?
What happens when you add the method declaration that you think?
>>
Going through the well typed interpreter example, Idris is quite cool
>>
>>57828755
Whereas RMGUI is always a completely unusable mess.
>>
>>57828747
>IMGUI doesn't work all that well unless you have a main loop and are getting input and repainting constantly
Well that happens in OO systems too really.
It's just that they either do it in a separate thread (which you can do with imgui too) or they do it from their own state in a gui.render() call.
>>
>>57828800
I suppose you can have it block on input, but you'll still end up repainting the whole thing every time.

Not that that should ever be particularly expensive.
>>
>>57828725
Bar in this example should be one of the classes implementing doSomething().

I want Bar and any other children of Foo to pass as Foo-arguments. I've tried just about anything I could think of and exhausted my google-fu to the max, but haven't gotten it working yet. Starting to think it might not even be possible in C++.
>>
>>57828798
kek, true I guess

well, it's somewhat managable. But while RM GUI systems have a higher "base-level messiness" I think they definitely scale better.

There are also some new paradigms that have recently come up like e.g. react or whatnot where state is injected at the root of a tree and then propagated downwards etc, which makes things a little more structured. Another paradigm is facebooks flyweight pattern (but I've never really looked much into it, so no idea)
>>
>>57828725
The function should accept a pointer to Foo, or something equivalent (i.e. a reference, smart pointer etc.).
>>
At what point can I say that I am experienced with Java on a CV?

I've never used jframe or anything, but I'm comfortable with the standard commands, and I've built games and things.
>>
>>57828838
In the end we need to figure out an optimal way to have a mix of both, I think. Retaining state tends to be better for the presentation side of things while being immediate tends to be better for the logic side of things.
>>
>>57828860
>I've built games and things.
Say you're experienced then. You shouldn't be punished for having high standards.
>>
>>57827522

glib
>>
>>57828725
template<class T>
void doOtherThing(&Foo<T>);

as a method?
>>
Whats the best / most user friendly IDE for C#?

Not VS, and unless codeblocks has significantly improved in the last 4 years, not that either.

Thanks in advance
>>
>>57828725
>>57828788 (me)
You shouldn't make the implementation methods virtual if you're going to define them.

I did both as an example:
template <class T>
class Foo
{
public:
virtual T* doSomething() = 0;
virtual void takeSomething(const T&) = 0;
};

class Bar : public Foo<Bar>
{
public:
Bar* doSomething();
void takeSomething(const Bar&);
};


Bar* Bar::doSomething()
{
printf("Hello from Bar");
return this;
}

void Bar::takeSomething(const Bar &)
{
printf("Taking something");
}
>>
>>57828901
VS Code?
>>
>>57828880
That yields me a

> cannot convert ‘param’ (type ‘Bar**’) to type ‘Foo<Bar>**’

Pointer to pointer because that's what I need.
>>
>>57828930
Because that's an invalid conversion.
Bar **bar;
Foo<Bar> **foo = bar; // pretend this is allowed
*foo = new Foo<Bar>(); // uh-oh! now *bar points to a Foo<Bar>
>>
>>57828910

If we take your code, I'd want a global function that takes any Foo child as a parameter. Something like

template<class T>
void doWhatever(Foo<T>* arg) {
//whatever
}


However, that and any variations on it have failed to compile so far.
>>
>>57828901
>Not VS
there is none
>>
>>57828901
Why do you exclude the only company with large interest in keeping C# around?
>>
>>57828988
that compiles for me on VS2015
>>
>>57828988
>>57829040
there's no error that I can see in that code
>>
>>57829012
>>57828992
Because microsoft are being cunts, and won't let me use VS until i sign in.
>I try and sign in and VS fucks up and gives me errors
>I google the error code and it says to download IE 8+
>I download their browser and have to restart computer
>error is gone, but still wont let me use VS
>I make a new account
>Try and sign in
>"you've been sending out spam emails, give us your phone number and we'll text you a verification code"
>It's literally a brand new account, wtf are they talking about
>I give them my number
>Currently waiting for them to text me
I want to kill myself
fuck microsoft
fuck bill gates
>>
>>57829055
probably you're on nsa list.
>>
>>57829055
>and won't let me use VS until i sign in.
IIRC you could skip that. But that was at least a year ago so who know
>microsoft are being cunts
As always
>fuck bill gates
He has nothing to do with this and is a nice guy.
>>
>>57829066
Probably, but why would that make MS fuck with me?

>>57829069
>>He has nothing to do with this and is a nice guy.
>Saving africans
>Nice guy
pick one and only one
>>
>>57829088
Saving Africa rather.
>>
>>57829040
>>57829047

Lmao, hold on. I must be fucking up somewhere majorly then.

Thanks for the help lads, I'll check what I'm doing wrong and I'll report back, or not if the shame is too great.
>>
>>57829040
>>57829047

Indeed, if the argument type is Foo<T>* it compiles no problem. However, when the argument type is Foo<T>** it fails.
>>
>>57829218
See >>57828964.
>>
>Tfw have 2 weeks to become proficient in scala
>Tfw can't even write fishbush in it
>>
>>57829218
That still compiles though.
Here's how I use it too:
    Bar b;
Foo<Bar> *b_ptr = &b;

doWhatever(&b_ptr);
>>
>>57829228
Well, shite.

Any cheap workarounds, or is this as far as C++ can take me?
>>
>>57829300
>>57829289
This works, if you can do it.
>>
Is there any limitations for Android apps developed in c# with xamarin?
>>
I'm trying to sending xml like data, but without the

<?xml version="1.0" encoding="UTF-8"?>

tag. Is this still valid XML? What header should I use?
>>
>>57829320
That seems to work, neat. I also discovered that changing the argument type to Foo<T> const* const* and casting my value to that also works, but your method seems shorter. Thanks!
>>
>>57829410
The xml declaration is there so a receiving application knows how to read.
If you don't have a header the application has to guess.
>is it still valid XML
Yes. But that doesn't mean everyone handles headerless XML.
>>
>>57829410
http://stackoverflow.com/questions/7007427/does-a-valid-xml-file-require-an-xml-declaration

>In XML 1.0, the XML Declaration is optional. See section 2.8 of the XML 1.0 Recommendation, where it says it "should" be used -- which means it is recommended, but not mandatory
>In XML 1.1, however, the declaration is mandatory. See section 2.8 of the XML 1.1 Recommendation, where it says "MUST" be used.

Did you just not not want to search google yourself?
>>
question regarding sockets maybe library specific (asyncore).

if i'm making multiple connections at once how can i test to make sure i'm connected to the maddresses?
>>
>>57829716
It'll just work
>>
>>57829744
top kek.

new = torrent('debian-8.6.0-amd64-CD-2.iso.torrent')
newbees = bees(new.torrent_tracker(), new.torrent_hash())
newbees.request()

start = Client(newbees.peers(), 6883)
asyncore.loop()


im not getting any erros and the loop is executing. i just need to make sure its not just connecting to the first peer but all the peers.
>>
>>57828538
python is very good, its for gettting work done
real system are implemented on mass scale, which means individually, one should strive for python
>>
In C, I have a server that can have loads of clients and each of those clients can have a pointer to another client

if one of the clients leaves and the server frees the resources of the client, lots of other clients now have pointers that are now pointing at unallocated memory

how would I go about preventing this?
should I do a smart-pointer type thing and have reference counts?
>>
>>57829953
use a real language like javascript to get work done
>>
How do I get a job in programming?

I have:
>Created Android games in Java
>Created my own version of machine learning in C#
>Created particle simulations in Python
>Created a music visualiser and games in Javascript
>Created websites in HTML, CSS, JS

I am self taught. Every job requires experience or a degree.
I only have a year of programming experience in my own time.

What do?
>>
>>57829953
>each of those clients can have a pointer to another client
That's a pretty strange thing to do.
>reference counts
Sure, that's one way to deal with it.
>>
>>57826834
>>57826771
You can avoid the cast by making sure the iterator type is Iterator<Penny>. Intellij would have done this for you automatically. If you are serious about using Java, you should look at using Intellij as your IDE.
>>
>>57829995
Learn programming in a real language like C and put your projects on Github.
>>
>>57828302
super not passable trans women make the community look bad. I'm trans myself, but I'm not going to fucking go out in public looking like that. I'd rather look like a man then look like that. I'd just an hero.
>>
>>57830141
>I'm trans myself
>>>/lgbt/
>>
>>57830147
I'm just going to laugh. I've never spoken of this on this board and probably won't again. I just felt like saying something this one time :^)
>>
>>57830141
Same reason stupid ugly cunts make feminism look bad.
>>
>>57830186
cheers to that mate
>>
what's the proper way to design a 2d maze game?
maze with player set
player with coordinates

or

maze with map of player and coordinates
>>
>>57830162
Yeah, you totally didn't bring it up for attention
>>
>>57830236
or player object with maze reference

this is for multiplayer, btw. so multiple entity will be on the same maze instance
>>
>>57830247
You're totally not saying this because you're a faggot
>>
>>57830316
Why are you even fucking bothering to try this bs?
This isn't your fucking support group.
>>
>>57830332
Why are you wasting your time being a dick with random strangers instead of doing something fulfilling and meaningful with your life?
>>
This thread just reminds me that you STEM shitlords truly are transgressive patriarchal scum.
>>
>>57830343
>being a dick with random strangers
You mean calling out one person (you)'s bullshit?
>>
>>57827173

Don't be nasty.
>>
>>57830343

You're on 4chan. Why are you complaining about people being a dick on the Internet?
>>
>>57827522
http://judy.sourceforge.net/

Judy arrays. Wicked efficient.
>>
>>57830386
Attention. Daddy issues.
>>
>>57830406

Impossibly complicated.
>>
>>57830564
Why haven't you learned Haskell?
>>
Is there a way to make luac produce platform-independent bytecode?
>>
>>57830584

I'm a turd.
>>
File: IMG_20161007_125343-01.jpg (664KB, 2448x2629px) Image search: [Google]
IMG_20161007_125343-01.jpg
664KB, 2448x2629px
>>57826513
>Comfy arm warmers edition!
finally a thread that makes me feel comfortable with my illness
>>
>>57830655
>thumb pubes
were those warmers knit from your own body hair?
just curious
>>
File: MrPajepe.jpg (112KB, 744x609px) Image search: [Google]
MrPajepe.jpg
112KB, 744x609px
>>57826543
>Pajeet101 Final project almost completed.

Someday i will become a real man and learn ruby
>>
>>57830693
>>thumb pubes

I have hair on all fingers. This is Siberia, anon, what do you expect from my body?
>>
>>57830727
>become a real man
>learn ruby
Pick one.

Ruby is a dead-end language. I suggest Python as an objectively better alternative.
>>
>>57830728
But how can you wear girl cloth if you don't shave yourself anon?
>>
>>57830727
Ruby is for women and trannies
>>
>>57830762
I'm not wearing them to look like a trap. I wasn't joking when I said "illness".
>>
>>57830749
>>57830783
Is python the best OOP?

I always think of ruskis for some reason when i thnk Python
>>
>>57830797
OOP is fine if you don't care about being inefficient.
>>
>>57830797
Python is bad
OOP is bad

But that doesn't mean Python is OOP.
>>
>>57830380
The tranny started it.
>>
>>57830797
>Is python the best OOP?
Probably.
It's the best you can get if you were considering Ruby.

And me liking Python doesn't have anything to do with me being russian.
>>
200th for fuck anime
>>
>What are you working on, /g/?

Trying to get my SIMD-accelerated deep maxout network to learn some logic gates. It's not working properly so I must have fucked something up in the training process.
>>
>>57828855
You could just overload the function to take foo and bar, and any further children of foo, as inputs. If the function is big, just extract the information you need in the overloaded function, then have every overloaded function call the same smaller function.
>>
I just realized that I don't really like programming, nor do I like solving math problems in my spare time. what do?
>>
>>57831518
feminize and sell yourself
>>
>>57831518
Get a job as a web developer :^)
>>
>>57831518
Learn to draw.
>>
>>57831518
Sport
>>
>>57831518
Sell your expensive computer and buy a gym membership. Congratulations on coming out of the normie closet by the way
>>
Does anybody know of god free written resources for starting programming in LUA? Please share any you know of.
>>
>>57831558
well, I'm learning to draw 3D CAD models, does that count?

>>57831602
but I already have a gym in my garage
>>
>>57830727
>listening to /g/ memes
java is the king of jobs
and even so, why the fuck would you want to learn hipster languages
>>
>>57831730
He's SPECIAL
>>
>>57831730
But anon, it's current year. Most jobs are boring and useless.
>>
>>57831730
I got memed on. I guess i'll stay the course.
>>
I think I'll try using xamarin to make a dickspin app that uses the accelerometer of the cellphone
>>
how come I can get away with
(funcall (lambda (x) (* x x)) 9)

instead of
(funcall #'(lambda (x) (* x x)) 9)
?
>>
>>57831999
Is the latter that lisp quote meme thing?
>>
File: 2016-12-04-034331_350x91_scrot.png (3KB, 350x91px) Image search: [Google]
2016-12-04-034331_350x91_scrot.png
3KB, 350x91px
>>57831999
seems both forms gibe funcs
>>
>>57832009
what are you asking?
>>
>>57826513
/g/ I'm really at a loss here

im supposed to write a program where the user refers to a text file, writes to the file, closes it, and reopens it and prints out what the user put in.

which I have done. HOWEVER I'm supposed to allow the user to enter "any amount of integers they want" which is an issue, since my program only writes the first integer.

How exactly do I allow the user to enter any amount of integers?

public static void main(String[] args) throws FileNotFoundException
{

BufferedReader reader = null;
String userString = "";
String inputFileName = "";


Scanner console = new Scanner(System.in);
System.out.print("Input file: ");
inputFileName = console.next();

Scanner in = new Scanner(new File(inputFileName));


Scanner numberin = new Scanner(System.in);

System.out.print("Input the numbers: ");
userString = numberin.next();

int integers = Integer.parseInt(userString);

PrintWriter writer = new PrintWriter(inputFileName);

writer.write(integers + "");


writer.flush();
writer.close();
in.close();
System.out.println("done");

try{
Path file = Paths.get(inputFileName);

reader = new BufferedReader(new FileReader(inputFileName));
String line;

while((line = reader.readLine()) != null) {
System.out.println(line);

}
}catch (IOException e) {
e.printStackTrace();
}
}
}


help would be greatly appreciated, I've been working on this for so long
>>
>>57832203
also please ignore the formatting, I can never make my code look good on /g/
>>
>>57832203
>userString = numberin.next();
>int integers = Integer.parseInt(userString);
You're only doing this once.
Just chuck that shit in a while loop.
>>57832215
>I can never make my code look good on /g/
Don't mix tabs and spaces or whatever you're doing.
If everything is indented consistently, it should appear fine on here.
>>
>>57832203
Loop
>>
>>57832260
>>57832255
okay so I put it in a while loop
 public static void main(String[] args) throws FileNotFoundException
{

BufferedReader reader = null;
String userString = "";
String inputFileName = "";


Scanner console = new Scanner(System.in);
{
System.out.print("Input file: ");
inputFileName = console.next();

Scanner in = new Scanner(new File(inputFileName));

while (true){
Scanner input = new Scanner(System.in);

System.out.print("Input the numbers: ");
userString = input.next();

int integers = Integer.parseInt(userString);

PrintWriter writer = new PrintWriter(inputFileName);

writer.write(integers + "");


writer.flush();
writer.close();
in.close();
System.out.println("done");

try{
Path file = Paths.get(inputFileName);

reader = new BufferedReader(new FileReader(inputFileName));
String line;

while((line = reader.readLine()) != null) {
System.out.println(line);

}
}catch (IOException e) {
e.printStackTrace();
}
}
}
}
}


The issue is that I think I need to input all the integers and once so that the text file is full of integers and then they are all output back.

I have no idea how to do that, I think I'll probably need to do an array but I don't know how that would look.

please help guis ;_;
>>
File: GnuPascal.svg.png (78KB, 742x599px) Image search: [Google]
GnuPascal.svg.png
78KB, 742x599px
Why do people hate Pascal? Modern languages are even more restrictive.
>>
>>57832449
They're all buthurt that Pascal uses := because they want the world to give in to trashy C bullshit
>>
>>57832472
:= looks like a creepy smile face.
>>
>>57832501
no it doesn't
did someone cut your mouth open?
>>
>>57832502
uh
I meant it looks like

..
||
>>
>>57832501
>>
>>57832531
what
>>
>>57832553
Look:
:=

then
..
||
>>
File: typajeet.png (47KB, 506x564px) Image search: [Google]
typajeet.png
47KB, 506x564px
With the power of pajeet i've made my first calculator. A gear rating calc for gw2.
>>
>>57832643
That's not what a face looks like
What the fuck is wrong with you?
>>
>>57832690
That's why I say it looks like a creepy face.
>>
>>57832715
NO
IT DOESN'T LOOK LIKE A FACE
WHAT IS WRONG WITH YOU?
>>
>>57832751
ANON STOP BULLYING ME THIS IS EXACTLY HOW I LOOK IRL I DID NOTHING WRONG
>>
>>57832779
show your pics
>>
>>57832799
his face apparently looks like := so I don't want to see it
>>
File: original.jpg (31KB, 300x299px) Image search: [Google]
original.jpg
31KB, 300x299px
>>57832751
>>
File: 1459191593971.png (683KB, 684x900px) Image search: [Google]
1459191593971.png
683KB, 684x900px
#include <iostream>
#include <memory>
#include <string>

// No more std:: ugliness
using namespace std;

// Program namespace, assuming program name was "program", name it whatever your program is named, or a shorthand version of it.
// Avoids namespace issues, you know, the sole reason everyone says to avoid "using namespace std;"
namespace program
{
// 99.9% of program code inside program namespace.

class Foo
{
private:
string blah;

public:
Foo(const string &blah)
{
this->blah = blah;
}
};

static void bar()
{
cout << "this is bar\n";
unique_ptr<Foo> f = make_unique<Foo>("Isn't this much nicer?");
}
}

// Of course main has to be outside of any namespace, but main is usually small and doesn't do much real work itself anyway.
// You could even jump into a second stage entry point inside your program namespace if you really must.
// It's not such a big deal.
int main()
{
program::bar();
}


Everyone says not to do
using namespace std;
, but all the problems that come with it (as far as I can tell, corrections welcome) are solved by just putting your whole program into a namespace, which you should be doing in the first place.

Tell me what is wrong with this code.
>>
>>57832883
>Tell me what is wrong with this code.
It's written in C++.
>>
>>57832893
Besides that.
>>
>>57832883
now tell me what happens when you call bind inside your namespace and have both std::bind and the bind function for sockets available ? Fcking retards who use using namespace std; should be killed
>>
>>57832883
>unique_ptr<Foo> f = make_unique<Foo>("Isn't this much nicer?");
Why do C++ fags hate so much raw pointers?
>>
>>57832903
Fuck, you're right.
God I hate C++ and it's stupid fucking decisions it makes. Why couldn't they just throw C compatibility out the fucking window.
The whole std namespace is fucking retarded, literally the only reason C++ needs it is to stay backward compatible with C.
FUCK C, C++ could've been so much better if it forgot about C.
>>
>>57832924
RAII
>>
>>57832883
>// No more std:: ugliness
>using namespace std;
you dumbfuck nigger
>>
>>57832926
Well I guess it would even be enough if they wrap all C functions in a namespace and name it something like Muh_Fcking_old_C_shit and then they could remove the std namespace. But hey, they need that 20 years backwards compatibility shit.
>>
>>57832926
C++ has no value in itself so it needs to steal C's credit to stay relevant.
>>
>>57832924
It's safer, more convenient, and also potentially more optimal (since internally it can be restrict and restrict itself is non-standard in C++).
>>
>>57832991
No. C++ has great potential. C++ is being dragged down by C. C++ could be so much more if C fucked off.
>>
>>57833025
It's called C#.
>>
>>57833034
>VM
Garbage.

The whole point of C++ is that it's efficient high level abstractions running on native platforms.
C# is out of the picture.
>>
>>57833034
>garbage collection
>bot NET
>reflection
loool
>>
File: C2NDIZj[1].png (110KB, 300x440px) Image search: [Google]
C2NDIZj[1].png
110KB, 300x440px
>those faggots hating on c#
>>
>>57833050
So, there's no other non-memous language to write native code with high-level abstractions?
>>
File: 1474221441087.png (67KB, 616x596px) Image search: [Google]
1474221441087.png
67KB, 616x596px
C# is trash
prove me wrong
>>
>>57833180
>frogposting
+100% to the irrelevance of the opinion
>>
File: Screenshot_3.png (5KB, 485x357px) Image search: [Google]
Screenshot_3.png
5KB, 485x357px
Snek/Spess invaders guy here.
Ran out of retro games, so I'm remaking Harvest moon in ncurses 'n C.
Got the framework out of the way, so it's decently smooth sailing from here.

Anyone got any idea how I should store map data? Currently leaning towards Lua/Scheme, since each tile has a lot of data, and writing all that out in xml/json seems like it'd be a pain in the arse. (Unless I make an editor...)
>>
File: 1474509697082.gif (494KB, 387x305px) Image search: [Google]
1474509697082.gif
494KB, 387x305px
>>57832203
>>57832346

I figured it out thanks to kek, and you guys pointing me in the right direction

I doubt anyone here is interested in seeing the final result, so thanks you guys
>>
File: 1474219799870.jpg (26KB, 499x499px) Image search: [Google]
1474219799870.jpg
26KB, 499x499px
>>57833194
>2017 - a few days
>not frog posting
just gtfo already
>>
What does this do?

        ; ================ B E G I N N I N G   O F   P R O C E D U R E ================


-[SSAppDelegate pleaseDontHackIndieSoftware_semicolonParen_wink_license]:
000000010000f802 push rbp ; Objective C Implementation defined at 0x10002ae08 (instance method), DATA XREF=0x10002ae08
000000010000f803 mov rbp, rsp
000000010000f806 pop rbp
000000010000f807 ret
; endp


; ================ B E G I N N I N G O F P R O C E D U R E ================


-[SSAppDelegate emailMeForAFreeLicense]:
000000010000f808 push rbp ; Objective C Implementation defined at 0x10002ae20 (instance method), DATA XREF=0x10002ae20
000000010000f809 mov rbp, rsp
000000010000f80c pop rbp
000000010000f80d ret
; endp
>>
>>57833226
that's not funny my brother died that way
>>
File: 1480401863069.jpg (102KB, 960x540px) Image search: [Google]
1480401863069.jpg
102KB, 960x540px
>>57833217
Anime is power, who's against - we'll down 'em.
Nya kawaii, nya kawaii, don't step up on our wai
>>
>>57833271
I've never said I'm against anime fag, I tolerate them
>>
>>57833271
delet this
>>
>reading emacs tutorial
>press M-a
How the fuck am I suppose to press that? Do emacs users dislocate their fingers to?
>>
>>57833718
That's Meta-a, aka the windows button on your keyboard.
Get a better tutorial.
>>
>>57833718
You can use ESC to replace M.
>>
>>57833718
>emacs
don't bother using that leftist shit
>>
>>57826513
are there any must do projects? also why does almost everyone make IRC bots? are the good for learning or just a fun project thinking of making one...
>>
>>57833771
it's easy, but stil a bigger project, it's the brainlets microprocessor emulator
>>
>>57833732
It's the official emacs tutorial.
>>57833736
That sounds more comfy. I'll try that.
>>57833768
I'm more of an alt-right, but my penis is slightly angled to the left. Am I still eligible to use emacs?
>>
>>57827826
I prefer managing to fix a bug without using google, satisfying as fuck
>>
>>57833822
>That sounds more comfy. I'll try that.
But don't keep it press. You just press it and release it.
>>
>>57833822
>alt-right
Too leftist. emacs is made for you so yeah, use it.
>>
>>57826545
>>57826543
>>57826537
> trying to troll noobs into trying to learn unlearnable and unusable c++ mess instead of compact, superior and productive java and c#

never change /g/
>>
>have to copypasta a gorrilian things individually in windoze

I really wish i was on linux right now with my middle click
>>
>>57833922
VM runtime dependent and .NET dependent high level shit
>>
>>57826771
>bluej
this is homework, isn't it?
>>
>>57833955
real life c++ depends on boost libs, which changes syntax all the fucking time LOL
>>
>>57833922
C++ is literally the best. Don't use it though I don't want your kind attempting to shit it up. You can stay with the .N*T and J*va plebs
>>
>>57833999
as opposed to what?
fake life c++?
>>
>"Thank you for applying to the dev team. Please answer these questions for us"
>"How long have you been married/in a relationship?"
>"A woman smoking in a public place is... "
>"Did you ever thoroughly check something you've bought?"
>"Don't you think our questions are rude?"
>"What words come to your mind when you listen to Sting's "Shape of my heart"?"
what the fuck
am i being rused?
>>
>>57834010
turn your post into all lower case and split it into words with C++. it'll take you what, two hours? I'll wait here, fagot.

>>57834018
as opposed to demo college shit
>>
>>57834021
Probably?
I'm not sure.
>>
@57834031
c++ is literally the best. don't use it though i don't want your kind attempting to shit it up. you can stay with the .n*t and j*va plebs
>>
>>57834043
nice C++ code.
>>
>>57834051
i did it.
now please refrain from talking to me. i don't want your kind shitting me up.
>>
>>57834021
They want to check if you're a normie. The place or probably riddled with SJW.
>>
>>57834063
>i did it.
you didn't do it in C++ otherwise you'd show the proof (code)

now GTFO you memeing fagot
>>
Did AoC day 4 parts 1 and 2. The code ended up being ugly as fuck.
>>
>>57834072
sorry i don't do opensource
now please refrain from talking to me. i don't want your kind shitting me up.
>>
>>57834096
Join us now and share the software;
You'll be free, hackers, you'll be free.
Join us now and share the software;
You'll be free, hackers, you'll be free.
Hoarders can get piles of money,
That is true, hackers, that is true.
But they cannot help their neighbors;
That's not good, hackers, that's not good.
When we have enough free software
At our call, hackers, at our call,
We'll kick out those dirty licenses
Ever more, hackers, ever more.
Join us now and share the software;
You'll be free, hackers, you'll be free.
Join us now and share the software;
You'll be free, hackers, you'll be free.
>>
>>57834096
>I can't even solve the most basic tasks with my messy meme "language"

QED
>>
>>57834112
just did
>messy meme "language"
uh...
but i dont use java or csharp
>>
What's the difference between the Java virtual machine thing and the .NET framework? I've never understood the concept of a framework
>>
>>57834127
>just did
doing means posting the code

what you did is you proved that C++ totally sucks
>>
>>57834145
not really though
i dont believe in opensourcing my code
in what way?
>>
>>57834127
btw, you realize that in java and c# what I asked you to do is two function calls which every noob knows?

standard C++ doesn't have the most basic necessary tools to complete everyday tasks
>>
>>57831999
LISP-2s are an abomination.
>>
That is weird, If I save my neural network to a file and then load it it produces totally different results
>>
>>57834166
It's sentient, you monster.
>>
>>57834166
uh oh
>>
>>57834166
it knows you're putting it to sleep and doesn't like it
>>
New thread when?
>>
>>57834200
>c++ got owned
>better start a new thread

never change /g/
>>
>>57834208
wut?
>>
>>57834200
Now.
>>
>>57834213

It's okay, you can stop pretending, we all know you're gay now.
>>
>>57834208
I just got here. I'm this guy:
>>57834163
>>57834200
>>
>>57834251
Also I forgot to add that C++ is also an abomination.
>>
>>57834166

MAN, WTF

It doesn't work in totally 1:1 environments and even doesn't work when I change the encoding???
>>
New thread:
>>57834252
>>57834252
>>57834252

>>57834200
You fags really shouldn't ask about new threads.
It usually causes multiple people to try and we get a bunch of duplicate threads.
And if you do it early, some douche will create a new thread before the bump limit.
>>
>>57829995
Check out Eli the computer guy, he got some nice videos on how to do well in CS related jobs.
Basically, apply anyway. You've got pretty much nothing to lose. Show them what you do, and hope for the best.
>>
>>57829995
keep improving your coding style and learning more

btw, requirements are often just guidelines, don't let that stop you from applying where you want (also don't be a sad fag if rejected, that's also normal, just keep applying )
>>
>>57833922
>Trying to say that OOP is any good, and that we shouldn't just stick to C.

never change, pajeet.
>>
>>57834376
>large codebase in C

no thanks, whitey
>>
Would this be a worthwhile feature for an IRC bot "/dpt" would make the bot post a link to the most recently made dpt thread - no idea if I could make it but would it be worth investing my time into trying?
>>
>>57834400
You could do that in less than 2 minutes. Your life must be very short if you need to worry about such short time frame.
>>
>>57834418
;_; it'd probably take me days if not weeks to do it I've never done anything that interacts with websites
>>
>>57834427
No need to directly parse the html or what-ever:
https://github.com/4chan/4chan-API
>>
File: 1472024041354.jpg (342KB, 978x1390px) Image search: [Google]
1472024041354.jpg
342KB, 978x1390px
>>57834284
>You fags really shouldn't ask about new threads.
Too late, bra.
>>
File: 1479326496287.jpg (36KB, 480x462px) Image search: [Google]
1479326496287.jpg
36KB, 480x462px
>no discord client for linux
what the fuck
>>
>>57829910
C# exists
>>
>>57828924
>VS Code
No, an IDE.
Thread posts: 328
Thread images: 41


[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.