[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: 333
Thread images: 34

File: ritsuko3.jpg (18KB, 500x335px) Image search: [Google]
ritsuko3.jpg
18KB, 500x335px
What are you working on, /g/?

Old thread: >>57941094
>>
>>57948378
Just comfy Sunday working. Hasklel.

Spent 2-3 hours trying to find a bug yesterday, found it in 15 minutes with fresh eyes today…

My import list is ever-increasing…
>>
I've started learning Go again for shits and giggles--no future project in mind for the knowledge. Maybe a toy web server?
>>
>>57948378
I was learning scala, expecting to replace python, but stumbled in it's crappy tensor libraries.
Now I'm thinking of picking clojure just to have a language to use in the jvm, while not expecting to do numerical simulations with it.
>>
>>57948378
Rate my python code for fetching text from websites, /dpt/

from bs4 import BeautifulSoup
import urllib2

data = open('Input', 'w')

def fetcher():
text = []
for request in range(0, 3):
request = raw_input('What is the URL you wish to use?\n')
if request.startswith('http://') == True or request.startswith('https://') == True:
continue
else:
request = 'http://' + request
for site in range(0,3):
site = urllib2.urlopen(request)
article = BeautifulSoup(site, 'html.parser')
for x in article.find_all('p'):
text.append(x.get_text())
fetched = (u''.join(text).encode('utf-8').strip())
return fetched

data.write(fetcher())
data.close()
>>
>>57948506
>python
That is where your mistake.
>>
>>57948512
show how you do it with you favorite language then faggot
>but muh lambda calculus
useless also in maths
>>
>>57948512
bikeshedders, everybody!
>>
>>57948538
>dpt
>knowing how to program
I bet you even ask about technology on /g/, lol.
>>
>>57948506
>
if … == True

stopped reading there desu
>>
File: 1477860369972.gif (1MB, 500x300px) Image search: [Google]
1477860369972.gif
1MB, 500x300px
Programming makes me want to kill myself
>>
>>57947240
>>57947206
thanks, figured it out
>>
File: rarest.png (590KB, 4960x5464px) Image search: [Google]
rarest.png
590KB, 4960x5464px
I'm that guy from last night making rare pepes with traveling salesman art and stippling.

This is the final outcome after changing a few pieces of code so it'll be quicker.
>>
File: common pepe.png (361KB, 620x683px) Image search: [Google]
common pepe.png
361KB, 620x683px
>>57948852
The input image
>>
File: 1472098817896.png (28KB, 620x683px) Image search: [Google]
1472098817896.png
28KB, 620x683px
>>57948852
>>57948862
The stippled images
>>
>>57948852
The corners where it crosses over its own path trigger me
>>
>>57948968
Did you just assume its lack of gender?
>>
>>57948501
mind you tell what is clojure good for?
>>
>>57948506
>urllib2
>not requests
>>
>>57948378
An OCR document processing application, both web frontend and the backend because it turns out our client's "programming company" doesn't know how to program for shit.

Web developer comes to the rescue of incompetent C# "developers". Again.
>>
>>57949255
>webdev
>>57924927
>>
>>57948506
>python

>>>/trash/

This is a programming general, not a "coding" general.

>>57949266
I'm also doing systems programming on the backend, since systems "programmers" don't seem to be able to do the job properly. Fucking embarrassing, isn't it?

Keep crying, faggot.
>>
File: 1480984539520.webm (1MB, 480x360px) Image search: [Google]
1480984539520.webm
1MB, 480x360px
How would I check for an if statement between Python and SQL, basically if Table has Object then X happens in Python. I feel like this should be very obvious
>>
>>57949291
res = db.query(Object.id).filter(Object.prop == prop).first()
if res:
print('yes')
>>
>>57949276
This reply is so much more entertaining than I'd hoped for.
>>
>>57948378
Coding an algorithm to efficiently compute the least number so its factorial ends with a given number of zeros.
>>
Why the fuck is there still no standard or at least GNU extension way to simply fucking embed arbitrary files into a C or C++ program?
I don't mean externally by the linker, but by the language itself.
>>
>>57948506
Use nodejs, it's way comfier for web scraping.
>>
>>57949365
Convert the file to a char array and include that?
>>
>>57949383
No, that's a stupid fucking way.
>>
>>57949392
Ok.
>>
File: 32.jpg (212KB, 1083x720px) Image search: [Google]
32.jpg
212KB, 1083x720px
'let' was an unnecessary addition to JavaScript, function scoping is all you need.

'let' just feels weird.
>>
>>57949423
>let it, be;
>>
File: pepe.png (85KB, 664x771px) Image search: [Google]
pepe.png
85KB, 664x771px
Here's the effect with no region division. Not sure how I want to implement that.
>>
Why is my audio coming out way too high pitched (64 hz is a loud noise, 64hz samples online are too low for my speakers/ears. 2kHz is a shrill, brain melting tone, 2kHz samples online are a highish beep)?

    fn callback(&mut self, out: &mut [f32]) {
let mut data = self.data.lock().unwrap();

let phase_inc = data.frequency / self.sample_frequency as f32;

for x in out.iter_mut() {
*x = match data.phase {
0.0...0.5 => data.volume,
_ => -data.volume
};
data.phase = (data.phase + phase_inc) % 1.0;
}
}
>>
>>57949542
No, 2KHz is indeed shril, brain melting tone.
>>
>>57949598
>https://www.youtube.com/watch?v=3bCT3YxZfAY
Yeah, that's really shrill and brain melting.
>>
File: really makes you think.png (76KB, 665x773px) Image search: [Google]
really makes you think.png
76KB, 665x773px
Oh, I am thinking now.
>>
>>57948709
ok, another question.
My program creates a thread, which loops infinitely. When I end my program with SIGINT, I want to close the thread so that memery addreses it used can be freed, but AFAIK i can't join that thread, because it will never return. Is there any way to do this?
>>
look, sorry to be this guy, but asking completely genuinely- whats the best way to get into programming and coding, and what the most viable languages to learn, or strive to learn? any help or pushed in the right direction to start are greatly appreciated
>>
What the fuck am I doing wrong? I have more than 1 row in my SQL table. I am trying to do some shit inside the loop but it does not work and program ends immediately.

db = sqlite3.connect('database.db')
c = db.cursor()
count=c.execute("SELECT COUNT(*) FROM mytable")
db.commit()
k = c.fetchone()[0]
print(k) #just to make sure that k is bigger than 1 and yes it is
while k <= 1:
c.execute("SELECT * FROM mytable ORDER BY number DESC LIMIT 1")
stuff = c.fetchall()
print(stuff)
>>
Writing a tiling window manager for Wayland
What do you guys think that most tiling window managers miss?
>>
>>57949661
>I am trying to do some shit inside the loop but it does not work
>just to make sure that k is bigger than 1 and yes it is
>while k <= 1
Am I reading this right?
>>
File: 1445871671137.jpg (62KB, 530x800px) Image search: [Google]
1445871671137.jpg
62KB, 530x800px
>>57949712
Holy shit I need some sleep please end my life
>>
>>57949741
We all do that man, it's alright, we still love you :p
>>
>>57949649
Install Fedora and start learning Python.
>>
Is there a better way to do error handling and resource cleanup in C than using gotos?
>>
File: wojak.png (367KB, 5064x6064px) Image search: [Google]
wojak.png
367KB, 5064x6064px
>>57948852
I can't forget about wojak, can I?
>>
>>57949875
Yeah, it's called switching to a better programming language.
>>
File: 1467382039313.gif (13KB, 633x758px) Image search: [Google]
1467382039313.gif
13KB, 633x758px
>>57949883
input image
>>
File: acdca-archive-logo-small-med.png (25KB, 225x225px) Image search: [Google]
acdca-archive-logo-small-med.png
25KB, 225x225px
>>57948378
working on my decentralized TV system, and I have a networking question.

The TV system relies on TCP connections to work, and I want to see how far I can push consumer hardware (router) before it starts dropping TCP connections.

I want to solve this by simply making a function that opens TCP sockets to itself through the 192.168.XXX.XXX IP address and test to see if connections dropped after a new one is created.

My question is this: will this TCP connection make it to the router's table, or is my OS (Linux) smart enough to realize that the traffic will never leave the computer, and just add this connection to a local connection table?
>>
File: 1459689361709.png (17KB, 633x758px) Image search: [Google]
1459689361709.png
17KB, 633x758px
>>57949883
>>57949892
Stippled image
>>
>>57949904
And if the router does see that connection, is that defined behavior on all platforms?
>>57949875
Upgrade to C++ and use try-catch blocks.
>>
Which C utility library with basic data structures and algorithms to use: tbox, qlibc, apr ...?
>>
>>57949907

How long does it take to generate these?
>>
>>57949907
>>57949892
>>57949883
>>57949634
>>57949534

so, did you wrote any code to do this or just used pre-existent code and run a few generations?
>>
>>57950160

My code is totally unique, I'm just trying to see if I can sort-of replicate the effect. The other guy is using the code that comes with the TSP art generator.
>>
File: running.png (11KB, 865x135px) Image search: [Google]
running.png
11KB, 865x135px
>>57950135
it takes a while, if I'm being honest.

Let me have it run through it once, without creating the travelling salesman solution, and I'll post when it's done

>>57950160
I used http://jackxmorris.com/posts/traveling-salesman-art

Only changed two files because it was taking too long to actually process.
>>
File: wojak.png (18KB, 671x865px) Image search: [Google]
wojak.png
18KB, 671x865px
Hmm, I am becoming stronger.
>>
>>57950177
you wrote it in C#?
>>
>>57950183
>it was taking too long to actually process.
That's the travelling salesman for you. Takes longer to plan the route than actually make the trip.
>>
>>57950198

Yes, and I wrote it by looking at the vague explanation, rather than the real algorithm which is why mine is [spoiler]wrong[/spoiler].
>>
>>57950183
write it in a better language
>>
>>57950210
how did you convert a normal image to an image with dots?
>>
>>57950245

I'm still trying to figure it out, fambly. Give me a bit.
>>
>want to declare variable of my object in main
>non-static variable this cannot be referenced from a static context

who thought of this gay shit
fucking shit gay ass java
>>
File: df.jpg (99KB, 1024x768px) Image search: [Google]
df.jpg
99KB, 1024x768px
>>57948378

What kind of naming conventions do you guys use in C?

I'm in a dilemma.
>>
>>57950209
Oh no, I meant the actual stippling takes too much time. I shortened it by raising the limit when it stops
>>
>>57950263
As much as java is an awful language, that makes perfect sense
>>
>>57950297
yeah and why
what's the solution to this
how do I create my fucking object in my main
>>
>>57950261
dont you just group pixels up?
>>
>>57950312
learn what static means and then don't
>>
>>57950330
read >>57950183
for a brief overview of the algorithm
>>
>>57949276
>I'm also doing systems programming on the backend
t. pajeet
>>
>>57950330

It's a bit more complicated than that.
>>
>>57950291
As long as you don't use camelcase and don't have significant case, you'll be fine.
>>
>>57950349
i don't get it anon

you already made it, but when i asked you how you did it, you didn't know?

like, what?
>>
>>57950334
ok I just solved it
that's utter bullshit and I don't see the point at all
why in the fuck am I not allowed to acces non-static shit in my static main
why in the fuck would I need to call some shitty method to initialize or change my variables everytime instead of doing it directly in the main
this sucks balls
>>
File: 1480711057957 (1).gif (2MB, 179x320px) Image search: [Google]
1480711057957 (1).gif
2MB, 179x320px
>>57950409
>java
>>
>>57950409
>why in the fuck am I not allowed to acces non-static shit in my static main
Because it's fucking static? Learn what that means you dipshit.
>>
>>57950369
>you already made it, but when i asked you how you did it, you didn't know?

Because mine isn't correct yet, so asking me how I did it is a little premature.
>>
>>57950409
>I have literally no concept of how OOP works but let me tell you what the designers of Java did wrong
>>
>>57950409
dumbass
>>
>>57950409
>why in the fuck am I not allowed to acces non-static shit in my static main
How is a static function supposed to know which instantiated object you are referring to?
>>
To anyone who's seriously considering Rust, look at SaferCPlusPlus instead. It fits into the current ecosystem without reinventing the wheel, so you keep your existing skills and get to use your favorite text editor and everything. It also isn't pushing a toxic leftist narrative deliberately calibrated to undermine western civilization, but that's just a nice bonus, really.

https://github.com/duneroadrunner/SaferCPlusPlus
>>
>>57950263
This should be pretty fucking obvious you retard nigger.
>>
>>57950642
>It also isn't pushing...
Chuckled, would read again.
>>
>>57950662
>hurr java is better
at least not pajeet like you seem to be
>>
>>57950135
sttiiiiiiiiiillllll generating
>>
>>57949904
It'll make it to the router and back.
>>
>>57950642
sepples fags reimplementing their language again.
>>
>>57950716
have you heard about threading?
>>
>>57950733
It's not my code
>>
>>57949392
You mean something like:

void main() {
char* somefile = #fileinclude(~/pepes/pepe.asciiart.txt);
printf(somefile);
}


Why would that ever be better than just including the file with the program?
>>
File: java_is_shit.png (169KB, 1431x839px) Image search: [Google]
java_is_shit.png
169KB, 1431x839px
>/dpt/ will still argue that java isn't shit
>>
>>57950723
at least they're doing something useful with their life, unlike you
>>
>>57950723
It's a library instead of a new language. Like Rust should have been in the first place.

We don't need more half-baked languages when we've got C++.
>>
>>57950747
>we don't need C++ when we have C
>we don't need C when we have assembly
>>
>>57950769
>we don't need assembly when we have machine code
>>
>>57950427
If that shit worked in another language, that other language did it wrong.
>>
>>57950743
No I won't, but I'll argue that you're a retard.
>>
>>57950769
C++ is a half-baked language.
That's the joke.
>>
File: 1477232001535.jpg (433KB, 1080x1080px) Image search: [Google]
1477232001535.jpg
433KB, 1080x1080px
>>57950710
I'm a C++ programmer you fucking faggot, it should be fucking obvious in ANY language why you can't access instance members without a fucking reference to the instance, in other words, accessing non static data from a static context. It's literally not possible to do so.
Learn to fucking program you dip shit before you start bashing any language.
Kill yourself nigger.
>>
>>57950786
t. mad pajeet
>>
>>57950821
>I'm a C++ programmer
>>
>>57950821
>I don't know what a pointer is for
>>
File: 1476733924880.jpg (45KB, 736x492px) Image search: [Google]
1476733924880.jpg
45KB, 736x492px
>>57950782
Yeah, I realised later that I hadn't actually read what problem he was having.

This was my face upon that realisation.
>>
File: wojak2.png (39KB, 673x865px) Image search: [Google]
wojak2.png
39KB, 673x865px
>>57950716

This is what my current algorithm gets in 106 seconds.
>>
>>57950859
I mean reference in a general sense, which could mean either a C++ reference or a pointer.
I don't even know what you're on about anyway, yeah if you don't have a pointer or reference to the instance you can't fucking access your instance data.
That's the whole fucking point of this shit. The retard nigger bashing Java for the wrong reasons doesn't even fucking know what an instance is.
>>
>>57950909
>implying java isn't shit and we all don't know it
>>
>>57950939
Java is shit m8 but not for the reasons you're bashing it for. Try it in any other fucking object oriented language m8, go ahead and fucking try it, and see what happens.
>>
>>57950888
is that a guy?

why is the title bar orange?
>>
>>57950962
>why is the title bar orange?

Why not?
>>
>>57950992
how's your riffle?
>>
>>57950996

Reported for spam :)
>>
>>57950960
>>57950909
not him, I was bashing java and I already solved the problem as stated above and I still think it's utter garbage in exactly the situation I was in
I haven't posted my whole problem, I just insulted Java for being shit in my situation
had to get some steam off

