[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: 337
Thread images: 26

File: maxresdefault.jpg (165KB, 1920x1080px) Image search: [Google]
maxresdefault.jpg
165KB, 1920x1080px
What are you working on, /g/?

Old thread: 57667266
>>
>>57674108
>no anime op
sage this
>>
>maxresdefault.jpg
Whats the video anon?
>>
>>57674108
About time for a new thread.
>>
>>57674125
Got it from google images searching for C++ wallpaper.
>>
>>57674108
>Pajeet in the shell
>>
will telling my interviewers that I have a speech impediment excuse my bumbling, or will it screw me over by making them realize I'm not just nervous, I'm like this all the time
>>
What are the core elements of Pajeet-style coding?
>>
>>57674155
Where can I hire cringy weebs to enact this for me?
>>
>>57674125
>>57674108
Found the channel from the sticky in the top right.
https://www.youtube.com/user/nallamothu
>>
https://www.youtube.com/watch?v=4hnnqgx_tjk

Found the video too!!
>>
>>57674174
It will definitely help. It gains you sympathy, they realize you are not retarded, and if it's a large business they might worry about a discrimination suit. I have no idea how important the last one is but you should be up front with them.

Be prepared to answer questions about how you cope with the speech impediment in the workplace.
>>
>>57674155
Goddammit lol

https://www.youtube.com/watch?v=4hnnqgx_tjk

>windows 7
>Turbo C++
>>
I wanna get into programming. Which make more money, front end developers, or back end? Which has more fun languages to learn?
>>
>>57674235
Probably back end but far more important are the skills you have, both technical and soft.

Front end is predominately JavaScript, which most people seem to dislike, myself included. Backend gives you greater flexibility.
>>
>>57674235
you're more likely to be able to make money on front end given no formal background.
>>
Is this better than a wall of if statements?
>>
>>57674251
h-how do i into soft skills
>>
File: 1480050491075.jpg (111KB, 1195x1067px) Image search: [Google]
1480050491075.jpg
111KB, 1195x1067px
>that feel when parents fighting again and dad's blaming mom for getting me into programming instead of pushing me to go do medicine
>>
>>57674235
Remember to also ask universities student councillors if they're open to you. They have their agendas but they can offer genuine advice. And you can be sure it's good info if they put you in contact with someone they think knows more.
>>
>>57674300
Asian?
Tell them that medicine is hard. If things aren't working out now it'd be worse with medicine.
>>
>>57674300
>he went to school to learn programming

your dad was right, you wasted your time
>>
>>57674108
tfw college unironically uses Turbo C++ in XP
>>
File: trump2.png (1MB, 1180x842px) Image search: [Google]
trump2.png
1MB, 1180x842px
big league, big pepper.
>>
>>57674121
>current year
>not accepting pajeetwaifu.exe as your lord and cuckster
>>
>>57674108
Why the fuck street shitter still using borland
>>
>>57674226
holy shit that editing
>>
//const reference to a std::vector holding reference pointers to Gio::Files

void on_open(const std::vector< Glib::RefPtr <Gio::File> >& files, const Glib::ustring& data)

>>
>>57674226
Fuck fuck fuck
> void main
> TurboC++.exe
> DOS Box
> stdio.h in C++

Pretty sure I heard Windows Vista somewhere
>>
>>57674287
Delete your 4chan account and go >>>/out/
>>
>>57674273
Maybe just a little bit, but honestly, not by much. Do you _really_ need to hold your return value in a variable, anon? Hint: No, you don't.
>>
Hello /g/. DU you have a minute to talk about your Lord and Saviour, Ada?
>>
>>57674300
How did your mom get you into programming?
>>
>>57674108
I finally got my VOIP client working and the audio output is good: https://a.pomf.cat/xpfqzv.ogg
For anyone interested, audio is opus 48kb mono.
>>
How can I use bufferSubData in WebGL to add new data, rather than change data?
I keep getting errors saying I'm exceeding the allocated bytes.
>>
>>57674300
Is your mom a cute progslut, or are you from the shitting-continent?
>>
>>57674744
first use bufferData to allocate a buffer of an adequate size
>>
I'm working on a personal C++ project (taking the Cryptopals challenge, if anyone's interested).
There are a lot of problems which require some common functions, so I thought it would be good time to learn some software engineering principles like Don't Repeat Yourself and such.

So, I was thinking of putting all the common functions somewhere else and making a library.

/
|----Lib/
|----src/
|----obj/
|----inc/

----Set1/
|----Challenge1/
|----src/
----bin/
----obj/
----inc/

|----Challenge2/
|----src/
----bin/
----obj/
----inc/

----Set2/
|----Challenge1/
|----src/
----bin/
----obj/
----inc/


Is this directory structure ok? Also, I've never made a library before, so should I use static or dynamic libraries?
>>
>>57674806
Read up on reasons to use dynamic vs static liberties.
Honestly nowadays it makes far more sense to just statically link everything. The other considerations are just insignificant compared to the issues dynamic linking can introduce on some platforms.
>is the directory structure ok
The library is separated into its own folder. So yes it's fine. Doesn't particularly matter where it lies beyond that.
>>
>>57674805
That kind of defeats the purpose of bufferSubData though.
>>
>>57674834
no it doesn't

bufferSubData updates a subset of the buffer while keeping the rest as it is instead of throwing it all away with another bufferData call
>>
>>57674831
Thanks.
Also, earlier when I didn't have any Lib/, I simply compiled a challenge from the Challenge directory itself (I had a makefile)
But now, should I compile from the root directory, since I have to use the Lib/ directory too.

But then I'll have a single big makefile in the root directory for all the challenges, so is there any good solution for this?

