[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: 315
Thread images: 20

File: monk.jpg (7KB, 195x259px) Image search: [Google]
monk.jpg
7KB, 195x259px
Old thread: >>61306028

What are you working on, /g/?
>>
friendly reminder to have a reddit application in your portfolio otherwise you will never get a job
>>
>>61308638
Whats a reddit application
>>
>>61308604
>Ballmer Effect edition
>>
>>61308604
5th for java
6th for java
>>
>>61308656
Secret sorry.
>>
making my own rival c++ standard
>>
>>61308717
shut the fuck up jonathan blow
>>
>>61308733
blow me
>>
Can you guys just sit and code straight without being interrupted by having to research or look stuff up? I have to stop and do research,r look up documentation, or look up examples from other people's code all the time is this normal or am I a brainlet?
>>
>>61308761
That just means you're not coding fizzbuzz tier shit.

Any real application is going to use some kinda library, and if you wrote all of it yourself then you'll have to look at your own documentation/headers.
>>
>>61308749
ok

>>61308761
I can do both but I mostly spend time doing things I'm uncomfortable with or learning so looking shit up is the norm.
>>
What is the language to learn for desktop and mobile platform programming?
java is not because the project that compiles to IOS is discontinued.
Ocaml might be but it doesn't support natives threads so I don't you can even count it as programming language.
Sepples is just too ugly.
I'm skeptical about Apple languages supporting windows.
C is just too arcane.
>>
>>61308807
Python.
>>
>>61308807
>C is arcane
I don't think you know what that word means.
>>
>>61308823
I don't think you know C so nobody cares.
>>
Do I really need a portfolio? I got a sweet gig as an intern right now for DoD/DARPA but I can't post any of my stuff I'm making on git. What do?
>>
>>61308848
REKT
>>
>>61308851
Get to refactoring it as MLP projects.
>>
>>61308854
I know C though.
>>
how many of you are making off blockchain technology retards?
>>
>>61308851
Just say that you worked for darpa anon. What sounds cooler to an interviewer:
>Here's my fizzbuzz written in high performance haskell sir. Please take note of the industry standard comments.
>I would show you the code I wrote for Project NEEDLE, but it's classified.
>>
>>61308807
Go is the /g/ approved language.
>>
>>61308877
top meme
>>
>>61308913
Are you implying /g/ is full of idiots?
>>
>>61308936
Si senorita
>>
>>61308936
>implying
laddie...
>>
File: cProblems.png (119KB, 1146x407px) Image search: [Google]
cProblems.png
119KB, 1146x407px
going through the C language book and I can't even get this easy script to work. it looks identical to me, am I missing something?
>>
>>61308936
>mentally ill pedos
>not idiots tho
please
>>
>>61308955
>e0f
>>
>>61308955
try finishing with CTRL-D or CTRL-Z
>>
>>61308955
Write in an EOF symbol (^D), or redirect a text file to it.
>>
>>61308908
That's what I was thinking, though a portion would be on a patent so would just tell them to look at that for proof
>>61308884
It's so bloated right now, 60% of Washington is talking about/writing on it. Now is the time to freelance it; people are willing to pay buckets for consulting while the hype is high
>>
>>61309012
btw ctrl z is the windows EOF control sequence if anyone was wondering
>>
>>61309053
nobody was wondering
>>
>you can do inline asm in rust
wew
>>
>>61309040
i make around 1000$ a week making ethereum spinoffs (just editing the config and mining it initially lol) to these retards who think their shitty imitation will take off. there was one idiot who thought by making his own coin and mining around 1 million $ he'll get 1 million off it.
>>
>>61309092
DELET
>>
>>61309019
>>61309012
thanks that did it
>>
>>61308604
How do I manually install a theme to NetBeans? The import button won't work and just says "Loading..." forever. This white background is making my eyes bleed and "Norway Today" isn't much better.
>>
Making a 3D gaem is effort m8, but it pays off
>>
>>61309090
Is that surprising? The language is intended to be C++ without segfaults.
>>
File: screenshot.png (240KB, 1007x701px) Image search: [Google]
screenshot.png
240KB, 1007x701px
>>61309117
It is. What are you making anon?
>>
>>61309092
The block chain talk isn't about crypto. Most of all the trade associations I've sat with said they would be looking into fiat ledger systems. With the exception of the energy industry which wants to look into trading energy on a blockchain platform for G&Ts. Yet because of the hype people stumble onto coins and waste their money in it.
>>
>>61308504
bumping old question
>>
>>61309194
>no one will ever create such a perfect game again
Man desu minecraft reminds me of Cataclysm DDA: a game that was initially perfect but eventually turned to shit because so much bloat was added. I discovered the game when it was in Alpha because one of my Swedish friends introduced me to it, it was so simple but so fun. Haven't played it in years but looks like the game got bogged down by a billion new features.
>>
>>61309194
>>61309117
How do I into OpenGL?

>>61309219
The game turned to shit because the devs did wolves and dyed clay and shit instead of a fucking modding API.
>>
>>61309226
start with webgl instead
>>61309202
im taking the money of the hypefags and dumb narcissistic "entrepeneurs", not the dudes that actually get something done
>>
>>61309254
>webgl
but I don't like using the web. I like using C.
>>
>>61309226
Just use unity :^)

