[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: 324
Thread images: 28

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

Umaru-chan edition, the best of all editions.

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

code of conduct:
no racism
no insult
no sexual harassment
no gender discrimination

wat r u working on, anon-chan ?
>>
Go fuck yourself, you god damn monkey.
>>
File: 1453042025087.jpg (531KB, 929x3132px) Image search: [Google]
1453042025087.jpg
531KB, 929x3132px
>>52664670
>no racism
>no insult
>no sexual harassment
>no gender discrimination
>>
Planning on making a toy language where your code degrades after use and you have to write self-modifying code to repair it.
>>
>>52664670
Want sum fuck, transnigger?

How'd I do? I wanted to try and break all the rules in as few words as possible.
>>
>>52664670
>no racism
>no insult
>no sexual harassment
>no gender discrimination

Fuck you, faggot nigger bitch.
>>
>>52664719
You forgot sexual harassment.

>>52664705
Nice work.
>>
File: bfb.jpg (8KB, 199x225px) Image search: [Google]
bfb.jpg
8KB, 199x225px
>>52664705
>>52664719
>/dpt/
>>
>your reaction when someone use c99's bool type
>>
File: abstract feel.jpg (46KB, 680x684px) Image search: [Google]
abstract feel.jpg
46KB, 680x684px
Who /creativelybereft/ here?

Want to work on something, but have absolutely no idea what to do, the challenges roller is not doing it for me any more.
>>
>>52664765
>>your reaction
>>>/out/
>>
>>52664670
I fucking hate this orange chink hamster so much.
>>
>>52664765

It's perfectly fine to use.
>>
>>52664772
You're not /creativelybereft/, you're just /boringasfuck./
If you have literally no improvements to make in your life, the least you could do is pick up a book on algorithms and work your way through.

Here. An algorithms book that isn't for faggots.
http://www.amazon.com/Online-Computation-Competitive-Analysis-Borodin/dp/0521619467
>>
>>52664872
I think you'll find I am /creativelybereft/.

I learn working on things, but I can't think of anything to work on, I wanted to try and make a library, but I couldn't even think of anything worth doing.
>>
>>52664872
Another non-faggot book
http://www.amazon.com/Approximation-Algorithms-NP-Hard-Problems-Hochbaum/dp/0534949681/

>>52664889
It's obvious that you won't find anything new to do if you think that the answer is to "make a library."
Libraries are made to solve well known problems. You don't write libraries to solve a problem you don't know the answer to.
>>
>>52664911
Well I did want to write something that could dynamically generate containers for JSON data seeing as I'm doing that quite a lot, and it's a pain in the ass sometimes, but I just had no idea where I'd begin.

Really I just wanted to make a very simple library just to see how making one and then using it actually worked.
>>
>>52664941
Then do it you nig
>>
>>52664953
I'd rather shitpost on /dpt/ and make worthless programs that only take about 30 minutes to write.

What can you do.
>>
>>52664981
Judge you vocally.
>>
File: shrugs.jpg (81KB, 600x857px) Image search: [Google]
shrugs.jpg
81KB, 600x857px
>>52665007
>>
Reposting from other thread, not sure which is the actual /dpt/

Anyone know why on earth maths would work differently on two different machines?

It's on .NET 4.5.2, both machines have it installed.

3.55*9.5*1.4=47.215
but the result the other machine is getting is 80.47

Why in the fuck would this be happening?
>>
>>> class Rec():
def __init__(self, f):
self.f = f
def __call__(self, *args):
return self.f(self, *args)
>>> map(Rec(lambda this, x: x*this(x-1) if x else 1), xrange(10))
[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]
>>
>>52665516
operator error
>>
>>52665601
Care to go into detail?
>>
>>52665589
hideous
>>
>>52665678
I thought it was cute. I guess Python programmers don't like cute things (at least not like Lispers do).
>>
>>52665698
it's cute if not a little pretentious

the ruby people are more receptive to that kind of thing

or perl6 if you want to get maximum overcute
>>
>>52665730
Reminds me of http://qdb.us/57805.
>>
File: Linus-Torvalds.jpg (162KB, 800x400px) Image search: [Google]
Linus-Torvalds.jpg
162KB, 800x400px
>>52664805
forgot pic

>>52664865
it's shit and not even a true bool type.
>>
Guys breitbart found our memes http://www.breitbart.com/tech/2016/01/25/ruby-hackers-in-revolt-after-sjws-attempt-to-impose-politically-correct-code-of-conduct/
>>
File: zdgh9mdqvcx2t3afa0p7.jpg (9KB, 200x200px) Image search: [Google]
zdgh9mdqvcx2t3afa0p7.jpg
9KB, 200x200px
>tfw you want to learn to program but you don't own a mechanical keyboard
>>
>>52666034
>falling for the meme
>>
#!/usr/bin/env python3

import argparse, bs4, os, requests, urllib.parse

parser = argparse.ArgumentParser()
parser.add_argument("tag", help="Tag of danbooru gallery")
parser.add_argument("extra_tags", nargs="*", help="Optional other tags")
parser.add_argument("-d", help="Directory to download to")
args = parser.parse_args()

if args.d:
if not os.path.exists(args.d):
os.makedirs(args.d)
os.chdir(args.d)

base_url = "http://danbooru.donmai.us?tags=" + args.tag

if args.extra_tags:
for tag in args.extra_tags:
base_url = base_url + "+" + tag

html = requests.get(base_url).text
soup = bs4.BeautifulSoup(html, "html.parser")

list_of_pages = []

for x in soup.find_all("li"):
try:
x = int(x.string)
list_of_pages.append(x)
except:
pass

max_page = max(list_of_pages) + 1

for page_number in range(1, max_page):

url = base_url + "&page=" + str(page_number)
html = requests.get(url).text
soup = bs4.BeautifulSoup(html, "html.parser")

for image in soup.find_all("article", class_="post-preview"):

link = "http://danbooru.donmai.us" + image.get("data-file-url")
filename = image.get("data-md5") + "." + image.get("data-file-ext")

if not os.path.exists(filename):
raw_data = requests.get(link)
image = open(filename, "wb")
image.write(raw_data.content)
image.close()
>>
>>52666034
>tfw you spent money on a mechanical keyboard and cant afford cute girl clothes now
Being a good programmer is too expensive.
>>
>>52666034
>mechanical keyboard

As opposed to a solid state keyboard?
>>
Is this thread safe?

int x = 0;

for(int y = 0; y < 10; y++){
new Thread(){
void run(){
x++;
}
}.start();
}
>>
>>52666457
Forgot to add

Will I get concurrency issues with that?
I'm creating on object in the thread body, and adding the object to an object dictionary.

void run() {
CustomObject co = new CustomObject();
coList.add(co);
}


I'm worried about that.
>>
Halp

public class A { void Run(); }
public class A1: A { }
public class A2 : A { }

public List<A1> a1s;// set at runtime
public List<A2> a2s;// same

public List<List<A>> all;


I have a good amount of children so here I just want to store all of the lists in that all because I need to fire Run() in all of them at some point.
I've read about IList and IEnumerable but I'm not sure how to use them for that particular problem.
>>
>>52666479
All lists are enumerable

public List<IEnumerable<A>> ans = new List() { a1s, a2s };

public IEnumerable<A> all = ans.SelectMany(as => as);


Think of IEnumerable<T> as anything that can be iterated over, mapped, filtered, etc. This can be pretty much anything. So, we have that, for List<T>,

- All List<T>'s are IList<T>'s
- All IList<T>'s are ICollection<T>'s
- All ICollection<T>'s are IEnumerable<T>'s
Hence List<T> is an IEnumerable<T>.

Also, since IEnumerable<T>'s interface is immutable, it's safe to make the T covariant, i.e., if T1 <: T2, then IEnumerable<T1> <: IEnumerable<T2>. This is what allows you to treat both a1s and a2s directly as IEnumerable<T> without any copying.
>>
>>52666582
>This is what allows you to treat both a1s and a2s directly as IEnumerable<T> without any copying.
Should be

>This is what allows you to treat both a1s and a2s directly as IEnumerable<A> without any copying.
>>
I'm recreating an android app for ios and it's proving very difficult especially since I'm a beginner. One big thing is that I'm creating variants of the app for 20 or so different companies. This is easy in Android studio with build variants. I just have a different folder for resources and source files for each company and select that build variant when I create the apk. Does x code have an equivalent? I can't find any.
>>
>>52666457
> Is this thread safe?
Nope. Incrementing an int isn't guaranteed to be an atomic operation, so there's no guarantee that x will be 10 at the end of the loop.
>>
>>52666591
>>52666582
Great, thanks.
>>
I got a job in a web development firm, and i have to create a program in PHP that is an basically an interactive timetable for incoming projects and jobs and shows how much time each part of the project/job has left
I need to do this in a month/6 weeks

i do not know PhP
i only know HTML5, CSS, some javascript and some C#

how fucked am i
>>
Anyone know why this avx code is doing shuffle and perm instructions?
>>
>>52666765
php is awful but it has enough documentation to get going.

Ask over in /wdg/
>>
>>52666765
then write some C#
>>
>>52666765
just lookup some tutorials to get data to where you need it, and write the entire thing in javascript
>>
>>52666809
im not versed enough in C# to do that either, maybe im just underestimating myself but idk

>>52666805
if it has a lot of documentation then thats great, i should be able to Frankenstein something together
>>
>>52661394
This will be changing soon. Go, the systems language of the future, is rapidly overtaking C in the operating system market. I wouldn't be surprised if about ten years from now, every major operating system is written in Go instead of C.
>>
>>52666866
source or bullshit
i bet my left ass cheek that C++ is still waaaay more popular then Go when it comes to system programming
>>
File: 1445908125782.jpg (25KB, 468x468px) Image search: [Google]
1445908125782.jpg
25KB, 468x468px
/dpt/
Help me design my ListView class.
>Must allow for a very large number of items
>Items may be sized differently

The ListView will only instantiate and display a subset of the items at once because its not practical to create everything. But since the sizes of the items can differ (lets say the list is vertical and we are talking about the height of each individual element) I can't know the entire size of the list *or* the position of an item exactly.

The list needs to be scrollable and I should be able to jump to arbitrary positions by index (ie. "show me the 400th record in this list of 1000 things")

Any general thoughts?
(ctd 1/2)
>>
File: 1435410370377.png (6KB, 349x382px) Image search: [Google]
1435410370377.png
6KB, 349x382px
>>52666974
(ctd 2/2)
I can think of two general approaches:

One is to define the top item (index 0) at a position y=0. Then to jump to another item, I use the average height to figure out the new 'y' position. This will introduce errors and be messed up if you jump down to an index and then scroll back up to 0 -- there could be a huge gap or overlap that would look ugly when you see it and when the list items are moved to their correct positions to fix it.

The second is to only think in relative terms. If the view jumps to an index, that item will be at the top of the view and a surrounding buffer of items will be instantiated. As you scroll around, more items are instantiated and destroyed keeping within the view. But now the positions in the list view and the overall height will have no meaning. ie, in this case y=0 won't correspond to the top of the first item in the list. This feels 'wrong' somehow because other ListView implementations don't do anything similar.
>>
>>52666954
Both Meme++ and Go are completely inappropriate for systems programming.
>>
>>52667006
>completely inappropriate
elaborate fagtron
>>
>>52667137
C++: Far too complicated to. Unstable ABIs. Many features that are completely unacceptable in low-level code (e.g. exceptions).
Go: Garbage collected
>>
>>52667174
>Far too complicated
Use only what you need, if you make your C++ code complicated that's your fault. Its a multi-purpose language designed to be good at lots of different things.

>Unstable ABI
Isn't this being standardized?

>exceptions
So turn them off and use only libraries that don't throw anything. Also why are exceptions 'unacceptable' in low level code?
>>
>>52667174
>C++
Its being used to write the software for the JSF (F35). The language is flexible enough for use in a wide range of applications.

http://www.stroustrup.com/JSF-AV-rules.pdf
>>
>>52667174
>Far too complicated to.
baseless argument

>Unstable ABIs.
granted, but i think this is being worked on

>exceptions
most system programming is done in "embedded mode" anyways, meaning no exceptions, no templates, no multiple inheritance from the same base object etc
>>
>>52667195
If you're going to limit C++ features so much, you may as well just use C and make sure you don't fuck that up.
>Isn't this being standardized?
Not that I'm aware of.
>>
>>52667235
Sure, pick the best tool for the job, but saying C++ is "completely inappropriate for systems programming" is absolutely moronic
>>
What's with all the anti-GC feeling going around?

I don't understand why manual memory management is such a meme.
>>
>>52667273
Java is the premiere GC language and it has a history of being ugly and sluggish so people just assume GC is naturally shit.

And in a way they're right -- it takes control of managing memory away from the developer. Even today on platforms like Android or on the web, GC passes are noticeable and even though they are a minor inconvenience from a functional point of view they dilute the user experience by making things jankier than a manually controlled alternative.
>>
>>52667305
Eh, as a desktop C# programmer it's completely irrelevant, I'll ignore all the GC memeing then because it clearly doesn't concern me.
>>
>>52667305
GCs also require a lot of spare memory to be efficient. So you then take a GC'd language like Java, then stick it on a memory-constrained device like a smartphone, then voilĂ : you have a hunk of shit.
As much as I don't like complimenting Apple, they were very smart to use a non-GC'd language as their 'apps language'.
>>
>>52667366
>they were very smart to use a non-GC'd language as their 'apps language'.
It's not smart that should be the default and for using GC'd language you would need to have pretty good reason.
>>
>>52667404
Do you have something against commas or something?
I'm having trouble trying to understand what the hell you said.
>>
in DB design, what is the preferred option between:
having a single table and a string based "type identifier"
CREATE TABLE MessageTemplate (Type NVARCHAR(30) NOT NULL, etc..) 

or splitting the "type" into its own table even though its just a single field
CREATE TABLE MessageTemplate (TypeID INT FOREIGN KEY NOT NULL, etc...)
CREATE TABLE MessageType (TypeName NVARCHAR(30) NOT NULL)
>>
>>52667206
and since then the f35 had numerous software problems.
>>
>>52667366
>GCs also require a lot of spare memory to be efficient. So you then take a GC'd language like Java, then stick it on a memory-constrained device like a smartphone, then voilĂ : you have a hunk of shit.

>what is dalvik
>>
>>52667366
>GC is the reason java is memory inefficient
not even close senpai
>>
>>52667668
>>GC is the reason java is memory inefficient
I didn't say that. I just said that GC's need spare memory to be efficient.
I do remember hearing something about Java using 16 bytes to store a 32-bit integer or something.
>>
>>52667571
i think thats an issue with the software having over 8 million lines of code (read: complex design) rather than the language itself
>>
File: mindblowing.gif (2MB, 200x200px) Image search: [Google]
mindblowing.gif
2MB, 200x200px
>>52667702
Integer objects (with 32-bit range) take up 16 bytes

http://stackoverflow.com/questions/8419860/integer-vs-int-with-regard-to-memory
>>
>>52667702
You certainly implied it
>So you then take a GC'd language like Java, then stick it on a memory-constrained device like a smartphone, then voilĂ : you have a hunk of shit.
It isn't GC that makes using java in memory constrained environments a problem, it's the massive overhead on objects (occasionally upwards of 100-200%, I'm really not kidding), arrays and by extension, strings

That integer overhead is when you use the wrapper Integer rather than the primitive int IIRC, but I haven't written java in ages so I might be wrong

GC gets unfairly attacked a whole bunch. In practice I don't think the memory overhead of GC is going to be anywhere near as much of a problem as the pausing, which isn't even much of a problem in ~80% of the java that gets written. IMO the biggest problem of GC is that it abstracts stuff away that a programmer really ought to know
>>
>no ocaml choice in poll
PATHETIC
>>
>>52667921
Fuck off. Not even actual ocaml people like you
>>
>>52667925
>non-ocamlfags are so butthurt their language is shit, they get #triggered whenever it's mentioned
W e w
e
w
>>
>>52667942
Get a trip so that anyone can filter you without filtering ocaml
>>
>>52667953
Why don't you calm down and learn OCaml? This way you'll no longer have to fight your language of choice, you'll just be able to go straight to programming.
>>
http://strawpoll.me/6662000

I'm 80% sure it's just one guy at this point
>>
>>52666765

fullcalendar.js
>>
>>52667994
Why are you so butthurt about the best language in the world? I understand being tsuntsun but this is a bit extreme, don't you think? Turn down the denial a bit and learn it.
>>
File: 1453303126171.png (31KB, 233x279px) Image search: [Google]
1453303126171.png
31KB, 233x279px
/dpt/ constantly goes through 'meme' languages that get shilled here, that usually lasts a few weeks to maybe a couple of months.
Python, C++, Haskell, Java, D, OCaml etc.
I'm pretty sure there is just a brigade of shitposters (or possibly an individual) who constantly goes around parroting this shit, trying to make themselves seem like a majority, despite the fact that usually very few people use that meme language here.

Did anybody else notice this, or is it just me?
>>
>>52668064
i don't know if you noticed, but the whole board is full of shitposting and calling everything a meme. there are probably a bunch of people who think it's funny and keep doing it.
>>
>>52668031
Haskell is better than OCaml, though
>>52668064
>meme language
kill yourself
>>
>>52668064
D is actually pretty good senpai
>>
>>52668064
Yes, and the worst part is that they actually have a negative effect on that language IMO
>>
>>52668081
>slower
>forced indentation
>garbage-tier libraries
>default laziness
>shit GC
>garbage modules
>no classes
>no macro system (template haskell is garbage)
Typeclasses are neat, but OCaml is strictly better than haskell in any other way.
>>
>>52668064
You forgot
>nim
>F#
>>
>>52668083
And I basically never see anybody post D code here, besides maybe a couple of fizzbuzzes, leading me to believe that nobody actually uses it.

>>52668097
>they actually have a negative effect on that language
Yeah, I've pretty much decided to never use any of those languages at this point.
>>
>>52668128
>And I basically never see anybody post D code here
I wrote a whole interpreter in it the other day
I'm pretty sure I posted some snippets
>>
>>52668104
lel
>>
>>52668104
>slower
>forced indentation
>garbage-tier libraries
>shit GC
>no macro system (template haskell is garbage)
bullshit

>default lazyness
The strictness analyzer is pretty good, and using strict data fields (built-in, no extensions required) is already good enough

Also, ocaml has a shit type system in comparison, there are tradeoffs to make. In addition, the lack of control of effects is just as bad as writing Java with (somewhat) nicer syntax.

>garbage modules
What's so wrong with them? They're not perfect, but they do the job pretty well actually

>no classes
Why exactly do you need them for? I bet there's a more Haskell-y way to do it
>>
>>52668119
Right. I didn't mean for the list to be exhaustive.
Also, thinking about it, Go is another one.
>>
>>52668240
I don't recall Go ever being seriously memed here desu
>>
Question:
Say you want to store a collection of data, and each data point has a related integer, string, date, and an image.

How do you do this in your favorite language, /dpt/?
>>
>>52668064
Why do you consider something obscure like D, and something ubiquitous like Java, to both be 'memes'?

What is your definition of a 'meme language'?

Don't you think the work 'fad' would be more appropriate?

In any case, there has and always will be posts about Java/C/C++/C#/Python, because of their widespread use.
>>
>>52668257
>I don't recall Go ever being seriously memed
Have you been here like an hour max?
It's been shilled pretty fucking hard.
>>
>>52668295
Not him, but I haven't really seen Go shilled that much, maybe the odd poster comes in and advocates for it for like one post, but no one ever agrees.
>>
>>52668260
Depends.
Is there any sort of order to the elements?
If so, is it sorted by the integer, string, or date?
Does it need to be modifiable?
etc.

>>52668293
>Don't you think the work 'fad' would be more appropriate?
That is what I was originally going to say, but meme has pretty much become a synonym for fad at this point, so I went with that.
>because of their widespread use
I was only talking about use in these threads in particular.
>>
>>52668209
>the lack of control of effects is just as bad as writing Java with (somewhat) nicer syntax.
The lack of control of side-effects is so good that the only way to get non-shit arrays in haskell is to callback to C.
Strict data fields are useless because string on lazy results in lazy. Since most libraries use non-strict operations, you yourself can't do anything about strictness. It also interacts badly with types (you have to explicitly annotate the entire callstack).

>they do the job pretty well actually
They do the job as well as another language's module system. Compare with ocaml's modules, functors, and first-class modules. It's not even in the same league.

>Why exactly do you need them for?
Structural typing allows for much greater code reuse by relying on a partial interface. For example, one function might only need > to be defined, not < or =. You don't need to instantiate from the full tc in that case, you only need to provide this operator. It also is unrestricted, as it should be (i.e. no reliance on anything external).

>bullshit
It's true, all of it.
>>
>>52668149
It's the same retard everytime, don't bother replying. He claims he never sees anyone write in any language but his favorite language. I bet he's the faggot who keeps spamming "omg ther iz no coad in thred" when half the thread has code in it contrary to usual.
>>
>>52668260
D
import std.datetime;

struct data
{
int i;
string s;
Date d;
int imageid; // assuming it's on vram and you're using opengl or whatever, otherwise maybe a filename or something
}

data[] collection;

int main()
{
collection ~= data(1, "hello", Date(2016,12,25), 10);
// etc
return 0;
}

It's probably valid - I've never used std.datetime before though
>>
>>52668260
struct and binprot, sexplib, hdf5 or a db depending on usecase.
>>
>>52668329
>>52668293
Also, I forgot to mention that I said Python, because of the Python Spammer that was here 3 years ago or whenever it was. There has also been times when I've noticed an unusually high amount of posts about Java.
>>
>>52668380
python spammer was there less than a year ago too.
>>
>>52664670
literally a sliding potato with hair and arms and legs
>>
>>52668260
>>52668329
>Is there any sort of order to the elements?
order does not matter, you should be able to retrieve the data in any order, though.
>Does it need to be modifiable?
Yes, you should be able to change anything and everything.
>>
>>52668365
What does the semen operator do there?

Adds an object to the collection?
>>
>>52668353
I'll be out for a while, will reply in an hour
>>
File: 2016-01-28_07-55-54.webm (541KB, 662x352px) Image search: [Google]
2016-01-28_07-55-54.webm
541KB, 662x352px
>>52668260
>>
>>52668064
> Did anybody else notice this, or is it just me?
It's just you.

I mean, I can get why some people might consider Haskell, OCaml or D "meme" languages (insofar as you won't find entire shelves dedicated to them in the average bookshop; but none of those are exactly esoteric languages as that term is generally understood).

But for someone to actually consider Python, C++ or Java to be "meme" languages, they'd have to have an extremely severe case of "stop liking what I don't like" syndrome. And I mean "severe" even by 4chan standards.

> very few people use that meme language here.
Look, it's obvious that you're not actually deluded enough to believe that (if you were, you'd be medicated and not let anywhere near a computer), but even being deluded enough to think that anyone is going to buy your feigned "surprise" is pretty fucking bad.

So I'm assuming that your preferred "non-meme" language is either C (that's about the only language as popular as C++/Java/Python that isn't in your "meme" list) or C# (which is actually behind those three, but tends to be heavily overestimated by its users).
>>
>>52668390
Are the integers going to be unique? If they are, maybe some sort of efficient binary tree.
Are the strings going to be short? Are they going to be unique? Then maybe a hashmap using those.

You really need to know everything about the data to decide which is the best data structure to use. Types are not enough.
>>
>>52668416
yep
it does concatenation, so for a type T it can append T or an array of T to the end of another array of T

collection is a dynamic array - from my testing the reference implementation seems to take a default size of 8 elements and then it doubles the size and reallocates as necessary

I could also have written
collection ~= 
[ data(1, "hello", Date(2016,12,25), 10),
data(2, "foo", Date(2016,7,15), 9),
data(3, "bar", Date(2016,6,8), 8)
// etc
];

or done it without the append operator at all, because collection is empty at that point

[] are used instead of {} because it's allegedly easier to parse and makes compile times shorter
>>
>>52668460
Integers do not have to be unique.

Strings are up to 8000 characters, also do not have to be unique.
>>
File: tees catgirl.png (24KB, 645x666px) Image search: [Google]
tees catgirl.png
24KB, 645x666px
Why is it bad to use glm::translate.
>>
>>52668479
Stop imposing annoying requirements.
At that point, I would just use a relational database.
>>
>>52668445
you could have simply posted your code.
>>
>>52668479
>Strings are up to 8000 characters
jesus
>>
>>52668491
They have no choice. These guys don't tend to
see sharp
>>
>>52668501
wanted to show off the prop tab tab feature.

also works with 'ctor' for contsructors.
>>
>>52668451
Notice how I used words like "usually". I never said that nobody uses Python/Java/whatever. I was mainly referring to the influx of shitposters who tell everyone they SHOULD be using the current meme language and trying to make the userbase here look a lot larger that it actually is.
Just because something is normally popular, it doesn't stop it from becoming the meme language.
>>
>>52668510
Holy shit
>>
>>52668510
I don't get it.
>>
>>52668445
>using snippets

baleeted
>>
need help /g/ents. i'm looking to start programming. decided to start with python. also what other language should i consider learning to be a bit better rounded. the closest thing to programming i have experience with is html and a little java script. that was 10 years ago when i was messing around with that. i'm thinking of getting pic related to start. is it a good book for a total noob?

automate the boring with python
http://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994/ref=sr_1_3?ie=UTF8&qid=1453989107&sr=8-3&keywords=python+for+beginner

or should i get this book?
python programming for beginners
http://www.amazon.com/Python-Programming-Beginners-Introduction-Computer/dp/1501000861/ref=sr_1_7?ie=UTF8&qid=1453989107&sr=8-7&keywords=python+for+beginner
>>
>>52668353
no way in hell is haskell slower than ocaml
>>
>>52668599
What's wrong with snippets?

prop and ctor are built-in.
>>
>spend 3 days writing a newsgroup scraper in nodejs
>find out now that the "best" nntp library is missing multiple basic features
Well, back to fucking python
>>
Just done fixing five bugs on my goddamned VB app. It's like adding a few more lines and it's so exhausting.
I'm not cut out for this shit.
>>
>>52668677
>abloobloo ;_;
>>
>>52668686
>What's wrong with snippets?

Nothing, I'm just being a weenie.
>>
In C++, if a class has one pure virtual function it becomes abstract so it cannot be instantiated right? Does that mean I can just make the constructors public rather than protected and it still won't be possible to create it?
>>
>>52668807
yes
>>
>>52668747
Are you ban evading?

Pretty sure you got banned for posting lewd images.
>>
>>52668954
>Are you ban evading?

No?

>Pretty sure you got banned for posting lewd images.

Mods love black chicks.
>>
>>52669001
Well, I'm going to do that thing you're not allowed to announce just in case.
>>
>>52669017

For what reason? Nothing has happened. You are going to being wasting the janitor's precious time, and he already does it

FOR
FREE
>>
>>52669042
Honestly?

I don't like your taste in women.
>>
>>52668353
>The lack of control of side-effects is so good that the only way to get non-shit arrays in haskell is to callback to C.
In fact, that's why Haskell is sometimes called the best imperative languages. Encapsulating effects in first-class values makes everything composable and avoids most needs for macros. Parametricity also helps control what a function can do, and an example of this is the ST monad, which allows you to do arbitrary mutation as long as it's not observable from the outside.

>lazyness
Do you have an idea of the evaluation model? Do you know what WHNF means? All that matters for lazyness is data, and once you force a single top-level operation the entire thing becomes strict if the data itself is strict. I don't know what you mean by "interacts badly with types".

>It's not even in the same league.
I need an example of this. Can't the same thing be achieved with typeclasses and type families?

>Structural typing allows for much greater code reuse by relying on a partial interface
You do that with some granularity in type classes and letting the constraint solver figure out everything. You can also use lens' zoom/magnify to achieve this explicitly.
>>
>>52669053
>I don't like your taste in women.

Wow. Rude.
>>
>subreddit
REEEEEEEEEEE
>>
>>52669064
>haskell is called a good imperative language because it's so shit the only way to get imperative constructs is with bindings to other languages
10/10 logic, as expected of an hasklel fag.
>once you force a single top-level operation the entire thing becomes strict if the data itself is strict.
Wow, so you don't even know hasklel even though you defend it tooth and nail! Incredible but not unexpected. It's just like the cfags in these threads, they literally can't allocate arrays in a function without leaking memory yet proclaim themselves experts.
>I need an example of this.
https://realworldocaml.org/v1/en/html/functors.html
and the following chapter.
>Can't the same thing be achieved with typeclasses and type families?
You wish, hasklelfag.
>You do that with some granularity in type classes and letting the constraint solver figure out everything.
My sides!
>>
concurrency scrub here
im creating a sort of ServiceProvider for my application which will (obviously) be hosting services, each service running on their own thread
now, these services needs to be able to report errors to the serviceprovider which will then figure out what to do with them
is it safe to run the same non-static method on an object with multiple threads as long as the state of the object itself is not modified and any function parameters are guaranteed to not be shared among other threads?
>>
File: gnome say what again.jpg (80KB, 600x800px) Image search: [Google]
gnome say what again.jpg
80KB, 600x800px
>>52668064>>52668119
Yeah, they are such keks.
All people who have at least a piece of brain know that the only future languages are C#, Go, Javashit, Rust, Scala and Swift.
>>
>>52669122
>haskell is called a good imperative language because it's so shit the only way to get imperative constructs is with bindings to other languages
In other languages it's built into the compiler. In Haskell it's done through the FFI. Guess what's more flexible?

>Wow, so you don't even know hasklel even though you defend it tooth and nail!
Stop projecting. I'm not saying that by forcing foldl it becomes strict, what I'm saying is that if you want something to be fully evaluated all you need to do is evaluate the top-level function call if the data is strict

>https://realworldocaml.org/v1/en/html/functors.html
Took a glance, all of that can be done quite easily with typeclasses and newtypes. Tell me if I missed anything

>My sides!
Now it's clear that you don't know what you're talking about
>>
Various numeric types should be able have their appropriate operators still usable (+ - * / and so on) across them and even between them when it makes sense (adding an int to a float and so forth)
However what really shits in my boot is seeing these operators used for things that are conceptually different.
String and List concatenation should not be represented by the addition operator
List replication should not be represented by the multiplication operator
That's not just overloading the types, that's overloading the MEANING of the operator, and always leads to shit happening further down the road
t. someone who loves dynamic languages but hates the sloppy standard coding patterns that pollutes them
>>
>>52669184
C++ has seen some surprising uptake recently
>>
>>52668736
> It's like adding a few more lines and it's so exhausting

the amount of lines means nothing as far as productivity goes. A well written, optimized line is superior to adding 100+ lines of spaghetti.

quality > quantity
>>
>>52669288
There's no way you're not paid to spout this kind of bullshit. Nobody unpaid could be this defensive and deluded.
>>
>>52669342
You're retarded.
>>
>>52669526
You're a lazy bastard who has never put together anything of note, but next week you swear you'll finally get your focus on and really get started on your dream project!
>>
>>52669577
The amount of projection in that post is genuinely frightening.
>>
>>52669455
>perl "devs"
>>
>>52669611
One day I will do something good and everyone will congratulate me. They will say "you really did good with that project".
>>
Python, Ruby, C, D, F#, C#, C++, PHP, VB, Erlang... whatever language we choose, let's do our best!
>>
>>52669632
Good luck with that. Hope you're not already over 20 years of age. It's not too late for you yet, is it?
>>
>>52669670
>shit, shit, Cancer, Dogshit, shitty version of ocaml, CancerShit, Cancer++, pretty horrible pham, visual blunder, er "no multicore in 2016" lang "is good for parallelism" (aka the biggest meme language in the world - it's very slow too with the erlang VM)
>>
>>52669709
I'm 34 and lonely
>>
NEW THREAD
>>52664756
>>52664756
>>52664756
>>52664756
GET IN HERE FAGGOTS
>>
Im working on a program that reads data from an excel document and posts it in a winform but im too fucking autistic to do it
>>
>>52669802
Fuck is wrong with you?

We're only 160 posts in, retard.
>>
>>52669807
Using C#, I assume?

I can help with that if you give me an idea on what you're doing, and what the data looks like.
>>
>>52669670
ganbarimasu
>>
How is it possible to build a scaleable application that can snap to the side of the windows desktop? All i know how to do is create a window of a fixed resolution.
>>
>>52669807
I know how to do that in java
>>
>>52668064
>usually very few people use python, c++, or java
lel, k tard
>>
>>52666984
>>52666974
I don't know if you're still watching this thread, but here goes.

Windows listview controls have support for variable item heights, "virtual" lists that are generated on-the-fly when needed (so you can have almost any number of items), caching, groups and many other goodies. ReactOS and Wine both support these listviews, so they implement these things. Go read their source code, maybe you'll find useful hints and ideas that will help you.
>>
>>52669894
WPF would be your best bet.
>>
>>52669847
I am, .office.interop.excel too

Any advice?
>>
>>52670029
Can you give an example of how your excel document is formatted?

If it's a custom document with lots of formatting, you're in for a wild ride.

If it can be used as a simple CSV, you can utilize it like this:

DataTable csvDT = new DataTable();
csvDT.Columns.Add("FirstName");
csvDT.Columns.Add("LastName");
csvDT.Columns.Add("Email");
csvDT.Columns.Add("Site");
csvDT.Columns.Add("Title");
csvDT.Columns.Add("Phone");

string[] csvRows = System.IO.File.ReadAllLines(@"C:\temp\import.csv");
string[] fields = null;
foreach (string csvRow in csvRows) //read csv and import as datatable
{
fields = csvRow.Split(',');
DataRow row = csvDT.NewRow();
row.ItemArray = fields;
csvDT.Rows.Add(row);
}


And then you have a DataTable object you can use to bind to whatever control.

I'm not entirely sure what you're working with from Excel though.
>>
>report the /dpt/ that was made 150 posts early
>mods delete the image in OP and keep it up

>last time some faggot makes a /dpt/ 20 minutes late
>mods delete the first /dpt/ anyway

Thanks, hiroshima nagasaki!
>>
>>52669802
I gotta know, are you actually retarded?
>>
File: image.jpg (49KB, 640x616px) Image search: [Google]
image.jpg
49KB, 640x616px
>>52670093
I have to populate it with fields that are already in the spreadsheet
>>
File: 1361989726116.gif (698KB, 209x193px) Image search: [Google]
1361989726116.gif
698KB, 209x193px
Should I use "qux" or "quux"?
>>
>>52666181
Im pretty sure they have a rest ap. Dont fucking use beautiful soup
>>
>>52666457
Mfw some idiot on a project I had to maintain spawned a new thread per processed lidt element
Making it singlethreaded made it finish within 2 seconds instead of 2 minutes
>>
>>52670689
You should use cuck.
>>
>>52670575
You should be able to see how to do that with the code I posted.

Simply use first row as your column assigments, assuming it is used as a CSV.

You still haven't shown me how it's formatted; I'm willing to help but I have no clue what you're working with.
>>
Looking for some critique on my code. I'm just learning C and what I am trying to do is
1. Read a char from stdin
2. Append it to a dynamically allocated buffer
3. print the string stored in the buffer to stdout

Or is it better to have an array with a fixed length as a buffer? What I was trying to do is save memory (not that it really matters in this case, just for practice).

#include <stdio.h>
#include <stdlib.h>

int main ()
{
char *buffer;
unsigned int len = 0;

buffer = (char *) malloc(sizeof(char) * len);

printf("echo> ");

while (1) {
char c = getchar();
len++;

buffer = (char *) realloc(buffer, len * sizeof(char));

if (c == 10) {
buffer[len - 1] = (char) 0;
break;
} else {
buffer[len - 1] = c;
}
}

printf("%s\n", buffer);
free(buffer);
}
>>
>>52664889
>>52664872
>tfw you had tons of ideas before learning to program
>now you know how to program but you don't remember any of them

on that note, can I make desktop crossplatform applications with SDL?
I don't want to mess with bloated frameworks like Qt.
>>
>>52670994
The only bloat is your stomach.
>>
>>52670955
> if ( c == 10)
What ? magic number ?
>>
>>52671062
10 is Carriage Return. Should have probably #defined it.
>>
>>52671087
Shit, not Carriage Return, Linefeed.
>>
>>52669511
You're probably in need of professional help, friend
>>
>can code
>no ideas excluding [spoiler] games [/spoiler]
am i destined to become a codemonkey?
>>
What is the best way to learn PHP?
>>
File: empty.jpg (39KB, 500x442px) Image search: [Google]
empty.jpg
39KB, 500x442px
what other hobbies do you have besides programming?
i've been trying to learn violin for the past year or so but i feel so fucking stuck, like im not getting anywhere at all
>>
>>52671226
Good ideas are harder to come by than good programmers anon. Zuckerberg didn't get rich for being able to make Facebook, he did because he thought to make it (or stole, whatever).
>>
>>52671223
It only took you over 2 hours to come up with this! Surely you're a normal person of at least average intelligence!
>>
>>52665326
typical Cshart

CPUs use differently sized FP registers. in java you'd just use the strictfp keyword to get the same result across different computers.
>>
>>52671262
by writing php code instead of browsing 4chan
>>
>>52671298
>(or stole
Don't put the most important part in parentheses near a whatever you dumbshit. Name a single high-end success story that wasn't theft, underhanded tactics and subterfuges.
>>
>>52671226
making games doesn't make you a codemonkey
doing CRUD shit and shitty apps makes you a codemonkey
>>
>>52671342
Both make you a codemonkey.
>>
>>52671342
no i said that i have no ideas excluding games and games are the biggest waste of dev time ever
>>
>>52671324
The point was the idea is what mattered, not how he got it. I really don't care either way.
>>
>>52671374
>games are the biggest waste of dev time ever
epic meme

whatever brings in the dosh and/or adds cultural value
>>
>>52671374
what about [spoiler]conway's gayme of life [/spoiler]? that's fun to make
>>
>>52671404
you can make that in a couple hours
i mean ideas for a real project
>>
File: Screenshot_2016-01-28-13-06-50-1.jpg (524KB, 1080x1920px) Image search: [Google]
Screenshot_2016-01-28-13-06-50-1.jpg
524KB, 1080x1920px
>How you know Yahoo has gone to shit
>>
>>52671578
outside of game and game-ish things like physics engines you'll be stuck with boring shit like muh text editor, muh encrypted chat, muh twitter clone etc.
>>
>>52671668
>encrypted chat
>boring
>not doing crypto/ai/qcs sim/reverse eng/plang
>>
>>52671710
then make a tox clone and steal pleb amounts of donation money like an underage kid
>>
>>52671729
Whatever happened to Tox? Is it dead?
>>
>>52671226
Create software that pulls from 4chan API and organizes information in your own relational database.

Perform analyses on meaningful words and phrases, to try to find meaningful trends on various boards and threads over time. Do this for images as well.

Create a GUI, either hardclient or web that displays charts and graphs of this information.
>>
>>52671799
i don't know much about tox but i think they have like a few competing branches and their credibility has gone down the drain
>>
so I guess everyone is programming today huh
>>
Is there any noticeable difference between MariaDB and PostgreSQL?
>>
>>52672681
Yes. MariaDB is dogshit while postgresql is great.
>>
Writing some Node. It's not too bad, although a bit hard to follow when your files start ending with
                            }
});
});
}
});
});
}
};
>>
>>52672729
Y senpai?
>>
>>52672924
>there are people who think that's acceptable
>these same people don't like )))))
>>
>>52672961
well if you had something like the following js/clojure code
});});});]});]});