maybe one day in the future you will encounter it yourself and think back "ah, java really is pretty shit"
>>
File: 1464839562330.png (42KB, 848x590px) Image search: [Google]
1464839562330.png
42KB, 848x590px
>>57950888
Mines almost finished. I set the upper limit to 50, so it's close
>>
>>57950720
Thanks. Is that standard behavior?
>>
is he baiting
>>
>>57951138
No, you're just fucking retarded. We already know exactly the situation you're in, and the problem is not Java, it's you. Now fucking kill yourself you dumb fuck.
>>
>>57951171
Ah, then tell me. What exactly was my problem?
Take your time.
I'll be here all night.
>>
>>57950747
Libraries simply cannot do what Rust does.
>>
>>57951138
It's not a flaw in Java. It's a flaw in your reasoning. The "static" keyword means that there's exactly one instance of a variable, instead of 2 or 50 or 0. Sometimes this is what you want. When it isn't what you want, don't use it. It's that easy. Now fuck off and stay fucked off until you've graduated middle school.
>>
>>57951206
t. pajeet tier html5 developer
>>
File: 1481220003576.png (51KB, 894x704px) Image search: [Google]
1481220003576.png
51KB, 894x704px
>>57950888
Fucking FINALLY. I can go to the gym now.

Here you go, 1 hour and 18 minutes to get the dots in the right spot, I'll make a webm of it moving the dots in a second
>>
>>57951268