>>61309194
Lara Croft/Zelda clone
>>
>>61309295
>Just use unity :^)
Can I learn how shit actually works with unity?
>>
>>61309219
Yeah. I got inspired to work on this when I installed minecraft for the first time in a few years, and it felt so bloated and ran at 20 fps on medium render distance with optifine.

>>61309226
I originally did the nehe tutorials, but I can't recommend them as they're for antique opengl 1.1, which is incompatible with current opengl. I read the opengl superbible to learn 4.5.

My game is being designed with modding in mind. The backend is in C but high level code is in scheme. The goal is you can distribute mods as compiled shared libraries that the game loads from a mod folder.
>>
>>61309318
i found some things that werent specified in most opengl docs in the unity docs funnily, like how gl.TRIANGLE works, its very explicit
>>
>>61308604
Any ideas for project to practice multithreading? I can make gui
>>
>>61309216
You probably get better answers on /r/programming or something, i think
>>
>>61309318
Not really, it's all abstracted away
>>
What's the best way of creating Windows applications in C++? Do people still use the API directly or is everyone relying on external frameworks to do the job?
>>
Does JavaScript have copy-on-write optimisations for any of its data types?
>>
>>61309441
If I wanted fine-grain control over player input, subtle but important stuff like a barely-perceptible pause when an enemy is hit to make an attack more weighty-feeling, would I able to do that with UE4, or would I have to build my own engine from scratch?
>>
File: ferris tea.png (502KB, 486x481px) Image search: [Google]
ferris tea.png
502KB, 486x481px
How does it feel knowing that programming without a license will become illegal in your lifetime?

>>61305287
>>61306664
>>
>>61308604
Currently trying to make emacs function...

I want to have auto-complete (specifically for C / C++) always available, and so I have the following code in my .emacs file:


