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

/dpt/ - Daily Programming Thread

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

Thread replies: 318
Thread images: 49

What are you working on, /g/?

Old thread: >>59536938
>>
C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't have dynamic method loading/creatin
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry. If you want guaranteed memory exploits and security vulnerabilities in your program with timesink development period then use Assembly, not C.
>>
>trying to argue with C and C++ niggers about types
>they think polymorphism means inheritance and nothing else

What is the final solution to the OOP question?
>>
Thank you for posting an anime pic.
>>
File: FP.png (190KB, 2440x1228px) Image search: [Google]
FP.png
190KB, 2440x1228px
>>59538462
>muh zygohistomorphic prepromorphisms
>muh garbage collected 1 gb per second
Take it to the functional programming thread general, will ya?
>>
>>59538485
>C++
>1 gb of template error messages per second
>>
>>59538426
C is a portable assembly. Use it as such.
>>
>>59538485
VLC wanted to adopt haskell for some security concerns last year, after seeing the performance they quickly fucked off. In a Google talk they were saying they were going to adopt some Rust into their codebase after Rust v1 came out
>>
>>59538508
Just report and hide.
>>
>>59538521
Truth hurts, doesn't it?
>>
>>59538537
don't reply anymore please
>>
>>59538537
>Incorrect
lol no
>>
>>59538521
>>59538537
Butthurt C tards thinking it's their shitlang safe place
>>
Dear anti-C fags: I can write a competent computer game in C and none of you fags will be able to say it's not competent

Dear anti-C++ fags: I can write a competent computer game in C++ and none of you fags will be able to say it's not competent
>>
>>59538556
What is a "competent computer game" ?

Btw, I love both C and C++
>>
>>59538560
A computer game that's competent at being a computer game
>>
This thread is doomed from the start.

Good job.
>>
Using C is like multiplying 6 digit numbers manually and feeling smug about it.
>>
>>59538564
What are you trying to imply with that tautology?
>>
>>59538496
>Rebrand Atom
>Rebrand Xamarin

wtf I love open source
>>
>>59538572
Well put
>>
>>59538572
Couldn't agree more
>>
>>59538426

>mum, I posted it again!
>>
Using C++ is like punching your own dick and feeling smug about it.
>>
>>59538585
Does C have function overloading?
>>
File: Screenshot_20170315-203433.jpg (620KB, 1411x1056px) Image search: [Google]
Screenshot_20170315-203433.jpg
620KB, 1411x1056px
>mfw edgelords shit on the two languages that serve respectively as the father of all modern procedural programming and the father of all modern object oriented programming
>>
>>59538572
C tards rekt

MUUUH POINTER AUTISM
>>
>>59538590
>the father of all modern object oriented programming
I wish I could go back in time and assassinate bjarne
>>
>>59538588
Partially, with C11 _Generics.
>>
>>59538590
>father of all modern object oriented programming
That's not a good thing.
>>
>>59538599
Weird way of saying "no"

Does C have exception handling? y/N
>>
>>59538598
why would you do that when object oriented programming, particularly using mixins, is the only sane way to write a computer game
>>
>>59538606
except it isn't
>>
>>59538590
>father of procedural programming
What is ALGOL 60

Hell, even Fortran outdates C.

>father of all object oriented programming
What is Simula-67 and Smalltalk
>>
>>59538601
why would you say that when object oriented programming, particularly using mixins, is the only sane way to write a computer game
>>
>>59538605
>Weird way of saying "no"
Simply ebin xDDDDD

>Does C have exception handling? y/N
Yes, with setjmp/longjmp (and more so with signals to catch faults as well)
>>
My rule of thumb:

Will I be using strings?

If yes, don't use C.
If no, it's ok to use C.

I would write a music program in C for instance, since music is just numbers and is time-sensitive.
>>
>>59538612
OOP is a fucking terrible way to write games, or any software.
Good job fucking up your cache.
>>
>>59538608
try to write a game procedurally and have it be easy to add content to (hint u can't)
>>
>>59538617
>with setjmp/longjmp (and more so with signals to catch faults as well)
Is there any standard try..catch..finally syntax or is it just some poor hackjob?
>>
>>59538621
>OOP is a fucking terrible way to write games
it's basically the only way to write games, procedural game development is pure agony
>>
>>59538621
>hurr durr muh OOP is bad for muh cache
Looking up a vtable entry (even if you actually do so, not all functions are virtual), does not necessarily flush the cache. It's also instruction cache bound, so it doesn't affect the data cache.
>>
>>59538508
/dpt/ have already compromised C and Haskell by putting its filthy hands on it. You'd better stick to Python, schoolkids.
>>
>>59538618
>My rule of thumb:
Will I be writing a kernel
>yes
Might use C or assembly
>no
Stay the fuck away from C
>>
If I want to write library to be used in higher level languages, what options I have other than C and sepples with extern "C"?
>>
>>59538618
I've actually been thinking about writing an audio analysis program for a while now, and I expect it to be extremely computationally intensive.
I wouldn't imagine not using C for it.
>>
>>59538631
>it's compromised
>teleports behind you
>"this is fro compromising my language, kid"
>reveals katana
>kiils a school kid
>>
>>59538618
strings are just numbers tho
>>
>>59538630
>It's also instruction cache bound, so it doesn't affect the data cache.
Are you fucking retarded?
Why on earth wouldn't that shit be data cache bound? Go look at Mike Acton's data-oriented design talk, you idiot.
>>
File: 1477832140687.png (546KB, 800x900px) Image search: [Google]
1477832140687.png
546KB, 800x900px
>tfw C was adopted as the industry standard and not Ada

i've been reading about that neuro-evolution of augmenting topologies and though I'd do something with that, but i dont know what because i dont want to do le ebin nintendo emulator ai
>>
>>59538644
Computer are just electrons tho
>>
File: 214.jpg (33KB, 615x630px) Image search: [Google]
214.jpg
33KB, 615x630px
>>59538642
>>
>>59538627
>Is there any standard try..catch..finally syntax
This is not necessary for implementing exceptions. C++ and Java does not have an exception monopoly.

But to answer your question, you can implement a try - catch-like structure using setjmp and longjmp, yes. But you're not limited to it.

Also remember that setjmp in C isn't like C++ exceptions, because C doesn't have RAII (at least not without compiler instructions). setjmp merely rolls back registers and state to a execution point, but you need to take additional considerations.
>>
>>59538642
/dpt/ just don't understand what they're talking about, kiddo. C and Haskell are just fancy words for /dpt/ and tools for actual pros.
>>
File: 1489777651506.png (2MB, 3772x756px) Image search: [Google]
1489777651506.png
2MB, 3772x756px
OOP is necessary for writing games, you cannot write procedural games.

Games basically cannot be written procedurally.

You need OOP. If you, are writing a game
>>
>>59538618
>arrays are hard
>>
>>59538605
In the standard? No.
As a single file library? Yes.
>>
>>59538667
Arrays\0 are\0 not\0 hard\0 but\0 check\0 out\0 my\0 C\0 sckillz\0
>>
>>59538588

>hitler dubs
>confirmed for fascist opinion

You're missing the point, your assupmtions are wrong. Windows, Linux and most production software does perfectly fine without "function overloading".


Some hints:
-YAGNI and KISS are still valid design principles.
-Abstractions always come at a cost.
-Linus made clear why C++ is not acceptable for Linux.
-There is no silver bullet, each language has certain advantages and disadvantages.
>>
>>59538645
i saw a youtube film and now i think i understand caches - the post.

Function code does not reside in the data cache. A simple address lookup is a mere 4-8 byte index into a table, you fucking tool. But I bet you think data structures such as hash tables are cache-unfriendly too, don't you?
>>
>>59538677
that's not C
>>
>>59538682
>Linux
Isn't that literally the worst kernel in existence?
>>
>>59538682
tell me one (1) disadvantage with using Ada
>>
File: robbie_rotten.jpg (119KB, 1252x1252px) Image search: [Google]
robbie_rotten.jpg
119KB, 1252x1252px
OOP IS IMPORTANT BECAUSE GAMES CANNOT BE WRITTEN PROCEDURALLY WITHOUT OOP, WHICH IS IMPORTANT FOR WRITING GAMES.
>>
>>59538682
Rust gives abstractions with practically no costs
>>
>>59538689
It tickles my autism that it's named after a cockslut who grabbed all the fame and attention from Charles Babbage.
>>
>>59538689
No one uses it.
>>
>>59538689
Pascal was better.
>>
>>59538686
because C doesn't have strings
>>
>>59538682
>-Linus made clear why C++ is not acceptable for Linux.
1) Linus' point is based on an outdated understanding of pre 1998 C++ and his view on programmers and developer culture, more than the actual language