You would rather spread them to multiple lines.
>>
>>52672924
Easier to follow if you use superior Allman-Style indentation
>>
>>52672961
node is disgusting but so is )))))
>>
>>52673015
Weird way to spell "harder" and "inferior".
>>
Alright, so I created a window with SDL.
That was easy enough.
Now how do I draw things inside of it?
>>
>>52671667

Yahoo was ever good?
>>
>>52673050
Int's a furagr langhueage
>>
Working on a lightweight but windows-avaliable ssh chat program for my pleb friends and I to discuss our hate of nigs, trangenders, and jews safely
>>
How do I hide name in anon field?
>>
Quick retarded question.
In the second version of the "for" loop in Java.

Example:
for(Object x: y)
{
do some shit;
}


What is x and what y ? One is the name of an ArrayList(let's say) but wich one and what's the other one ?
>>
>>52673392
x is the object, y is the interable collection.
Think of it like "for x in y".
>>
What do you guys have against obscure languages?
They're a lot of fun in the free time, at least if you don't spend your freetime arguing over languages...
>>
>>52673450
So if I replace "do some shit by"

{
y.getName();
System.out.println("He's the "+x+"th person);
}

I'll get each person's name and their number of order in the ArrayList ? Or it's the other way around ?
>>
Why doesn't this draw a red rectangle inside my window context?

SDL_Surface *surface = SDL_CreateRGBSurface(0, global.w, global.h, 32, 0, 0, 0, 0);
SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 255, 0, 0));
>>
>>52673482
only selftaught retards who think it's cooler to be le code wizard who can do hello world in brainfuck than get things done would believe that
>>
>>52673498
It's more like