Interesting. I should try to refine mine.
>>
>>57951194
Your problem is not knowing the difference between a static context and a non static context, and not understanding why you can't access the latter from the former.
A non static context in your situation refers to a class instance, when you instantiate a class, you're allocating a block of memory, that block of memory stores all the values of your classes member variables.
Notice that when you call a method, you do it through your instance, and not the class name, that's because when you call a member function, the language behind the scenes is passing a reference to your instance to the method so the method knows what block of memory to use to access of modify member variables.
Class myClass = new Class(x);
myClass.printX();

Is equivalent to doing:
Class myClass = new Class(x);
Class.printX(myClass);

I don't know if the second is valid Java code or not, but my point is, notice how you are passing in a reference to your instance? that's what's happening in the background of the first code sample. It does that so printX knows which x to print.

Now consider when you DON'T have any reference to an instance, and you want to call an instance member or modify an instance variable, can you understand now why this can't be done? because the instance members are not global state, they're part of the individual instances, and if you don't have an instance, then you need to instantiate and instance otherwise you just flat out cannot use them.
It's like wanting to use a variable named foo without even declaring foo first, Java has no idea where this so called "foo" is or what it even is.
>>
File: stippling.webm (933KB, 633x758px) Image search: [Google]
stippling.webm
933KB, 633x758px
>>57951285
Here you go, I assume if I let it continue forever instead of capping it at 50, that it would be more clear
>>
>>57951332
Btw, this applies to every language, not just Java.
>>
>>57951345
>>57951285

You know what, I'm going to try that out with more stipples and leave it running when I go to the gym.