2) Linus is a twat

3) Linus has programmed in C++ himself for other projects
>>
File: 3e8.jpg (15KB, 367x390px) Image search: [Google]
3e8.jpg
15KB, 367x390px
YOU NEED OBJECT ORIENTED PROGRAMMING WITH MIXINS TO WRITE GAMES.

THEY ARE NECESSARY, IF YOU WANT TO WRITE GAMES.
>>
>>59538713
Ok
>>
>>59538694
please dont trash-talk my wife

>>59538697
sure they do, mostly maintenance of old stuff though

>>59538699
nah my man
Ada safer, better at concurrency, more features, much more readable, easily maintained, more suitable for real-time applications etc etc
the only thing pascal is used for is stuff its unsuitable for
pascal is also very minimal
pascal is a language for children
>>
>>59538713
Thanks I will remember that
>>
>>59538703
> I got those C fags now
>>
>>59538713
>>59538690
b-but i don't want to use OOP bjarne
please let my family go
>>
>>59538710
>his view on programmers and developer culture
I believe this is still completely relevant.
>the actual language
A lot of the criticisms of C++ now apply 10-fold to what they used to.
>2) Linus is a twat
Nice actual ad hominem, fuckface.
>3) Linus has programmed in C++ himself for other projects
If you're talking about that dive log program, I'm pretty sure that's just there because it uses Qt.
>>
>>59538726
>C white night status
>PROTECTED
>>
>>59538724
>mostly maintenance of old stuff
Which is a disadvantage to using it.
>>
>>59538688

>hitler dubs again

It has grown incredibly, but every project of that size and age would be hard to maintain after a while. It's the simple laws of complexity and software engineering, nothing to do with C.


>>59538689

I have no problem with Ada, it's a little bit anal about some things where C feels more "flowing" to me, but Ada has a beautiful syntax. Too bad nobody uses it (unless you count some exotic stuff like F-22).


>>59538693

Not true. "Costs" can mean a lot of things, i.e. it's way harder to learn Rust than C. Also Rust is young and immature, they will probably deprecate some things in the future and find more problems.
Furthermore Rust is over engineered. That's why why Go (which is sharing the C philosophy) is getting traction and Rust is not.
>>
>>59538710
>Linus has programmed in C++ himself for other projects
This hurts a C tard
>>
File: 52200267.jpg (17KB, 400x267px) Image search: [Google]
52200267.jpg
17KB, 400x267px
>>59538727
YOU ARE NOT GAMES.
IT AM WRITE ARE THE DO GAMES WITH AN FOR OOP.
>>
File: 8b2.png (184KB, 500x308px) Image search: [Google]
8b2.png
184KB, 500x308px
>>59538736
VERY NICE REFERENCE TO MEME!!!!
(you must use oop to write game)
>>
>>59538741
>you must use oop to write game
I am paid to do so...
>>
>>59538746
YOU ARE EQUIVALENT TO MONEY
>>
File: 12506712512.jpg (41KB, 960x960px) Image search: [Google]
12506712512.jpg
41KB, 960x960px
>>59538737
>>59538741
>>59538713
>>59538690
>C manlet angry again
>>
Rate my tail-recursive reverse, /dpt/!

(define reverse
(lambda (list)
(define reverse-in
(lambda (tsil list)
(cond
((not (null? list))
(reverse-in (cons (car list) tsil) (cdr list)))
((null? list)
tsil))))
(reverse-in null list)))
>>
>>59538749
Take your autism pill, C Tard
>>
File: 1490262729573.jpg (84KB, 648x720px) Image search: [Google]
1490262729573.jpg
84KB, 648x720px
>C++ can't even handle infinitely recursive self instantiating types
>>
File: 51TouNKOUwL.jpg (47KB, 352x500px) Image search: [Google]
51TouNKOUwL.jpg
47KB, 352x500px
>>59538753
>>59538756
USE C++ TO WEIRTE AN GAME.