for(String name : names)
{
System.out.println("There is a student named " + name);
}
>>
>>52673482
Because obscure languages are either limited in use-cases or flawed.
>>
>>52673010
c is the only one that did closure brackets right

            }
}
}
}
>>
>>52673503
Shot your whole rendering code.
>>
>>52673498
What it basically does is grab an item from the collection, y (arraylist, set, map, etc), then set x to that object for that iteration of the loop.
It's equivalent to something like this:
Iterator it = y.interator()
while (it.hasNext())
{
x = it.next();
// do shit
}

Look up iterators if you haven't come across them, as that's what you're attempting to use.
>>
>>52673681
*show
>>
>>52673122
geocities

that's about it
>>
>>52673678
That's how
C
C++
java
C#
F#
and pretty much every other language does it
>>
>>52671667
>look mom i posted node.js is shit even though i have no idea what i'm talking about
>>
>>52673681
...rendering code?
what is that exactly?
SDL_Surface *surface = SDL_GetWindowSurface(window);
SDL_FillRect(surface, NULL, SDL_MapRGB(surface->format, 0x64, 0x64, 0x64));
SDL_UpdateWindowSurface(window);
>>
How do I recursively add an index to a multidimensional array?
Like, a function that takes an array and does

array[0]
array[0][0]
array[0][0][0]
array[0][0][0][0]
...
until break?
>>
File: workflow.png (34KB, 278x386px) Image search: [Google]
workflow.png
34KB, 278x386px
>>
>>52673708
C did it first
>>
>>52673750
So?
>>
>>52673482
Indians are scared of using something other than java.
>>
>>52673765
cuz
>>
>>52673739
Well that code should draw a rectangle. But you shouldn't use surfaces anyway, use accelerated rendering with SDL_Renderer and SDL_Texture.
>>
>>52667712
Guess what lets you have fewer lines of code and a less complicated design? Come on, I'll give you three guesses. ...No? Okay, I'll tell you: a better programming language!
>>
>>52673741
you can't. why would you want to do that anyway? you can take a simple one-dimensional array and treat it like any multidimensional array you want
>>
>>52673979
Alright, so to draw things on a window context you need to create a surface, and then use a renderer to draw on the surface?