I could do -L../../Lib/ in the original makefile, but that doesn't look quite nice.
>>
>>57674875
But I have to throw it all away each time I expand with a bufferData call.
I could use the classic method of doubling capacity whenever capacity is reached, but I don't know how to get the vertex data back out of a buffer; something which I'd need to do if I wanted to do another bufferData call for expansion.
>>
File: 1479400117884.gif (3MB, 700x285px) Image search: [Google]
1479400117884.gif
3MB, 700x285px
>>57674108
>mfw Turbo C++
>>
>>57674959
allocate everything you need in advance. "resizing" by allocating a new buffer is expensive, it's not something you want to happen at random times in a real-time rendering environment
>>
>>57674995
I definitely need live resizing for what I'm doing: The case I'm dealing with could, in an unpredictable and everchanging manner, have many small objects or a few large objects.
>>
>>57674725
Not him, but premature returns are equivalent to goto's. They disrupt program flow.
>>
>>57674273
Why don't you just make some macros?
>>
>>57675043
>many small objects or a few large objects
those can be in the same buffer

surely you have a known upper bound of the size, but if not, enjoy your out of memory crashes, and just reupload with bufferData then because bufferSubData doesn't magically append data like whatever webshit faggotry you're used to
>>
>>57675089
Please explain how I could do that. I'm always looking for ways to improve.
>>
>>57675058
Having seen and dealt with code that dogmatically sticks to the "single return" policy, I'd rather have the alternative!!
>>
>>57674880
I'd do ../../lib
I don't see why it wouldn't be 'nice'. You can have it be a conf variable
>>
>>57675120
I have a known combined maximum for the data of all objects.
But that data could be divided between hundreds of objects, and it'd be annoying to have to make hundreds of objects share a buffer.
Problem is I can't find a WebGL function that will allow me to pull vertex data out of a buffer so I can recreate the buffer with a larger cap.
>>
>>57675125
Ok, what I thought of won't work. I think yours is a good solution.

By the way, when you're calling this function, are you passing in integer literals like 1,2,3 or have you enum'd the names somewhere?
>>
>>57675213
>But that data could be divided between hundreds of objects, and it'd be annoying to have to make hundreds of objects share a buffer.
annoying maybe but it'd probably be the sensible solution

>Problem is I can't find a WebGL function that will allow me to pull vertex data out of a buffer so I can recreate the buffer with a larger cap.
you got the vertex data from somewhere (assuming no transform feedback) so just get the data from where you got it before
>>
>>57675237
They're #define'd in the assembly.h header.
I probably should use enums over that, but I mindlessly wrote the defines before I thought of that.
>>
>>57674273
put NULL in the table and return table[type]
>>
>>57675196
I suppose you're right.

I'm a bit confused about the dependencies though. So suppose my binary is challenge1.out, what would be the dependencies?
It would obviously depend on the .o files of the current challenge, but would it depend on the library as well?
Technically it should, but how should I write that in the Makefile? Also, should each challenge's Makefile contain code to compile the libraries as well?
>>
>>57675284
Will this matter? I still have to do bounds checks in case of negative numbers.
>>
File: fsasfdac.png (76KB, 1234x536px) Image search: [Google]
fsasfdac.png
76KB, 1234x536px
>>57674108
>>
>>57674273
you could return table[type%34]
>>
>>57675305
saves you one DEC operation m8
>>
>>57675337
>>57675332


Y'all are probably fucking with me at this point.
>>
>>57675332
still doesnt handle negative numbers
>>
>>57674273
Why dont you make that table static?
>>
>>57675415
Good idea, but I'm 90% sure the compiler will optimize that for me.
>>
>>57675330
>rude
sure, it was rude
>abusive
what? literally what the fuck? who is being abused by a troll question on a programming board?
>>
>>57675419
That's interesting. I didn't know compilers could change the storage classes.
>>
>>57675305
it's cleaner code. and i don't see why you should need a bounds check, but if you do, then an early return on a ternary for the bounds check would make sense, you don't need a disgusting mutable return variable, it makes the code less readable
>>
>>57675330
>firefox
gtf>>/out/
>>
>>57675460
>on a ternary
or a ternary return expression
>>
I'm working on a little python project with selenium and firefox. but firefox doesn't find the geckodriver even though its in the path. did anyone get this problem?
>>
>>57675474
*selenium not firefox
>>
>>57675437
Now that I'm looking into it, I'm not so sure.

>>57675460
I've been taught that it's "cleaner" to return only once, and never return early. Idk man, idk. Also, as much as ternary statements shorten code, they make it less readable. I think this is a matter of preference.

Here's the latest version. You guys sure are picky.
>>
hey guys i need help, how do i make a visualization of sorting algorithms?, i already have the code for the algorithms but i dont know how to program the visualitzation, what framework should i use? library?, qt looks complicated, maybe i should use a 2d game framework?
im using C++, Java or Python
>>
>>57675493
>I've been taught that it's "cleaner" to return only once

I personally like the returning NULL early paradigm better, because it sort of looks like an 'assertion'. And PLEASE remove that NULL from table[] for god's sake. Why are you mixing NULL and valid strings in the same table?

char *
func(int type) {
// Sort of like assert(type > 0)
if (type <= 0) {
return NULL
}
// "Main" logic of the code
}
>>
>>57675538
> And PLEASE remove that NULL from table[] for god's sake. Why are you mixing NULL and valid strings in the same table?
>>57675284

You know what, I think I'll just keep it the way it was. There are as many opinons as there are people.
>>
>>57675493
My assembler defaults to an instruction that takes no parameters and keeps on going. It made my logic very clean in my opinion.
>>
>>57675493
>I've been taught that it's "cleaner" to return only once, and never return early
That's an extremely old-fashioned and quite honestly stupid way of doing things.
It doesn't make your code cleaner. All it does is complicate your logic by needlessly having to pass all of these errors around.
>>
>>57674273
why not use enum?
>>
>>57675595
He has to map integers to string literals. How will he use enums? I'm not saying you can't, but if there is one, it's gonna be very convoluted.
>>
>>57675593
>>57675585
I'll learn from my mistakes, but I'm done staring at the same 10 lines of code. Thanks for your help, though.
>>
>>57675606
I could use enums, as AFAIK you can give them integer values, at least for the purpose of mapping. But I can't print out an enum name so it's pretty much equivalent to #defining.
>>
>>57675524
>visualization
You're going to need to be more specific about what kind of visualisation you're talking about. You could create a visualisation by printing to the terminal if you wanted to.
>>
>>57675595
>Enums in C
Trash "feature"
>>
>>57675493
>table not constant
>type isn't being sanitized
REEEEEE
>>
>>57675627
it would be nice if each value's type was not unsigned int but instead of type 'enum'