see ya guys, gonna try a deadlift PR today
>>
File: sensible chuckle.gif (1MB, 250x250px) Image search: [Google]
sensible chuckle.gif
1MB, 250x250px
>>57948378
hey /dpt/
what do you love most about 'static'
>>
>>57948378
so I think I have a project idea but I'd like some feedback
me and my friend have been using private dead drops, we put a usb in a plastic bag and leave it at a location, recently I've been thinking of ways to make it more secure - we already encrypt the files but it still worries me - the concept is simple, you set a timer when the timer runs out all the files are encrypted several times with random keys using random passphrases the private keys would also get encrypted then the entire usb would get deleted a similar process would take place if the power is lost - one problem I'm thinking of is getting the files off the usb without unplugging the usb or the PI losing power, is there a way to make a raspi mount as a usb or something like that? I mean I don't see why I couldn't make the pi execute all scripts off usbs automatically then you plug in a second usb that automatically copies the encrypted files anyway any feedback would be helpful, not using the dead drop for anything illegal I just like trying to make things as secure as I can
>>
>>57951614
Maybe you should just hand the drive to one another instead of leaving it lying around in public places.
>>
Is it me or AoC day 11 can have an unresolvable input? Let say we have on start:
Lvl.4: -
Lvl.3: G1
Lvl.2: M1
Lvl.1: (everything else)

You cannot get up with generators past M1.
You can only get to lvl3 with M1.
You cannot move G1 down past lvl2 since after you got up with M1 you left microchip you got up to lvl2 with here.
>>
>>57948378
Tweaking on a couple of desktop apps from the menagerie of side projects I've built over the years. Turns out that staying interested and motivated in your own stuff is hard when you spend 40 hours per week being paid to program for someone else.

Also tossing around the idea of picking up Go and/or Elixir for a couple of web projects I want to work on.
>>
>>57951644
I don't want to meet him in person and even if I did finding a time we would both be free to meet is tricky since we both work rotating shifts
>>
>>57951662
Post it.
>>
>>57951434
Easy access to generic methods that don't need to be instanced or shouldn't be instanced but do fit into a particular namespace perfectly. The ability to wrap around RAII pointers in the std lib to heap allocate my own objects in their protected constructor, then pass back the pointer to the caller.
>>
>>57951345
programming baby here.
How would you go about making a program like this? What's it even called? Can I do it in java? pls no bully
>>
>>57951700
post what? at this point the project is just an idea if that's what you wanted me to post
>>
>>57951737
>Millennials
>>
>>57951775
I was born in 1987...
>>
>>57951775
also the reason it's just an idea is because I'm currently working on a project and don't want to abandon it when it's half finished to move onto something else
>>
>>57951737
Oh, you must be American.

Mail it.
>>
>>57951805
actually I'm a UKfag just retarded also mailing it though an ok idea requires us both to buy PO boxes or give out our address
>>
>>57950720
I'm running the test now, anybody want to guess when it craps out? I'm using a stock D-Link router. It's at 319 sockets right now
>>
File: 1479552443257.jpg (52KB, 1024x768px) Image search: [Google]
1479552443257.jpg
52KB, 1024x768px
Has anyone here ever rolled their own neural network and got it to work properly? I'm 0 for 3 right now.

Granted, I've mainly been messing around with pretty new stuff that hasn't made it to Tensorflow/ Theano yet, but it escapes me why I can never get these to work. A deep maxout network should be able to learn XOR, right?
>>
>>57951818
What naughtiness are you up to? Unless you're actually selling and/or manufacturing drugs you could probably get away with being less paranoid.
>>
>>57951843
65536
>>
>>57951734
That image was created from a series of frames in gimp, turned into a gif, and inputted into ffmpeg

The source code for creating the frames are in python and are located here
>>57950183
That python script calls upon a traveling salesman solver that you can download online, and their own scripts for actually creating the dots. It also calls upon other libraries, and if you're in Windows, good luck downloading that shit. If under Linux, it's probably already downloaded and in your repositories

Also all languages that are Turing complete can be turned into each other. Meaning if you can do this in python, you could do it in java
>>
>>57951843
If your structure isn't ass you should be able to get it as high as 65k~ (physical limit in a single network interface).
>>
>>57951862
as weird as it sounds it's nothing illegal I just enjoy making things more secure. a guy who used to sell me anti psychotics did once offer me money to think of a good way to log all drug transactions without a lot of risk - I could modify this so you have to enter a password every 48 hours, then if he gets arrested he just has to not hand over the password for 48 hours or hope they power it off - not going to do that though unless I ever can't afford the meds
>>
>>57951903
That sounds a little out of my league right now. Still neat though! Thanks for the info anon
>>
>>57951903
You can't do it in Python3, though.
>>
https://browsix.org/

jesus christ why
>>
Is it worth it to do manual memory management or is garbage collection fine?
>>
>>57951918
The bottleneck is the number of connections the shitty router can take before it starts dropping TCP connections.
>>
>>57952074
If you want performance, yes.
>>
>>57951988
That's actually pretty cool tbhfamalam
>>
>>57951988
>Browsix has an init system that supports managing and supervising in-browser services specified by systemd unit files.
>>
how does one go from web dev (php) to real programming? Should i start with C? what do i even make since i'm not working with a web browser?
>>
>>57952074
Manual memory management isn't a task anymore. Smart pointers, memory pools, as also the fact many programs don't even need to free memory since they jump in and out so fast like compilers. Garbage collection is really unimportant now.
>>
>>57952245
>college fag
sane concurrency without any gc is impossible.
>>
>>57952234
at least not systemd
>>
>>57951434
The fact that I can cheat non-OOP code into an OOP language without having to resort to a singleton pattern.
>>
>>57952313
> Impossible
Seems like a personal problem to me
>>
>>57952357
Keep reading
>>
I'm using Visual Studio c++ win32 and I'm trying to draw an array of pixels on the screen. How do I do this without it being laggy and slow.
//that's the pixel struct
struct pixel{
int x;
int y;
COLORREF color;
};

//that is the WM_PAINT case
case WM_PAINT: {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
//todo: draw here
EndPaint(hWnd, &ps);
}


I have tried using a bitmap and print that on screen but that ends up being slow and lagging around same goes for using SetPixel() or FillRectangle() if I change many pixels.
>>
>>57952424
Try bitblt.
>>
>>57952424
use a direct2d library there's like a billion of them, so it's retarded. I can't remember the latest/good one

GDI+/GDI or some shit
>>
>>57951843
>>57951891
>>57951918
>>57952086
It got to just over 500 before it crapped out.
>>
>>57952452
I'm doing that right now but its still lagging if I fill a bitmap of 700x700
>>
Hi, I'm trying to clean up my Python code by defining functions, but I keep getting NameError's because of the whole local variable thing. I've read up on this and still can't seem to understand why this is so difficult. Can anyone take a look at my code and try and explain to me why it doesn't work and what would work?