AM GAME WRITE!!!!!!!!!
(GAME)
>>
>>59538754
    #include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
};
void insert(struct node **head,int x)
{
struct node *newnode= new node[sizeof(node)];
newnode->data = x;
newnode->next = *head;
*head = newnode;
}
void display(struct node *head)
{
while(head!=0)
{
cout<<head->data<<"->";
head=head->next;
}
cout<<endl;
}
struct node * reverse(struct node* newnode,struct node **head)
{
if(newnode->next==0)
{
*head = newnode;
return newnode;
}
else
{
struct node *prev = reverse(newnode->next,head);
prev -> next = newnode;
newnode -> next = 0;
return newnode;
}
}
int main()
{
struct node *head = 0;
int n=10;
while(n!=0)
insert(&head,n--);


display(head);

reverse(head,&head);
display(head);
return 0;
}
>>
>>59538761
You can create a compiler in C++ for your language which handles infinitely recursive self instantiating types
>>
File: IMG_20170207_0830208.png (634KB, 1015x602px) Image search: [Google]
IMG_20170207_0830208.png
634KB, 1015x602px
>>59538761
>tfw your infinitely recursive self instantiating type language can't even handle mixins
>>
>>59538767
>>59538737
>>59538741
>>59538713
>>59538690
C people are mentally ill, aren't they?
>>
>>59538786
MEME
>>
File: 1467821966170.gif (662KB, 500x446px) Image search: [Google]
1467821966170.gif
662KB, 500x446px
>>59538774
but i can do that in any other language too

>mfw the AST for that language you are speaking of cannot be written in HOAS in C++ because to do so would be an infinitely recursive and self instantiating type

>>59538785
>mixins
this isn't the 90s
nobody wants your struct++'s
>>
>>59538729
>I believe this is still completely relevant.
Then you are the one adhering to an ad hominem. If your problem with C++ is not the language itself, but some preconception you have created yourself as a result of residing within your safe bubble about a community you know nothing about, then that is the true ad hominem.

>Nice actual ad hominem, fuckface.
That's not an ad hominem

https://the-orbit.net/lousycanuck/2011/09/15/what-is-an-ad-hominem-what-isnt/
>>
File: SO tags.png (49KB, 251x349px) Image search: [Google]
SO tags.png
49KB, 251x349px
>>59538724
>heaps of people use Ada
>tfw sjw meme language has a bigger community
>>
>>59538793
Just talk to a doctor and say C has given you chronic autism
>>
>>59538794
>but i can do that in any other language too
Yes
Why argue then?
>>
>>59538794
>>mixins
>this isn't the 90s
Doesn't matter, mixins are still non-negotiably necessary for properly writing games
>>
>>59538795
You clearly stated "Linus is a twat" as an argument in itself.
Read your own link, you stupid fuck.
>>
>>59538809
>>>/v/
>>
>>59538802
NEED MIXIN TO WIRETE GAM
>>
>>59538821
Yeah say that too. Mental clinics are made for C tards
>>
File: 20170321_070938.png (595KB, 781x739px) Image search: [Google]
20170321_070938.png
595KB, 781x739px
>>59538819
>he doesn't respect game programming as a legitimate subordinate discipline of computer science
>>
>>59538827
It's not, though.
>>
python3

infile = "./nigga.bin"
offsets = [0x123421, 0xFEDA232, 0x123, 0x525234]

def myFunction(offset, size):
#what do i need to write here so it goes to the file's address 'offset' and reads 'size' amount of bytes to an array I can manipulate inside this function and return so it overwrites the original 'size' bytes at 'offset' ?
return newBytes

myFunction(offsets[0], 0x20)
#^ when I run that function, 32 bytes at offset 0x123421 have been changed


pls help
>>
>>59538830
yes it is
>>
File: 1489780105963.gif (2MB, 502x474px) Image search: [Google]
1489780105963.gif
2MB, 502x474px
>>59538827
YOU'RE RIGHT I DON'T
I THINK IT IS COMPARABLE TO WEB DEVELOPMENT
>>
>>59538825
KUMQUAT
>>
>>59538814
Stating that Linus is a twat is not an adhominem in itself. If my central point was that Linus is a twat, then yes it would have been. However, my central point is that his famous rant from a literal decade ago are the result of him being tucked away in his safe-bubble and knowing nothing about the subject he was talking about. So in other words, it's just an argument with an insult slapped on it. That's not an ad hominem fallacy
>>
File: Screenshot_20170323-024248.jpg (352KB, 1410x644px) Image search: [Google]
Screenshot_20170323-024248.jpg
352KB, 1410x644px
>>59538843
>he doesn't respect web development as a legitimate subordinate discipline of computer science
>>
>>59538814
>You clearly stated "Linus is a twat" as an argument in itself.
No, he didn't.
>>
File: 1489794524837.png (299KB, 480x336px) Image search: [Google]
1489794524837.png
299KB, 480x336px
>>59538861
BECAUSE IT ISNT
>>
File: 20170323_042154.jpg (435KB, 629x1410px) Image search: [Google]
20170323_042154.jpg
435KB, 629x1410px
>>59538874
>he doesn't respect calling Linus a twat as a legitimate subordinate discipline of web development
>>
>>59538847
>>59538874
You fucking listed it alongside other arguments with a number and everything.
You were clearly putting it forward as an argument, even if that isn't what you intended.
>>
>>59538884
Can I get a PhD in calling Linus a twat?
>>
>>59538885
>You fucking listed it alongside other arguments with a number and everything.
Exactly, which means that it in no fucking way was an argument by itself.

Are you genuinely retarded?

>You were clearly putting it forward as an argument
What the fuck are you even rambling about, you autist?

>inb4 hurr durr ad homimem!!!!!!!
>>
>>59538885
>everything I don't like is an ad hominem attack - the post
>>
>>59538904
>which means that it in no fucking way was an argument by itself
You can't be fucking serious.
Any reasonable person would implicitly read that as
>Here are the 3 premises to my argument, for which I draw my conclusion
>1) ...
>2) Linus is a twat
>3) ...
>>
File: 20170323_042703.png (2MB, 1185x1328px) Image search: [Google]
20170323_042703.png
2MB, 1185x1328px
>>59538899
probably