that way I don't have to name them like
namespace_apple
namespace_orange
namespace_banana
>>
>>57675627
They get the job done. They also interact nicely with other features:
enum my_enum {
A,
B,
C,
};

const char my_enum_str[] = {
[A] = "Alfa",
[B] = "Bravo",
[C] = "Charlie",
};
>>
>>57675625
you know like the visualizations you see on youtube that has the vertical lines from small to big, or an array of numbers in a canvas that shows comparisions and stuff
>>
>>57675658
this

they have their uses
>>
>>57675656
why won't they put namespaces in C like holy shit how autistic do you have to be
>>
>>57675658
Wait, hold on a second. You can initialise an array like that? What if my A=1, B=3, C=10. what will my table look like? I'm seeing this for the first time.
>>
I'm intrigured but this doesn't compile.
What am I doing wrong?
>>
>>57675672
enum fruits {
APPLE,
ORANGE,
TOMATO
};

unsigned int APPLE;
/*'APPLE' redeclared as a different kind of symbol*/
>>
>>57675680
It'll be 11 elements large
>>
>>57675687
C99
>>
>>57675656
>unsigned int
enums underlying type default to int.
>but instead of type 'enum'
It's a shame they're not strongly typed, but that's never been too big of a concern to me.
There is actually a proposal for the next C2X to add more strongly types enums where you can specify the underlying type.
>that way I don't have to name them like
I don't get how that has anything to do with name spacing.

>>57675672
>why won't they put namespaces in C
C does have namespaces. Structs/unions have their own namespace.
This probably isn't what you're talking about though.
They won't add namespaces for functions because it would break C's simple ABI.

>>57675680
>You can initialise an array like that?
C99 Designated initialisers. A feature notable for being absent from C++.
>What if my A=1, B=3, C=10. what will my table look like?
The array will be 11 elements big.
The unmentioned elements will be initialised to zero.
>>
const char *my_enum_string[]

You forgot the *
>>
>>57675706
>I don't get how that has anything to do with name spacing.
name collisions trigger me
>>
>>57675710
see that >>57675687
>>
>>57675710
Oh right. My mistake.
>>
>>57675255
Fair point, I might as well keep the vertex data in parallel since I'll be accessing it a lot.
Though how do I create an array of a given capacity?
Javascript is weird, since you just stick stuff in an array of indefinite size.
If I wanted to limit bufferData calls, I'd need to somehow tack onto the end of my vertex data array a null array of the same length as the vertex data every time I do bufferData.
>>
>>57675720
>>57675721
Oh wow, that's pretty sweet. tmyk.
>>
>>57675706
>The array will be 11 elements big.
>The unmentioned elements will be initialised to zero.
That's pretty sweet.
>>
>>57675721
Could you explain how this actually works?
>>
>>57675757
What exactly don't you understand?
>>
>>57675757
it's an array of strings

enums are integers that start from 0 upward

you use the enum to index the array to get the string
>>
>>57675769
You lost me at [A] = "";
What does [A] do inside an array declaration?
>>
>>57675730
>Though how do I create an array of a given capacity?
new Array(capacity)

>tack onto the end of my vertex data array a null array of the same length as the vertex data
concat i think
>>
>>57675794
[i] = "String" in an array definition is similar to doing array[i] = "String" outside of an array definition
>>
>>57675794
You can initialise an arbitrary array value by doing
[3] = "abcd"
or whatever.
In C, an enum is just an integer, so you can use them to index arrays. It starts at 0 and goes up 1 for each member.
enum my_enum {
A, // 0
B, // 1
C, // 2
};

So when we initialise the array like
[A] = "Alfa"
, it's exactly the same as doing
[0] = "Alfa"
.

Doing with with enums has another advantage though. We can initialise the elements in any order and can leave out values if we want to.
enum my_enum {
ERROR,
A,
B,
C,
};

cosnt char *my_enum_str[] = {
[C] = "Charlie",
[B] = "Bravo",
[A] = "Alfa",
// Note: my_enum_str[ERROR] is initialised to zero
};
>>
>>57675863
Huh, never seen that before. Thanks!
>>
>>57675870
>>57675863
That makes sense. Thank you!
>>
>>57675870
>Doing with with enums has another advantage though. We can initialise the elements in any order and can leave out values if we want to.
Are you saying that this will give an error?

cosnt char *my_enum_str[] = {
[3] = "Charlie",
[2] = "Bravo",
[1] = "Alfa",
// Note: my_enum_str[0] is initialised to zero
};
>>
>>57675885
>Are you saying that this will give an error?
No. That will work fine. I didn't really express my point properly.
You can mess with the enum and reorder/add members and not mess up your array declaration.
>>
>>57675906
Ah, makes sense.
>>
for your projects, do you use errno or something similar?

I find that having a global variable for error handling is very convenient.
>>
>>57675968
I normally just exit immediately if I have an error.
Although all of the shit I've written was just for personal use, so I didn't need to make it a particularly reliable program.
>>
>>57675986
yeah, but wouldn't you like to know why it exited?
>>
>>57676042
I just print an error message and/or write it to a log.
>>
>>57675827
Concat?
>>
>>57676065
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/concat
>>
File: 1477172406211.png (8KB, 398x293px) Image search: [Google]
1477172406211.png
8KB, 398x293px
>>57676115
>===
>>
>>57675968
Just use setjmp() and longjmp() :^)
>>
>>57674108
I use errno mostly and strerr to get the readable version and send it to the user.
>>
>>57676172
giving the user exact error information would make it a lot easier to exploit your program
>>
>>57674108
>TurPOO C++
>>
>>57676187
My projects so far have been open source desktop utilities.
>>
λ let gay = map (const "gay") . enumFromTo 1
λ gay 69
["gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay","gay"]
>>
>>57675690
I have an apple
I have a compiler
Unnghhh
Type error
>>
>>57676357
How do you implement the Y-combinator in Haskell? Mine goes into a infinite loop, it has something to do with deferred evaluation, but I'm not sure how to do that.
>>
trying to work on a quake 3 to source map converter. i'm working on this because i don't like vavle's map editor, hammer. since both engines use pretty much the same stuff like brushes and point entities, it's easy as hell to convert the base geometry except for the texture alignments and rotations.