(Setq ac-modes '(c++-mode sql-mode cc-mode))
(require 'auto-complete)
(global-auto-complete-mode t)

But when I close-then-open up emacs, auto-complete mode is still disabled (which I check by typing M-x auto-complete)... What am I doing wrong?
>>
>>61309744
>auto-complete
kys
>>
File: 1494685903794.png (14KB, 603x562px) Image search: [Google]
1494685903794.png
14KB, 603x562px
How do I write cleaner code?
>>
>>61309893
by ditching C and learning a language that isn't 50 years old and deprecated
>>
>>61309893
Don't use braces for single-line conditionals and loops.
You could even do something like this and it would only require one semicolon
if (a)
if (b)
if (c)
while (do_something());
>>
>>61309893
>array
I can see that nigger, what's it for?
>>
>>61309893
thats beautiful theme
>>
>>61309893
Couple of things:

>Better variable names than 'array'
You look like you're doing this pretty well with names like "fileHandle" and "filePath", but with variable names like "char1" and "char2", it's not too clear what they mean.

>Decomposition
If you have a large block of code, it's usually better off being delegated to a function.

>Comments
This should honestly go without saying, but a good way to see if your code is well-written is to ask yourself "Can someone with know knowledge about what I'm doing understand this?"

You also get better at writing code with experience
>>
>>61309893
use whitespace/comments between code chunks
use a font that isn't aliased
stop coding in C
>>
>>61309534
I'd argue that every adult male should write a winapi C++ program at least (at most) once in his lifetime

Winforms with c# are much better for that purpose though
>>
File: 1-NO8C9y2QNEb5iPjtXISATg.png (35KB, 600x375px) Image search: [Google]
1-NO8C9y2QNEb5iPjtXISATg.png
35KB, 600x375px
So this is how C dies...with thunderous applause.
>>
>>61309944
>not &&
>>
>>61310022
>winapi C++
winapi is C you dumb webshit
>>
it's literally the same person bashing web developers and javascript every time
>>
Anyone Prolog here?
I'm playing with PLCs and their programs are written in ladder logic, and I was thinking of writing something that could do some automated testing for me. Like, "given all these boolean logic statements, will these two outputs ever be true at the same time? No, cool."
Would Prolog actually work for this or is there some better choice?
>>
>>61310122
>prolog
is this 1992?
>>
Anyone delphi here?
>>
File: 727px-EiffelStudioScreenshot.png (215KB, 727x599px) Image search: [Google]
727px-EiffelStudioScreenshot.png
215KB, 727x599px
having so much fun with #eiffel right now
>>
>>61310130
Is there a more modern logic programming language? I'm not memeing, I seriously don't know.
>>
>>61309931
>C is deprecated
nice meme
>>
>>61310178
Name one application for C outside of low-level driver/OS development and embedded systems.
>>
>>61310191
high-performance network daemons
>>
>61309931
poor bait
>>61309944
Bad practice.
>>61309962
The frequency of digrams at a certain index, for example if [0]['t']['h'] = 26 it means that there are 26 occurences of 'e' in character 2 preceded by 'h' in character 1.
>>61309966
Base16 default and vim syntax highlighting.
>>61309976
>Variable names
I can't really find anything more descriptive. Would it make it more readable if I switched it out for something like "firstCharacterInDigram" and "secondCharacterInDigram"? It just seems like it'll be much worse.
>Decomposition
I don't see exactly what to delegate. Should I put the JSON writing part (everything from
printf("{");
to
printf("\"ignore\": \"ignore\"}");
) in a separate function?
>>61310017
>use whitespace/comments between code chunks
Would it help that much?
>use a font that isn't aliased
6x13 is perfection
>stop coding in C
no
>>
File: ActionScript_icon.png (18KB, 256x256px) Image search: [Google]
ActionScript_icon.png
18KB, 256x256px
who /actionscript/ here?
>>
>>61310191
Don't need to. That's enough to make it not deprecated.

But here's another feature that makes C not deprecated: no retarded name mangling, so it's good for libraries.
>>
>>61310062
It's essentially language agnostic, equally accessible from assembly, C, C++ and probably many other languages. And I don't think there is much pure C left in the current implementations of windows - and regardless, using a language with classes is useful when designing any kind of non-trivial application. Just because you can interface with the API from C doesn't mean you need to limit yourself to C.
>>
>>61310191
low-level driver/OS development and embedded systems
>>
File: 1374577328217.png (224KB, 554x439px) Image search: [Google]
1374577328217.png
224KB, 554x439px
>>61310191
I'm writing some shit for a wayland compositor, and I would like to not have to bind to like 15 FFI libraries.
It really wouldn't make sense to NOT use C.
>>
>>61310122
>autistic owl programming
I never used prolog except for solving heavy logic based riddles and those find x based on relative placement of other variables type of questions.
A lot of PLC and scada systems are really up to whoever implements it.
>>
who /unlambda/ here?
>>
>>61310191
Name one language that's an adequate replacement for C in driver and OS development.
>>
>>61310253
Assembly
>>
>>61310265
Not a replacement since C was created in response to the deficiencies of assembly.
>>
I remember Mike Acton in "Data-Oriented Design and C++" casually mentioning that they would've liked using assembly fulltime. Was he being ironic or are or were console gamedevs really that concerned with performance?
>>
>>61310217
there might be a cleaner way to do the array where you won't end up so nested, but you'll have a lot more lines and have to kick some of that stuff to functions.
>>
>>61310246
>>61310122
You can solve the same thing in scheme very easily with amb. So I can't really think of a good reason to use prolog myself.

https://mitpress.mit.edu/sicp/full-text/sicp/book/node89.html

>>61310273
Still adequate though. Not ideal, but adequate.
>>
>>61310215
*BZZZT* Wrong. Try again.
>>
>>61310228
>>61310253
Rust
>>
>>61310324
Why is it wrong?
>>
>>61310297
Historically games were entirely coded in assembly. It was only with the ps2 generation that you started seeing non assembly games.
>>
Any language that contains puts belongs in the trash.
>>
>>61310381
How many languages use puts()?
>>
>>61308807
Swift is a really nice language to program in, but unfortunately it is (almost entirely) Apple only.
>>
>>61310395
Too many.
>>
>>61308823
C is archaic. Nobody learns C anymore. Nobody cares about C anymore. C is dead.
>>
>>61310395
C and ruby does for sure

>>61310438
you still need it for legacy code
>>
>>61310461
>you still need it for legacy code
Not since 2005.
>>
>>61310297
mike action is autistic as hell, see his ogre engine 'critcism', he could have been serious

>>61310351
I think you mean snes generation
>>
C is arcane.
>>
>>61310461
>C
The compiler throws a hissy fit if you try to use puts. You have to willfully disregard all sanity to use puts. It even says "never use this function" in its documentation.

I don't know why they haven't just deleted it, but it's hard to write new code with puts without realizing what you're doing
>>
>>61310407
Care to recommend a resource to learn it senpai?
>>
>>61310499
Backwards compatibility is pretty important
>>
>>61310489
Ecco the Dolphin is an exception, not the norm.

No way in hell you'd use C when you needed to race the beam during horizontal blanking intervals for mode 7 shit and other insane techniques.
>>
>"Hey, I wanna get dat job"
>"Do you have at least 2 different iOS and Android apps with 100k+ downloads?"
>"Um.. no"
>"K bye"
fun day

I wonder if they'd hire some kid who wrote "Flashlight app" with gazillion downloads
>>
>>61310510
no it's not
>>
>>61310591
>Literally the reason half the retarded shit in languages still exists
>Not important
Okay Dokey
>>
>>61310514
he said started, it wasn't until the ps1 that most console games were made in C. It's just ridiculous to suggest people only started to move away from it in the ps2 era. PC games moved away from assembly much eariler aswell
>>
>>61310510
You know we're talking about compilers (which are archived and free to download) not video games, right?
Backwards compatibility is a meme.
>>
>>61310510
Backwards compatibility is overrated, honestly. It's definitely not needed.
>>
>>61310496
Why doesn't C become the next meme language after node.js, python, ruby?
>>
>>61308807
C is almost as far from arcane as you can get, below scheme. php is arcane.
>>
>>61310607
You fucking moron... You belong on the bottom of my shoe.
>>
>>61310668
see >>61310496
Nobody will be using C in 5-10 years.
>>
>>61310696
>Nobody will be using C in 5-10 years.
people are still using COBOL
>>
>>61310668
>C is almost as far from arcane as you can get
lolwut
>>
>>61310703
>people are still using COBOL
no they aren't
>>
>>61310230
winapi is C you dumb webshit
>>
>>61310721
yes they are
>>
>>61310438
>waaaah, I don't know C
back to your shithole webcuck
>>
>>61310763
>webcuck
This is never going to catch on. Stop trying to force it.
>>
>>61310499
>compiler throws a hissy fit if you try to use puts
use a better compiler
>even says "never use this function" in its documentation
confirmed shit compiler
>why they haven't just deleted it
because it's required by the standard
>>
>>61310763
>waaaah cuck cuck cuck everyone I don't like is a cuck fucking cuck cuck cuck waaaahhh waah waahhhh
>>>/pol/
>>
>>61310792
>stop cucking meeeeeee!
no
>>
>>61310802
>calling someone a name is cucking
lol who let the underage /pol/tard in?
>>
>>61310826
it's like you enjoy getting cucked ;)
>>
Assembly is small, faster, and easier than C to understand/write. C is dead.
>>
>>61310859
Enjoy porting over all that code for a new architecture.
>>
>>61310499
did you confuse gets() with puts()?
>>
>>61310869
>replace opcode names with one button
wow so hard
>>
>>61310869
there are no new architectures lad
>>
>>61310499
puts is perfectly safe. You're talking about gets.
>I don't know why they haven't just deleted it
They did. gets was removed in C11.
>>
>>61310869
>new architecture
hahahahahahahahahahaha
>>
>>61310870
what did you expect from a webshit?
>>
>>61310870
Maybe, maybe I did anon. I never use either so whatever. I just use printf and I don't think I've ever had to read from stdin since programming classes in high school.
>>
>>61310905
>C11
Who cares? Nobody uses that shit.
>>
>>61310911
>don't think I've ever had to read from stdin
of course not, you can't read from stdin in css
>>
Any other /dpt/anons have difficulty finding somewhere to live? It seems all potential roommates want someone to party with, not someone who'll keep to themselves
>>
File: 1473068569478.jpg (10KB, 164x160px) Image search: [Google]
1473068569478.jpg
10KB, 164x160px
>>61310916
>Default in both GCC and Clang
>Nobody uses it
Really gets the old noggin joggin.

I'm working on something at the moment (where I'm not the only developer) where we use C11.
>>
>>61310921
Are you having a stroke, anon?
>>
>>61310921
I'm pretty sure javascript has stin and stout.
>>
>>61310944
is it a /g/ project?
>>
File: akari AAAAAAAAAAAA.png (566KB, 891x810px) Image search: [Google]
akari AAAAAAAAAAAA.png
566KB, 891x810px
>>61310930
Nobody wants to bunk with a literal autist who is going to be a wet blanket during his prime and will probably go postal on you if you piss him off in just the right way, and it doesn't take a whole lot to trigger an autistic virgin with rage.
>>
>>61310947
>DELIT
umad?
>>
>>61310951
>that image
Please, for the betterment of mankind, hang yourself.
>>
>>61310950
No, but it is open source.
>>
>>61310911
#include <stdio.h>