>>59538879
>he doesn't respect yes it is as a legitimate subordinate discipline of shut the fuck up you elitist trash
>>
File: tmp_3891-1489632943864917414763.gif (172KB, 500x506px) Image search: [Google]
tmp_3891-1489632943864917414763.gif
172KB, 500x506px
>>59538754
Rate my tail-recursive append, /dpt/!
(define append
(lambda (list1 list2)
(define append-in
(lambda (tsil1 list1 list2)
(cond
(and (null? tsil1) (null? list1)) list2)
((null? tsil1) (append-in (reverse list1) null list2)
((null? list1) (append-in (cdr tsil1) null (cons (car tsil1) list2))))))
(append-in null list1 list2)))
>>
>>59538920
>elitism
the goto insult of the lowest class scum
>>
>>59538919
Yes, three premises. Not one. How fucking autistic do you have to be to completely look aside from my main and first premise and have a mental breakdown over the word "twat"?
>>
>>59538937
I don't know Lisp but that is a very nice animated anime girl gif
>>
File: super-retard.jpg (23KB, 499x376px) Image search: [Google]
super-retard.jpg
23KB, 499x376px
>>59538919
>a premise for an argument is an argument in itself
>>
>>59538947
>>59538956
Read your own fucking link.
>An ad hominem fallacy is constructed something like this.
>Premise 1: You are an idiot.
>>
File: 20170323_043500.png (3MB, 1430x1784px) Image search: [Google]
20170323_043500.png
3MB, 1430x1784px
>>59538943
>he's such an elitist that he gets called elitist often enough to even be elitist about the way people call him elitist
>>
File: 20170302_223608.jpg (25KB, 201x170px) Image search: [Google]
20170302_223608.jpg
25KB, 201x170px
>>59538943
>he uses goto
>>
File: sasaki.jpg (103KB, 390x600px) Image search: [Google]
sasaki.jpg
103KB, 390x600px
>>59538987
I AM elite
>>
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r0.html

wow, we really need this
>>
>>59538953
>I don't know Lisp
Do you want to learn it?
>>
File: 1476005453310.png (689KB, 1520x1080px) Image search: [Google]
1476005453310.png
689KB, 1520x1080px
>>59539014
>people are still defending this language
>people are still defending this language
>people are still defending this language
>people are still defending this language
>people are still defending this language
>>
>>59538754
>>59538937
How much do these abstractions cost?
>>
>>59539043
$10.99
>>
>>59539022
but it gets even better: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0611r0.html

let's deprecate ^ just so we can use it as exponentiation operator later
>>
File: .png (4MB, 3127x3566px) Image search: [Google]
.png
4MB, 3127x3566px
>>59539013
>he's such an elitist he's willing to plainly declare himself elite
>>
>>59539056
can't wait to see all those overloaded
>>
File: sepples.png (113KB, 1908x976px) Image search: [Google]
sepples.png
113KB, 1908x976px
>>59539056
Holy shit!
>>
>>59539022
That's because it's the superior language.
Reasons:
>1) it's the superior language for game development
>2) game development is the superior reason for using a language
>>
>>59539075
it's just a proposal, but who the fuck comes up with this stuff
>>
>>59539064
Don't talk to your superiors without their permission.
>>
>>59538754
>>59538937

It's like... you could abstract out the list recursion into a function that takes a function and applies it.
>>
Is it possible for an algorithm's worst case to have an upper bound different from its lower bound?
>>
Fixed a memory leak that caused my daemon which organizes incoming sequence data to bloat up to using 40 gigs of RAM over a few hours.
>>
>>59539014
>
// Note: “for (auto& x : f().items())” is WRONG


What did they mean by this?
>>
>>59539132
We may never know
>>
>>59539132
Are Pajeets just trying to troll or are most(all) sepples users just fucking mental?
>>
>>59539132
probably because it's trying to bind temporaries to a reference
>>
File: .gif (2MB, 480x640px) Image search: [Google]
.gif
2MB, 480x640px
>>59539092
>>
>>59539160
Are you here to waste my time, you pleb?
>>
>>59539169
As long as you think game development isn't a real field of study, yes, I am.
>>
>>59539178
I could be even more wasteful of my time.
I could be developing games.
>>
File: .png (579KB, 781x739px) Image search: [Google]
.png
579KB, 781x739px
>>59539191
>he doesn't respect game programming as a legitimate subordinate discipline of computer science
>>
File: 1457274399165.jpg (44KB, 544x529px) Image search: [Google]
1457274399165.jpg
44KB, 544x529px
>>59539199
I don't respect computer science either
>>
>>59539107
Could you explain?
>>
Does a tight bound (big Theta) have the same upper and lower bounds, or does it just mean we know the upper and lower bounds and they're not necessarily identical?
>>
File: what-a-tweest.gif (421KB, 480x360px) Image search: [Google]
what-a-tweest.gif
421KB, 480x360px
>>59539218
>>
>>59539253
tight bound means the lower bound is accurate as well; big O is just an upper bound
>>
I have a list of lists in Python; is there a way to check all these lists are empty?

>>> list = [[],[],[]]
>>> for i in list:
... if not i:
... print("asdf")
...
asdf
asdf
asdf


is what I currently have but I'd rather not have it go off for each thing in the list
>>
>>59539301
none that would not involve iterating over them
>>
>>59539132
>>59539143
>>59539147
>>59539149
http://en.cppreference.com/w/cpp/language/range-for

The lifetime of something within but not returned by a range expression isn't extended. You can't bind a non-const lvalue to an rvalue. Thus, to do this:
for (auto& x : f().items())


You'd need to use either const auto& (to allow binding of lvalue to rvalue) or auto&& which is an rvalue reference itself.
>>
>>59539301
Make it a function so that you can jump out with a return.
def all_empty(list):
for i in list:
if i:
return false
return true
>>
>>59538415
>OP image
>still liking yuki nagasaki
>>
>>59539332
auto&& would be a forwarding reference in this context
>>
>>59539334
just use:
if not any(lst):
print("all sublists empty")


Also, don't overwrite builtins using variable names. It's bad practice!
>>
File: Untitled.png (67KB, 1298x523px) Image search: [Google]
Untitled.png
67KB, 1298x523px
just finished a very crude ATA driver for my kernel
>>
>>59537612
Can anyone help?
>>
>>59539425
what are you trying to do here
>>
>>59539422
very inspiring anon
>>
>>59539288
Ok, so you could say that the lower bound (big Omega) is different from the upper bound (big O) in a tight bound (big Theta), and be correct?
>>
>>59539365
Impressive knowledge. Are you a C++ programmer?
>>
>>59539425
Why are you trying to fill a string from data without accessing the data?
>>
>>59539510
not sure if you're being sarcastic, but yeah
>>
>>59539520
I'm not being sarcastic. How tricky do C++ interviews get?
>>
>>59538835
If you read the docs on file objects this will be clear to you.
>>
>>59539583
Heh, I don't know, I really have only been a hobbyist up to this point.
>>
>>59539453
>>59539512
Its meant to return a string that represents a minefield with '*' that represents the mine & numbers as unmined tiles.