def ssh_init():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
return ssh

def ssh_connect_test(ssh):
ssh_init()
try:
ssh.connect(get_remote_ip(), port=22, username=get_username(), password='password')
print('Successfully connected to remote host')
except paramiko.AuthenticationException:
print 'fail'

ssh_connect_test(ssh)



You can see that ssh_init() contains the code required for the ssh.connect method to work.

You'll also notice that I wasn't able to reference the variable remote_ip and had to instead put a function call in the argument part which I think is retarded.

Please help because it's really holding me back
>>
>>57952313
>sane concurrency without any gc is impossible.
why?
>>
>>57952486
Then it's probably not the bottleneck.Paint the bitmap using BitBlt but for modifying the bitmap pixel-wise use CreateDIBSection. But unless you must use win32 only you better switch to something GPU accelerated.
>>
>>57952424
I would use SDL2. I wrote a little wrapper for direct pixel access, and the bottleneck is the refresh rate (actual code can run at over 5000FPS, I timed it).
>>
>>57952542
What name is undefined?
>>
>>57952542
ssh = ssh_init()
>>
>>57952542
ssh_connect_test(ssh)

This is happening at the global level. You simply have no variable called ssh defined when you try to call ssh_connect_test. Note that ssh_init() returns the object ssh.
ssh = ssh_init()
ssh_connect_test(ssh)

Doing it this way, you can remove ssh_init() from ssh_connect_test(), though if it were me, I would remove the argument from ssh_connect_test(), like so:
def ssh_init():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
return ssh

def ssh_connect_test(ssh):
ssh = ssh_init()
try:
ssh.connect(get_remote_ip(), port=22, username=get_username(), password='password')
print('Successfully connected to remote host')
except paramiko.AuthenticationException:
print 'fail'

ssh_connect_test()
>>
>>57952542
Remove the line ssh_init() from ssh_connect_test. Your last two lines should be

ssh = ssh_init()
ssh_connect_test(ssh)
>>
trying to learn spring but my brain is about to explode
all this undocumented and "magic" behavior is driving me insane
does anyone who develop an app with spring actually know what the fuck is going on or do they just put annotations everywhere until it works?
>>
>>57952594
looking into direct2d now like the other anon suggested
>>
>>57952571
1. you need mutability for explicit memory management.
2. manually tracking data dependency is hell.
3. too much prone to synchronization bugs.
4. performances.
>>
>>57952642
>>57952667
>>57952675
Okay, that makes sense that it doesn't know what it is unless I assign it.

Last question sorry. How about if I had another item returned from a function. Say for instance:

def ssh_init():
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
b = 1
return ssh, b


def ssh_connect_test(ssh):
ssh = ssh_init()
try:
ssh.connect(get_remote_ip(), port=22, username=get_username(), password='password')
print('Successfully connected to remote host')
except paramiko.AuthenticationException:
print 'fail'

ssh_connect_test()


Would ssh = ssh_init(), be equal to both ssh and b. Or would I have to:

return ssh, b

def ssh_connect_test(ssh, b)
ssh = ssh_init()
b = ssh_init()


Does that make sense or is it wrong, arguments defined in a function, must match what is returned from another function(?) and referenced as a variable in the called function?
>>
>>57952722
Ah, a guy who fell for the "functional languages are better for concurrent programming" meme.
>>
File: autcsgrad.png (71KB, 369x406px) Image search: [Google]
autcsgrad.png
71KB, 369x406px
>>57952760
>immutability = functional programming
Your whole education must be redone.
>>
>>57952756
That would be
ssh, b = ssh_init()

Be careful about returning multiple values, though. While there are certainly valid uses for it, it can easily become unwieldy.
>>
>>57952801
>implying I fell for a programming degree meme
>>
>>57952823
Good thing is you're probably not gonna fall for the whole "job" meme
>>
public String getBackWards()
{
String back="";
for ( int x = word.length()-1; x < 0; x++)
{

}

return back:
}
this is probably super simple but how do i get this to give me what ever string a put in backwards. I think the loop is right but that may be wrong too also getting the return statement to work to is a problem. Im trying to catch up since my AP class is not going well right now.
>>
>>57952859
Well first off, code tags
Second off, you're not passing anything to the method
Third off, check your for loop condition and see if it'll ever make sense
>>
>>57952812
Okay thanks very much mate
>>
>>57952859
public String getBackWards(String word)
{
String back="";
for (int x = word.length()-1; x < 0; x++) {
back[i] = word[word.length-i-1];
}

return back:
}
>>
>>57952849
Programming jobs are the saddest damn meme.
>>
>>57952943
You seem bitter
>>
My desktop is 50x better than my gfs laptop
Is there any way that I have a second independant mouse and keyboard, so she can use my pc with me, on a separate monitor?

So she can do things on one monitor, and I can do my own thing on another.
>>
>>57952859
I think word.length() should be word.length since it's a field, not a method.

There is no "word", where are you getting "word" from, unless a global scoped variable.
>>
>>57952954
wrong thread
>>
>>57952979
I can post in whatever thread I like, friendo
>>
>>57952982

Wrong.
>>
>>57952927
were not supposed to use an array.
>>
>>57952982
You can but it doesn't mean you're going to get a reply to your 2 seconds in Google question
>>
File: 059132.gif (79KB, 516x600px) Image search: [Google]
059132.gif
79KB, 516x600px
>>57952982
>>
>>57952982
No you can't fuck off.
>>
>>57952954
>Is there any way that I have a second independant mouse and keyboard, so she can use my pc with me, on a separate monitor?
Yes.
>>
>>57952954
https://en.wikipedia.org/wiki/Multiseat_configuration

>>57952979
>what is pair programming
>>
>>57952954
No
>>
>>57953021
>pair programming

if you have literally every done it you'd know that wasn't it lmao
>>
>>57953021
>gf
>programming
Pick one.
>>
>>57953029
Pick none
>>
File: 123457890.jpg (4KB, 233x216px) Image search: [Google]
123457890.jpg
4KB, 233x216px
>>57952908
shit , i dont think im good at this at all.
>>
>>57952236

pls respond
>>
>>57948506
why don't u use requests family?
>>
File: CLgm1XqVEAAQRzT.jpg:large.jpg (80KB, 1023x682px) Image search: [Google]
CLgm1XqVEAAQRzT.jpg:large.jpg
80KB, 1023x682px
>>57953029
*tip*
>>57953038
kek
>>
>>57952927
Even if you did have enough characters in back to fit the word, this would fail because strings in Java are immutable, that is to say, they can't be modified. You need to append the new character to back (or, more properly, use a StringBuilder, but that's overkill for this case). Furthermore, the loop is non-sensical. You're going in reverse logically; let the loop reflect that. That's not even mentioning that you define x in the for loop, but then use i in the body.
public String getBackWards(String word)
{
String back = "";

for (int i = word.length - 1; x >= 0; x--) {
back += word[i];
}

return back:
}