int main(int argc, char **argv)
{
if (argc > 1)
printf(argv[1]);

return 0;
}

can you spot the bug, anon?
>>
>>61310972
link me senpai!
>>
>>61310980
But that's not CSS tho!
>>
>>61310892
t. knows nothing about CPUs
>>
>>61310980
the name of the program being invoked is the first member of the argv array, so your program will always work.
>>
>>61310980
yes
>>
>>61310980
>return 0;
disgusting verbosity
>>
File: 1499727501253.png (37KB, 357x493px) Image search: [Google]
1499727501253.png
37KB, 357x493px
Is C, dare I say it, deprecated?
>>
>>61311000
>non-sequitur
back to mongojs with you
>>
>>61311013
consistency
>>
>>61311023
unfortunately, no
>>
>>61310980
I can beak your program by passing %d as the second parameter. Also there's no newline so printf won't flush right. You need to do
printf("%s\n",argv[1]);
>>
>>61311029
>damage control
sure
>>
>>61311046
>there's no newline so printf won't flush right
someone doesn't know C
>>
>>61310984
I would rather not.

>>61311046
You can break it even worse with %n. It can actually lead to a security hole if the attacker is crafty enough.
>>
File: C.jpg (10KB, 480x360px) Image search: [Google]
C.jpg
10KB, 480x360px
>>
>>61311001
>>61311023
shit benchmark
it compares C against gc languages and counts the memory management overhead in the benchmark.
into the trash
>>
>>61311082
you need to pass a newline eventually to force printf to flush its contents to stdout.