...or how does it work?
>>
>>52667644
A hunk of shit which they replaced with an AOT compiler?
>>
Guys i'm a webdev or well came from an education in which I learned php, js, html, css but i'm of a back-end developer. Now i'm doing software engineering which starts in about 2 weeks with Java.
Don't blame me for Java, I didn't pick it, it's the school. Anyhow I want to get ahead of the curve, any ideas of what I can develop for fun or for good practice or perhaps something to follow like a book with assignments?
>>
>>52674078
irrelevant, ART or dalvik, it's still java and garbage collected.
>>
>>52668260
>>
>>52674033
No, you create a window and a renderer. The renderer is kind of like a surface you draw to, but it's hardware accelerated.

SDL_Window* window = SDL_CreateWindow(...);
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);


In your main loop, before you start drawing, clear the screen with
SDL_RenderClear(...)
. It clears the screen with the color you set with
SDL_SetRenderDrawColor(...)
. Every time you draw a primitive like a rectangle, you draw with the color you set previosly with that function. Now you can draw filled rectangle with
SDL_RenderFillRect(...)
. Once you've drawn all your primitives, present everything to the screen by swapping the window buffers with
SDL_RenderPresent(...)
.

Check out: https://wiki.libsdl.org/CategoryRender
>>
>>52673741
apologies for php