Now I remember why I never go in these threads. There is so much bad advice and so many wrong answers.
>>
>>57948506
honestly not very pythonic but you're doing an alright job keep it up :)
>>
>>57953075
>ISIS
*splodes*
>>
>>57953052
>pls respond
pls don't guilt trip me anon

I have no experience with php, but I found the transition from Javascript to Java very easy.

Think of what type of project you want to start before you choose a language.

If you don't have any projects in mind and just want to learn, I'd go for Java or C#.
>>
>>57950743

I can do 2mil unique 6 integer tickets in 3-4 seconds. How well do other languages do?

// Machine to make tickets for us
final class TicketMachine {
// Ticket Machine Data Queue -- data.add(), contains and next are O(1)
private LinkedHashSet<String> data = new LinkedHashSet<String>();
// NumbersList -- numbers.get() -- O(1)
private ArrayList<String> numbers = new ArrayList<String>();
// Get copy of data
@SuppressWarnings("unchecked") /* -- Not using generics -> hard typed return -- */
public LinkedHashSet<String> getData(){
LinkedHashSet<String> ref = (LinkedHashSet<String>)data.clone();
return ref;
}
// Ticket algorithm
private final String getTicket(){
String ticket="";
for(int y=0; y < 6; y++){
if(y<5) ticket+=numbers.get(y)+"-";
else ticket+=numbers.get(y);
}
return ticket;
}

// Generate lottery tickets
public void createTickets(int n){
// x => n : { 1 ... 40 }
for(int x=1; x <= 40; x++){ numbers.add(String.valueOf(x)); }
// Until we have n unique tickets -- .size() is O(1)
while(!(data.size()==n)){
// Introduce randomness..
Collections.shuffle(numbers);
String ticket = getTicket();
// Add ticket to data queue
data.add(ticket);
}
}
}
>>
>>57953089
it's her firstname.
https://en.wikipedia.org/wiki/Isis
>>
>>57949276
I'm going to go write even more python! Thanks gramps!
>>
>>57953098
Either my eyes deceive me or it's a really shitty algorithm.
>>
>>57952236
PHP is a dogshit language and I avoid it whenever possible. You can still get a real job in web development, you just need other skills in non-retarded languages. I recommend Python. It's easy to pick up and learn, and can either prepare you for either web development in proper web frameworks or "real programming," as you call it, in other languages. I tried diving right into C and I just couldn't wrap my head around it. Most C tutorials require a fuckton of prior knowledge about computer science and UNIX that you may not well have. I came back to C after learning Python and then Java and it all made sense then.
>>
>>57953202

Well it's pseudo random bag stuff so it's always going to be pretty shit.
>>
>>57949276
>>>>>>>>>>>>"systems" programming
>>
>>57953098
This is some of the most retarded and misleading code formatting I have seen.
>>
>>57949904
https://wiki.wireshark.org/CaptureSetup/Loopback
>If you are trying to capture traffic from a machine to itself, that traffic will not be sent over a real network interface, even if it's being sent to an address on one of the machine's network adapters.
>>
>>57953241
>Most C tutorials require a fuckton of prior knowledge about computer science and UNIX
No they don't.
K&R only requires a little bit of experience in programming in general.
>>
>>57953283
Thanks. I timed the ping times for 127.0.0.1 and the router, and there is virtually no difference between my network IP and 127.0.0.1, where 192.168.0.1 is 10x longer. I might just make two modes for testing, one for making and sending and the other for accepting and receiving. I wonder why 500 is the limit
>>
C is a bad language for beginners, C++ is a horrible language for beginners. Learn lisp and read HtDP
>>
>>57953076

i used you loop but since we are not supposed to use an array for this one. i did this.

public String getBackWards()
{
String back="";
for ( int x = word.length()-1; x >= 0; x--)
{
back = word.charAt(x) + back;
}

return back;
}
but it gave me the word normally for some reason but i changed it to this

public String getBackWards()
{
String back="";
for ( int x = word.length()-1; x >= 0; x--)
{
back += word.charAt(x);
}

return back;
}
This did work. but why though ?
>>
>>57953365
>C is a bad language for beginners
C is fine for beginners. Outside of Emacs, I have never seen or had to use Lisp, so I wouldn't bother.
>>
>>57953391
Read the sticky m8
As for why the first one doesn't work, run through it on paper
Also, look up array indexing, it applies to strings too
>>
>>57953365
>i read SICP, do i fit in yet?
>>
So I'm torn between two ways of storing files for a web application, using a database and a file system.

Right now, I store a file like this:
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.jpg


where there are three subfolders and then the file, where the filename is the sha1 hash of the file.

I am now considering this instead:

directory: files / 08 / 2b / df / 082bdf129834297234dfab321 / original_filename.jpg

which is the same, except that the hash now becomes the folder name, and then I store the filename with the original filename.

Why does this matter, you ask? Because consider a PNG and PNM. Same content, same hash, but different filename. (file.png and file.pnm) is the same file.

With the second, I could do
directory: files / 08 / 2b / df / 082bdf129834297234dfab321 / original_filename.png
directory: files / 08 / 2b / df / 082bdf129834297234dfab321 / original_filename.pnm


stupid and pointless? Am I doing everything wrong?
>>
>>57953411
>expecting to become a good enough programmer who to design software in the industry after learning your first language
>expecting to use C for anything relevant after just reading K&R
>thinking learning an ancient language riddled with oddities and complications, that were put there so that they could run efficienty on processors that aren't even designed anymore, is somehow better than learning a language that is literally designed to be simple for beginning programmers
Well, good luck anyways
>>
>>57953507
why not put the files into the database as a blob?
>>
>>57953568
Because that's for shitters?
>>
I am c++ programmer, please forgive me for this dumb question, but my Java IDE is telling me I can only switch constants, and stackoverflow seems to be set on that switches are a "bad smell" and that they're evaluated during compile time only. Is this true? What's the point in switches at all, in Java?
>>
does anyone else really like it when a language has syntax for everything like /regex/, `shell command`, or [list comp]
>>
>>57953521
The languages that are designed to be simple for beginners are the worst kind of languages to teach to beginners.
>>
>>57953581
elaborate
>>
>>57953610