if i decided to learn c++ instead of php 10 years ago, i would make gtkradiant work with source engine instead of writing a shitty parser and a converter with php. am i doing alright?
>>
>>57676388
>c++ instead of php
But they're used for completely different applications, you can't just learn one language 'instead' of another one. Unless you change your job title.
>>
>>57675058

>sees recursive function
>brain explodes
>>
>>57676386
Oooh, I know this.

fix f = f (fix f)
λ fix (\f x -> if x <= 0 then 1 else x * f (x-1)) 5
120


I don't think you can do it without explicit recursion because trying to do
\x -> x x
breaks the type checker.
>>
read() or fread()?

who wins?
>>
Trying to get my head around Ember, or more specifically the almost pathological bullshit that goes into creating the environment and workflow to actually develop the code.

Have been creating some web apps for a new company and the spaghetti of jQuery and direct DOM manipulation is not sustainable. My thinking is about 5-10 years old -- Utilizing the object literal pattern.
>>
>>57676412
void base_case(int a) {
return 0;
}

void recursive_fn(int n) {
void (*fptr)(int) = base_case;
if (n > 0) {
fptr = recursive_fn;
}
return fptr(n-1);
}
>>
>>57676452
They're different functions for different purposes.

read() is a "low level" read and works on file descriptors. It is also tied to POSIX implementations.
fread() works on standard C stdio FILE handles.
>>
>>57676452
d3epends what your'e using them for

don't fread on /dev/random without first setbuf'ing it to not buffer, for example
>>
>>57676470
so using read() for sockets is the way to go?
>>
>>57676447
Hmm, I was hoping there was some way to make a 'pure' Y-combinator. Anyway, thanks.
>>
>>57676408
i was a 14 year old high school student with no understanding of which language does what. i just wanted to do some cool shit in a short timespan so i decided to go with php which i still regret today lol.
>>
>>57676484
It depends. Depending on the type of socket, you might want to use one of the specialised socket functions (recv, etc.).
>>
>>57676491
There might be, but I don't know it, sorry.

There is this, though.

http://rosettacode.org/wiki/Y_combinator#Haskell
>>
>>57676512
Come on anon you can still learn C++. You're literally 24 and acting as if you're stuck with php for the rest of your life.
>>
>>57676521
Nice, the coffeescript solution is so elegant
Y = (f) -> ((h)->h(h))((h)->f((t...)->h(h)(t...)))
>>
>>57676529
you're right. i should probably do that but i'm just not sure where i should start since i'm so used to be spoonfed. some it instructor in my university recommed me a book and said he failed c++ classes a couple of times, i'm starting to fear my brain will not handle all that information. any recommendations apart from accelerated c++?
>>
>>57676605
I hope someone else responds to your question.
I'm not the right person to answer this question. I took an intro to programming course in C and then sort of learned C++ by myself, mostly by working on my own projects.

> i'm starting to fear my brain will not handle all that information
Don't be a pussy.
>>
>>57675058

Premature returns are always okay.
Break and continue are always okay.

Goto is okay when used to break out of a nested loop, or to avoid repeating one's self when recovering from error and cleaning up resources.
>>
>>57676388
use Boost
>>
I dunno, 24 is already two or three years into the "I'm just waiting to die now" phase of life.
>>
File: 3dfeels.jpg (35KB, 388x380px) Image search: [Google]
3dfeels.jpg
35KB, 388x380px
>>57676798
This is not a feels thread anon.
>>
>>57676769
>to avoid repeating one's self when recovering from error and cleaning up resources.
This is my favourite use of goto statements.
>>
File: 1406803019377.jpg (103KB, 1280x720px) Image search: [Google]
1406803019377.jpg
103KB, 1280x720px
>>57676815
>Frogposting
>feels
Fuck off back to /r9k/, reddit or wherever the hell you came from, you stupid fag.
>>
>>57676839
>barcode-eyed chink posting

>>>/trash/
>>
File: 4chan_feels_frog.png (367KB, 1288x692px) Image search: [Google]
4chan_feels_frog.png
367KB, 1288x692px
>>57676839
But this is the first thing that came up when I googled it. Sorry I'm new to 4chan XD
>>
>>57676882
You could type "anything feels frog" and it would still come up with that same cancerous shit.
>>
>>57676790
wat
>>
>>57676756
thank you. the only thing that scares me is the low level stuff that i'll have to deal with when i try to read models and images and other low level stuff. the rest should be easy. right?
>>
in C, how do I make sure there is no 'gaps' in my struct?
>>
>>57676949
Order your members properly, or use a non-standard extension to make your structs tightly packed, which has some efficiency problems.
http://www.catb.org/esr/structure-packing/
>>
>>57675687

const char* my_enum_str[]

then just test

printf("%s\n", my_enum_str[A]);
>>
File: 1478557647714.jpg (62KB, 840x544px) Image search: [Google]
1478557647714.jpg
62KB, 840x544px
>>57676882
there's nothing wrong with frogposting
>>
>>57677049
You need to fuck off, mate.
>>
>>57677258
I really really like that frog. Can I download it lol?
>>
>>57677258
How does it feel to be one of the most stupid and cancerous posters on this website?
Why don't you go to reddit or facebook, where you would fit in better?
>>
is <threads.h> a thing yet?
>>
File: 1478489849598.png (503KB, 476x503px) Image search: [Google]
1478489849598.png
503KB, 476x503px
>>57677285
it's all yours
>>
File: 573.jpg (158KB, 636x358px) Image search: [Google]
573.jpg
158KB, 636x358px
>>57677317
this is you
>>
>>57674108
PYTHON 3.x help pls
def sending():
friend = UID_01
print("Please input your message")
MESSAGE_01 = input("> ")
print("How many messages would you like to send?")
count = input("> ")
for i in range(count)
sent = client.send(friend, MESSAGE_01)
if sent:
print("Message sent successfully!")

error message
  File "C:\XXXXXXX", line 29