printf("a");
printf("b\n");
works fine but there's no guarantees on

printf("a");

It doesn't have to print until after the program closes.
>>
>>61311100
>until after the program closes
good thing it closes on the next line then
>>
>>61311087
>open saus
>no link to saus
m8...
>>
File: Capture.png (229KB, 848x317px) Image search: [Google]
Capture.png
229KB, 848x317px
>>
>>61311087
>I would rather not.
>not leveraging /g/ autismo for free bug fixing
it's like you want your project to fail
>>
>>61311207
1. take off the blindfold and do it
or 2. create 26 piles of 2 cards each. at least 2 will have 2 face down cards
>>
>>61311207
take 13 cards and flip them
>>
>>61310314
>Still adequate though. Not ideal, but adequate.
C is better though. All the problems with C are way worse in asm.
>>
File: 1492923105243.jpg (47KB, 645x968px) Image search: [Google]
1492923105243.jpg
47KB, 645x968px
>>61311241
>>
>>61311207
create 2 empty piles duh

Alternatively if you want me to use all the playing cards, make card houses without roofs so all of them are on their sides.
>>
>>61311238
You'd only need to create 5 piles for that. Do you even pidgeonhole anon?
>>
>>61311266
you're a little slow
>>
>>61311207
13 can't be divided evenly
>>
>>61311238
>>61311293
>Not just laying down 3 piles of 1 card each
>>
>>61311293
why use more brainpower solving the question than i have to? .. which would actually mean you could just put each card into a separate pile. this question's dumb
>>
>>61311241
WINRAR
>>
>>61311314
It's about elegant solutions. A proof is one thing. An attractive proof that makes you feel fluttery is another.

No one gives a shit about the proof for fermat's last theorem because it's unintelligable and was only double checked with a computer.

But the proof of infinitely many primes? Oh god yes. YES.
>>
>>61311359
faggot
>>
>>61308761
All the time. There's usually so much in a library that I have to look up whether or not I'm re-inventing the wheel or said library already has me covered.
>>
>>61311238
>"create 2 piles"
>proceeds to create 26 piles

>>61311309
who says you can't flip them
>>
>>61311359
It's not even looking good.
If working in a team it's good practice to make sure that someone else can understand the code.
>>
>>61308799
>>61308804
>>61311371
Thanks guy I couldn't see professionals browsing around researching or looking up how to do things instead getting work done and I was worrying that I'm too stupid and will never make it.
>>
Anybody got all those programming challenge pics? I think some of them were roll pics.
>>
>>61311421
Stupidity is the means of not looking to learn.
Glad to of helped.
>>
>>61311431
https://better-dpt-roll.github.io/
>>
>>61308807
>What is the language to learn for desktop and mobile platform programming?
Learn your webshit and deploy through Apache Cordova. It's the only "platform" that will run on iOS, Android, and desktops.
>>
>>61309893
>20
>256
>256
>these numbers sprinkled throughout the source
It would marginally improve your code's modularity if you'd try to avoid magic numbers. If you're concerned about the overhead of runtime constants, you could always use macros, but if you have to use a number more than once, anything would be better than just the bare number.
>>
>>61310219
Why can't I download the attached script file?
>>
>>61309893
use C++

>>61311474
>macros
eww
>>
>>61311511
>not using macros
eww
>>
>>61311467
Running through a WebKit app is so cringe. Even as a JS developer I'd rather communicate with the backend via native code.
>>
>>61311474
Yeah, I can see a few of those. I should put the """"""JSON""""""" writing in a separate function too, right?
>>
>>61311524
fuck off, macros are disgusting as hell, and C is fucking garbage for not having constexpr
>>
Reminder that C and C++ do in fact have modules. They're called compilation units. Headers exist as an extension of this facility, not in its stead.
>>
>>61311573
No, you fuck off. Macros are elegant and necessary. Constexpr is garbage. Only functions should be inline, if a variable is inline it's not a variable it's a macro.
>>
>>61311590
ironic shitposting is still shitposting
>>
>>61311598
It's not a shitpost, ironic or otherwise. It's simply the truth.
>>
>>61311603
lol
>>
>>61311543
Why?