You what..?
>>
>>57948506
>python2
kys
>>
>>57953610
In java, a switch works with the byte, short, char, and int primitive data types. It also works with enumerated types, the String class, and a few special classes that wrap certain primitive types: Character, Byte, Short, and Integer
>>
>>57953610
Kek, what?
>>
>>57953619
I'm trying to write a switch. You know


switch(value) {
case x:
do something;
break;
}



But apparently, all the cases MUST be constant. Why?
>>
Short term project: Figure out a way to find a 70% discount on a product price for work.
Long term project: Text based version of Bloodborne: The card game.
>>
>>57953617
It'd be impossible to distribute the files via a cdn. The CDN would then have to also serve images from a database that I maintain.

Storing a filepath which is then appended upon the cdn is easier.
>>
>>57953654

How is this particularly different from how C++ does it?
>>
>>57953654
Are you trying to do a lookup based on a value that can change?
>>
>>57953654
>have a non-constant switch, e.g. a function which returns something
>it might return different values on each evaluation
>?????
>hilarity ensues
>>
>>57953654
Because it's not supposed to replace if
>>
>>57953507
....
just fucking store the hash with the original name in a database, then change the filename to be the hash. Put all the files in the same directory.

Like literally every other CDN on the fucking planet (including 4chan, imgur, etc...)

directory: files / 082bdf129834297234dfab321.jpg