print("How many messages would you like to send?")
^
TabError: inconsistent use of tabs and spaces in indentation
>>
>>57677354
Why are some people incapable of reading error messages?
The answer is literally right there.
>>
File: 1451337320315.jpg (25KB, 400x386px) Image search: [Google]
1451337320315.jpg
25KB, 400x386px
>>57677354
>TabError: inconsistent use of tabs and spaces in indentation
>>
>>57677354
>>57677360
yeah sorry not slept yet and for some reason couldn't comprehend it I thought it was telling me something was wrong with my indentation, fixed it now <3
>>
>>57677354
I'm not sure what the problem is, but I can say with certainty that your indentation is perfectly fine. Must be something else.
>>
Okay, somebody help me here. What exactly that code does?

>>>/wsr/225700
>>
>>57677380
4chan converts tabs to spaces
>>
>API documentation has sample code
>Sample Code doesn't work after entering credentials
Why do people fucking do this? Every fucking time.
>>
>>57677384
It's compressed malicious code. Without knowing intent/running it and looking at what it produces it'd be hard to know.

Most people in your thread will probably just guess but some may recognise it.

Maybe modify it and run it in node.js and print the document output to a file?
>>
I'm just barely starting out. I've been working through the Codecademy stuff for about a week. I know that Codecademy is probably laughable, but someone told me that I should start uploading my tutorial projects to github as soon as possible, to build a solid portfolio. Should I be doing that with my Codecademy stuff, or should I wait until I move onto more advanced stuff? Is it worth perhaps doing it anyway just to get familiar with putting stuff on git?
>>
>>57677532
sure, do it to get familiar but a bit more serious projects matter for a portofolio
>>
>>57674601
Education system hasn't caught up yet, I guess
>>
>>57677532
don't bother, just run through the codecademy stuff as quickly as possible and move on to better things that are more worthy of putting on github
>>
>{{current year}}
>Don't know how to Enterprise quality FizzBuzz

https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
>>
>>57677608
Anon it's a 2 (?) year old meme. Drop it now. You're too slow and it's not funny anymore. We started that shit. We know it exists.
>>
Ok so in python I have
for  i in range (500)
print("yes")

but every 50 I want it to print no how do I do this?
>>
i want to start learning java and would be a beginner with a tiny bit of experience with python and c

what would be the best book to start with?
>>
>>57677750
>but every 50 I want it to print no how do I do this?
Python is not sufficiently advanced enough to solve such problems yet.
>>
>>57677750
 
if(i%50==0):
print("no")
else:
print("yes")

>>57677757
Heads first java is pretty good.
>>
>>57677750
have another variable called j say, which starts at 0, and counts up, and when it reaches 50 you reset it to zero and print "no", otherwise you increment it (add one to it) and print "yes"
>>
>>57677750
for  i in range (500):
print("no" if i%50 == 0 else "yes")
>>
>>57677750
for i in range (500)
print("no" if i % 50 == 0 else "yes")
>>
j = 0
for i in range(500):
if j == 50:
print("no")
j = 0
else:
print("yes")
j += 1
>>
>>57677791
too slow senpai
>>
>>57677784
> another variable
No point. Just print no with every multiple of 50.
>>
File: 9483204.png (29KB, 633x758px) Image search: [Google]
9483204.png
29KB, 633x758px
>>57677798
>>
don't tell him the answer, help him to work it out himself
>>
File: 1478720675087.jpg (296KB, 714x715px) Image search: [Google]
1478720675087.jpg
296KB, 714x715px
>>57677805
>>
>>57677807
No that's pointless. It's such a trivial case he just doesn't know the modulus operator. We should have told him about what it does though.
>>
count to 10. for each of these, count to 49, printing "yes" each time. then print "no" once.
>>
for i in range(10):
for j in range(49):
print("yes")
print("no")
>>
>>57677825
Programming doesn't need more retards who can't solve problems for themselves
>>
>>57677856
>programming doesn't need more retards who haven't been introduced to the modulus operator
That's all we know.
>>
>>57677874
Modulus is usually page 2 in any book, after 'hello world'.
>>
>>57677884
Well he's clearly on page 1 then.
>>
test
>>
So I have a self-defined class Point and a self defined class GeometricObject. Every Geometric Object has a Point called center. A point can be created with a two integers-constructor.

How do I make a constructor that assigns coordinates to a Point? I am trying this, but it shows me a syntactic error.

public GeometricObject (int myX, int myY) {
this.center = new Point(myX, myY);
}
>>
>>57677837
maybe
>>
>>57677975
the function is meant to return a GeometricObject, you have it returning nothing.
>>
In an IT class and my teacher says I cannot use arrays for a sentence; I can only use string manipulation. The problem with this is that if you simply type a letter as your input, it will be identified in the sentence as a word. How to I solve this problem???

sentence = ('words are amazing because they can be used to store information that is easy to read')

word = input("Please enter a word. ")

while 1 == 1:
chars = set("0123456789$!£$%^&*()-_=+¬`{[}]:;@'~#|\<>/.,? ")
if any((c in chars) for c in word):
word = input("Your input is invalid as it contains numbers and/or symbols. Please enter a word. ")
else:
break

if word in sentence:
print('Your word has been identified in the sentence!')
else:
print('Your word was not detected in the sentence.')
>>
>>57677995

it is a constructor, so I thought I dont need a return.
>>
>>57677996
Also, how the fuck do I post scripts properly? I've only ever used the 'Misc' boards and /sci/.
>>
>>57677750
print("yes")  #1
print("yes") #2
print("yes") #3
# ...
print("yes") #49
print("no") #50
print("yes") #51
# and so on
>>
>>57678009
you need to define it with
public void

not
public GeometricObject
>>
>>57677995
No the return for constructors in c++ is implicit.
>>57677975
I'm pretty sure you don't intent that "new" to be there.
If center is a pointer to a point then that's correct. But likely it's just a point stored in the class geometric object. So if you remove the new it should be fine.
>>
>>57678015
code tags
[ code ] [ /code ]
i.e. spoiler tags with spoiler rpelaced with code
>>
>>57678018

but its a constructor. constructors dont need/have a return type, or do they?

>>57678019