<?php
$arr = [];
$ref = &$arr;

for ($i=0; $i<=5; $i++) {
$ref[] = [];
$ref = &$ref[0];
}

print_r($arr);
?>
>>
java is a steaming pile of nigger shit, suitable only for fat white women. if there are any people who knowingly propagate the existence of java i will twist your balls while i finger your puckerhole then take a fat, bristol scale 6 on your chest and then cum on it.
>>
>>52664699
Sounds cool, why not make it a game?
>>
>>52673741
In what language? And also what the fuck are you trying to do?
>>
>>52667777
who the fuck uses Integer objects outside of normie enterprise applications or as a few auto-wrapped ints for when you need a HashMap that "just werks"
>>
File: 1453653438419.gif (147KB, 850x613px) Image search: [Google]
1453653438419.gif
147KB, 850x613px
Lads, anyone got any good ideas for a simple, yet fun zelda game?
>>
Anyone played tis-100 here?
>>
>>52674323
Who said it was a common problem?

Point is 300% bloat is a lot of fucking bloat, even by GC language standards.
>>
>>52674343
yes, it's shit
>>
>>52667305
Java's GC is shit because it was designed early on when there weren't a lot of work in GCs. Java has yet to switch to a good GC implementation, of which there are many, and the best of which being ocaml's.
>>
>>52674339
Not Zelda, but try making a maze game.
>>
>>52674352
if you use primitives, data structures and objects sensibly it's far from 300% bloat
>>
>>52674343
yeah limited opcodes, registers and node space make it less of a programming game though, and definitely more a puzzle game