>>61311603
Declarations of truth are still shitposting.
>>
Remember when /dpt/ was actually good?
>>
>>61311626
it was never good, you just didn't see as much of the retardedness when you were a newfag
>>
>>61311624
> why?
I suppose it's a personal touch, But I don't think WebKit apps are as stable as communicating directly with the OS API.
It's like having a layer on top of another layer of code just for the sakes of simplicity.
Don't get me wrong, if you're making a basic app ( like a click and go type thing) then you're ok, but for advanced and ""resource"" heavy apps ( real-time node to node ) it's just not beneficial user end.
>>
You're waifu a shit
>>
>>61311380
26 is more than 2, so if you create 26 piles you have created 2 piles
>>
>>61311703
26 != 2
>>
What's the compiler keyword for a function that never touches the state in C? Takes input, does something with it, returns output.
>>
>>61311725
__attribute__((const))
>>
>>61308604
ncurses shit
>>
>>61311725
__attribute__(((const)))
>>
>>61311737
but those aren't standard, are they? (genuine question)
>>
>>61311722
there's no way to reliably create exactly 2 stacks in that problem which solves it so it's obviously not asking for exactly 2
>>
>>61311745
no it's a compiler extension. C++ has constexpr tho
>>
>>61311745
No, it's GNU C which means it's available in GCC, probably in TCC and maybe in Clang.
>>
>>61311745
>>61311760
don't use those. they aren't free.
>>
>>61311752
see >>61311241 brainlet
>>
>>61311769
There are free compilers for C++ and GNU C.
>>
>>61311767
clang won't complain about it but i'm not sure if it actually supports it since it just treats attributes as hints and often ignores them
>>
>>61311781
>GNU shit
>free
Yeah, if your idea of free is handcuffing yourself to prevent yourself from stealing shit, even though you have no history of theft.
>>
>>61311777
the cards are randomly distributed throughout the deck, so as i said that isn't a reliable solution
>>
>>61311687
>Don't get me wrong, if you're making a basic app ( like a click and go type thing) then you're ok, but for advanced and ""resource"" heavy apps ( real-time node to node ) it's just not beneficial user end.
I can agree with that much. Trying to wrangle a large database and keep it synced with a central server is not super fun. I have yet to stick my nose into React, which according to supposedly in-the-know people is *the* way to handle UI efficiently.

>>61311777
How do you know which 13 if you're blindfolded?
Making piles of 2 (or 4) cards each is the only way to divide the cards evenly and, with high confidence, guarantee there are at least two piles with the same number of face-up cards.