thanks, that helped.
albeit Eclipse now claims that Point(int, int) is not defined for GeometricObject. well, i defined the Point constructor in the Point class.
>>
>>57678017
you posting this has just made me realize how I can cut around 80 lines off an old project holy fuck thanks
>>
>>57678019
p.s. If you tell people what the syntax error is then that's far more helpful than just saying 'I have a syntactic error'.
>>57677975
It could also be that you didn't do GeometricObject::GeometricObject()...
If that definition is outside the class declaration.
>>57678018
See
https://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm
I don't blame you for not caring for OOP and or RAII in C++. It's a terrible idea.
>>
>>57678061
>If that definition is outside the class declaration.

its inside the class declaration of GeometricObject.

removing new apparently helped, so now its

this.center = Point (int, int)
>>
>>57677996
tell him you're already using arrays because the sentence is an array of characters. then sneer at him a lot.
>>
poll or select?
>>
>>57678098
epoll/kqueue
>>
>>57677996
find the position of the entered word in the string, check there's a space before and after it? (or start/end of sentence)
>>
so I lied i know Spring in order to get a job

How fcked am I? I have only three days to prepare.
>>
>>57678132
You're fine. Read up on it. Write a basic gui application. It's no problem.

Just work your ass off to gain confidence when you get there.

Then apply yourself at work. They will have some sort of grace period for you anyway.
>>
File: 101291.gif (370KB, 490x750px) Image search: [Google]
101291.gif
370KB, 490x750px
>>57678132
Idk, I've lied my way into a few jobs. I just got people to do shit for me.
>>
File: 1479086973111.jpg (9KB, 400x400px) Image search: [Google]
1479086973111.jpg
9KB, 400x400px
>>57678115
you are exactly the type of person who tells everyone to use Boost when asking about C++ on SO

>me: 1 or 2
>you: 3!
>>
>>57678160
Well anon I'm not him but epoll is better.
>>
>>57678176
I know it's better but I asked which of poll or select is better
>>
>>57678160
epoll and kqueue are literally just more efficient versions of poll/select, especially when working with multiple file descriptors.
If you need your program to be completely POSIX compliant for some odd reason, use poll or whatever, but in the very likely situation that your program only needs to run on Linux, use epoll (or kqueue for FreeBSD).
>>
>>57678183
Why ask that when just knowing epoll well gets you further?

I couldn't tell you because I use epoll
>>
So I'm working on a project that decrypts, decodes and cracks several algorithms but I'm struggling to think of a name so far the only thing I've thought of is DCRD (Decoder/Cracker/Decrypter) anyone got any better ideas?
>>
>>57678098
NOTES
Generally speaking, all operating systems that support sockets also
support select(). select() can be used to solve many problems in a
portable and efficient way that naive programmers try to solve in a
more complicated manner using threads, forking, IPCs, signals, memory
sharing, and so on.

The poll(2) system call has the same functionality as select(), and is
somewhat more efficient when monitoring sparse file descriptor sets.
It is nowadays widely available, but historically was less portable
than select().

The Linux-specific epoll(7) API provides an interface that is more
efficient than select(2) and poll(2) when monitoring large numbers of
file descriptors.

>>
>>57678238
ZCrypt
>>
>>57678238
>DCRD
DiCkRiDe
>>
>>57678271
i-its not ransomware anon
>>
>>57678284
Lol, didn't know it was a thing. XCrypt, YCrypt?
ReCode, CryptoCode
>>
>>57678324
I've just used http://www.nsanamegenerator.com/ got pentagonbreak and decided it'll do for now
>>
>>57675330
>removed
Why are mods over there such huge cucks?
>>
GeometricObject1.getCenterPoint().getX()


why does this fail, telling me "Point.x is not visible"?
yes, the x parameter of a Point object is indeed private, but both getCenterPoint() and getX() are public.
>>
what IDE do you guys use? ive only really used eclipse and im wondering if theres something better i could try
>>
>>57678525

Intellij IDEA, albeit you have to be under 30 and wear skinny fit to not look laughable while trying it.
>>
File: zap zap.jpg (37KB, 500x500px) Image search: [Google]
zap zap.jpg
37KB, 500x500px
>>57678525
Jetbrains IDEs (mostly IDEA and Pycharm), and Visual Jew Code for on the fly editing or small/disorganized projects
>>
>>57678525
vim
>>
λ mapM_ putStrLn $ map (\(a,b) -> take a (repeat ' ') ++ [b]) $ zip [1..] "what the fuck am i doing"
w
h
a
t

t
h
e

f
u
c
k

a
m

i

d
o
i
n
g
>>
>>57678655

what the fuck are you doing
>>
Hey /dpt/ I'm new t9 C++ and I need to make a program that turns a word I input into separate letters i.e I enter 4chan and it outputs as 4 c h a n

What do
>>
>>57678663
Have you cosidererd using a for loop
>>
>>57678663
open IDE, code
>>
File: Capture.png (100KB, 889x587px) Image search: [Google]
Capture.png
100KB, 889x587px
B3
>>
>>57678663
for(char& c : str) cout << c << ' ';
>>
>>57678655
λ mapM_ putStrLn $ zipWith (++) (inits $ repeat ' ') (map pure "what the fuck am I doing")
w
h
a
t

t
h
e

f
u
c
k

a
m

I

d
o
i
n
g
>>
>>57678705
They're fun to play with.
https://www.shadertoy.com/view/Xdt3Dl
What re you doing?
>>
File: debian.png (81KB, 1028x1270px) Image search: [Google]
debian.png
81KB, 1028x1270px
Can someone please run this program in C# and show me the result?

http://pastebin.com/CV07SukP
>>
>>57678762
REEEEEEEEE
fuck you faggot
>>
>>57678762
why don't you do it?
>>
>>57678744
It's a grid of triangles where each vertex is given a random complex number, then through the power of varyings every pixel has a complex number.
I then use the mandelbrot algorithm on the horribly distorted number plane that results.
>>
File: 084.png (102KB, 300x256px) Image search: [Google]
084.png
102KB, 300x256px
>>57677384
>>57677518
http://ideone.com/IGegru