>>52674371
What do you mean?
>>
>>52674399
>generate maze
>move from point A to point B
>???
>WINNER
>>
>>52674386
No, it's not far from 300%, it is exactly 300%.
Each and every time you use an Integer wrapper, it is 300% bloat.

I didn't say the entire language is fucked because of a feature that hardly anyone uses.

That said, I think people use Integers more than you think, especially to work around the lack of pass by reference.
>>
>>52674422
AFAIK an Integer doesn't do pass by reference. Something with auto boxing & shizzle. AtomicInteger does.
>>
File: snake fast.gif (36KB, 640x321px) Image search: [Google]
snake fast.gif
36KB, 640x321px
>>52674420
that doesn't sound challenging or rewarding at all
>>
>>52674422
16 bytes is for the desktop hotspot VM, not dalvik/ART, and part of it is due to alignment.

on a 32 bit machine it's 4 bytes for the int, 4 bytes for the reference and 8 bytes of padding

in C/C++ you'll also have 4 bytes for the int, 4 bytes for the pointer and possibly also 8 bytes of padding.

it's not strange for an Integer object to take up 16 bits especially not on desktop
>>
>>52674450
Generating mazes is jolly good fun though.
>>
>>52674447
I knew there was a reason I usually just make a single-element int array instead.

The syntax is kinda non-standard but accessing status[0] doesn't look that weird overall.
>>
>>52672662
>/dpt/
>programming
lmbo
>>
>>52674499
>The syntax is kinda non-standard but accessing status[0] doesn't look that weird overall.
I really don't like the idea of using an array to pass a primitive by reference. An AtomicXXX is much more obvious. The whole concept of not being able to pass primitives by reference is completely fucked up. At least Go supports pass by reference for primitives.
>>
>>52674369
wut ? hotspot has four garbage collectors and two of them are considered to be the start of art in their category.
>>
>>52674476
>and possibly also 8 bytes of padding
Right, but sometimes it will require less padding, or none at all.
Also, for whatever sized array it'll only need 0-8 padding bytes for the entire block.