The neighbouring tiles to a mine is incremented by 1 each time by the minetile method.
>>
>>59539640
For example:

00011212*1
0112*3*532
02*434***1
03**3*4*31
02*6*32110
023**20000
01*3222210
122212**10
1*11*22210
1111110000
>>
>>59538754
(defun reverse2 (list)
(let ((l '()))
(mapcar (lambda (x) (push x l)) list)
l))
>>
>>59539640
>>59539652
I don't understand why you want to do this even though you've calculated the number of neighbor mines already.

You could lay all the mines in the string while using placeholders for the numbers, then go back and do the neighbor counting again on the placeholders.

This violates DRY, though. Also, given String's immutability, you should think about using StringBuilder or StringBuffer depending on your needs.
>>
File: 1445975038825.jpg (28KB, 331x311px) Image search: [Google]
1445975038825.jpg
28KB, 331x311px
>>59538426
This thread went from who can write the least readable fizz and buzz problem to absolute shitposting I have no clue what I am talking about and thinking that languages we have no replacement for are absolute tier.

Man, serious question. Does anyone here even work as a developer somewhere?
>>
>>59539673
It's CL, I write in Scheme
>>
>>59539758
>Does anyone here even work as a developer somewhere?
Yes.

I know for a fact from talking to other anons that frequent /dpt/ on non-4chan channels that there are other developers besides me here, too.
>>
>>59539766
It's Scheme, I write in CL
>>
>>59539758
Did someone say fizzbuzz?
#.(loop for i from 1 to 100 do
(format t "~:[~:[~a~;Buzz~]~;Fizz~:[~;Buzz~]~]~%~@*" (zerop (mod i 3)) (zerop (mod i 5)) i))
>>
Are upper (O) and lower (omega) bounds always identical in a tight bound (theta)?

E.g. O (n) = Omega (n) = Theta (n)
>>
>>59539873
>Are upper (O) and lower (omega) bounds always identical in a tight bound (theta)?
Yes.
>>
>>59538785
I squat 160kg 5x5 and my calves are not the half of his.
>>
>>59539873
>Are upper (O) and lower (omega) bounds always identical in a tight bound (theta)?
No.
>>
>>59539873
Yes, just look at the the formal or limit definition of big theta.
https://en.wikipedia.org/wiki/Big_O_notation#Family_of_Bachmann.E2.80.93Landau_notation
>>
>>59539897
So, would it be fair to say that in every case where we're measuring the Big O of an algorithm's worst case, we're actually measuring Big Theta?
>>
>>59539924
lol wrong :^)
>>
>>59539758
I, for one, have a job working with embedded shit and network protocols.
I only come here to shitpost. There's no saving these stupid threads.
>>
>>59539939
Pretty much.
>>
>>59539944
Big theta is the intersection of big O and big Omega, friendo.
>>
>>59539939
>>59539957
No! Big O is a bound from above (worst case). Big Theta is bound from above and below (best and worst).
>>
>nobody can figure out complexity

fuck this place, I'm going to infinity
>>
is the most widely used language in terms of getting a job java?

im seeing c++ alot on job postings now
>>
>>59539227
Compare:
(define reverse
(lambda (list)
(define reverse-in
(lambda (tsil list)
(cond
((not (null? list))
(reverse-in (cons (car list) tsil) (cdr list)))
((null? list)
tsil))))
(reverse-in null list)))
% With:
(define append
(lambda (list1 list2)
(define append-in
(lambda (tsil1 list1 list2)
(cond
(and (null? tsil1) (null? list1)) list2)
((null? tsil1) (append-in (reverse list1) null list2)
((null? list1) (append-in (cdr tsil1) null (cons (car tsil1) list2))))))
(append-in null list1 list2)))


Notice how they're so similar?

You're essentially doing:
- Walking through the list
- Applying a function on every member of said list.

Your reverse could be seen as:
- let accumulator be nil
- For each thing in list:
- - conc it to accumulator

> YFW the concing can be a lambda supplied to mapcar

Accumulator:
- let accumulator be nil
- for every list in a list of lists
- reverse the list (use above function)
- conc the resulting list it to an accumulator.

> Notice some stuff are the same?

You can make some very generic list functions.
You'll learn a lot, and then you'll realize that the genericness isn't always all that valuable.
Which is another valuable lesson.
>>
>>59539968
You can't provide an example where Big Theta has different upper and lower bounds.
>>
>>59540056
Excluding Javascript and SQL from job listings, Java has the most. C# is next. After that, Python, C++, and C all have about the same.
>>
>>59539998
In an algorithms worst case, Big O will always be the same as Big Omega, therefore the value of Big O will be identical to the value of Big Theta

In that sense, if you measure an algorithm's big O for its worst case, you'll also be measuring its big theta
>>
C toddlers BTFOOO!!!!
>>
>>59540087
>if you measure an algorithm's big O for its worst case
As opposed to what? Measuring its big O for its best case? Please see the definitions in >>59539925 .
>>
>>59540087
this is wrong and doesn't really even make any sense

In an algorithm's worst case its runtime will be big O

in its best case it will be big omega

if you give a big theta you're giving an accurate bounding on the complexity instead of just an upper (big o) or lower bound (big theta)
>>
>>59540121
As opposed to measuring its average or best case.

I don't see how a certain case can have different upper and lower bounds. If we're measuring the Big O for an algorithm's best/average/worst cases, we're essentially also measuring its Omega, and in turn, its Theta, because they can't be different -- it's one input after all.
>>
>>59540157
>I don't see how a certain case can have different upper and lower bounds.

if you don't know what you're talking about don't just pull stuff out of your ass
>>
>>59540149
>in its best case it will be big omega
"Big O" means Big Omega
>>
>>59540157
>>59540121
>As opposed to measuring its average or best case.
I see what you mean - the functional bounds of its cases.
>>
>>59540215
The difference between Big O notation and Big Omega notation is that Big O is used to describe the worst case running time for an algorithm. But, Big Omega notation, on the other hand, is used to describe the best case running time for a given algorithm.

fuck off retard
>>
>>59540234
https://en.wikipedia.org/wiki/Big_O_notation
>Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity.

Now, we can find a function that describes the best, average, worst, what have you case of an algorithm. We can then use big O/omega/theta notation to describe that function.