System.IO.IOException: Corrupted data ReadInternal
at System.IO.Compression.DeflateStreamNative.CheckResult (Int32 result, System.String where) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStreamNative.ReadZStream (IntPtr buffer, Int32 length) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] in <filename unknown>:0
at System.IO.Compression.GZipStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] in <filename unknown>:0
at Test.CopyTo (System.IO.Stream src, System.IO.Stream dest) [0x00000] in <filename unknown>:0
at Test.Unzip (System.Byte[] bytes) [0x00000] in <filename unknown>:0
at Test.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Corrupted data ReadInternal
at System.IO.Compression.DeflateStreamNative.CheckResult (Int32 result, System.String where) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStreamNative.ReadZStream (IntPtr buffer, Int32 length) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] in <filename unknown>:0
at System.IO.Compression.GZipStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] in <filename unknown>:0
at Test.CopyTo (System.IO.Stream src, System.IO.Stream dest) [0x00000] in <filename unknown>:0
at Test.Unzip (System.Byte[] bytes) [0x00000] in <filename unknown>:0
at Test.Main () [0x00000] in <filename unknown>:0
>>
File: 2016-11-25_12-05-14.webm (148KB, 668x352px) Image search: [Google]
2016-11-25_12-05-14.webm
148KB, 668x352px
How do i do this on linux?
>>
>>57678817
run it through WINE
>>
>>57678776
What?

>>57678780
I'll have to install a lot of stuff in order to do that.

>>57678800
Good! I still don't understand what it does.
>>
>>57678856
try the Deflate method in the answer here instead of Unzip but you'll need the library at the codeplex link

http://stackoverflow.com/questions/20850703/cant-inflate-with-c-sharp-using-deflatestream
>>
Experimenting with passing blocks in Ruby, so I can get late string interpolation. So far it seems to be working.

@action_queue = []
@vars = {}
@vars[:cash] = 100
def enqueue(&block)
@action_queue.push block
end

def show_message(&block)
enqueue {puts block.call}
end

def set_vars(&block)
enqueue {@vars.merge! block.call}
end

def process_queue
@action_queue.each do |action|
action.call
end
end

show_message {"I have #{@vars[:cash]}"}
set_vars { {cash: 50} }
show_message {"I have #{@vars[:cash]}"}
process_queue
>>
>>57674121
Wha does everyone on this board ... or this entire Website love Anime so much?

I never got into Anime, always thought it was inferior to western Animation.
>3 Animation Frames per second at best
>Practically no lipsyncing
>Glossy haired dumb looking protagonists everywhere
>sexual things implied with 9 year old Girls, which is gross

proove me wrong faggots
>>
>>57678817
ncurses
>>
>>57678078
Did you come from java? In cpp you can allocate statically and the owning class destructor will call that member's destructor. 'new' would be used if center was a pointer to dynamically allocate in which case you'd have to free the data yourself with delete when you are done with it.

Btw, look at initializer list for when you initialize variables in constructor.
>>
How do I remove instances of certain characters from a string in C?
>>
>>57678937
epic b8 my dudesage
>>
>>57678937
it started out as an anime website

i don't like anime tho
>>
>>57678937
Because it was founded and first used by posters from somethingawful's anime sub forum and is based on 2channel/2ch
>>
>>57678937
It's an anime website you fucking retard, get a clue
>>
>>57678937
>sexual things implied with 9 year old Girls, which is gross

See, that's where you're wrong, kiddo.

*teleport behind you*
nothing personell, kid
>>
if(!x)

means

if(x != NULL)


right?
>>
>>57679109
if (x != 0)
>>
>>57679124

so
if(x)

means
if(x == 0)


?
>>
>>57679141
whoops, other way around
>>
>>57679109
Don't ever use
if(!x)

in your code. It pretty much means to flip whatever is next to it to the opposite truth value.
A "true" value would become "false". And a "false" value will become "true."

But it's much better to just say
 if( x==0 ) 
>>
>>57679185
C doesn't have true or false
>>
>>57679185
Are you the type of person who does
if (x == false)

:^)
>>
>>57679196
Yes. It compiles to the same assembly, but == false is more readable

>>57679195
#define false 0
#define true 1
>>
so

if(!x)


means

if(x != 0)


or not?
>>
>>57679216
typedef enum { false, true } bool;
>>
>>57679216
>but == false is more readable
>>
>>57679216
>but == false is more readable
wtf... how is that more readable than
if (!x)

?
>>
>>57679216
i prefer to explicitly compare with 0 and null but for booleans == false is just clutter, you pretty much never see it outside of programming 101
>>
>>57679257
Because the transformations the compiler has to do for !x is different than == false.
== false is what the compiler does in its intermediate program representation usually (the final product depends on platform).

It's closer to the computer, it's trivially similar so it's simply BETTER to think that way.

Unless you consider the typing to be a major time waste of your programming time in which case maybe step it up and get some WPM instead of sitting here on 4chan writing 13 word posts..
>>
if(!x) means if(x == 0)
>>
>>57679278
stop it

>>57679282
meant for:
>>57679234
>>
>>57679278
>Because the transformations the compiler has to do for !x is different than == false.
That has literally nothing to do with readability. And if you're using an optimising compiler then most of your code cannot be guaranteed to look anything like what's outputted.
>>
>>57679278
the compiler can optimize it just fine, you should do the more readable option
>>
>>57679246
>>57679257
Jesus christ. Just get a job you neets and learn what it's like reading other people's code.

You
 DON'T 
want to be that guy who spends all day troubleshooting an issue because he didn't see there was a "!" in the if statement. And you most certainly don't want to be the guy who gets the blame for writing unreadable code
>>
>>57679306
>And you most certainly don't want to be the guy who gets the blame for writing unreadable code
The question was, how is "== false" more readable. Thanks.
>>
>>57679292
It has if you're a programmer and not a 'programmer'.
>>57679299
Didn't get my point.
>>57679306
Interesting point but I'm not sure it's true that people just ignore bangs.
>>
>>57679195
>C doesn't have true or false

>#include <stdbool.h>

lmaooo
>>
>>57679306
this is painful bait
>>
>>57679324
>It has if you're a programmer and not a 'programmer'.
why? All you've said so far is basically
>because I say so.
You'd be fired pretty quick from where I work for autistic dribble like that.
>>
>>57679306
How the fuck is "!" less readable?