Whereas an Integer array is going to have padding in each element.
>>
>>52666866
>http://qdb.us/57805

Was talking to a few people the other day who told me that Go is an easymode language that doesn't present many good solutions for scalability. Rust appears to be well respected though, but is said to be hard.
>>
>>52674154
No one any suggestions?
>>
Why can't we have a wee more makefile shilling?
>>
>>52674598
so just don't use Integers unless you need them for whatever reason (like for a vanilla HashMap)
>>
>>52674154
https://docs.oracle.com/javase/tutorial/
>>
>>52666181
>scraping a chinese cartoons website

Gonna be honest, I tried making an xvideos scraper for shits and giggles when I was learning to scrape with requests/beautifulsoup/

Must go back and finish it
>>
>>52674585
And that category is "high latency, low responsiveness".
>>
File: 1453153156513.png (378KB, 1450x1080px) Image search: [Google]
1453153156513.png
378KB, 1450x1080px
>>52674637
roll, faggot
>>
>>52674639
You're mom is PHONY.
>>
>>52674682
give
>>
>>52674642
You should be doing that anyways. If Java wasn't shit there wouldn't be any problem.
>>
>>52674583
I know it's not always obvious why it's an array, but if it's declared as single element it's kind of obvious what is going on. Also I prefer the syntax:
if(status[0] == x)