>>61311815
>>>/pol/
>>
>>61311781
GNU is not free.
>>
I had a phone interview a little ways back where the interviewer accused me of stealing the solution for the sample problem because he said it was too optimized for someone without a CS degree (mine's in engineering).

Is there a practical way to defend this accusation? I explained how the code worked but he still didn't end up buying it and I got passed on as a result.

The code was NOT complicated at all, it was just a python file that knew how to use list comprehension, dictionaries, and sorted().
>>
>>61311832
>>61311815(You)
>>>/pol/
Good one, GNU is all about preemptively preventing people from doing shit that might be considered objectionable.
>>
>>61311846
They wanted pajeet.
>>
>>61311846
He was probably butthurt for getting a useless degree
>>
>>61311854
The compiler is free as long as I don't modify it. The output of the compiler is free without restriction. Can you tell me why I should give a flying fuck about your ability to monetize it?
>>
Is there any resources that teach C++ as an extension of C?
Like C++ with just the right amount of extensions like vectors, concatenations, tuples etc?

I am looking for a book where they teach you to use printf instead of cout
>>
>>61311830
>>61311832
if you take 13 cards in your hand and there are 13 face up cards in the pile, it means you have 13 face up cards in your hand after flipping them. 13 = 13
if you take 13 cards in your hand and there are 12 face up cards in the pile, it means you have 12 face up cards in your hand after flipping them. 12 = 12
if you take 13 cards in your hand and there are 11 face up cards in the pile, it means you have 11 face up cards in your hand after flipping them. 11 = 11
if you take 13 cards in your hand and there are 10 face up cards in the pile, it means you have 10 face up cards in your hand after flipping them. 10 = 10
if you take 13 cards in your hand and there are 9 face up cards in the pile, it means you have 9 face up cards in your hand after flipping them. 9 = 9
if you take 13 cards in your hand and there are 8 face up cards in the pile, it means you have 8 face up cards in your hand after flipping them. 8 = 8
if you take 13 cards in your hand and there are 7 face up cards in the pile, it means you have 7 face up cards in your hand after flipping them. 7 = 7
if you take 13 cards in your hand and there are 6 face up cards in the pile, it means you have 6 face up cards in your hand after flipping them. 6 = 6
if you take 13 cards in your hand and there are 5 face up cards in the pile, it means you have 5 face up cards in your hand after flipping them. 5 = 5
if you take 13 cards in your hand and there are 4 face up cards in the pile, it means you have 4 face up cards in your hand after flipping them. 4 = 4
if you take 13 cards in your hand and there are 3 face up cards in the pile, it means you have 3 face up cards in your hand after flipping them. 3 = 3
if you take 13 cards in your hand and there are 2 face up cards in the pile, it means you have 2 face up cards in your hand after flipping them. 2 = 2
if you take 13 cards in your hand and there is 1 face up card in the pile, it means you have 1 face up card in your hand after flipping them. 1 = 1
>>
>>61311846
Tell him you can redo it in person, or search for the code and prove you didn't directly copypaste it at least.
>>
>>61311846
lmao
>>
>>61311832
>database
>server
>React
>UI
>struggles with a basic riddle even after being told the solution
>>>/g/wdg
>>
Does supporting free software make me a communist?
>>
>>61311467
fag
>>
>>61311939
no, for example you can support eclipse and tell intellij shills to go fuck themselves without being a communist
>>
Follow up question (same guy as >>61311846)

Is it typical to be accused of stealing sample code in interviews?

It kinda threw me off balance for the rest of the interview despite the fact that it was a false accusation.
>>
>>61311958
What's wrong with intellij?
>>
>>61311777
>>61311895
>what is the birthday paradox
you can't just grab cards from the deck expecting them not to already be face-up
>>
>>61311846
write a full explanation of the situation, make the interviewer look like a jackass, and email it to his manager
>>
>>61311895
Got it.
>>61311933
Fuck off, they're full.
>>
>>61311979
hello, brainlet
>>
>>61311968
it's overpriced and it's not better than the latest version of eclipse, at most it's a subjective opinion if you prefer the UI or something
>>
>when you spend 90% of your time unfucking dependencies and 10% of your time actually working on your project

i want to cry
>>
>>61312001
>not an argument
hello, brainlet
>>
>>61311993
The interviewer was the founder of the company, it wasn't really an option.
>>
>>61312004
>it's not better than the latest version of eclipse
That's bullshit though. Eclipse is awful while CLion is the best software I've ever purchased.
>>
>>61312015
at leas read the man's post before you incorrectly say it isn't a solution. he took time autistically writing it out just for you
>>
>>61311933
You might flip a face up card back down.
>>
>>61312004
>it's overpriced and it's not better than the latest version of eclipse
seriously senpai?
>>
>my company has a client company
>lead developer on one of their projects
>surprise, no project manager, asked to write tickets with no preparation in the middle of a meeting
>obviously I do a bad job
>get no feedback on tickets
>they get upset when we finish the tickets because they want to test them in a different order
>they get upset when we try to add missing work to the board
>they get upset when we work on that missing work
>they get upset when we're pulled off the project for a sprint by that client and don't finish the sprint
>everyone happy after a demo when they see the groundwork we've laid
>someone from our company gets involved a week late
>doesn't pay attention all demo
>asking us to cut corners to save time, not providing an alternative
>I have to work overtime to make up for it
I miss open source software.
>>
>>61311979
>>61312051
and you call yourself programmers lmfao

you're seriously dumb as shit
>>
"open source software" technically cannot exist.
>>
>>61311832
I've used react and it's overly complicated for what it needs to be. I've used Angular, which is more mainstream, but I personally use VueJS because it feels like a perfect blend of Jquery and Angular.
But regardless of the DOM framework, they will all sit on top of WebKit which is very resource heavy and mostly creates needles backend checks to the browser when you can create a native programmed app.

You've to remember that WebKit is designed for PC (both Windows and Unix based OS) rather than the low end 'smart' phones. And unfortunately, NodeJs is then only bridge between the two.
>>
>>61312012
See, this is why statically linked is the best. Or even better, #include fucking everything if you want better performance.
>>
>>61312020
publicly shame him and his company on reddit or hackernews
>>
>>61312051
read the post, kid
>>
no software is free...
>>
File: gopher.jpg (17KB, 200x200px) Image search: [Google]
gopher.jpg
17KB, 200x200px
>2017
what is your excuse not to program in Go?
>>
>>61312084
kek
>>
File: spongebob slipping.jpg (29KB, 283x357px) Image search: [Google]
spongebob slipping.jpg
29KB, 283x357px
How can I use my .emacs file to make my life easier?

Specifically, I use an add-on, "sr-speedbar", and I always have to type
M-x sr-speedbar-open

And it just seems tedious... I'm pretty sure there's a really simple way I an avoid doing this by changing my .emacs file a bit... Is there?
>>
>>61312040

this anon >>61311895 is under the assumption that there were always 13 face up cards in the deck.
the original problem >>61311207 however states that there's only 13 face up cards in the deck to start out with.
picking out random cards while blindfolded doesn't give you any information about the cards themselves.
you just have 13 cards.
are they face-up? face-down?
there's literally no way of knowing this.
>>
>>61312065
Flipping a card doesn't guarantee a state, it only changes it.
? xor 1 = ?
>>
>>61312084
I'm Intelligent
>>
Someone uses Emacs for Javascript? Atom and VS Code have a nice popup with annotation and a comment below.

I've spent some time fiddling with company-tern and company-quickhelp, but it doesn't come up together. All I get is annotation in the message window. I can't even get the fuzzy matching and it doesn't get any built in tern definitions, unlike the Atom which uses the same tern backend as far as I know.

Should I bother? I like Emacs but just really tired setting this all up.

Anyway, what do you use for JS and why?
>>
>>61312098
>>61312100
you're not going to make it
>>
>>61312101
invalid, ken thompson is more intelligent than you.
>>
>>61312098
read the post, kid
>>
File: js.png (31KB, 490x447px) Image search: [Google]
js.png
31KB, 490x447px
>>61312105
Forgot the picture.
>>
>>61312107
>not an argument
you're not going to make it
>>
>>61312122
how about you prove one of the 13 cases he gave wrong
>>
>>61312098
>>61312100
>13 cards face up, 39 cards face down
>split cards into one pile of 13 cards and one pile of 39 cards
>pile one has n cards face up, pile two has 13 - n cards face up, 0 <= n <= 13
>after flipping pile one upside down, it now has 13 - n cards face up, equally as many as pile two

>>61312122
kill yourself brainlet
>>
What is an alternative to glib?
>>
>>61312101
https://en.wikipedia.org/wiki/Dunning–Kruger_effect
>>
>>61312171
musl is the most commonly used one, but why do you want an alternative? lgpl doesn't put a burden on proprietary software.
>>
http://brainlet.io
>>
>>61312105
I use VueJs, desu though it doesn't matter what you're accustomed to, as long as you don't 'pick and mix' your framework like some feral retard.
>>
>>61312122
Not even the other anon, but holy shit, are you serious? There are 39 face-down cards and 13 face-up cards in the original deck. Suppose you take 13. There are now two decks: one in which there are u face-up cards and 13 - u face-down cards and one in which there are 13 - u face-up cards and 26 + u face-up cards. Now, if you flip the 13 cards, you get 13 - u face-up cards on both.
>>
>>61311207
While blindfolded cut each of the 52 cards into infinitely many pieces. Do not flip any of the cards or the pieces.

Glue the infinitely many pieces back into 52 cards randomly, again without any flipping.

Create two 26 card piles composed arbitrarily. Each will assuredly have 6.5 flipped up card incorporated into them.
>>
>>61312211
Are you having a fucking stroke?
>>
>>61312211
Stop... Just stop.
>>
>>61312196
Just knowing my choices.

I'm new to C. Is there any libraries that provide things like grow-able arrays/vectors?
>>
>>61312224
I'll come back and ask how it's coming along when you're done cutting just one card into infinitely many pieces.
>>
Why did perl have to die, /dpt/?
>>
>>61312227
>>61312247
are you trolling at this point? if not, you should honestly reconsider your career choice
>>
>>61312252
>growable arrays
This is super easy to do yourself with realloc.

Glibc does offer linked list macros though.
>>
>>61312227
Yes. I wrote face-up twice. s/26 + u face-up/26 + u face-down/

>>61312247
What else did I do wrong? Are you fishing?
>>
>>61312069
>when you can create a native programmed app.
>a
Without web technologies I am now creating and maintaining three apps and most likely three sets of tests. I've already been bitten by subtle differences between native db implementations for iOS vs. Android, even with a web stack consuming them.

>>61312110
kt is at room temperature right now.
ohisthatthejoke.jpg
>>
>>61312263
If an infinite number of monkeys will type infinitely long on a computer, one will eventually write a valid Java program. The others are all writing perl.

Perl – The only language that looks the same before and after RSA encryption.
>>
Notice that the problem didn't say you had to flip 13 cards face up.
>>
>>> deck = [0 for i in range(52)]
>>> for i in range(13): deck[i] = 1

>>> random.shuffle(deck)
>>> deck
[0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0]
>>> hand = deck[0:13]
>>> deck = deck[13:]
>>> hand = [1-i for i in hand]
>>> hand.count(1)
10
>>> deck.count(1)
10
>>>
>>
>>61312291
kek
>>
>>61312299
>hand deck hand deck
you have a problem man, get a girlfriend
>>
>>61312291
You forgot dc and maybe APL.
>>
>>61312361
import random
def trial():
deck = [0 for i in range(52)]
for i in range(13): deck[i] = 1
random.shuffle(deck)
hand = deck[0:13]
deck = deck[13:]
hand = [1-i for i in hand]
if hand.count(1) == deck.count(1): return 1
else: return 0

tc = 1000
total = 0
for i in range(tc):
total += trial()
print("Chance you are a brainlet: ", 100 * (total/tc), "%")
>>
>>61312287
I know. It's hard. WebKit is currently trying to bridge these issues. But, from an industry standard, its currently best if you write natively to the device.

But if you some awesome, on your own fuck everyone else, programmer then you actually help this tech succeed.
I'm just, like previously stated, performing advice for the industry standard.
>>
>>61312394
Stop trying to make the brainlet meme happen. It never will.
>>
>>61312404
run the program and screenshot the output
>>
>>61312299
>Calling shuffle
>Not writing your own more efficient shuffle algorithm, specifically optimized for card decks
    for i := 1; i < len(s.deck); i++ {
n := rand.Intn(i + 1)
if i != n {
self.deck[n], self.deck[i] = self.deck[i], self.deck[n]
}
}
>>
new thread
>>61312355
>>
>>61312394
>('Chance you are a brainlet: ', 100, '%')
>>
>>61308807
Python. The Kivy library is good for mobile mostly and I think you can port PyQt applications to mobile, but I have never done it myself. Good thing about it is that the language is so laughably simple that you can have shit up and running in a few days if you're a decent programmer.
>>
Thoughts on this?
https://www.youtube.com/user/handmadeheroarchive/videos
>>
>>61312658
>day 398
>2+ hour long videos
>still hasn't completed it
your time could be much better spent than watching these videos. video tutorials in general are shit for programming. learn opengl and pick up a game engine book
>>
>>61312762
I think I understand the Open GL basics, but I struggle with the architecture of large programs.
Thread posts: 315
Thread images: 20


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