Big O/omega/theta/whatever don't have anything intrinsically do do with average, worst, best. They're just ways to describe functions. Average, worst, and best analyses typically provide said functions.
>>
>>59540234
It has nothing to do with best or worst case you retard.
Big O is upper bound, Big Omega is lower bound
>>
>>59540200
Wow, great refutation fampai, proved me wrong

If you can find a worst-case analysis where big O and big Omega are different, be sure to publish that shit, because you totally said it was possible, right?
>>
>>59540276
you don't understand the words you're typing

an upper bound is indicative of the worst case outcome and a lower bound is indicative of the best case outcome, asymptotically

big theta gives a more precise bounding on that while big o only gives an upper and big theta gives a lower

>>59540283
lower or upper bound on the asymptotic complexity as given by the best or worst case RETARD

the best or worst is what defines the limit

think of quicksort; it's best case is big theta n log n but its worst case is O(n^2)

>>59540318
you didn't say for worst-case analysis and I thought you were that other retard posting; I thought you meant for an algorithm in general
>>
>>59540332
>Big O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity.
>describes the limiting behavior of a function
>limiting behavior of a function
>function

Best/worst are not themselves functions. They provide functions that can then be analyzed using using O, Theta, Omega, what have you.
>>
>>59540332
>big o only gives an upper and big theta gives a lower
big omega** gives a lower
>>
>Eclipse/Netbeans/Idea
>relatively small installation size
>can take a geologic era to start depending on the size and type of the previously open projects
>usually bloat up to 1-1.5+gb ram utilization after a few hours of usage

>Visual Studio
>2.5-3gb installation size as a minimum, can go up to 12-13gb depending on the version
>starts pretty quickly, sometimes instantly
>ram usage stays pretty low throughout