if (!contains(table, key)) {
insert(table, key);
}


versus

if (contains(table, key) = false) {
insert(table, key);
}


The first one is so much more readable. You literally read it as "If NOT contains table key"
>>
>>57679375
#define NOT !
>>
>>57679400
#define NOT(p) ((p)?0:1)
>>
>>57679345
>autistic dribble like that.
Well maybe you work in a 'programming' place.

I've explained sufficiently. If you feel your compiler doesn't generate the right code you look at why and how to fix the compiler. Not how to rewrite your code to make the compiler 'get it'.

If you're genuinely interested here's a nice talk which may not explain my view on this logical operation but it should let you sympathize better with the view that the compiler and understanding the compiler is important.
https://www.youtube.com/watch?v=yG1OZ69H_-o
It's not this static thing you have to deal with. It's part of the development process.
>>
#define ((void*)0) nil
typedef enum { false, true } bool;

where b is a bool: if(!b)
where p is a pointer: if(p == nil)


Now stop arguing and get on with things.

>>57679375
>>>>>>>>>>>>>= false
No wonder you're whining about non-issues.
>>
>>57679415
Why shouldn't one do
<code>
using namespace std
</code>

and instead do

<code>
std::vector<std::string> v;
</code>
>>
>>57679375
IMO the second one is more readable desu
>>
>>57679400
!x
>>
>>57679433
second one wont compile
>>
>>57679422
>>>>>>>>>>>>>>= false
>No wonder you're whining about non-issues.

Fuck. Touché.
>>
>>57679446
I didn't notice that you weren't actually advocating that guy's "you can't read exclamation points" bullshit anyway.
>>
File: 1464363461408.jpg (110KB, 1279x720px) Image search: [Google]
1464363461408.jpg
110KB, 1279x720px
>>57679442
==
>>
>>57679433
disagree
>>
>>57679329
>stdbool
is a fucking joke, an embarrassment
>>
>>57679400
#define NOT !
printf("Good idea anon. NOT!")

>>57679415

printf("Actually a good idea anon.") 
if (typingBang == NOT(yourPreference)
return EXIT_SUCCESS;

>>57679431
Because the namespace is there for a reason. You can do
using namespace std; 

inside a scope where you want to save on the typing, preferably a small scope.
>>
>>57679466
Agree (with you)
>>
>>57679474
it's better than defining your own bool type every time
>>
>>57679487
C should've already had one
>>
>>57679487
>it's better than *including* your own bool type every time
How?
>>
>>57679474
how so?
>>
>>57679234
not
>>
>>57679475
>
"Good idea anon. NOT!"

>NOT!
NOT of !, so true?
So good idea?
>>
>>57679498
Too advanced for compilers back then DESU.
Wiser to let people understand the implications by writing it themselves.
>>
>>57679499
#include <stdbool.h> is short
>>
#define NOT! !
>>
>>57679475

What exactly is a namespace and how do you use it? I come from a C background but decided to use C++ for one of my projects because vectors make my life a more easier than using just plain old arrays.
>>
>>57679420
>hurr, ya dum
compelling argument.

That video has nothing to do with "== false". Using !x is not undefined behaviour at all. It's just shorthand for "== false"
>>
>>57679498
Why? int works just fine.
>>
>>57679539
It's a space for names (variables, functions and types), like a scope
>>
>>57679539
instead of muh_namespace_foo which pollutes the global namespace you have muh_namespace::foo etc and you can put using namespace muh_namespace in functions (and in global scoope) so you can use variables like foo comfortably
>>
New thread: >>57679595
>>
Hey Csauce, Tcl here!

Predicates. They're everywhere. Sometimes you have to deal with a lot of them in a single conditional statement, and it can get pretty dizzying to read because you can barely tell where the predicates end and the block begins. There's a simple trick for when you don't want to admit that you're using pig disgusting Allman bracing to make these multi-line statements WAY easier to read.

#define then

if(p != NULL && p->u.safe &&
p->s != NULL && p->s->whatever == NICE_CONSTANT_DUDE &&
strcmp(p->r.factofthematter, "faggots") == 0)
then{
immanentize(cpu, p);
flushchan();
freething(p);
return 0;
}


>>57679498
int
>>
Which is more efficient?

Calling this 50 times
JNIEXPORT jfloatArray JNICALL Java_finnstr_libgdx_liquidfun_ParticleSystem_jniGetParticlePositionBufferX(JNIEnv* env, jobject object, jlong addr) {
b2ParticleSystem* system = (b2ParticleSystem*)addr;
int32 count = system->GetParticleCount();

jfloatArray array;
array = env->NewFloatArray((jsize) count);

jfloat fill[count];
for(int i = 0; i < count; i++) {
fill[i] = system->GetPositionBuffer()[i].x;
}

env->SetFloatArrayRegion(array, 0, (jsize) count, fill);
return array;
}


Or calling it once, creating a new Java Array and cloning the values, and then reading each value.
>>
Unemployed Haskell programmer checking in
>>
>>57679799
Or, what if I did something like and called this 50 times? I don't know how expensive using JNI is.

JNIEXPORT jfloatArray JNICALL Java_finnstr_libgdx_liquidfun_ParticleSystem_jniGetParticlePositionBufferX(JNIEnv* env, jobject object, jlong addr) {
b2ParticleSystem* system = (b2ParticleSystem*)addr;

// I don't know c++ syntax
float positionX = system->GetPositionBuffer()[i].x;

return positionX;
}


Pls respond
>>
>>57679852
Ask on the new thread >>57679595
>>
>>57679872
thank you anon, i have both tabs open but posted in the wrong one <3
>>
>>57679799
>>57679852
Go to the new thread.
But generally if you have a lot of object initialization in your functions as you have in >>57679799 Produce the result and copy it.

Also always profile your code when you care about performance. Write both and compare.
>>57679851
Do you get to wear girl-socks?
>>
>>57679889
thank you anon

>Also always profile your code when you care about performance. Write both and compare.
How do I do this?

I will need to call either function 2-600 times (an average of ~50).
>>
>>57679936
call the function in a loop with System.nanoTime() before and after. since it's JNI the function call won't get optimized away.
Thread posts: 337
Thread images: 26


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