over
if(status.intValue() == x)
>>
>>52674679
if you trigger the GC at any remotely high frequency you're a terrible programmer and you should be thankful that the java program works at all. for a desktop application it could be okay to trigger the GC once in a while but not to the point where it affects the user experience.
>>
>>52674642
>X in Java is shit
>NO X IS FINE
>Here is proof why X is shit
>WELL YOU SHOULDN'T BE USING X ANYWAY

Every time.
>>
>>52674735
>X killed my family and raped my dog
ok buddy
>>
>>52674682
Ah, why not
>>
>>52674709
I wouldn't trust my normie coworkers with a single element array construction over an AtomicInteger. Like you said, passing an array to a method doesn't give the impression of pass by reference. Also, it crashes when some dumb shit decides to pass an empty array to the method. Trust me, they'll do that.
>>
>>52674682
>Finally finished all the ones I had an interest in, all that remains is shit I really couldn't care less about.

Oh well, time to go find a new source of things to do.
>>
>>52674728
OK pajeet.
>>
>>52674790
Well you know what the real solution is?

public class ObjectWithStatus {
public int returnStatus;
public Object returnObject;

public class ObjectWithStatus(Object returnObject) {
this.returnObject = returnObject;
}
}


Just use this friendly™ helper class to pass all of your return types with status :^)
>>
>>52674945
>not using a factory
>>
>>52674945
>I went full inception OOP

It should be:

public class ObjectWithStatus {
public int returnStatus;
public Object returnObject;

public ObjectWithStatus(Object returnObject) {
this.returnObject = returnObject;
}
}
>>
>>52674945
Fucking Java.
>>
>>52674632
It's not easy, it's simple, and simple doesn't mean bad. Use language as tools...
And as a tool, go is great.(web servers for example)
>>
>>52674989
t. programming101 Ctard babby
>>
>>52675005
>muh C boogeyman
>>
NEW THREAD >>52664756
>>
>>52675005
>programming101 Ctard babby
Nice try, Pajeet :^)
>>
>>52675005
That shitty java snippet was just written by a "Ctard" and now you're defending it.

T O P K E K
O
P
K
E
K
>>
>>52675045
>Ctard has no reading comprehension
i was attacking the "fucking java" comment, not defending your epic meme code
>>
>>52674677
Well yes of course i'll check there however I mean an idea, something i'm supposed to build, I see the standard documentation of each language as some sort of manual not a challenge or task.
>>
>>52675077
fizzbuzz
>>
>>52675068
You were attacking the comment either because you thought it was actually a good example, or because you just like shitposting.

It you agree it was a bad example, then "fucking java" is the perfect response. Maybe you're just confused.
>>
>>52675111
"fucking java" implies that he took the example seriously and not as a joke
>>
>>52675141
The only person who would take that code seriously is Prajeet.

You seem to be 100% certain that it is the other person who has been baited and not you :^)
>>
>>52668064
Let me guess: C is the only non-meme language.
>>
>>52669410
I'm pretty sure that's just me posting in a few recent threads multiple times.
>>
>>52674154
https://sites.google.com/site/steveyegge2/five-essential-phone-screen-questions
Read through that. It's ostensibly about phone screens, but has example questions and lists of things you should learn.
Also take a look at the rest of Steve Yegge's blog. It's probably going to teach you more about programming than your "software engineering" course, and it's not even a particularly good blog.
>>
>>52675093
I didn't know what fizzbuzz was until now and i've no idea how to apply this to learning a language, please do elaborate if not memeing.
>>52675273
Thanks, i'll look into it right away.
>>
>>52675316
>>52675093
Forget what I said, I figured out what you mean and it looks good, i'm going to try it.
>>
>>52674339

Mate, it ain't a Zelda game if you don't have Batman-tier weaponry selection.

That said... when I was younger, I used to have this idea for a Zelda-like game about a boy who sets out on a quest to quite literally transform himself into an archangel, going through dungeons using a selection of celestial-themed magical powers. One of the ways the game was supposed to stand out was that the combat system would have a decent aerial focus. The initial concept came from an idea of "what if Link had wings?"

Of course, I have no skills in art or story design, and 3d graphics programming is... not exactly one of my strong points, so I likely won't be able to get this idea to come to fruition.

No idea what you can do for a Zelda-like game on Chip-8 specs though.
>>
>>52664670
/sci/ here, we need your expert code monkey knowledge.

>>>/sci/7817700
>>
>>52666422
no, I think he meant keyboards with rubber dome or butterfly switches.
>>
>>52674682
Roll
Thread posts: 324
Thread images: 28


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