But why
>>
>>59540361
When analysing the worst case for instance, is it possible for the Big O to be different to the Big Omega?
>>
>>59540386
you get what you pay for
>>
>>59540332
If it's Big Theta n log n then it's also Big O n log n
>>
>>59540403
A function that is O(nlogn) is O(n^2) as well, so sure.
>>
>>59540361
Maybe I should rephrase this. Best/worst DO give functions. But any function can be analyzed using big o tools. That's why you can take the big o of the best case.
>>
Pardon me, posted question on a bump limit thread:
>>59540136
>>
>>59540408
I typoed; that was supposed to be big omega n log n (it's quicksort, the complexity is well-known)

>>59540419
This I can agree with
>>
>>59540417
I see. If we were to only provided a tight upper-bound, i.e. O(n) as the lowest upper bound value, rather than somewhat redundantly saying O(n^2), O(n^3), etc., could that tight upper bound be different from the lower bound (similarly tightly defined) when measuring an algorithm's worst case complexity?
>>
>>59540441
The fuck are you talking about?
best case is Big O(n log n)
>>
>>59540077
If you actually looked at the definition of Big Theta, you'd realize it'd be pretty easy.
>>
>>59540455
yes

it's presumed when a big o is given in a formal situation that it's a tight upper bound (why would you give a loose upper bound? that's not helpful at all)

giving a tight lower bound makes your explanation of the complexity more useful as you've narrowed the range down (it will never be better than x or worse than y)

>>59540472
quicksort worst case is O(n^2)
best case is big omega n log n
go read clrs some more
>>
>>59540515
No, that's retarded
That would allow for quicksort to run with 2^n operations.
>>
>>59540515
Do you know of an algorithm where the upper and lower bounds differ within a particular case (worst, best, average) -- i.e. worst case upper bound is O(n), while worst case lower bound is something smaller?
>>
>>59540515
Just checked CLRS and it says Big Theta.

I feel stupid for not realizing it instantly since it's a classic example use of the Master Theorem.
>>
>>59540592
Bogosort
>>
File: smile.jpg (255KB, 1321x1782px) Image search: [Google]
smile.jpg
255KB, 1321x1782px
>mfw jenkins pipelines
this shit is fucking great
>>
whi is libstdc++ such a complete clusterfuck?
>mixed tabs/spaces
>newline after nearly every word
>__unnecessary_underscores
>everything is a _M_thing
>>
>>59540907
>>__unnecessary_underscores
>>everything is a _M_thing

that's what the standard mandates to protect against macros
>>
>>59540927
fucking macros should be banned already.
>>
>>59540927
>language has namespaces
>still has to use _ in names
lol
>>
>>59540945
libc++ is slightly more readable if you want to dive into that
>>
I'm new to Python; if I have two lists, is there a way to have a list reordered to match the appearance of those element in another list?

lista = [4, 4, 4, 1, 1, 2, 3, 5]
listb = [1,2,3,4]
listc = magically reorder listb to the order elements appeared in lista
[4, 1, 2, 3]
>>
>>59541002
listc = list(filter(lambda x: x != None, (x if x in listb else None for x in lista)))
>>
>>59541066
You need to remove duplicates after this.
>>
what's the point of putting a space after keywords?
>>
>>59541066
>>59541177
Running that code as is gives TypeError: 'list' object is not callable

this filter lambda business is a bit above my Python pay grade so I'm not quite sure how to go about tweaking what you wrote

thank you for the help!
>>
>>59541177
my bad

seen = set()
listc = (filter(lambda x: x != None, (x if x in listb and x not in seen and seen.add(x) == None else seen.add(x) for x in lista)))
>>
>>59541211
Do you have something like
list = <something here>
>>
class woman {
private:
std::set<woman*>& kitchen;
std::ostream& me;
woman& operator=(woman const& other) {
return *this;
}
public:
woman(std::set<woman*>& kitchen, std::ostream& anon):
kitchen(kitchen), anon(anon) {
kitchen.insert(this);
}
~woman() {
kitchen.erase(this);
}
woman(woman const& other): kitchen(other.kitchen), anon(other.anon) {
/* women are interchangeable */
kitchen.insert(this);
}
template <class meat> void make_sandwich() {
anon << "===BEGIN SANDWICH=== (bread)" << std::endl
<< meat() << std::endl << "===END SANDWICH=== (bread)"
<< std::endl << "*burp*" << std::endl;
}
};
>>
>>59541236
ah, yeah, oops

Thanks for this!
>>
>>59538735
>it's way harder to learn Rust than C
Only if you are literally handicapped. Which you most likely are so it's understandable.
>>
File: 1484589609504.png (439KB, 720x720px) Image search: [Google]
1484589609504.png
439KB, 720x720px
>>59541211
>Running that code as is gives TypeError
>>
>>59541289
No problem. Pretty troublesome python just lets you do that though.
>>
>>59541283
template <class meat> void make_sandwiches() 
{
std::string output { };
do
{
anon << "===BEGIN SANDWICH=== (bread)" << std::endl
<< meat() << std::endl << "===END SANDWICH=== (bread)" << std::endl;
anon >> output;
}
while (output != "*burp*");
}
>>
>>59541458
Do you enjoy eating meat sandwiches? Fucken fag.
>>
>>59541458
while (stomach > sandwich) {
poop();
}
>>
Can someone help me with a problem in C# console? I'm trying to use threading in which one thread permanently displays the current time in the top left corner. However, I have a problem with user input, in that it doesn't put the cursor in the new line after I ask for it, but rather puts it after the time. Example
16:53:00input <-- input is here
User input:
<--- instead of here

I just create a new thread and use datetime.now in a permanent while loop.
>>
>>59541614
post code
>>
>>59541458
>>59541585
>>59541541
if (output == "vomit") throw sandwich_overflow_exception { };
>>
>>59538415
Google:
Let's optimise this C++ method using a retroactive data structure and metaheuristic.

/dpt/:
Moar fucntional programmeng haskel, OOP is sheeiiiit.
>>
>>59541745
Haskel is OOP sheiiit.
>>
>>59541646
using System.Threading;

static void time()
{
Console.CursorTop = 0;
while(true)
Console.Write("\r" + DateTime.Now);
}
static void Main(string[] args)
{
Thread t = new Thread(new ThreadStart(time));
t.Start();

Console.WriteLine("\nInput here:");
Console.ReadLine();
}
>>
>>59538426
>C doesn't have delegates
>C doesn't have resizable arrays
>C doesn't have strings
>C doesn't have string concatenation
>C doesn't have namespaces
>C doesn't have exception handling
>C doesn't have closures in the standard
>C doesn't have unit tests
>C doesn't have Function overloading
>C doesn't have memory safety of any kind
>C doesn't prevent memory exploits and has no bounds and runtime checks
>C doesn't have dynamic method loading/creatin
>C doesn't even have generics and templates
>C doesn't have meta programming
>C doesn't have mixins
>C doesn't have higher order functions
>C doesn't have contract programming
>C doesn't have inner classes
>C doesn't have function literals
>C doesn't have array slicing
>C has a very limited support for implicit parallelism
>C doesn't even have string switches
but it does nigga
>>
File: anal beads.webm (71KB, 742x358px) Image search: [Google]
anal beads.webm
71KB, 742x358px
>>59541853
Alright, I see what you're trying to do.

When you write the DateTime, the cursor ends up at the end of your write, so that's where any input will start. In fact, I'm not certain there's an easy way to do what you're trying to accomplish.

You can, however, use the Console's Title to display the time if that's fine for your purposes. Webm related.

Is this homework or a personal project?
>>
>>59541974
Personal, I'm just trying to see if I can do threading properly in console, since I never attempted it before.
I'm having problems, because even if I put the cursor position anywhere else, after the writeline, it still ends up just after the time, which is something I don't want it to do.
>>
>>59542013
>it still ends up just after the time
Well, yes, because you're telling the program:
>Okay, I want you to "write" the value from DateTime.Now as fast as you possible can constantly, forever. And by "write", I mean put the cursor at position 0 and end with the cursor immediately after what you've just written.

"Write" puts the cursor immediately after whatever it writes. Frankly, what you're doing doesn't make much sense to be doing; what if your user input and the responses go beyond your window size? Now you can't see that constantly updating time anymore anyway.
>>
>>59541895
Fucking around with raw pointers does not count. And once you implement all the features properly, you get very a clunky C++ with wierdass syntax.
>>
>>59542071
Window size is fixed, goes into a new line if the user fucks about, but the user input should never be that long; rather it's limited.
>>
>>59542123
>Window size is fixed
You can't guarantee this unless you're actively checking the size and resizing it if the user messes with it.

Why aren't you using WPF or something similar to accomplish this?

What is your application ultimately going to be doing?
>>
>>59542135
Several games, with stored user data (name, score, last logon, etc...). No reason, just thought it'd be easier to implement in console first, since I don't want to fuck around with databases.
>>
>>59538415
Can someone redpill me on the container meme?

Most people seem to run their containers inside a VM, so apparently having your computer boot a hypervisor to run a kernel that launches a userspace which launches a program to manage another userspace to run your program is somehow preferable to: just running your fucking program.

What the fuck is wrong with just maintaining a disk image, or heaven forbid packaging your application for distribution to your target OS?
>>
>>59542095
>Fucking around with raw pointers does not count
What, praytell, do you think any other language is doing behind the scenes?
>>
>>59542184
>just thought it'd be easier to implement in console first, since I don't want to fuck around with databases
What makes you think you must be using a "database" to use a GUI framework?

You're right, console applications are easier to prototype, but you're talking about basically creating a "form" of sorts where various components on this "form" change state independently. It's not difficult to get a basic working WPF window going that would make all of these extremely easy.
>>
File: this is real.png (97KB, 711x657px) Image search: [Google]
this is real.png
97KB, 711x657px
nice thread, non-web babbies

web development has already removed your jobs
>>
>>59542255
I maintain legacy COBOL making 200k/year so I'm not too bothered
>>
>>59542255
stackoverflow confirmed for being 72.6%+23% cancer
>>
>>59542211
check for equality?
>>
>>59542244
Because it would be easier to connect a database to a form than to a console, if I'm not mistaken.
I know it would be easier in a form, but once I realized that, I was more than 3/4 done with my code, and couldn't be fucked converting it. Plus, I'd rather learn something new.
>>
File: sausage fest.png (178KB, 739x807px) Image search: [Google]
sausage fest.png
178KB, 739x807px
Stack overflow's programmer gender demographics
>>
>>59541221
Instead of using ternary to set to None then filter just use list comprehension's conditional?
seen = set()
[x for x in lista if x in listb and not (x in seen or seen.add(x))]
>>
>>59542255
>Stackoverflow users survey
It only shows that 72.6% of dumbfucks who asks at stackoverflow are webdevs :^)
>>
File: 1313691748545.gif (801KB, 200x86px) Image search: [Google]
1313691748545.gif
801KB, 200x86px
>year of our lord 2017
>still can't write a .NET application that works both as a Console Application and as a Windows Application without resorting to P/Invoke voodoo magic
>>
>>59542354
there are only two genders
>>
>>59542358
because it's not incomprehensible enough
>>
>>59542397
Did you just assume my numeral system
>>
>>59539673
(let ((l '()))
(mapcar (lambda (x) (push x l)) list)
l))

What does let do?
>>
Playing with ROP, improving my post-exploitation skillz

    uint64_t nop_ret = 0x7fff80020000 + 0x772c5 + sc_slide;
uint64_t pop_rax_ret = 0x7fff9547a000 + 0xd8446d + sc_slide;
uint64_t pop_r8_pop_rbp_ret = 0x7fff813cb000 + 0x6e0702 + sc_slide;
uint64_t mov_rsi_rax_pop_rbp_jmp_r8 = 0x7fff8176db49;

rop_chain_t *chain = init_chain();
assert(chain);

printf("chain base: %p\n", chain->chain);

for (uint32_t i = 0; i < 400; i++) {
ROPPG_CHAIN_PUSH_GADGET(chain) = ROPPG_CATALOG_NOP;
}

ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)pop_rax_ret;
ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)100;

ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)pop_r8_pop_rbp_ret;
ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)nop_ret;
ROPPG_CHAIN_PUSH_GADGET(chain) = 0x1337;
ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)nop_ret;