//database request
SELECT original_name FROM names WHERE hash = '082bdf129834297234dfab321';
>>
>>57950642
>safer
you mean slower
>>
>>57953754
>implying those aren't the same thing
>implying "safer languages" don't just fail more slowly
>>
>>57953731
This. Switch tries to generate a jump table which, in the best case, is blazing fast (aside from a possible conveyor flush due to jump misprediction, but it's still much better that x10 flushes on nested ifs)
>>
>>57953731
What is a switch if not an alternative for if-statements?
>>
>>57953789
a very fast lookup table for instruction pointers
>>
>>57953740
All those files in the same directory? CHAOS!

Just imagine what opening that directory in a terminal or whatever else will do!
>>
>>57953880
...you'll be able to see which files are in the directory?
>>
>>57953880
If you're really autistic, yes keep your first version and just use a database.
>>
waiting for haskell anon to post concise god tier versions of the codes posted here
>>
>>57951614
no one has told me if this is a good idea and would putting it all on my github contribute to getting hired or is it even a project that other people would be interested in?
>>
>>57954015
It's not my day off today :(
>>
>>57953507
Why not name it using a timestamp?
>>
haskell is garbage
it should be collected
>>
>>57951657
I don't even know how to start.
>>
>>57954036
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEe
>>
>>57954015
in Haskell this is just

as in moral
>>
>>57954082
Some academics still hold references to it, can't collect :(
>>
>>57953906
Go ahead, open your 4chan folder. You know, the one where you save all the stuff from 4chan.

>>57953987
In retrospect, I realize that the second version was pointless. This will also work:

directory: files / 08 / 2b / df / 082bdf129834297234dfab321.png
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.png


The question now is, should I be storing the file with the extension at all? It's the same damned file. Why store it twice?

directory: files / 08 / 2b / df / 082bdf129834297234dfab321


That is how it should be. But then I'd require a database call to serve it, and god damnit.
>>
ETL
>>
>>57954187
I don't have a 4chan directory, just a 'dl' dir. What's the problem with ls? Handles 398 items fine.
>>
>>57954187
>>57953987
was supposed to be this:
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.pnm
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.png


But what if I used symbolic links?

directory: files / 08 / 2b / df / 082bdf129834297234dfab321
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.png --> 082bdf129834297234dfab321
directory: files / 08 / 2b / df / 082bdf129834297234dfab321.pnm --> 082bdf129834297234dfab321


Yes, that's how it has to be, isn't it?

>>57954218
398 is nothing
>>
some sql homework that i can't get right for the life of me

IF OBJECT_ID('spLineItems') IS NOT NULL
DROP PROC spLineItems;
GO

CREATE PROC spLineItems
@InvoiceDateMin smalldatetime = NULL, --default minimum date
@InvoiceDateMax smalldatetime = NULL --default max date(current date)

AS
IF @InvoiceDateMin = NULL AND @InvoiceDateMax = NULL
BEGIN

SELECT VendorName, InvoiceNumber, InvoiceDate, InvoiceLineItemAmount,
InvoiceLineItemDescription
FROM Vendors
JOIN Invoices ON Vendors.VendorId = Invoices.VendorId
JOIN InvoiceLineItems ON Invoices.InvoiceId = InvoiceLineItems.InvoiceID
ORDER BY InvoiceDate ASC;
END
ELSE
IF @InvoiceDateMin = Null
BEGIN
SET @InvoiceDateMin = '1990-1-1'

SELECT VendorName, InvoiceNumber, InvoiceDate, InvoiceLineItemAmount,
InvoiceLineItemDescription
FROM Vendors
JOIN Invoices ON Vendors.VendorId = Invoices.VendorId
JOIN InvoiceLineItems ON Invoices.InvoiceId = InvoiceLineItems.InvoiceID
WHERE InvoiceDate BETWEEN @InvoiceDateMin AND @InvoiceDateMax
ORDER BY InvoiceDate ASC;
END
ELSE
IF @InvoiceDateMax = NULL
BEGIN
SET @InvoiceDateMax = GETDATE()

SELECT VendorName, InvoiceNumber, InvoiceDate, InvoiceLineItemAmount,
InvoiceLineItemDescription
FROM Vendors
JOIN Invoices ON Vendors.VendorId = Invoices.VendorId
JOIN InvoiceLineItems ON Invoices.InvoiceId = InvoiceLineItems.InvoiceID
WHERE InvoiceDate BETWEEN @InvoiceDateMin AND @InvoiceDateMax
ORDER BY InvoiceDate ASC;
END;

GO

EXEC dbo.spLineItems @InvoiceDateMax = '2011-12-31';

I'm sure i fucked up my IF somewhere but idk where
>>
>>57954275
You asked me about my downloads directory... It has 398 files. Do you want to choose a different number this time?
>>
>>57954320
nothing shows up when i run the procedure
>>
>>57954331
Try thousands, try potentially hundreds of thousands.
>>
So Common Lisp is pretty much everything and the kitchen sink while Scheme is the perfect contrary, right?

Why would you use Scheme in that case?
>>
daily reminder programming jobs do not exist
>>
>>57954455
>tfw clocking out of Hasklel job right now and taking few days off this week

feels ok
>>
>>57954455
my pay cheque begs to differ
>>
>>57951844
A-anybody?
>>
>>57954455

>be php programmer in seattle area
>want to get low level programming job instead

im too lazy, plus my current job is a 5 min drive away
>>
>>57954480
do you only do programming anon?
nothing else?
>>
>>57954502
of course I do other stuff. Programming is just my primary role I'm being employed for.
>>
>>57954531
you're a code monkey then?
>>
>>57954540
define code monkey
>>
>>57954320
did I nest my IF statements incorrectly?
>>
>>57954562
Code monkeys are simple men with big warm fuzzy secret hearts who are not crazy, but are proud, and like fritos, tab, and mountain dew.
>>
>>57954365
seq 100000 | xargs touch
time ls >/dev/null
real 0m0.253s
user 0m0.213s
sys 0m0.037s


>>57954475
Livin' the dream.
>>
>>57954637
that brings me back
>>
>>57954562
People here forgot it's meaning and use it incorrectly. It's someone who doesn't know what they're doing and rely on their manager to tell them what to do and how to solve problems.
>>
I'm skinny, whats the best language for me?
>>
>>57954779
C
>>
>>57954649
Sure thing m8. Think about the output in your terminal, or file browser.
>>
>>57954894
time ls
...
16908 23831 30755 3768 44602 51526 58450 65374 72298 79221 86145 93069 99994
16909 23832 30756 37680 44603 51527 58451 65375 72299 79222 86146 9307 99995
1691 23833 30757 37681 44604 51528 58452 65376 723 79223 86147 93070 99996
16910 23834 30758 37682 44605 51529 58453 65377 7230 79224 86148 93071 99997
16911 23835 30759 37683 44606 5153 58454 65378 72300 79225 86149 93072 99998
16912 23836 3076 37684 44607 51530 58455 65379 72301 79226 8615 93073 99999
16913 23837 30760 37685 44608 51531 58456 6538 72302 79227 86150 93074
16914 23838 30761 37686 44609 51532 58457 65380 72303 79228 86151 93075
16915 23839 30762 37687 4461 51533 58458 65381 72304 79229 86152 93076
16916 2384 30763 37688 44610 51534 58459 65382 72305 7923 86153 93077
16917 23840 30764 37689 44611 51535 5846 65383 72306 79230 86154 93078
16918 23841 30765 3769 44612 51536 58460 65384 72307 79231 86155 93079
16919 23842 30766 37690 44613 51537 58461 65385 72308 79232 86156 9308
1692 23843 30767 37691 44614 51538 58462 65386 72309 79233 86157 93080
16920 23844 30768 37692 44615 51539 58463 65387 7231 79234 86158 93081

real 0m0.630s
user 0m0.457s
sys 0m0.147s
>>
>>57954933
Just write ls.
>>
>>57954933
I get 0.3s in fish
>>
>>57954894
Why are you so desperate to print out and look through the unfiltered directory listing of a managed file-store?
>>
Grammar question:

What does a collection have? Does it have member, parts, or items? What's the right name?
>>
>>57954949
Same execution time.
>>
>>57954964
containees
>>
>>57954964
Elements.
>>
>>57954964
"members" sounds good to me. there are lots of words you could use that would be fine
>>
>dude what's static lmao. why do languages have, like, rules and shit man.. haha pajeets amirite?
Thanks for the entertaining read whoever that dumb nigger is.
>>
>>57954964
Items. Members are used to describe what makes up a class. Parts is too generic.
>>
>>57955009
>>57955107
>>57955117
>>57955238
All good suggestions, except one. You know who you are.
>>
>>57954964
bytes
>>
>>57955238
oh, that's a good point. go with that. i just replied with what i would use in mathematical writing but the expectations are different -- i think if you said "items of a set" people would understand but also look at you funny
>>
>>57954964
thingamajigs
>>
>>57955294
>you know who you are
That's awfully presumptuous. I have no idea who I am and is in a constant state of confusion.
>>
is the empty set a subset of all sets?
>>
>>57955390
Yes
>>
>>57955390
Yes.
>>
>>57954964
Elements.

>>57955117
Bad.
>>
>>57955390
Yes and it's a proper subset of every set but itself.
>>
explain to a noob in simple terms why javas main is always
public static void main(String[] args)
I understand what void is and why main should be void
I know what public and static are but dont know why they should be used in main
I dont really know much about inside the ( )
>>
Should I learn Common Lisp or Scheme?
>>
>>57955558
>public
Can be called from anywhere. Because main is the entry point this really shouldn't matter though. But it makes slightly more sense for it to be public
>static
Naturally it needs to be static or it can't be the entry point. There's no context outside of main where you could have an instance of your main class. It's the entry point.
>void
Actually you'd probably expect int, as programs have exit codes on most operating systems. But because its in the VM it does things differently
>String[] args
This is a list of arguments passed to your programs on the command line. Usually used for flags (-a, --something) and such to programs.
>>
>>57955594
Racket.
>>
>>57955558
Java really does have a horrendous entry point.
>>
>>57955623
>Actually you'd probably expect int, as programs have exit codes on most operating systems. But because its in the VM it does things differently
I hate languages that do this, but it seems to be popular for some reason.

It's like nobody has heard of the command line where error codes are actually useful.
>>
New thread:
>>57955732
>>57955732
>>57955732
>>
NEW THREAD

>>57955720
>>
>>57955445

Fun fact: the set of all sets contains the aforementioned set.
>>
>>57955722
Well they have System.Exit(0)
I think the reason they do that is because the program doesn't actually stop running until every thread is dead. So maybe you'd like to have the different threads generate exit codes? I'm not sure how much sense that makes. I'd expect when you call exit() you've already determined if it's a good execution or not.
>>
>>57955738
>>57955743
Congrats fags, you both blew it
>>
>>57955771
I deleted the other thread, because they posted the thread slightly before mine, but put the link in this thread very slowly for some reason.

Fucking redditor fagshit. All the do is spout there LE FUNNAY XDD trap memes.
>>
>>57955738
I prefer this one.
>>57955813
Please post the image you used. I didn't catch it.
>>
File: Homura_DPT_rust.jpg (128KB, 563x712px) Image search: [Google]
Homura_DPT_rust.jpg
128KB, 563x712px
>>57955858
I've used it several times before, but not recently.
>>
>>57955294
hostages
Thread posts: 333
Thread images: 34


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