ROPPG_CHAIN_PUSH_GADGET(chain) = (uint64_t)mov_rsi_rax_pop_rbp_jmp_r8;

ROPPG_CHAIN_PUSH_GADGET(chain) = 0x1337;

ROPPG_CHAIN_PUSH_GADGET(chain) = ROPPG_ROP_ARG_1(chain, "%d\n");
ROPPG_CHAIN_PUSH_GADGET(chain) = ROPPG_CATALOG_RESOLVE_FUNCTION(chain, printf);

ROPPG_ROP_CALL_FUNCTION_1(chain, exit, 1);
>>
>>59542531
It lets you set up bindings to a name. I let l be an empty list, then within the body of the let, I make modifications to that list.
>>
File: dt170323.gif (117KB, 900x280px) Image search: [Google]
dt170323.gif
117KB, 900x280px
LOL
>>
>>59542670
Thank you, Dilbert poster
>>
Can someone point me to a large C# codebase (50k+ lines) so I can test compiling speeds? The largest I've found are less than 15k lines
>>
spent 2 hours trying to do an efficient sum of primes with haskell and never ended up doing it, took 20 minutes to do it in C
>>
>>59542786
Post your code.
>>
If I want to write a gui app in Go should I just make it run local web server and do a ui through browser? Or is there good gui library.
>>
>>59542821
There are no good GUI libraries.
>>
>>59542135
Also, related question, by actively checking the size, do you mean making another thread or how would I accomplish this?
>>
>>59542742
You could at game engines made in c# like xenko.
>>
File: 1489264704334.jpg (16KB, 255x200px) Image search: [Google]
1489264704334.jpg
16KB, 255x200px
>became a programmer
>became to hate programmers
>>
>>59542801
already got the C version on my personal free file storage website you'd be able to find me. the thing that threw me off with haskell was that i was trying to do it functionally. i think a lot of these programming problems are best done procedurally tbqh. i'd be able to just take my c code and port it to haskell without any functional style coding but whatd be the point
>>
>>59542867
Most people hate their colleagues, regardless of profession
>>
>>59542821
if you can use html use it. it's piss easy. there's a reason webdevs are so dim
>>
>>59542821
Go doesn't even have a decent OpenGL library or SQL library.

Use it as the backend of a web UI. That'll be the easiest.
>>
>>59542925
>Go doesn't even have a decent OpenGL library or SQL library.
https://golang.org/pkg/database/sql/
Why is it not decent?

It was a mistake not to include sqlite in the core library though.
>>
>>59542942
1) Sqlite
2) Hardcoding string queries is never forgivable
>>
>>59538623
>what is composition
>what is using procedural systems over virtual methods
>>
>>59542960
>Hardcoding string
?
db.QueryRow("SELECT name FROM foo WHERE id=?", id)
>>
>>59542843
I really wish you wouldn't do this, but yet, you could spawn another indefinite thread that checks the console's window size 5 times a second and resizes to the appropriate size if it's not the correct size.
>>
>>59542978
do...do you not see the hardcoded string?
Interpolating a string doesn't mean it's not still a hardcoded string. There's no inherent sanitation involved like there is in modern Java of C# libraries (C# has it done the best, imo)
>>
>>59542979
I know it's generaly not a good thing to do, but I don't know of no other option to constantly update a thing in console, while you're still free to do other stuff.
Actually, I could put it in the same thread as the one checking for time, and it wouldn't impact performance that much, correct?
>>
>>59543000
Assuming you limit the check to every x milliseconds, rather than as fast as possible like you had before.
>>
>>59542991
literally nothing wrong with hardcoded strings
>>
File: 1487715369348.jpg (55KB, 457x381px) Image search: [Google]
1487715369348.jpg
55KB, 457x381px
>>59543119
>>
New thread:

>>59543141
>>59543141
>>59543141
>>
>>59543139
not an argument
>>
I'm trying to figure out how objects on the heap and stack work in C++. I don't know the much about the language though and was just curious about this particular feature, so please go easy if I've done something dramatically wrong.

I'm running this bit of code from http://pastebin.com/7ucTaXuF
int main(int argc, char* argv[])
{
Tester test1 = Tester("First");
test1.speak();

cout << endl;
test1 = Tester("Second");
test1.speak();

cout << endl;
Tester* test2 = new Tester("Dynamic");
delete test2;

cout << endl;
return 0;
}


The output is this.
Constructing Tester at 0x7ffd6c849a50 with message First
Hello, World from 0x7ffd6c849a50 with message First

Constructing Tester at 0x7ffd6c849a70 with message Second
Destructing Tester at 0x7ffd6c849a70 with message Second
Hello, World from 0x7ffd6c849a50 with message Second

Constructing Tester at 0xac5070 with message Dynamic
Destructing Tester at 0xac5070 with message Dynamic

Destructing Tester at 0x7ffd6c849a50 with message Second


The bit I'm unsure about is this.
Destructing Tester at 0x7ffd6c849a70 with message Second

I think the destructor is getting called on the object occupying test1, intending to destruct the original object, after it's already been replaced by the new one.
Is this normal, should I just avoid doing this, can I destruct the original object instead?
>>
>>59543443
This thread has hit bump limit already.
>>
>>59543552

I noticed and reposted. I think I figured it out though.
>>
>>59542195
Easyness to spin things up and down. And you can use a copy of the prod container for deving
>>
>>59542095
>does not count
wew pajeet
Thread posts: 318
Thread images: 49


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